Skip to main content

API Quickstart Guide

This is a quickstart guide for the API.

To get started you will need

Essential

  1. API Keys
  2. URL endpoint details: https://api.captain.ai
  3. A test account to post orders to and read from

Recommended

  1. iPad / Android tablet with Dispatch app downloaded and logged into the account
  2. Driver app downloaded on your smartphone to verify order information appears correctly

Check all orders on an account of your integration

Each store on Captain has an unique account_UUID. Using your account UUID post a request to:

GET https://api.captain.ai/v1/accounts/{{ACCOUNT_UUID}}/orders/{{ORDER_UUID}}

Use the API reference docs to GET all orders from your account (this should return empty unless we have set up a simulated account for you with drivers). Please visit Retrieve All Orders for more information.

Create your first Order

Use the API reference docs to carefully enter all the required parameters in correct format. If you enter something in the wrong format the API should return a detailed error message. Once your order has been created successfully you will receive a tracking link and order UUID in the JSON response.

To read more details about creating an order, please visit Create New Order

POST https://api.captain.ai/v1/accounts/{{ACCOUNT_UUID}}/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",
"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"
},
"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"
},
"items": [
{
"name": "Margherita Pizza",
"category": "Pizza",
"addons": ["cheese"],
"price": "12.34",
"cookable": true
},
{
"name": "Veggie Pizza",
"category": "Pizza",
"addons": ["chilli sauce", "nachos"],
"price": "34.56",
"cookable": true
},
{
"name": "Chocolate Ice cream",
"partners_uuid": "18c7f2aa04cc",
"category": "Dessert",
"addons": ["extra chocolate sauce"],
"price": "56.78",
"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"
}
}
}