Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.rxscale.com/llms.txt

Use this file to discover all available pages before exploring further.

Order Lifecycle

Every order in RxScale moves through a series of statuses as it progresses from creation to completion. Understanding these statuses is essential for building a reliable integration.

Status Flow

  init
     |
     v
waiting for pharmacy -----> cancelled
     |
     v
 pending review ----------> cancelled
     |
     v
 in-progress
     |
     v
ready_for_pickup
     |
     v
 completed

Status Descriptions

StatusDescriptionWho sets it
initOrder has been created in the system but is not yet assigned to a pharmacySystem
waiting for pharmacyOrder is assigned to a pharmacy and ready to be processedSystem
pending reviewPharmacy is reviewing the order and checking availabilityPharmacy (via API)
in-progressPharmacy has started preparationPharmacy (via API)
ready_for_pickupOrder is packed and ready for pickup or shippingPharmacy (via API)
completedOrder has been delivered and finalized (includes stock reduction)Pharmacy (via complete endpoint)
cancelledOrder was cancelled before completionSystem or Pharmacy

Transitions

Waiting for Pharmacy to Pending Review

When your pharmacy receives a new order (status: waiting for pharmacy), acknowledge that review has started:
curl -X PATCH "https://api.rxscale.com/v1/external-pharmacy-api-v1/pharmacy_orders/po-abc123/status" \
  -H "X-API-Key: your-api-key-here" \
  -H "Content-Type: application/json" \
  -d '{"status": "pending review"}'

Pending Review to In Progress

Once stock availability is confirmed and preparation begins, update the status to in-progress:
curl -X PATCH "https://api.rxscale.com/v1/external-pharmacy-api-v1/pharmacy_orders/po-abc123/status" \
  -H "X-API-Key: your-api-key-here" \
  -H "Content-Type: application/json" \
  -d '{"status": "in-progress"}'

In Progress to Ready for Pickup

Once the order has been packed and is ready for pickup or shipping, update the status to ready_for_pickup:
curl -X PATCH "https://api.rxscale.com/v1/external-pharmacy-api-v1/pharmacy_orders/po-abc123/status" \
  -H "X-API-Key: your-api-key-here" \
  -H "Content-Type: application/json" \
  -d '{"status": "ready_for_pickup"}'

Ready for Pickup to Completed

When the order has been delivered or otherwise fulfilled, complete it through the dedicated complete order endpoint. This step includes stock reduction and order finalization.
curl -X PATCH "https://api.rxscale.com/v1/external-pharmacy-api-v1/pharmacy_orders/po-abc123/complete_order" \
  -H "X-API-Key: your-api-key-here" \
  -H "Content-Type: application/json" \
  -d '{
    "tracking_links": [
      {
        "tracking_link": "https://tracking.example.com/parcel/123",
        "carrier": "DHL"
      }
    ]
  }'
Do not set completed through the generic status endpoint. Use complete_order so RxScale can reduce stock and emit shipment and order update events consistently.

Cancellation

An order can be cancelled before completion:
curl -X PATCH "https://api.rxscale.com/v1/external-pharmacy-api-v1/pharmacy_orders/po-abc123/status" \
  -H "X-API-Key: your-api-key-here" \
  -H "Content-Type: application/json" \
  -d '{"status": "cancelled"}'

Webhook Notifications

You will receive webhook notifications for status changes if you have subscribed to the pharmacy_order_updated event type. Each notification includes the full order data with the new status. See Webhook Events for payload details.

Best Practices

Move orders from waiting for pharmacy to pending review as soon as your team begins reviewing them. This provides visibility to all stakeholders.
Keep the status current. Accurate status tracking helps with customer communication, reporting, and issue resolution.
Listen for pharmacy_order_updated webhooks with cancelled status. If a cancellation arrives while you are preparing an order, stop processing and update your internal systems accordingly.
Always follow the order: waiting for pharmacy to pending review to in-progress to ready_for_pickup. Use complete_order only when the order is fulfilled.