Skip to main content

Orders - Update an Order

Overview

This endpoint allows you to update an order.


Request

PATCH /v1/accounts/{account_uuid}/orders/{order_uuid}

Example Request #1

PATCH /v1/accounts/3584a197b5a9/orders/46edc8e3

{
"items": [
{
"uuid": "c4078626d738",
"name": "Veggie Pizza 123",
"partners_uuid": "97csddafa972411",
"category": "Pizza",
"addons": [
"chilli sauce",
"nachos"
],
"price": "12.34",
"cookable": true
},
{
"uuid": "3d84c53eac47",
"name": "Fresh Pizza",
"addons_type": "pizza",
"addons": {
"whole": ["vegan cheese"],
"left": ["tuna", "cucumbers"]
},
"preparation_status": "not_being_prepared",
"partners_uuid": "97-34-3534",
"special_instructions": "please make sure it hots",
"payment_gateway_id": "ch_1IaB23XYZa1AbCdEfGhIJK2L",
"price": "12.34",
"cookable": true
}
]
}


Example Response #1

{
"uuid": "053866dc80f6",
"created_at": "2020-09-27T08:43:03.327-04:00",
"status": "cancelled",
"scheduled_for": "2020-09-28T06:46:17.000-04:00",
"partners_unique_internal_order_id": "5b25410b-40asasd67c1-asd434554fb5de6f9",
"kind": "delivery",
"special_instructions": "testing gian",
"placed_at_time": "2020-09-09T09:32:40.560-04:00",
"payment_gateway_id": "ch_1IaB23XYZa1AbCdEfGhIJK2L",
"custom_fields": {
"member": "Ward One",
"ord_name": "Jass"
},
"preparation": {
"estimated_preparation_start_time": "2020-07-08T06:46:17.244-04:00",
"estimated_preparation_duration": 3,
"auto_prepare": true
},
"id_verification_info": {
"contains": ["alcohol"],
"min_age": 18
},
"status_history": [],
"store_order_reference_description": null,
"tracking_link": "https://tracking.captain.ai/t/053866dc80f6",
"financial_record": {
"delivery_fee": "5.0",
"grand_total_including_tax": "25.9",
"items_subtotal": "22.0",
"payment_amount_received": "25.9",
"remaining_balance": null,
"payment_method": "online",
"payment_status": "fully_paid",
"pre_delivery_driver_tip": "5.0",
"post_delivery_driver_tip_by_card": null,
"card_charges": "2.0",
"total_tip_left_for_driver": null,
"tax_type": null,
"credit": "0.05",
"deposit": "0.10",
"discount": "1.13"
},
"recipient": {
"uuid": "162a8b255684",
"first_name": null,
"last_name": null,
"full_name": "John Doe",
"email": "john.doe@captain.ai",
"phone_number": "+17760275444",
"opted_out_of_SMS": false,
"opted_out_of_email": false,
"partners_internal_recipient_id": "1258484",
"landline_number": "+177602875444"
},
"delivery_job": {
"promised_delivery_minutes": 30,
"uuid": "053866dc80f6",
"promised_delivery_time_at": "2020-09-28T06:46:17.000-04:00",
"disable_dropoff_geoverification": false,
"delivery_status": "unassigned_to_driver",
"dropoff_location": {
"uuid": "a14a53567d09",
"name": "John Doe",
"line_1": "895 Sierra Vista Drive",
"line_2": "Sierra Vista Drive",
"city": "Las Vegas",
"postcode": "89169",
"country": "USA",
"address_specific_instructions_to_driver": "2nd red door on the right next to the tree",
"state": "ontario",
"apartment_number": "Flat 56",
"latitude": "36.12641",
"longitude": "-115.14379"
},
"delivery_status_history": []
},
"internal_notes": [
{
"note": "Important note",
"date": "2020-07-08T10:46:17.244Z",
"user": "john.doe@captain.ai"
},
{
"note": "Important note #2",
"date": "2020-07-08T10:50:00.244Z",
"user": "john.doe@captain.ai"
}
],
"items": [
{
"uuid": "c4078626d738",
"name": "Veggie Pizza 123",
"partners_uuid": "97csddafa972411",
"category": "Pizza",
"addons": ["chilli sauce", "nachos"],
"preparation_status": "not_being_prepared",
"display_on_kds": true,
"price": "12.34",
"cookable": true
},
{
"uuid": "3d84c53eac47",
"name": "Fresh Pizza",
"partners_uuid": "97csddafa972411",
"category": "Pizza",
"addons_type": "pizza",
"addons": {
"whole": ["vegan cheese"],
"left": ["tuna", "cucumbers"]
},
"preparation_status": "not_being_prepared",
"special_instructions": "please make sure it hots",
"display_on_kds": true,
"price": "12.34",
"cookable": true
}
],
"channel": {
"slug": "uber_eats",
"name": "Uber Eats",
"logo_cloudinary_url": "https://res.cloudinary.com/captain-ai/image/upload/v1655985610/kds-assets/ubereats.png"
},
"assigned_driver": null
}

You can use the order update endpoint to:

To ChangeDescription
Dropoff addresspass delivery job with dropoff_location payload
Promised delivery timepass delivery job with promised_delivery_minutes key only
Disable Dropoff Geoverificationpass delivery job with disable_dropoff_geoverification key only
Internal Notespass internal_notes payload
KDS Custom Fieldspass kds_custom_fields payload
Update an itemmust have provided a partner UUID to update an existing one or without uuid for adding new one plus removing any existing one
Recipientpass only recipient payload with uuid in payload
Financial Recordpass only financial_record payload with uuid in payload
Scheduled forpass only scheduled_for key value
Preparationpass only preparation payload with required keys to update
Notepass only note key value
Channelpass only channel_slug key value
Estimated Preparation Timepass estimated_preparation_time in your payload
Kindpass kind as key value. Value can be one of these delivery, collection, walk_in, drive_thru, third_party_delivery.
Payment Gateway IDpass only payment_gateway_id value
ID Verification Informationpass only id_verification_info

Note: There are certain keys that we can't update - partners_unique_internal_order_id

Reschedule an Order

When we have to reschedule the order

PATCH /v1/accounts/3584a197b5a9/orders/46edc8e3

{
"scheduled_for": "2020-10-02T05:25:49.000Z"
}

Example Response

{
"uuid": "47d268ebc4d5",
"scheduled_for": "2020-10-02T05:25:49.000Z",
"partners_unique_internal_order_id": "d81d5565-3686-4376-8872-97820b4eac3a",
.....
}

Update the Recipient

When we have to update recipient phone number & any other details specific to recipient block:

{
"recipient": {
"phone_number": "+917009570291",
"opted_out_of_SMS": true
}
}

Example Response

{
"uuid": "47d268ebc4d5",
.....
"recipient": {
"uuid": "d573b2225d9e",
"first_name": null,
"last_name": null,
"full_name": "John Doe",
"email": "john.doe@captain.ai",
"phone_number": "+919968412447",
"opted_out_of_SMS": true,
"opted_out_of_email": false,
"partners_internal_recipient_id": "1258484",
"landline_number": "+177602875444"
},
.....
}

Update the Dropoff Details

When we have to update dropoff apartment number to Flat 78 pass complete dropoff_location block:

{
"delivery_job": {
"dropoff_location": {
"uuid": "e65f85127f5d",
"name": "John Doe",
"line_1": "895 Sierra Vista Drive",
"line_2": "Sierra Vista Drive",
"city": "Las Vegas",
"postcode": "89169",
"country": "USA",
"address_specific_instructions_to_driver": "2nd red door on the right next to the tree",
"state": "ontario",
"apartment_number": "Flat 78",
"latitude": "36.12641",
"longitude": "-115.14379"
}
}
}

Update the Note

When we want to update the note attach to an order:

{
"note": "36000 RUE BELAIR, MONTREAL QUEBEC delivery charges are applied and cx wants delivery ASAP and str plz send dips mentioned in the bill as well"
}

Example Response

{
"uuid": "47d268ebc4d5",
"note": "36000 RUE BELAIR, MONTREAL QUEBEC delivery charges are applied and cx wants delivery ASAP and str plz send dips mentioned in the bill as well",
"partners_unique_internal_order_id": "d81d5565-3686-4376-8872-97820b4eac3a"
}

Update Display on KDS value of an item

{
"items": [
{
"uuid": "47f262ajc4d7",
"display_on_kds": false
}
]
}

Example Response

{
"uuid": "47d268ebc4d5",
"items": [
{
"uuid": "47f262ajc4d7",
"display_on_kds": false
}
]
}

Update cookable value of an item

{
"items": [
{
"uuid": "47f262ajc4d7",
"cookable": false
}
]
}

Example Response

{
"uuid": "47d268ebc4d5",
"items": [
{
"uuid": "47f262ajc4d7",
"cookable": false
}
]
}

Update source of the order

When we want to update the source of order

{
"uuid": "47d268ebc4d5",
"channel_slug": "door_dash"
}

Example Response

{
"uuid": "47d268ebc4d5",
"channel": {
"slug": "door_dash",
"name": "Door Dash",
"logo_cloudinary_url": "https://res.cloudinary.com/captain-ai/image/upload/v1655985611/kds-assets/doordash.png"
}
}

Update the Estimated Preparation Time

When we want to update the estimated preparation time of an order

{
"uuid": "47d268ebc4d5",
"estimated_preparation_time": 30
}

Example Response

{
"uuid": "47d268ebc4d5",
...
"estimated_preparation_time": 30
...
}

Update the Financial Record

{
"uuid": "47d268ebc4d5",
"financial_record": {
"payment_status": "fully_paid",
"credit": "1.57",
"discount": "2.45",
"deposit": "1.83"
}
}

Example Response

{
"uuid": "47d268ebc4d5",
...
"financial_record": {
"delivery_fee": "5.0",
"grand_total_including_tax": "25.9",
"items_subtotal": "22.0",
"payment_amount_received": "25.9",
"remaining_balance": null,
"payment_method": "online",
"payment_status": "fully_paid",
"pre_delivery_driver_tip": "5.0",
"post_delivery_driver_tip_by_card": null,
"card_charges": "2.0",
"total_tip_left_for_driver": null,
"tax_type": null,
"credit": "1.57",
"discount": "2.45",
"deposit": "1.83"
}
...
}

Update Internal Notes

{
"uuid": "47d268ebc4d5",
"internal_notes": [
{
"note": "Important note",
"date": "2020-07-08T10:46:17.244Z",
"user": "john.doe@captain.ai"
},
{
"note": "Important note #2",
"date": "2020-07-08T10:50:00.244Z",
"user": "john.doe@captain.ai"
}
]
}

Example Response

{
"uuid": "47d268ebc4d5",
...
"internal_notes": [
{
"note": "Important note",
"date": "2020-07-08T10:46:17.244Z",
"user": "john.doe@captain.ai"
},
{
"note": "Important note #2",
"date": "2020-07-08T10:50:00.244Z",
"user": "john.doe@captain.ai"
}
]
...
}

Update KDS Custom Fields

{
"uuid": "47d268ebc4d5",
"kds_custom_fields": [
{
"key": "VIP Customer",
"value": true
},
{
"key": "# previous orders",
"value": "5"
}
]
}

Example Response

{
"uuid": "47d268ebc4d5",
...
"kds_custom_fields": [
{
"key": "VIP Customer",
"value": true
},
{
"key": "# previous orders",
"value": "5"
}
]
...
}

Update ID Verification Information

{
"uuid": "47d268ebc4d5",
...
"id_verification_info": {
"contains": ["alcohol"],
"min_age": 18
}
}

Example Response

{
"uuid": "47d268ebc4d5",
...
"id_verification_info": {
"contains": ["alcohol"],
"min_age": 18
}
}