Order Status Changed
6 min
The status of an order changes.
Set the webhook (sandbox)
Send this mutation with your urlPath. Expressoft then sends a message to urlPath each time the status of the order with orderKey changes.
Query
mutation OrderStatusChange($urlPath: String!, $locationKey: Guid!, $orderKey: Guid!, $status: Short!) {
miscellaneous {
webHooks {
post_OrderStatusChanged(
payload: {
urlPath: $urlPath,
locationKey: $locationKey,
orderKey: $orderKey,
status: $status }
)
}
}
}Variables
{
"urlPath": "<your callback URL>",
"locationKey": "<locationKey>",
"orderKey": "<orderKey>",
"status": 1
}cURL
curl --location 'https://sandbox.expressoft.eu/connect/api/interopgql' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data '{"query": "mutation OrderStatusChange($urlPath: String!, $locationKey: Guid!, $orderKey: Guid!, $status: Short!) { miscellaneous { webHooks { post_OrderStatusChanged( payload: { urlPath: $urlPath, locationKey: $locationKey, orderKey: $orderKey, status: $status } ) } } }", "variables": {"urlPath": "<your callback URL>", "locationKey": "<locationKey>", "orderKey": "<orderKey>", "status": 1}}'Response
{
"data": {
"miscellaneous": {
"webHooks": {
"post_OrderStatusChanged": "<string>"
}
}
}
}The mutation returns a String (the type is confirmed by the schema). Your callback URL is called later, when the event happens.
Payload sent to your URL
Expressoft sends a POST request with this JSON body:
{
"order_key": "00000000-0000-0000-0000-000000000121",
"status": 4,
"location_key": "00000000-0000-0000-0000-000000000051"
}Field | Type | Description |
|---|---|---|
order_key | GUID | The publicKey of the order. |
status | integer | The new status. See the table below. |
location_key | GUID | The publicKey of the location that prepares the order. |
Status codes
Code | Status |
|---|---|
1 | Held |
3 | PickedUp |
4 | Ready |
5 | Dispatched |
6 | Delivered |
7 | HandedOver |
8 | Canceled |
9 | Assigned |
ℹ️ INFO
The webhook supports only these values. The BillDeliveryStatusType enum has more names (NONE, UNCONFIRMED, IN_TRANSIT, REASSIGN) that aren't supported values here.