Webhooks
item_status_updated
This event is triggered every time the status of an order changes. This only works if we receive order preparation data, either by the store using our Kitchen App, or by the integration with the store receiving kitchen updates from a third-party system. It is possible to programatically change the URL this webhook is sent to - please see below for more information.
Specific Data for this message
Key | Type | Description |
---|---|---|
item_status | string | The new status of the order (e.g. being_prepared or prepared ). See 'Item Statuses' section below. |
quantity | integer | The quantity of the item |
sequence | string | Can be used for printing labels. This field is derived by taking all the items you have sent at the point of creating the order, ignoring the items that have either the display_on_kds or cookable properties set to false . This will be an empty string for items that have cookable set to false |
channel_slug | string | The order's source, by default the channel_slug is unknown . |
account_uuid | string | Store UUID |
published_at | integer, unix timestamp | The time the event occurred |
payment_gateway_id | string | The order's payment gateway ID, as sent in by your system. |
payment_status | string | The order's payment status |
grand_total_including_tax | decimal | The order's grand total including tax |
item_account_partners_external_identifier | string | The store's unique ID on your system. This can be set when setting up a store. |
item_account_business_partners_external_identifier | string | The business's unique ID on your system. This can be set when setting up a business. |
kind | string | The order's kind, Can be either delivery , collection , walk_in , third_party_delivery , or drive_thru . |
order_description | string | Your internal friendly order ID |
tracking_link | string | A URL you can use to direct your customers to Captain.AI's Tracking Page |
item_uuid | string | The item's UUID, generated automatically by Captain.AI at the point of the order being created. |
item_name | string | The item's name, as sent in by your system. |
item_addons | array | The item's addons, as sent in by your system. |
order_uuid | string | The order's UUID, generated automatically by Captain.AI at the point of the order being created. |
partners_unique_internal_order_id | string | Your unique internal order UUID, as sent in by your system at the point of creating the order. |
order_custom_fields | object or null | If you passed through an array of custom fields to the order creation API (custom_fields ), this will then be passed back to you here. |
recipient | object | Information about the receipitn. Contains name (string), phone_number (string), and address (object) keys. Address contains name , line_1 , line_2 , city , postcode , country , state , apartment_number , latitude , longitude , and address_specific_instructions_to_driver . |
printer | string | Name of the printer. |
Item Statuses
Name | Description |
---|---|
being_prepared | the item has been marked as being prepared by the Kitchen App. This means that the kitchen has just started preparing this tiem. |
prepared | the item has been marked as prepared by the Kitchen App. This means that the kitchen has finished preparing this item. |
Example payload
{
"data": {
"item_status": "being_prepared",
"quantity": 2,
"sequence": "3 of 4",
"channel_slug": "unknown",
"account_uuid": "09762c11db9a",
"published_at": 1686307894.3427908,
"payment_gateway_id": "01234",
"payment_status": "fully_paid",
"printer": "fryer",
"grand_total_including_tax": "23.57",
"item_account_business_partners_external_identifier": "",
"item_account_partners_external_identifier": "",
"kind": "delivery",
"order_description": "5039-748",
"tracking_link": "https://tracking.captain.ai/t/73acf7d2fcae",
"item_uuid": "2ae70448ed49",
"item_name": "Pineapple Pizza",
"item_addons": [],
"order_uuid": "73acf7d2fcae",
"partners_unique_internal_order_id": "b743bfb7-6053-4372-8023-777da4999799",
"order_custom_fields": null,
"recipient": {
"name": "Sarah Miller",
"phone_number": "+16692224322",
"address": {
"name": "Sarah Miller",
"line_1": "5 Marlow Gardens",
"line_2": null,
"city": "Hayes",
"postcode": "UB3 1QZ",
"country": "United Kingdom",
"state": "England",
"apartment_number": null,
"latitude": "51.503013",
"longitude": "-0.434346",
"address_specific_instructions_to_driver": null
}
}
},
"event_name": "item_status_updated",
"environment": "production",
"created_at": "2023-06-09T05:51:34.379-05:00",
"event_uuid": "465fca19-063b-45eb-9b5c-a568c5e15ecd",
"metadata": {
"sent_at": "2023-06-09T10:51:34.399+00:00",
"delivery_attempt": 1
}
}
Programatically updating the URL
This webhook is special in that the URL it's sent to is controllable programatically. However, the webhook itself must already be enabled for you to be able to do this. Please contact your account manager to get this setup.
PATCH /v1/accounts/:account_uuid
Parameters:
{
"webhooks": {
"item_status_updated_url": "https://260.270.280.555:40000/label_printer.php"
}
}