---
search:
  tags:
    - Prescriptions
    - POST
seo:
  description: >-
    Any signed in user. Moves a pending prescription to… Reference for the POST
    /api/v1/prescriptions/{prescriptionId}/dispense endpoint in the PharmaFlow
    API.
sidebar:
  label: Dispense a prescription
  badge: POST
title: Dispense a prescription
type: openapi-operation
---
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`

**Request body** (`application/json`, required)

- `payment_method` (string)
- `patient_national_id` (string)
- `doctor_license` (string)

Request body example:

```json
{
  "payment_method": "string",
  "patient_national_id": "string",
  "doctor_license": "string"
}
```

**Responses**

- `200` — The prescription dispensed and its sale booked
- `400` — Prescription is already dispensed or cancelled, has no items, or stock is insufficient
- `401` — Not authenticated
- `404` — Prescription not found

Response example, 200:

```json
{
  "rx_id": "string",
  "rx_number": "string",
  "sale_id": "string",
  "invoice_number": "string",
  "total_amount": "string",
  "dispensed_at": "string"
}
```
