Skip to main content

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

  created
     |
     v
   open ---------> cancelled
     |
     v
 processing -----> cancelled
     |
     v
  shipped
     |
     v
 completed

Status Descriptions

StatusDescriptionWho sets it
createdOrder has been created in the system but is not yet assigned to a pharmacySystem
openOrder is assigned to a pharmacy and ready to be processedSystem
processingPharmacy has acknowledged the order and started preparationPharmacy (via API)
shippedOrder has been shipped to the patientPharmacy (via API)
completedOrder has been delivered and finalized (includes stock reduction)System
cancelledOrder was cancelled before completionSystem or Pharmacy

Transitions

Open to Processing

When your pharmacy receives a new order (status: open), acknowledge it by updating the status to processing:
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": "processing"}'

Processing to Shipped

Once the order has been packed and handed to the shipping carrier, update the status to shipped:
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": "shipped"}'

Shipped to Completed

The transition from shipped to completed is handled automatically by the RxScale system. This step includes stock reduction and order finalization.
Setting status to completed is not available through the API. Order completion is handled through a dedicated internal process.

Cancellation

An order can be cancelled from the open or processing state:
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 open to processing as soon as your team begins working on 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: open to processing to shipped. Do not jump directly from open to shipped.