Order Status Hooks
Once an order has been created, Pharmacy keeps you informed of its lifecycle by calling back into your system. This page describes the two hooks you must expose:
- A status webhook that Pharmacy calls whenever the order moves to
Processing,Shipped,Delivered,Cancelled - A Get Order API that Pharmacy calls to fetch the current state of an order from your system.
Status Webhook
We send status updates to the webhook URL configured for your integration. Each update is sent as an HTTP POST request with a JSON payload.
The following events trigger a webhook notification:
- Processing – Indicates that Pharmacy has started processing the order.
- Shipped – Indicates that Pharmacy has shipped the order and includes the
carrier,tracking number,tracking URL. - Delivered – Indicates that the order has been delivered and includes the
delivery date. - Recalled – Indicates that the shipment has been recalled and is no longer in transit.
- Cancelled – Indicates that the order has been cancelled and includes the
cancellation reason.
Expected response
How you should respond is agreed with you as part of setting up the integration.
Get Order API
Pharmacy also needs a way to read back the current state of an order from your system - for example, to resync after a webhook delivery failure.
Expected response
json
{
"orderReference": "ORD-2024-00123",
"prescriptionUrl": "https://example.com/prescriptions/ORD-2024-00123.pdf",
"medicines": [
{
"name": "Amoxicillin",
"reference": "MED-456",
"description": "Amoxicillin 500mg",
"packageSize": "21 capsules",
"dosage": "500",
"dosageUnit": "mg",
"units": 21,
"unitLabel": "capsule",
"quantity": 1,
"usageAdvice": "Take 1 capsule 3 times daily."
}
],
"customer": {
"reference": "CUST-789",
"firstName": "Jan",
"lastName": "de Vries",
"email": "jan.devries@example.com",
"phone": "+31612345678",
"dateOfBirth": "1985-04-22",
"gender": "male"
},
"shipmentDetails": {
"carrier": "DHL",
"trackingNumber": "TRACK-123",
"trackingUrl": "https://carrier.example.com/track/TRACK-123"
}
}| Field | Type | Description |
|---|---|---|
orderReference | string | Order reference. |
prescriptionUrl | string | Link to the prescription document. |
status | string | Current order status, e.g. new, processing, shipped, delivered, cancelled, returned. |
medicines | array | Same shape as the order creation request. |
customer | object | Same shape as the order creation request. |
shipping | object | Same shape as the order creation request. |
shipmentDetails | object | null | Present once the order has shipped. |
shipmentDetails.carrier | string | Carrier name. |
shipmentDetails.trackingNumber | string | Carrier tracking number. |
shipmentDetails.trackingUrl | string | Carrier tracking URL. |