Orders

Use the interactive API for endpoint exploration and request execution:

Create order

PUT /api/v2/Order/create

cURL

curl --request PUT \
  --url 'https://<your-cloudrx-host>/api/v2/Order/create' \
  --header 'Authorization: Bearer <access_token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "clinicInformation": { "allProducts": true, "prescriberFeeTypeId": 0, "prescriberFee": 5 },
    "deliveryAddress": { "countryCode": "GBR", "postCode": "SW1A1AA" },
    "prescription": { "courierCode": 1, "clinicOrderId": "ORD-10001", "paymentType": 1 },
    "prescribingDoctor": { "prescriberName": "Doctor Example", "registrationNumber": "GMC1234567" },
    "customer": { "dateOfBirth": "1990-01-01T00:00:00Z", "surname": "Doe", "title": 1, "email": "", "telephone": "07123456789" },
    "prescribedItems": [
      { "productId": 123, "dmdCode": 456, "pack": 1, "quantity": 1, "medication": "Drug Name", "dosageInstructions": "Take daily", "allowedRepeats": 0 }
    ]
  }'

Request body (example)

Success response

200 OK

Common failures

  • 400: validation/business rule failure (invalid country, clinic, courier, prescriber, duplicate clinicOrderId, etc.)

  • 403: patient locked out

  • 500: server exception


Create order with clinic registration

PUT /api/v2/Order/create-with-clinic

Use this when clinic metadata/doctor linkage needs to be established during submission.

cURL


Create order from HL7

PUT /api/v2/Order/create-with-hl7message

Body is raw HL7 string.

cURL


Order status by pharmacy order id

GET /api/v2/Order/status?orderId=<int>

cURL


Order status with clinic code (supplier flow)

GET /api/v2/Order/status-with-clinic-code?orderId=<int>&clinicOrderId=<string>&clinicCode=<string>

Rules:

  • clinicCode required.

  • Either orderId or clinicOrderId must be provided.

cURL


Order status by clinic order id

GET /api/v2/Order/status-clinic-ordernumber?orderId=<string>

cURL


Order status by date range

GET /api/v2/Order/status-date-range?startDate=<ISO8601>&endDate=<ISO8601>

Rules:

  • Date range max is 3 days.

cURL


Cancel order (clinic-scoped)

POST /api/v2/Order/cancel?orderId=<string>&clinicCode=<string>&cancelReason=<string>

cURL

Required params

  • orderId

  • clinicCode

  • cancelReason

Why clinicCode is mandatory

clinicCode scopes cancellation to the correct clinic context and prevents cross-clinic cancellation when one client is linked to multiple clinics.

Success response

200 OK

Business rules (summary)

  • If order cannot be found for (orderId + clinicCode scope): 404.

  • Clinic-pay orders can be cancelled only before processed state.

  • Patient-pay orders can be cancelled only while waiting for payment.

  • Rule violation returns 400.

Last updated

Was this helpful?