DoorDash Checkout API Interface (0.1.6)
Last updated: Apr 20, 2021
Release Notes
v0.1.8 (effective Apr 20, 2021)
- Clean up Introduction section
- Create Order Session
- Update Extra.tax_excluded_price to now allow negative values
- Update Option.tax_excluded_price to now allow negative values
- Add field_errors.code field
- Remove unused scheduled_delivery_time field
- Get Checkout Page
- Remove content body for 400 bad request (incorrect content)
v0.1.7 (effective Mar 10, 2021)
- Added first_name and last_name on consumer object
v0.1.6 (effective Feb 16, 2021)
- Changed checkout endpoint to be https://order.online/embed/v1/checkout/
v0.1.5 (effective Feb 08, 2021)
- Added scheduled_delivery_time, cart.items.item.special_instructions, external_order_id, dropoff_preference
- Renamed for cart items, extras, and options: price is now tax_excluded_price
- Updated descriptions
- Updated Error Response for 400 Bad request cases
v0.1.4 (effective Feb 02, 2021)
- Added webhook type and payload
v0.1.3 (effective Jan 28, 2021)
- Removed tip, pickup_address, pickup_time, delivery_time, provider_type
v0.1.2 (effective Jan 26, 2021)
- Modifying Options and Extras to be arrays
- Removed external_business_name
- Added provider_type
v0.1.1 (effective Jan 19, 2021)
- Modified field: Currency, Option, Extra, Tip
v0.1.0 (effective Jan 13, 2021)
- First pass
Welcome to Drive's payment integration platform. Using this API, you can leverage our payment processing and checkout flow, along with order creation, order tracking, SaaS capabilities, and payment reporting.
Requirements:
- Store must be an existing store on DoorDash Marketplace
- Items passed in must reflect menu items existing on Marketplace store
- Must pass consumer email to us for storing Stripe profile on DoorDash's end
Here is the typical flow:
- Once items on external end are ready for checkout, request an
order_session_id
by passing those items and prices, along with consumer data, delivery data, to our API. - Request a secure HTML checkout page to open in a webview on your app using the
order_session_id
from the previous step. - When consumer finished checkout flow, the order should either be successfully created or an error will be returned.
- The delivery is executed.
A delivery is created in a scheduled state with the event "delivery_created". The end state is either "delivered" or "cancelled". Notable events will change delivery state and/or dasher state.
- Interface is REST-based
- POST data is application/json
- Request and response HTTP header “Content-type” is always “application/json”
- We use normal HTTP status codes
You will have to replace ${apiKey} curl -H "Authorization: Bearer ${apikey}" -v https://api.doordash.com/drive/v1/...
with your specific API key. If you need an api key, contact [email protected].
Please retry all 50x response status codes as the error could be transient. We recommend up to 3 retries with some exponential backoff delay between requests.
When providing a time to any of the below APIs (i.e. pickup_time
or delivery_time
), the format must be UTC.
If you need updates on various stages of a delivery, please provide us with a url endpoint that you would like to receive webhook events. The webhook events we send to your endpoint will have an Authorization header with value Bearer {API_KEY}, while {API_KEY} is the api key we provided you.
Currently, we send out the following events:
delivery_created
: We accepted your order and a delivery has been created for it.
delivery_created
: This event will occur once, after the delivery is created.
{
"external_order_id": "1234-abcd",
"event_category": "delivery_created",
"tracking_url": "https://www.doordash.com/XXX",
"created_at": "2021-02-01T02:01:00.000Z"
}
Create Order Session
Create the order session by passing in order details to receive a order_session_id, which is used to open the Checkout Page webview.
Authorizations:
Request Body schema: application/json
Request body for checkout endpoint
required | object (The consumer's cart containing their order.) An object that represents the cart of order items and which menu type / category the order belongs to. |
currency required | string Enum: "USD" "AUD" "CAD" "JPY" Type of currency of the payment. |
required | object (Consumer) Consumer information. |
required | object (The address where the order needs to be dropped off.) The address where the order needs to be dropped off. |
external_order_id | string Merchant's unique identifier for the order. |
external_store_id required | string Merchant's unique identifier for a store that this delivery is for. |
object (DropoffPreference) Details on how Dasher should dropoff to the consumer; consumer preference for their delivery getting dropped off. |
Responses
Request samples
- Payload
{- "cart": {
- "category_name": "BREAKFAST",
- "items": [
- {
- "merchant_supplied_id": "DELUXE_AMERICAN",
- "quantity": 3,
- "tax_excluded_price": 899,
- "special_instructions": "Please add any sauces to the side.",
- "extras": [
- {
- "merchant_supplied_id": "BREAKFAST_CONDIMENTS",
- "quantity": 0,
- "tax_excluded_price": 0,
- "options": [
- {
- "merchant_supplied_id": "ADD_KETCHUP",
- "quantity": 1,
- "tax_excluded_price": 50,
- "extras": [ ]
}
]
}
]
}
]
}, - "currency": "USD",
- "consumer": {
- "external_consumer_id": "12345678",
- "phone_number": "+16505555555",
- "address": "12345 Oakview Drive, San Francisco, CA 94108",
- "first_name": "Jane",
- "last_name": "Goodall"
}, - "delivery_address": {
- "street": "901 Market Street",
- "unit": "Suite #600",
- "city": "San Francisco",
- "state": "California",
- "zip_code": "94105",
- "country": "USA"
}, - "external_order_id": "aer5-ufc9-7865-45ng8-iuywq",
- "external_store_id": "148767394",
- "dropoff_preference": {
- "option": "LEAVE_AT_DOOR",
- "dasher_instructions": "This is a gated community. Just head over to the gate entrance and on the left there should be a mail package area where you can drop off the order. Thanks!"
}
}
Response samples
- 200
- 400
{- "order_session_id": "24ac000c-3934-11eb-adc1-0242ac120002"
}