Order Status Changed
The ORDER_STATUS_CHANGED event is triggered whenever the order status is changed. It is also sent when the status stays the same but its statusDetail changes, for example when a DELAYED order's reason changes from weather_delay to missorted.
Delayed orders
An order moves to DELAYED when the carrier reports that the package is behind schedule or has hit a recoverable problem. The package has already shipped and is still expected to arrive, so handle DELAYED like SHIPPED and not like a failure. A package that cannot be delivered moves to TRANSIT_FAILURE instead.
order.statusDetail holds the carrier's reason for the delay:
statusDetail | Meaning |
|---|---|
delayed | The package is behind schedule. |
weather_delay | Weather is holding up the package. |
missorted | The carrier sent the package to the wrong place and is rerouting it. |
transit_exception | The carrier hit a problem in transit that it expects to resolve. |
held | The carrier is holding the package. |
awaiting_information | The carrier needs more information before it can deliver. |
address_correction | The carrier is correcting the delivery address. |
null | No reason was reported, or someone set the status by hand. |
More values may be added later, so treat an unknown value as a generic delay.
Each change to status or statusDetail sends a new ORDER_STATUS_CHANGED event. Keep these points in mind when you handle them:
- The order leaves
DELAYEDonly on a carrier update or a manual change. It moves toSHIPPEDwhen the delay clears, or toOUT_FOR_DELIVERY,DELIVERED,RETURNEDorTRANSIT_FAILURE. A pharmacy resending its "shipped" update does not move aDELAYEDorder back toSHIPPED. - A reason-only change adds no case activity. When only
statusDetailchanges,activityis the most recentORDER_STATUS_CHANGEDactivity on the case, the one that recorded the move toDELAYED. Read the current state fromorder.statusandorder.statusDetail, not fromactivity.valueAfter. statusDetailis cleared when the status changes. When the order moves to a status that has no reason, such asDELIVEREDorCANCELLED,statusDetailisnull.
Attributes
eventstringpayloadobjectShow child attributes
orderobjectShow child attributes
idstring<UUID>statusstringstatusDetailstring | nulltrackingIdstring | nulldecisionIdstring | nullreplacementReasonstring | nullmessagestring | nullcaseProductIdstring<UUID>productIdstring<UUID>pharmacyNamestring | nullpharmacyOrderIdstring | nullitemsarray<object>Show child attributes
idstring | nullnamestringquantitystringquantityUnitstring | nullexternalMedicationIdstring | nullcreatedAtstring<date-time>caseobjectShow child attributes
idstring<UUID>typestringtitlestringstatusstringshortIdstringcreatedAtstring<date-time>updatedAtstring<date-time>assignedAtstring<date-time>inProgressAtstring<date-time>closedAtstring<date-time>isArchivedbooleanisEscalatedbooleanisImportedbooleanreferralCodestringclosedBystringinProgressBystringorganizationIdstring<UUID>archiveReasonstringarchiveNotestringvisitTypeVisitTypeproductBundleIdstring<UUID>productBundleobjectShow child attributes
namestringsubmitterobjectShow child attributes
idstringfirstNamestringlastNamestringemailstringdobstring<date-time>genderstringphoneNumberstringaddressstringaddress2stringcitystringstatestringpostalCodestringactivityobjectShow child attributes
idstring<UUID>typestringisPHIbooleanisRestrictedbooleanvalueBeforestring | nullvalueAfterstring | nulltimestampstring<date-time>actorobjectShow child attributes
idstring<UUID>firstNamestringlastNamestringemailstringtargetUserobjectShow child attributes
idstring<UUID>firstNamestringlastNamestringemailstringResponse
{
"event": "ORDER_STATUS_CHANGED",
"payload": {
"order": {
"id": "07b9925a-233e-46e7-8873-f5f878ad292e",
"status": "DELAYED",
"statusDetail": "weather_delay",
"trackingId": "1Z999AA10123456784",
"message": null,
"pharmacyName": "Pharmacy A",
"pharmacyOrderId": "101478650",
"decisionId": "b894efac-eeb8-4666-ae6b-f45749d22929",
"replacementReason": "Incorrect Address",
"caseProductId": "80f9b122-6e13-4f04-acd4-bf3b7ff9a6bb",
"productId": "cf862f8d-e5cf-492e-a6c7-a81985568506",
"items": [
{
"id": "3f1c2a7e-8b4d-4e6a-9c21-5d7e8f9a0b1c",
"name": "product name A",
"quantity": "2",
"quantityUnit": "ml",
"externalMedicationId": "8b4d-4e6a-9c21-5d7e8f9a0b1c"
},
{
"id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
"name": "product name B",
"quantity": "1",
"quantityUnit": null,
"externalMedicationId": null
}
],
"createdAt": "2025-12-18T21:28:58.972Z"
},
"case": {
"id": "c747fe81-6b49-4d4e-9a87-81cb0ee026fd",
"type": "GLP",
"title": "Case for John Doe",
"status": "APPROVED",
"shortId": "ADA-Y09STM",
"createdAt": "2025-12-17T11:28:26.365Z",
"updatedAt": "2025-12-18T22:16:51.374Z",
"assignedAt": "2025-12-17T11:28:45.125Z",
"inProgressAt": "2025-12-18T21:26:32.248Z",
"closedAt": "2025-12-18T21:28:17.008Z",
"isArchived": false,
"isEscalated": true,
"isImported": false,
"referralCode": null,
"closedBy": "YaM948FdwiQa3Ek3GCnYsnZTTSW2",
"inProgressBy": "DgHxzGRtS5gFzdL7cReiPzJcA852",
"organizationId": "2081c4bc-8d0e-4664-a5f8-30669d750543",
"archiveReason": null,
"archiveNote": null,
"productBundleId": "209c4a44-8acf-4f87-a978-da81fa73a6a1",
"productBundle": {
"id": "209c4a44-8acf-4f87-a978-da81fa73a6a1",
"name": "ORG-PRODUCT-BUNDLE-1"
},
"submitter": {
"id": "a9a2bJ9VcoVEPGgK9REMkjKIbl33",
"firstName": "John",
"lastName": "Doe",
"email": "john@example.com",
"dob": "1990-12-12T00:00:00.000Z",
"gender": "MALE",
"phoneNumber": "+12284746464",
"address": "1271 6th Avenue",
"address2": "bgr",
"city": "New York",
"state": "AK",
"postalCode": "10020"
}
},
"activity": {
"id": "d806b834-4de7-4ccf-8cf0-98c611949b51",
"type": "ORDER_STATUS_CHANGED",
"isPHI": false,
"isRestricted": false,
"timestamp": "2025-12-18T22:16:51.363Z",
"valueBefore": null,
"valueAfter": "DELAYED",
"actor": {
"id": "DgHxzGRtS5gFzdL7cReiPzJcA852",
"firstName": "Sarah",
"lastName": "Williams",
"email": "sarah@example.com"
},
"targetUser": null
}
}
}