Skip to content
PharmaFlow Knowledgebase
Esc
↑↓navigate↵open⌘Jpreview

Dispense a prescription

Any signed in user. Moves a pending prescription to DISPENSED and books the matching sale. Dispensed or cancelled ones are refused, and controlled items need a national id and licence.

POST/api/v1/prescriptions/{prescriptionId}/dispense
Authorization
AuthorizationBearer token (JWT) · headerrequired

JWT from POST /api/v1/auth/login sent as Authorization Bearer.

Path parameters
prescriptionIdstringrequired

The prescription id to dispense.

Request body
requiredapplication/json
payment_methodstring
patient_national_idstring
doctor_licensestring
Responses
200

The prescription dispensed and its sale booked

rx_idstringrequired
rx_numberstringrequired
sale_idstringrequired
invoice_numberstringrequired
total_amountstringrequired
dispensed_atstringrequired
400

Prescription is already dispensed or cancelled, has no items, or stock is insufficient

detailstringrequired
401

Not authenticated

detailstringrequired
404

Prescription not found

detailstringrequired
Try it
Server
Authorization
Parameters
Bodyapplication/json
Request
curl -X POST 'http://localhost:8000/api/v1/prescriptions/string/dispense' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "payment_method": "string",
  "patient_national_id": "string",
  "doctor_license": "string"
}'
Response
{
  "rx_id": "string",
  "rx_number": "string",
  "sale_id": "string",
  "invoice_number": "string",
  "total_amount": "string",
  "dispensed_at": "string"
}