Orders - Create New Order
Overview
This endpoint allows you to create an order.
Request
POST /v1/accounts/{account_uuid}/orders
- Mandatory Request Values
Key | Type | Description | Example |
---|---|---|---|
placed_at_time | string | The date and time the order was placed on your system. DateTimes should be provided in UTC and in ISO-8601 format. | `2018-12-21T16:01:03-05:00` |
partners_unique_internal_order_id | string | This is your unique order reference number from your internal system. This should be unique across all your orders. We use this to prevent duplicate orders. If you try to create an order twice using the same order reference it will be rejected. Although you can make updates to existing orders. | `JohnnysPizza-342` |
store_order_reference_description | string | This is the reference the store uses when referring to an order. Eg order-57. This will be shown on the driver app and dispatcher app to identify orders. | `112` |
kind | string | Can be either 'delivery', 'collection', 'walk_in', 'drive_thru', or 'third_party_delivery' | `delivery` |
recipient | object Recipient | Details of the recipient of the order |
- Optional Request Values
Key | Type | Description | Example |
---|---|---|---|
special_instructions | string | This is for any order specific special instructions | `please add extra chilli sauce and include napkins` |
scheduled_for | string | This is the time the customer would like the order delivered at. It's an exact time and not a window. | `2018-12-21T16:01:03-05:00` |
internal_notes | object InternalNote | This is a list of internal notes related to the order. This will be displayed on the Manager Portal | |
items | object Item | This is a list of items related to the order. This will be displayed on the dispatch app, drivers phone and kitchen app. | |
financial_record | object FinancialRecord | This is an optional section to include if you would like to use Captain's financial analytics. Click on FinancialRecord link to view this object attributes | |
preparation | object Preparation | This is an optional section to include if you would like to use Captain's auto preparation feature. Click on Preparation link to view this object attributes | |
signature_url | string | This is a link to the url containing the image of the signature obtained by the driver when available | `http://www.cloudinary.com/imageurl.jpg` |
kds_custom_fields | Array of objects KdsCustomField | This is a list of kds custom fields related to the order. This will be displayed on the KDS. | |
custom_fields | object | You can use custom fields to add any additional data that can't be saved on the standard fields. We will send you this data back via webhooks. | { "transactionID": "123" } |
items_link | string | An external link to your website/ portal which is available for the drivers to access in the driver app when performing a delivery | `www.toogood-logistics.com/receipts/12211.pdf` |
delivery_job | object DeliveryJob | ||
note | text | You can attach note to the order. | 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 |
channel_slug | string | Specify the source of order, by default the channel_slug is `unknown` | `uber_eats` |
estimated_preparation_time | integer | This is the estimated preparation time in minutes for the order, the default value is null. | 35 |
promised_minutes | integer | This is the number of minutes it takes to finish an order. The number will be override by promised_delivery_minutes in DeliveryJob | 60 |
remake_order | boolean | This is used to specify that this order is the remake order of an existing order | true |
remake_for_order_uuid | string | This is order_uuid of an existing order to show that this order is a remake order | 8b7dde3454b2 |
payment_gateway_id | string | This is used to contain unique identifier associated with the payment gateway used for processing transactions within the system | ch_1IaB23XYZa1AbCdEfGhIJK2L |
id_verification_info | object IdVerificationInfo | This optional section is for specifying orders that contain age-restricted items (such as alcohol) and require minimum age verification. |
Example Request
POST /v1/accounts/3584a197b5a9/orders
{
"placed_at_time": "2020-09-09T13:32:40.560Z",
"partners_unique_internal_order_id": "5b25410b-40aa-43d0-a2c1-27a4fb5de6f9",
"store_order_reference_description": "577",
"scheduled_for": "2020-07-10T16:16:17+05:30",
"kind": "delivery",
"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",
"channel_slug": "uber_eats",
"promised_minutes": 60,
"promised_time_at": "2020-09-09T14:32:40.560Z",
"estimated_preparation_time": 35,
"remake_order": true,
"remake_for_order_uuid": "8b7dde3454b2",
"payment_gateway_id": "ch_1IaB23XYZa1AbCdEfGhIJK2L",
"preparation": {
"auto_prepare": "true",
"estimated_preparation_duration": 3,
"estimated_preparation_start_time": "2020-07-08T10:46:17.244Z"
},
"special_instructions": "testing gian",
"custom_fields": {
"custom_data_tag": "first_time_customer",
"link_to_voucher_url": "https://www.restodownloads.com/2839.pdf"
},
"id_verification_info": {
"contains": ["alcohol"],
"min_age": 18
},
"financial_record": {
"delivery_fee": "5",
"grand_total_including_tax": 25.9,
"items_subtotal": "22",
"card_charges": 2,
"payment_amount_received": "25.90",
"payment_method": "online",
"payment_status": "fully_paid",
"pre_delivery_driver_tip": "5",
"post_delivery_driver_tip_by_card": "",
"post_delivery_driver_tip_by_cash": "",
"credit": "0.05",
"deposit": "0.10",
"discount": "1.13"
},
"recipient": {
"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"
},
"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": [
{
"name": "Margherita Pizza",
"category": "Pizza",
"quantity": 1,
"addons": [
"cheese"
],
"display_on_kds": true,
"price": "12.34",
"cookable": true
},
{
"name": "Meat Pizza 123",
"partners_uuid": "97-34-3534",
"category": "Salad",
"quantity": 1,
"addons_type": "pizza",
"addons": {
"whole": ["vegan cheese"],
"left": ["tuna", "cucumbers"],
"right": ["steak", "mayo"]
},
"special_instructions": "more cheese please",
"display_on_kds": false,
"cookable": true
},
{
"name": "Chocolate Ice cream",
"partners_uuid": "18c7f2aa04cc",
"category": "Dessert",
"quantity": 1,
"addons": [
"extra chocolate sauce"
],
"display_on_kds": true,
"cookable": false
}
],
"delivery_job": {
"promised_delivery_minutes": "30",
"show_driver_tip_request_on_app": "true",
"dropoff_location": {
"name": "Johns place",
"latitude": "36.126410",
"longitude": "-115.14379010",
"apartment_number": "Flat 56",
"line_1": "895 Sierra Vista Drive",
"line_2": "Sierra Vista Drive",
"city": "Las Vegas",
"postcode": "89169",
"address_specific_instructions_to_driver": "2nd red door on the right next to the tree",
"state": "ontario",
"country": "USA"
},
"driver_summary": [
{
"name": "CONTACTLESS DELIVERY",
"quantity": 1
},
{
"name": "CUTLERY",
"quantity": 3
}
]
}
}
Response
Response Values
Key | Type | Example Value | Description |
---|---|---|---|
uuid | String | 0ba1a567b80e | A unique ID for the new order. |
tracking_link | String | https://tracking.captain.ai/t/0ba1a567b80e | A link to track the order |
special_instructions | string | This is for any order specific special instructions | `please add extra chilli sauce and include napkins` |
scheduled_for | string | This is the time the customer would like the order delivered at. It's an exact time and not a window. | `2018-12-21T16:01:03-05:00` |
internal_notes | object InternalNote | This is a list of internal notes related to the order. This will be displayed on the Manager Portal | |
items | object Item | This is a list of items related to the order. This will be displayed on the dispatch app, drivers phone and kitchen app. | |
financial_record | object FinancialRecord | This is an optional section to include if you would like to use Captain's financial analytics. Click on FinancialRecord link to view this object attributes | |
preparation | object Preparation | This is an optional section to include if you would like to use Captain's auto preparation feature. Click on Preparation link to view this object attributes | |
signature_url | string | This is a link to the url containing the image of the signature obtained by the driver when available | `http://www.cloudinary.com/imageurl.jpg` |
note | text | 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 | Any note for the order. |
channel | object Channel | This is an optional section if you want to specify the source of order. Click on Channel link to view this object | |
estimated_preparation_time | integer | Estimated preparation time in minutes for the order. | 35 |
promised_minutes | integer | This is the number of minutes it takes to finish an order. | 60 |
promised_time_at | string | Timestamp when the order should be finished | `2018-12-21T17:01:03-05:00` |
remake_order | boolean | Whether or not the order is remake order | true |
remake_order_uuid | string | An order_uuid of existing order | 8b7dde3454b2 |
payment_gateway_id | string | This is used to contain unique identifier associated with the payment gateway used for processing transactions within the system | ch_1IaB23XYZa1AbCdEfGhIJK2L |
id_verification_info | object IdVerificationInfo | This optional section is for specifying orders that contain age-restricted items (such as alcohol) and require minimum age verification. |
Example Response
{
"uuid": "6b6cce3454b2",
"created_at": "2020-06-18T20:14:53.988+02:00",
"status": "completed",
"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",
"promised_minutes": 60,
"promised_time_at": "2020-06-18T21:14:53.988+02:00",
"estimated_preparation_time": 35,
"remake_order": true,
"remake_for_order_uuid": "8b7dde3454b2",
"payment_gateway_id": "ch_1IaB23XYZa1AbCdEfGhIJK2L",
"preparation": {
"auto_prepare": "true",
"estimated_preparation_duration": 3,
"estimated_preparation_start_time": "2020-07-08T10:46:17.244Z"
},
"id_verification_info": {
"contains": ["alcohol"],
"min_age": 18
},
"status_history": [],
"scheduled_for": "2020-06-19T20:14:53.988+02:00",
"partners_unique_internal_order_id": "SRCIiCZp4qZcdQRaDeDnwUTk",
"kind": "delivery",
"special_instructions": "",
"placed_at_time": "2020-06-18T20:14:53.503+02:00",
"store_order_reference_description": "Mmk",
"tracking_link": "https://tracking.captain.ai/t/6b6cce3454b2",
"financial_record": {
"delivery_fee": "0.0",
"grand_total_including_tax": "25.90",
"items_subtotal": "22",
"payment_amount_received": "25.90",
"remaining_balance": "0.0",
"payment_method": "online",
"payment_status": "fully_paid",
"pre_delivery_driver_tip": "0.0",
"post_delivery_driver_tip_by_card": "0.0",
"card_charges": "0.25",
"total_tip_left_for_driver": "0.0",
"tax_type": "GST",
"credit": "0.05",
"deposit": "0.10",
"discount": "1.13"
},
"recipient": {
"uuid": "c060e997b25f",
"first_name": "John",
"last_name": "Owl",
"full_name": "John Owl",
"email": "john.doe@captain.ai",
"phone_number": "+47455644555",
"opted_out_of_SMS": false,
"opted_out_of_email": false,
"partners_internal_recipient_id": "fkA022WJ",
"landline_number": ""
},
"delivery_job": {
"promised_delivery_minutes": 60,
"uuid": "6b6cce3454b2",
"promised_delivery_time_at": "2020-06-18T21:14:53.503+02:00",
"dropoff_eta": "2020-06-18T21:10:00.000+02:00",
"pickup_eta": "2020-06-18T21:00:00.000+02:00",
"disable_dropoff_geoverification": false,
"delivery_status": "on_way_to_pickup_location",
"delivery_status_history": [],
"dropoff_location": {
"uuid": "18e0f802f520",
"name": "John Owl",
"line_1": "78 Cable Street",
"line_2": "-",
"city": "London",
"postcode": "E1 8GT",
"country": "United Kingdom",
"address_specific_instructions_to_driver": "",
"state": "London",
"apartment_number": "78",
"latitude": "51.510911",
"longitude": "-0.064716"
}
},
"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": "cc3bc4ce95db",
"name": "Items not listed",
"partners_uuid": "1234-2020",
"quantity": 1,
"category": "Pizza",
"addons": ["chilli sauce", "nachos"],
"preparation_status": "not_being_prepared",
"display_on_kds": true,
"price": "12.34",
"cookable": true
},
{
"name": "Meat Pizza 123",
"partners_uuid": "97-34-3534",
"quantity": 1,
"addons_type": "pizza",
"addons": {
"whole": ["vegan cheese"],
"left": ["tuna", "cucumbers"],
"right": ["steak", "mayo"]
},
"special_instructions": "more cheese please",
"display_on_kds": false,
"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
}