Overview
Overview
Welcome to the Captain.AI API! You can use our API to access Captain.AI API endpoints, which can get information on your stores, delivery drivers, and orders.
You can
- create orders and delivery jobs
- retrieve orders and delivery jobs
- retrieve drivers for an account
- cancel orders
- automate orders preparation
Captain uses a REST protocol with methods GET, POST, PATCH, DELETE to interact with resources on Captain. All data is transmitted in JSON format.
Resources
Order- usually has oneDelivery Job(can have multiple in the case of Redelivery) - has oneFinancial record- has oneRecipientDriver
Business Logic
Before using the API it's useful to understand the Captain ecosystem. Here’s a 60 second intro:
Captain is a platform that enables Drivers and Orders with DeliveryJobs to be managed. We have the following concepts:
Business- A
Businessis a financially independent organisation. ABusinesshas a Business Owner and can have manyAccounts(aka stores). - eg. A Business owner owns 3
Accountsin different parts of New York under the brand ‘Frank Sinatra Pizza’.
- A
Account- You might know this as a Store / Hub / Base
- There are two types of accounts - store or fleet, a single store would be a store type and a fleet of drivers delivering across many stores would be a account of kind 'fleet'
- An account of kind 'store' is a single store where deliveries are picked up from and then delivered to
Recipients. - Typically this would also be the base where the
Driversreturn after completing a group ofOrders(aka deliveries). Accounthas manyOrders
Driver- Also known as Agent. These are the individual people who perform Delivery
Jobsas part ofOrders - A driver performs Delivery
Jobsas part of aTaskGroupconsisting of multipleTasks. - A Driver Profile always belongs to a single
Account, however a single user (identified by email) can have multiple driver profiles (each profile belongs to a single account.
- Also known as Agent. These are the individual people who perform Delivery
Job- Known as
Jobon Captain system - This belongs to an
Order. - These are the deliveries made to Recipients. A
Jobis typicallymatchedone to one with anOrder. Sometimes an order can have many delivery jobs, e.g. in the case of a re-delivery. - The Delivery
Jobhas adropoffwhich is typically the recipients address.
- Known as
Recipient- This is the recipient of the delivery, this is the end customer who receives the delivery. Each
DeliveryJob/Orderhas aRecipient
- This is the recipient of the delivery, this is the end customer who receives the delivery. Each