Skip to main content

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 one Delivery Job (can have multiple in the case of Redelivery) - has one Financial record - has one Recipient
  • Driver

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 Business is a financially independent organisation. A Business has a Business Owner and can have many Accounts (aka stores).
    • eg. A Business owner owns 3 Accounts in different parts of New York under the brand ‘Frank Sinatra Pizza’.
  • 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 Drivers return after completing a group of Orders (aka deliveries).
    • Account has many Orders
  • Driver
    • Also known as Agent. These are the individual people who perform Delivery Jobs as part ofOrders
    • A driver performs Delivery Jobs as part of a TaskGroup consisting of multiple Tasks.
    • 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.
  • Job
    • Known as Job on Captain system
    • This belongs to an Order.
    • These are the deliveries made to Recipients. A Job is typically matched one to one with an Order. Sometimes an order can have many delivery jobs, e.g. in the case of a re-delivery.
    • The Delivery Job has a dropoff which is typically the recipients address.
  • Recipient
    • This is the recipient of the delivery, this is the end customer who receives the delivery. Each DeliveryJob / Order has a Recipient