Online Delivery Provider Docs
Online Delivery Provider Docs
Online Delivery Provider Docs
Overview
General Guides
Getting Started
API General Definitions
API Authentication/Authorization
Webhook
API Usage Limits
Error Responses
Authentication
Scopes
Generate Token
Usage
Orders Integrations
Overview
Operations
Integration Flows
Orders Endpoints
Create Order
Update Order
Update Order Status
Update Customer Payment
Update Order Delivery Information
PUT /v1/orders/{orderId}/delivery
Models
Menus Integration
Overview
Operations
Integration Flows
Menu Events And Callbacks
Menu Publish
Update Menu Entities Availability
Send Menu
Upsert Hours
Callback Errors
Models
How to Send Test Webhooks
Storefront Integration
Overview
Operations
Integration Flows
Storefront Events And Callbacks
Get store availability
Pause store
Unpause store
Models
Overview
The API endpoints are developed around RESTful principles secure via the OAuth2.0 protocol.
Beyond the entry points, the API also provides a line of communication into your system via webhooks.
General Guides
Getting Started
Onboard your application
Onboard your webhook configurations
Onboard your store(s)
API General Definitions
API Authentication/Authorization
OAuth2.0
Request Examples
URL Encode Form
HTTP Basic Auth
Webhook
Notification Schema
Notification Request Example
Expected Response
Webhook Auth
API Usage Limits
Error Responses
Getting Started
External developers are required to have a registered Application representing their integration. This is a one-time, manual registration needed to
setup authentication and authorization between your application and the API. Please reach out to your Account Representative to register your
Application with the API.
Once onboarded, your Application will receive its own Application ID and Client Secret for each environment (production and staging).
This Guide will walk you through where and how to use these credentials.
NOTE: The Application ID used to be called the Partner ID, so please use those interchangeably.
The API allows you to configure your integration to receive Webhook into your system. Please reach out to your Account Representative to
register to receive Webhooks from the API.
Applications are required to register every store to authorize requests at a store level. This registration is on a per-store basis, as to associate the
store entity in your system with the store entity in our system. After a store is onboarded, its ID will be used in every request in header X-Store-
Id. Reach out to your Account representative to onboard each store that your application acts on behalf of.
The APIs use resource-oriented URLs communicating, primarily, via JSON and leveraging the HTTP headers, response status codes, and verbs.
To exemplify how the API is to be consumed, consider a fake GET resource endpoint invocation below:
Header Description
Authorization Standard HTTP header is used to associate the request with the originating invoker. The content of this
header is a Bearer token generated from you client_secret, defined in the API Auth guide.
X-Store-Id The ID of the store in your system this call acts on behalf of, available after a store onboarding.
All resource endpoints expect the Authorization and X-Application-Id header, the remaining headers are explicitly stated in the
individual endpoint documentation section.
Validate the client token, making sure the call is originating from a trusted source.
Validate that the Application has the permission to access the v1/resource/{id} resource via the Application's pre-configured scopes.
Translate your X-Store-Id to our internal store ID (e.g. AAA).
Validate and retrieve resource AAA, that is associated to your Application via store id 321.
POST/PUT methods will look similiar to the GET calls, but they'll take in a body in the HTTP request (default to the application/json content-type).
curl --location --request POST 'https://partners-staging.api.com/v1
/resource' \
--header 'Authorization: Bearer 34fdabeeafds=' --header 'X-Store-Id:
321' --header 'X-Application-Id: e22f94b3-967c-4e26-bf39-9e364066b68b"
--data '{"foo": "bar"}'
API Authentication/Authorization
OAuth2.0
The Authorization API is based on the OAuth2.0 protocol, using the client credentials grant. Resources expect a valid token sent as a Bearer to
ken in the HTTP Authorization header.
To generate the token, use the Application ID and Client Secret (provided during onboarding) to the Token Auth endpoint endpoint. The
result of this invocation is a token that is valid for a pre-determined time or until it is manually revoked.
The response of the following endpoints will return a token that will be sent as a Bearer value of the Authorization HTTP header, along with
meta information such as expiry-date.
Request Examples
Webhook
The API platform is able to send notifications to your system via HTTP POST requests signed with an HMAC digest defined in the Webhook
AUTH section. Please work with your Account Representative to setup your Application's Webhook configurations.
Notification Schema
metadata.payload object The event object which will be detailed in each Webhook description.
metadata.storeId string Id of the store for which the event is being published.
metadata.applicationId string Id of the application for which the event is being published.
metadata.resourceId string The external identifier of the resource that this event refers to.
Expected Response
The partner application should return an HTTP 200 response code with an empty response body to acknowledge receipt of the webhook event.
Webhook Auth
Webhooks use a standard HMAC signature for your system to validate that the inbound request is coming from our API.
The sent in the Authorization header should be used to validate that the payload was sent by us. The shared client_secret (configured
during onboarding) is used to generate the digest:
Python:
Java:
// request_body = Body of the request.
// clientSecret = The shared secret key.
String hashSignature = getHashSignatureFromAuthHeader(); //
hash_signature will be prefixed with "MAC "
String hashSignatureDigest = hashSignature.split(" ")[1]; // strip off
prefix "MAC "
byte[] hashSignatureDigestDecoded = Base64.getDecoder().decode
(hashSignatureDigest);
Mac mac = Mac.getInstance(HMAC_SHA_1);
mac.init(new SecretKeySpec(clientSecret.getBytes(Charsets.UTF_8),
HMAC_SHA_1));
assertArrayEquals(hashSignatureDigestDecoded, mac.doFinal(request_body.
getBytes()));
Error Responses
HTTP Status Code 403: Authorization not valid for the requested resource.
Specification
Example
{
"message": "Account could not be found: {ext_store_id=,
partner_id=1}",
"details": []
}
Authentication
Scopes
Generate Token
Usage
The Authentication/Authorization API support OAuth2.0 protocol. Only Generate Token operation is supported.
Scopes
The following scopes are available. Scopes must be configured by our internal team to be enabled for an app. Each endpoint requires a given
scope that can be verified on each endpoint documentation. When generating an OAuth2.0 token multiple scopes can be requested.
Scope Description
menus.publish Token has permission to notify the result of a publish menus operation for a
given store.
menus.get_current Token has permission to send the current state of a menu, after being
requested by a webhook event.
menus.pos_publish Token has permission to read available integration targets and to publish
complete menus for selected integration targets.
menus.async_job.read Token has permission to read the status of a menu upser job.
menus.entity_suspension Token has permission to notify the result of a menu entity availability update,
after being requested by a webhook event.
menus.read Token has permission to read the current menus for a given store.
orders.delivery_info_update Token has permission to update delivery information for a previously created
order.
orders.status_update Token has permission to update the order status for a previously created order.
orders.create Token has permission to create new order for a given store.
orders.upsert Token has permission to create and / or update new order(s) for a given store.
reports.generate_report Token has permission to request reports for a given store and period of time.
storefront.store_pause_unpause Token has permission to notify the result of a pause/unpause operation, after
being requested by a webhook event.
storefront.store_hours_configuration Token has permission to send the current store hours configuration.
Generate Token
POST /v1/auth/token
Used to generate an OAuth2.0 token that must be used to call all available endpoints.
Client credentials in the request-body and HTTP Basic Auth are supported.
Request
Specification
Field Type Description
client_id string <uuid> The ID of the client (also known as the Application ID).
scope string The scope to request, multiple scopes are passed delimited by a space character.
Example
Response
Specification
Example
{
"access_token": "oMahtBwBbnZeh4Q66mSuLFmk2V0_CLCKVt0aYcNJlcg.
yditzjwCP7yp0PgR6AzQR3wQ1rTdCjkcPeAMuyfK-NU",
"expires_in": 2627999,
"scope": "ping orders.create",
"token_type": "bearer"
}
Error Responses
HTTP Status Code 400: The request is malformed.
Example:
{
"message": "Client Secret and Authorization header are null.",
"details": []
}
Usage
The token provided in field access_token is used to authenticate when consuming the API endpoints. Send the token value in the Authorizat
ionheader of every request. The token expiration time is represented in the field expired_in, in seconds. Currently, all tokens are valid for 30
days and should be stored and re-used while still valid.
Example usage:
Orders Integrations
Overview
Operations
Integration Flows
Order Lifecycle
Order Creation Flow
Order Cancellation Event Flow
Overview
This section aims to guide the development of order integration, covering order creation flow and state transitions.
Operations
Create order: Creates a new order for a given store. This operation is performed by sending a POST request to /v1/orders.
Update order status: Updates the order state for a previously created order. Supported states are: PREPARED, CANCELED,
FULFILLED. This operation is performed by sending a POST request to /v1/orders/{orderId}/status.
Update order delivery information: Updates delivery information for a previously created order, like destination address, courier,
vehicle, current location, and customer notes. This operation is performed by sending a PUT request to /v1/orders/{orderId}
/delivery.
Event - Intent to cancel order: Partners API sends a webhook event to a pre-configured URL, notifying that a restaurant operator
wants to cancel and order. If the cancel operation succeeds, the order status should be changed to CANCELED by using the endpoint /v1
/orders/{orderId}/status.
Event - Order status update: Partners API sends a webhook event to a pre-configured URL, notifying about an order status transition.
The webhook payload contains the full history of order statuses, with timestamps. Statuses that trigger this event: ORDER_ACCEPTED,
ORDER_READY_TO_PICKUP, ORDER_FULFILLED, ORDER_CANCELED.
Integration Flows
Order Lifecycle
The order lifecycle is composed of the possible state transitions that can happen to the order.
1. The order lifecycle starts with NEW_ORDER status. In general, orders will be created in this status. However, it is possible to create orders
in a more advanced status in case of state transitions happening earlier on the integration side.
2. After a new order is placed it must be accepted, either manually or automatically. This moves the order into the ORDER_ACCEPTED
status.
3. Once the store completes preparation of the order, it moves into the ORDER_READY_TO_PICKUP status.
4. After the order is delivered or picked up by the customer, the state will change to ORDER_FULFILLED.
5. This is the terminal state for a successful order.
An order can be canceled at any point, which will change the status to ORDER_CANCELED. This is the terminal state for a failed order.
Integration flow for the process of creating a new order and state transitions until the order is fulfilled.
1. Partner application creates a new order using POST /v1/orders.
2. When the user accepts the order (can be automatically accepted) Partners API sends an order status update webhook event containing
status ORDER_ACCEPTED.
3. Partner application updates the order status to PREPARED using POST /v1/orders/{orderId}/status.
4. Partner application updates the order status to FULFILLED using POST /v1/orders/{orderId}/status.
Optional: an order status update webhook event may be triggered when the user marks the order as ready to pick up, on the Online Delivery
Provider side, the order status should be changed to the equivalent PREPARED state. The PREPARED status can still be sent through POST /v1
/orders{orderId}/status.
2A - At any point of the order lifecycle, the partner application can update the order status to CANCELED using POST /v1/orders/{orderId}
/status.
2B.1 - When a user requests to cancel an order, an “intent to cancel order” webhook event is sent. When required, the partner application must
try to cancel the order on the Online Delivery Provider side to effectively cancel the order.
2B.2 - If the user request to cancel an order is fulfilled, then the Partner application must update the order status to CANCELED using POST /v1
/orders/{orderId}/status.
Orders Endpoints
Create Order
Update Order
Update Order Status
Update Customer Payment
Update Order Delivery Information
PUT /v1/orders/{orderId}/delivery
Models
Create Order
POST /v1/orders
Authorization
Request
Headers
Header Description
Authorization Standard HTTP header is used to associate the request with the originating invoker. The content of this
header is a Bearer token generated from you client_secret, defined in the API Auth guide.
X-Store-Id The ID of the store in your system this call acts on behalf of.
Request Body
Request body schema: application/json
Specification
orderedAt string (ISO 8601 Date and Time) Optional The date (in UTC) when the order was placed by the customer
(YYYY-MM-DDThh:mm:ssZ).
currencyCode string Required The 3-letter currency code (ISO 4217) to use for all monetary
values in this order.
customer Person Optional Details about the customer who placed the order.
status string <enum: OrderStatus> Required The current status of the order.
deliveryInfo DeliveryInfo Optional Information about how the order will be delivered, if it is a
delivery type.
customerPayments CustomerPayment[] Optional Details about the payments made by the customer.
Example
{
"externalIdentifiers": {
"id": "69f60a06-c335-46d9-b5a1-97f1a211c514",
"friendlyId": "ABCDE",
"source": "ubereats"
},
"items": [
{
"id": "33e0418f-3d56-4360-ba03-18fc5f8844a3",
"name": "Juicy Cheeseburger",
"quantity": 1,
"note": "Please cook to well done!",
"categoryId": "303de078-870d-4349-928b-946869d4d69b",
"categoryName": "Burgers",
"price": 5.9,
"modifiers": [
{
"id": "d7a21692-9195-43aa-a58f-5395bba8a804",
"name": "Avocado",
"quantity": 1,
"price": 1,
"groupName": "Add ons",
"groupId": "fb52b138-7ac4-42c1-bfd8-664d57113a41",
"modifiers": [
{}
]
}
]
}
],
"orderedAt": "2020-12-20T02:30:00Z",
"currencyCode": "EUR",
"customer": {
"name": "Jane Doe",
"phone": "+1-555-555-5555",
"email": "email@email.com",
"personalIdentifiers": {
"taxIdentificationNumber": "01234567890"
}
},
"customerNote": "Please include extra napkins!",
"status": "NEW_ORDER",
"deliveryInfo": {
"courier": {
"name": "Jane Doe",
"phone": "+1-555-555-5555",
"email": "email@email.com",
"personalIdentifiers": {
"taxIdentificationNumber": "01234567890"
}
},
"destination": {
"postalCode": "20500",
"city": "Washington",
"state": "DC",
"countryCode": "US",
"addressLines": "1600 Pennsylvania Avenue NW",
"location": {
"latitude": 38.8977,
"longitude": 77.0365
}
},
"licensePlate": "ABC 123",
"makeModel": "Honda CR-V",
"lastKnownLocation": {
"latitude": 38.8977,
"longitude": 77.0365
},
"note": "Gate code 123"
},
"orderTotal": {
"subtotal": 11.97,
"claimedSubtotal": 12.98,
"discount": 1,
"tax": 1.1,
"tip": 2,
"deliveryFee": 5,
"total": 19.07,
"couponCode": "VWXYZ98765"
},
"customerPayments": [
{
"value": 2,
"processingStatus": "COLLECTABLE",
"paymentMethod": "CASH"
}
],
"fulfillmentInfo": {
"pickupTime": "2020-12-20T02:30:00Z",
"deliveryTime": "2020-12-20T02:30:00Z",
"fulfillmentMode": "DELIVERY",
"schedulingType": "ASAP",
"courierStatus": "COURIER_ASSIGNED"
}
}
Response
Specification
Example
{
"externalIdentifiers": {
"id": "2eb26483-43f5-44ad-ace2-de6a3f1f71a8",
"friendlyId": "ABCDE",
"source": null
},
"storeId": "123456"
}
Update Order
POST /v1/orders/{orderId}
Authorization
Request
Headers
Header Description
Authorization Standard HTTP header is used to associate the request with the originating invoker. The content of this
header is a Bearer token generated from you client_secret, defined in the API Auth guide.
X-Store-Id The ID of the store in your system this call acts on behalf of.
Request Body
Request body schema: application/json
Specification
orderedAt string (ISO 8601 Date and Time) Optional The date (in UTC) when the order was placed by the customer
(YYYY-MM-DDThh:mm:ssZ).
currencyCode string Required The 3-letter currency code (ISO 4217) to use for all monetary
values in this order.
customer Person Optional Details about the customer who placed the order.
status string <enum: OrderStatus> Required The current status of the order.
deliveryInfo DeliveryInfo Optional Information about how the order will be delivered, if it is a
delivery type.
customerPayments CustomerPayment[] Optional Details about the payments made by the customer.
Example
{
"externalIdentifiers": {
"id": "69f60a06-c335-46d9-b5a1-97f1a211c514",
"friendlyId": "ABCDE",
"source": "ubereats"
},
"items": [
{
"id": "33e0418f-3d56-4360-ba03-18fc5f8844a3",
"name": "Juicy Cheeseburger",
"quantity": 1,
"note": "Please cook to well done!",
"categoryId": "303de078-870d-4349-928b-946869d4d69b",
"categoryName": "Burgers",
"price": 5.9,
"modifiers": [
{
"id": "d7a21692-9195-43aa-a58f-5395bba8a804",
"name": "Avocado",
"quantity": 1,
"price": 1,
"groupName": "Add ons",
"groupId": "fb52b138-7ac4-42c1-bfd8-664d57113a41",
"modifiers": [
{}
]
}
]
}
],
"orderedAt": "2020-12-20T02:30:00Z",
"currencyCode": "EUR",
"customer": {
"name": "Jane Doe",
"phone": "+1-555-555-5555",
"email": "email@email.com",
"personalIdentifiers": {
"taxIdentificationNumber": "01234567890"
}
},
"customerNote": "Please include extra napkins!",
"status": "NEW_ORDER",
"deliveryInfo": {
"courier": {
"name": "Jane Doe",
"phone": "+1-555-555-5555",
"email": "email@email.com",
"personalIdentifiers": {
"taxIdentificationNumber": "01234567890"
}
},
"destination": {
"postalCode": "20500",
"city": "Washington",
"state": "DC",
"countryCode": "US",
"addressLines": "1600 Pennsylvania Avenue NW",
"location": {
"latitude": 38.8977,
"longitude": 77.0365
}
},
"licensePlate": "ABC 123",
"makeModel": "Honda CR-V",
"lastKnownLocation": {
"latitude": 38.8977,
"longitude": 77.0365
},
"note": "Gate code 123"
},
"orderTotal": {
"subtotal": 11.97,
"claimedSubtotal": 12.98,
"discount": 1,
"tax": 1.1,
"tip": 2,
"deliveryFee": 5,
"total": 19.07,
"couponCode": "VWXYZ98765"
},
"customerPayments": [
{
"value": 2,
"processingStatus": "COLLECTABLE",
"paymentMethod": "CASH"
}
],
"fulfillmentInfo": {
"pickupTime": "2020-12-20T02:30:00Z",
"deliveryTime": "2020-12-20T02:30:00Z",
"fulfillmentMode": "DELIVERY",
"schedulingType": "ASAP",
"courierStatus": "COURIER_ASSIGNED"
}
}
Response
Response Body
Response body schema: application/json
Specification
Example
{
"externalIdentifiers": {
"id": "2eb26483-43f5-44ad-ace2-de6a3f1f71a8",
"friendlyId": "ABCDE",
"source": null
},
"storeId": "123456"
}
POST /v1/orders/{orderId}/status
Authorization
Request
Headers
Header Description
Authorization Standard HTTP header is used to associate the request with the originating invoker. The content of this
header is a Bearer token generated from you client_secret, defined in the API Auth guide.
X-Store-Id The ID of the store in your system this call acts on behalf of.
Request Body
Request body schema: application/json
Specification
orderStatus string <enum: OrderStatus> Required The requested status to transition the order to, only PREPARED,
CONFIRMED, CANCELED and FULFILLED are accepted.
Example
{
"orderStatus": "PREPARED"
}
Response
POST /v1/{orderId}/payments
Authorization
Request
Headers
Header Description
Authorization Standard HTTP header is used to associate the request with the originating invoker. The content of this
header is a Bearer token generated from you client_secret, defined in the API Auth guide.
X-Store-Id The ID of the store in your system this call acts on behalf of.
Request Body
Request body schema: application/json
Specification
Field Type Required Description
currencyCode string Required The 3-letter currency code (ISO 4217) to use for all
monetary values in this order.
customerPayments CustomerPayment[] Required Details about the payments made by the customer.
Example
{
"currencyCode": "EUR",
"customerPayments": [
{
"value": 2,
"processingStatus": "COLLECTABLE",
"paymentMethod": "CASH"
}
]
}
Response
PUT /v1/orders/{orderId}/delivery
Authorization
Request
Headers
Header Description
Authorization Standard HTTP header is used to associate the request with the originating invoker. The content of this
header is a Bearer token generated from you client_secret, defined in the API Auth guide.
X-Store-Id The ID of the store in your system this call acts on behalf of.
Request Body
Request body schema: application/json
Specification
deliveryInfo DeliveryInfo Required The requested status to transition the order to.
Example
{
"deliveryInfo": {
"courier": {
"name": "Jane Doe",
"phone": "+1-555-555-5555",
"email": "email@email.com",
"personalIdentifiers": {
"taxIdentificationNumber": "01234567890"
}
},
"destination": {
"postalCode": "20500",
"city": "Washington",
"state": "DC",
"countryCode": "US",
"addressLines": [
"ullamco et",
"velit non Lorem deserunt id"
],
"location": {
"latitude": 38.8977,
"longitude": 77.0365
}
},
"licensePlate": "ABC 123",
"makeModel": "Honda CR-V",
"lastKnownLocation": {
"latitude": 38.8977,
"longitude": 77.0365
},
"note": "Gate code 123"
}
}
Response
Models
OrderExternalIdentifiers
friendlyId string Required ID used for driver pickup and restaurant management.
source string Optional Describes the source of the order, typically from a food ordering marketplace.
Item
An order item.
name string Optional The name of the item as displayed to the customer.
quantity integer Required The quantity of the item ordered by the customer.
ItemModifier
name string Optional The name of the modifier as displayed to the customer.
quantity integer Required The number of times the modifier was applied to the given item.
Person
personalIdentifiers PersonalIdentifiers Optional The person's personal identifiers (e.g. tax identification number).
PersonalIdentifiers
OrderStatus - enum
Value Description
NEW_ORDER The order was placed by the customer.
DeliveryInfo
makeModel string Optional Make and model of a vehicle used by the courier.
Address
A delivery address.
state string Optional Highest administrative subdivision which is used for postal addresses of a country or
region. For example, this can be a state, a province, or a prefecture.
addressLines string[] Optional Address lines (e.g. street, PO Box, or company name).
Location
OrderTotal
subtotal decimal Required The order's subtotal, as the sum of all item and modifier prices.
claimedSubtotal decimal Optional Claimed subtotal for the order. This figure does not have to match the sum of all item and
modifier prices. If claimedSubtotal is set, its value takes precedence over the value in sub
total field.
discount decimal Optional Any discount amount for the order.
total decimal Optional Order total including everything paid by the customer.
CustomerPayment
value decimal Required The portion of the overall amount that needs to be paid.
processingStatus string <enum: PaymentProcessingStatus> Required The processing status of the payment.
PaymentProcessingStatus - enum
Value Description
PaymentMethod - enum
Value Description
FulfillmentInfo
pickupTime string (ISO 8601 Date and time) Optional Estimated time (in UTC) that the courier or customer will pick
up the order.
deliveryTime string (ISO 8601 Date and time) Optional Estimated time (in UTC) when the order is expected to be
delivered. This should be filled in if FulfillmentMode is delivery.
schedulingType string <enum: SchedulingType> Optional Describes whether this order should be cooked as soon as
possible, or some time in the future. Please use the
pickupTime and/or deliveryTime to indicate when. If no
scheduling type is provided, we assume the order should be
prepared as soon as possible.
courierStatus string <enum: CourierStatus> Optional The current status of the courier.
FulfillmentMode - enum
Value Description
RESTAURANT_DELIVERY The restaurant is responsible for managing the delivery of this order.
SchedulingType - enum
Describes whether this order should be cooked as soon as possible, or sometime in the future.
Value Description
ASAP
FIXED_TIME
CourierStatus - enum
Value Description
COURIER_PICKED_UP_FOOD The courier is on its way to deliver the order to the customer.
Menus Integration
Overview
Operations
Integration Flows
Menu publish flow
Update menu entities availability flow
Upsert hours flow
Failed Event Flow
Overview
This section aims to guide the development of menu integration, covering the process to integrate with events to publish and sync menus and
related data for menu consumers.
Operations
Menu publish: Partners API sends a webhook event containing menus that a user wants to push to an integrated service. The partner
application must perform the menu publish operation and then send the event result to the callback endpoint.
Upsert hours: Partners API sends a webhook event containing a configuration of menu hours that a user wants to push to an integrated
service. The partner application must perform the upsert hours operation and then send the event result to the callback endpoint.
Update menu entities availability: Partners API sends a webhook event requesting to suspend/unsuspend a particular item on an
integrated service. The partner application must perform the update availability operation and then send the event result to the callback
endpoint.
Send menu: Partners API sends a webhook event requesting the partner application to send the currently available menus in an
integrated service. The partner application must fetch the current menus and then send them using the callback endpoint.
Callback error: Endpoint to send the id of a webhook event when a requested operation could not be performed by the partner
application, the request body must contain the cause of the failure.
Integration Flows
This flow describes the process of publishing a menu to an integrated service and syncing the current menus with our API.
1. Partners API sends the “send menu” webhook event, requesting the partner application to send the currently available menus for a given
store in an integrated service.
2. The partner application sends the webhook event result containing the current menus for the store. Partners API will take the current
menus and attempt to intelligently match our menu entities to what already exists in the partner menu.
3. Partners API sends a menu publish webhook event containing the matched and new menu entities. Matched entities will have the ids
that were sent in the previous step or in previous menu syncs. New menu entities will have random UUIDs and those entities that should
be deleted will be omitted from the webhook payload.
4. The partner application must perform the menu publish operation for the given store in an integrated service and then send the event
result containing the ids for newly created menu entities.
This flow describes the process of suspending/unsuspending a given menu entity on an integrated service.
1. Partners API sends an “update menu entity availability“ webhook event, requesting to suspend/unsuspend a menu entity.
2. Partner application performs the request operation within the integrated service and then sends the webhook event result to POST /v1
/menus/entity/availability/bulk.
This flow describes the process of creating/updating only the menu hours for a given store on an integrated service.
1. Partners API sends an “upsert hours“ webhook event request to modify menu hours for a given store on an integrated service.
2. Partner application performs the request operation within the integrated service and then sends the webhook event result to POST /v1
/menus/hours.
This flow describes the process to inform that an operation requested by a webhook event could not be performed successfully by the partner
application. The event id must be used to call POST /v1/callback/error.
1. Partners API sends any webhook event requesting to perform an operation within an integrated service (menu publish, upsert hours,
update menu entities availability, send menu).
2. Partner application fails to perform the requested operation within the integrated service.
3. Partner application informs the failure and the cause using POST /v1/callback/error.
Menu Publish
Event representing menu update - requiring partner action to update 3PD system.
Webhook Event
Request
Headers
Field Type Description
Authorization string (MAC <hash signature>) HMAC signature to validate the request origin.
Request Body
Specification
metadata.storeId string Required Id of the store for which the event is being published.
metadata.applicationId string Required Id of the application for which the event is being published.
Example
{
"eventId": "5d779a68-c06f-4f94-a8e9-79c59ddd94e5",
"eventTime": "2021-05-20T18:57:12Z",
"eventType": "menus.menu_publish",
"metadata": {
"storeId": "25346",
"applicationId": "a8a33dc8-9842-4fc2-9c1a-532e3c92781a",
"payload": {
"menuData": {
"menus": {
"name": "Tasty BBQ",
"categoryIds": [
"string"
],
"fulfillmentModes": [
"DELIVERY"
],
"id": "da0e4e94-5670-4175-897a-3b7dde45bed5",
"hoursData": {
"timeZone": "UTC, America/Los_Angeles",
"regularHours": [
{
"days": [
"MONDAY"
],
"timeRanges": [
{
"start": {
"hour": 0,
"minute": 0,
"second": 0,
"nano": 0
},
"end": {
"hour": 0,
"minute": 0,
"second": 0,
"nano": 0
}
}
]
}
],
"specialHours": [
{
"date": "2019-08-24",
"timeRanges": [
{
"start": {
"hour": 0,
"minute": 0,
"second": 0,
"nano": 0
},
"end": {
"hour": 0,
"minute": 0,
"second": 0,
"nano": 0
}
}
],
"type": "OPEN"
}
]
}
},
"categories": [
{
"empty": true,
"property1": {
"name": "Breakfast",
"description": "All early morning items
served up hot and fresh!",
"itemIds": [
"string"
],
"id": "da0e4e94-5670-4175-897a-3b7dde45bed5"
},
"property2": {
"name": "Breakfast",
"description": "All early morning items
served up hot and fresh!",
"itemIds": [
"string"
],
"id": "da0e4e94-5670-4175-897a-3b7dde45bed5"
}
}
],
"items": {
"name": "Bagel",
"description": "Delicious bagel!",
"modifierGroupIds": [
"string"
],
"status": {
"saleStatus": "TEMPORARILY_NOT_FOR_SALE",
"suspendedUntil": "2019-08-24T14:15:22Z"
},
"price": 25.21,
"id": "da0e4e94-5670-4175-897a-3b7dde45bed5",
"photoIds": [
"string"
],
"priceOverrides": "$1.5 as a customer item, $1 as a
modifier."
},
"modifierGroups": {
"name": "Choose your type of bagel",
"minimumSelections": 0,
"maximumSelections": 0,
"maxPerModifierSelectionQuantity": 0,
"itemIds": [
"string"
],
"id": "da0e4e94-5670-4175-897a-3b7dde45bed5"
},
"photos": {
"url": "https://www.google.com/images/branding
/googlelogo/2x/googlelogo_color_272x92dp.png",
"fileName": "this image.jpg",
"id": "e9174f75-a293-4908-bba7-9db69871ad81",
"contentType": "image/jpeg, image/png"
}
}
}
}
}
Expected Response
HTTP Status Code: 200 OK
Callback Endpoint
POST /v1/menus/publish
Request
Headers
Field Description
Authorization Standard HTTP header is used to associate the request with the originating invoker. The content of this
header is a Bearer token generated from you client_secret, defined in the API Auth guide.
X-Store-Id The ID of the store in your system this call acts on behalf of.
X-Event-Id Unique identifier of the event that this callback refers to.
Request Body
Specification
requestedToCreatedEntityIds map<string, string> Required A map for entities created by the Upsert containing the
IDs of the requested entities mapped to the IDs of
entities created by the request. Our system will use the
IDs returned in this map to send updates to these
entities in future requests.
Example
{
"requestedToCreatedEntityIds": {
"empty": true,
"property1": "string",
"property2": "string"
}
}
Response
HTTP Status Code: 204 No content
Event representing menu items availability change - requiring partner action to update 3PD system.
Webhook Event
Request
Headers
Authorization string (MAC <hash signature>) HMAC signature to validate the request origin.
Request Body
Specification
metadata.storeId string Required Id of the store for which the event is being published.
metadata.applicationId string Required Id of the application for which the event is being
published.
metadata.payload BulkUpdateItemStatusEvent Required Event data containing list of item status updates.
Example
{
"eventId": "5d779a68-c06f-4f94-a8e9-79c59ddd94e5",
"eventTime": "2021-05-20T18:57:12Z",
"eventType": "menus.update_menu_entities_availabilities",
"metadata": {
"storeId": "25346",
"applicationId": "a8a33dc8-9842-4fc2-9c1a-532e3c92781a",
"payload": {
"updates": [
{
"selector": {
"id": "string",
"isModifier": true
},
"status": {
"saleStatus": "TEMPORARILY_NOT_FOR_SALE",
"suspendedUntil": "2019-08-24T14:15:22Z"
}
}
]
}
}
}
Expected Response
HTTP Status Code: 200 OK
POST /v1/menus/entity/availability/bulk
Request
Headers
Field Description
Authorization Standard HTTP header is used to associate the request with the originating invoker. The content of this
header is a Bearer token generated from you client_secret, defined in the API Auth guide.
X-Store-Id The ID of the store in your system this call acts on behalf of.
X-Event-Id Unique identifier of the event that this callback refers to.
Response
HTTP Status Code: 204 No content
Send Menu
Event requesting the partner to send back the current menu in the 3PD system.
Webhook Event
Request
Headers
Authorization string (MAC <hash signature>) HMAC signature to validate the request origin.
Request Body
Specification
metadata.storeId string Required Id of the store for which the event is being published.
metadata.applicationId string Required Id of the application for which the event is being published.
Example
{
"eventId": "5d779a68-c06f-4f94-a8e9-79c59ddd94e5",
"eventTime": "2021-05-20T18:57:12Z",
"eventType": "menus.send_menu",
"metadata": {
"storeId": "25346",
"applicationId": "a8a33dc8-9842-4fc2-9c1a-532e3c92781a",
}
}
Expected Response
HTTP Status Code: 200 OK
Callback Endpoint
POST /v1/menus/current
Request
Headers
Field Description
Authorization Standard HTTP header is used to associate the request with the originating invoker. The content of this
header is a Bearer token generated from you client_secret, defined in the API Auth guide.
X-Store-Id The ID of the store in your system this call acts on behalf of.
X-Event-Id Unique identifier of the event that this callback refers to.
Request Body
Specification
Example
{
"menuData": {
"menus": {
"name": "Tasty BBQ",
"categoryIds": [
"string"
],
"fulfillmentModes": [
"DELIVERY"
],
"id": "da0e4e94-5670-4175-897a-3b7dde45bed5",
"hoursData": {
"timeZone": "UTC, America/Los_Angeles",
"regularHours": [
{
"days": [
"MONDAY"
],
"timeRanges": [
{
"start": {},
"end": {}
}
]
}
],
"specialHours": [
{
"date": "2019-08-24",
"timeRanges": [
{
"start": {},
"end": {}
}
],
"type": "OPEN"
}
]
}
},
"categories": [
{
"empty": true,
"property1": {
"name": "Breakfast",
"description": "All early morning items served up
hot and fresh!",
"itemIds": [
"string"
],
"id": "da0e4e94-5670-4175-897a-3b7dde45bed5"
},
"property2": {
"name": "Breakfast",
"description": "All early morning items served up
hot and fresh!",
"itemIds": [
"string"
],
"id": "da0e4e94-5670-4175-897a-3b7dde45bed5"
}
}
],
"items": {
"name": "Bagel",
"description": "Delicious bagel!",
"modifierGroupIds": [
"string"
],
"status": {
"saleStatus": "TEMPORARILY_NOT_FOR_SALE",
"suspendedUntil": "2019-08-24T14:15:22Z"
},
"price": 25.21,
"id": "da0e4e94-5670-4175-897a-3b7dde45bed5",
"photoIds": [
"string"
],
"priceOverrides": "$1.5 as a customer item, $1 as a
modifier."
},
"modifierGroups": {
"name": "Choose your type of bagel",
"minimumSelections": 0,
"maximumSelections": 0,
"maxPerModifierSelectionQuantity": 0,
"itemIds": [
"string"
],
"id": "da0e4e94-5670-4175-897a-3b7dde45bed5"
},
"photos": {
"url": "https://www.google.com/images/branding/googlelogo/2x
/googlelogo_color_272x92dp.png",
"fileName": "this image.jpg",
"id": "e9174f75-a293-4908-bba7-9db69871ad81",
"contentType": "image/jpeg, image/png"
}
}
}
Response
HTTP Status Code: 204 No content
Upsert Hours
Webhook Event
Request
Headers
Authorization string (MAC <hash signature>) HMAC signature to validate the request origin.
Request Body
Specification
metadata.storeId string Required Id of the store for which the event is being published.
metadata.applicationId string Required Id of the application for which the event is being published.
Example
{
"eventId": "5d779a68-c06f-4f94-a8e9-79c59ddd94e5",
"eventTime": "2021-05-20T18:57:12Z",
"eventType": "menus.upsert_hours",
"metadata": {
"storeId": "25346",
"applicationId": "a8a33dc8-9842-4fc2-9c1a-532e3c92781a",
"payload": {
"hoursData": {
"storeTimeZone": "America/Los_Angeles",
"regularHours": [
{
"daysOfWeek": [
"MONDAY",
"TUESDAY"
],
"hours": [
{
"start": {
"hours": 8
},
"end": {
"hours": 12
}
}
]
}
],
"specialHours": [
{
"date": {
"year": 2021,
"month": 4,
"day": 1
},
"hours": [
{
"start": {
"hours": 8
},
"end": {
"hours": 12
}
}
],
"isClosed": true
}
]
}
}
}
}
Expected Response
HTTP Status Code: 200 OK
Callback Endpoint
POST /v1/menus/hours
Request
Headers
Field Description
Authorization Standard HTTP header is used to associate the request with the originating invoker. The content of this
header is a Bearer token generated from you client_secret, defined in the API Auth guide.
X-Store-Id The ID of the store in your system this call acts on behalf of.
X-Event-Id Unique identifier of the event that this callback refers to.
Response
HTTP Status Code: 204 No content
Callback Errors
POST /v1/callback/error
This endpoint should be used to publish a callback error when the partner application was not able to complete an operation requested by a
webhook event.
Request
Headers
Field Description
Authorization Standard HTTP header is used to associate the request with the originating invoker. The content of this
header is a Bearer token generated from you client_secret, defined in the API Auth guide.
X-Store-Id The ID of the store in your system this call acts on behalf of.
X-Event-Id Unique identifier of the event that this callback refers to.
Response
HTTP Status Code: 200 OK
Models
UpsertFullMenuEvent
BulkUpdateItemStatusEvent
UpsertHoursEvent
UpdateItemStatusEntry
ItemSelector
MenuData
menus map<string, Menu> Required All Menus for the store, indexed by ID
categories map<string, Category> Required All Categories for the store, indexed by ID
items map<string, Item> Required All Items for the store, indexed by ID
modifierGroups map<string, ModifierGroup> Required All ModifierGroups for the Store, indexed by ID
photos map<string, Photo> Required All photos for the store, indexed by ID
Category
Item/MenuItem
Items are sold on the Menu. Modifiers to items are items themselves and their relationship is defined by ModifierGroup.
status string <enum : ItemStatus> Required Status that determines whether an item is for sale or not.
photoIds string[] Required A list of Photo references associated with the Item.
priceOverrides ItemPriceOverride[] Required Specify price overrides for different service slugs.
ItemStatus
Represents whether an Item is for sale, indefinitely not for sale, or not for sale until a specific time.
suspendedUntil string (ISO 8601 Date and time) Optional ISO-8601 timestamp representing the time the
saleStatus value is supposed to change to FOR_SALE.
Set only when current saleStatus value is
TEMPORARILY_NOT_FOR_SALE (YYYY-MM-DDThh:
mm:ssZ).
Menu
A menu for a store.
fulfillmentModes MenuFulfillmentMode[] Optional The ways in which this menu may be fulfilled. If no values
are specified, it is assumed that all fulfillment types are
allowed.
ModifierGroup
Items are sold on the menu. Modifiers to items are items themselves and their relationship is defined by ModifierGroup.
minimumSelections integer Optional Minimum number of selections customers can make in this
ModifierGroup. 0 means no min limits. Default is 0.
maximumSelections integer Optional Maximum number of selections customers can make in this
ModifierGroup. 0 means no max limits. Default is 0.
maxPerModifierSelectionQuantity integer Optional Maximum number of selections customers can make for
each modifier item in this ModifierGroup. 0 means there is
no limit to how many times they can select a single modifier
item. If not specified, a value of 1 will be used as the default
value. Default is 1.
Photo
Storefront Integration
Overview
Operations
Integration Flows
Get store availability event flow
Pause/Unpause event flow
Overview
This section aims to guide the development of storefront integration with the Partner API. The document will describe the integration flow of
storefront events, endpoints, and prerequisites.
Operations
Update store hours configuration - The partner sends the current store hours configuration through the endpoint /v1/storefront/hours. Sen
ding a store hour configuration is a prerequisite to enable other available operations.
Get store availability - Partners API sends a webhook event requesting the partner to send the current store availability state through the
endpoint /v1/storefront/availability. The default frequency of webhook events is 5 minutes.
Pause/Unpause store - Partners API sends a webhook event requesting the partner to pause/unpause a store, the partner must send
the event result through the endpoint /v1/storefront/{pause | unpause}, this will trigger the “store availability event” flow to confirm the
current store state. Implementing the “get store availability” is a prerequisite for the pause/unpause event integration.
In addition to these 3 events, the partner can consume the endpoint /v1/storefront/availability to proactively send any updates on the availability
for a given store.
Integration Flows
To keep the store state in sync, Partners API sends a “get store availability“ webhook event, the default frequency is 5 minutes. The Partner
application must send the current store state for a given store, preferably by consulting the current status of the store.
1. Partners API sends a “get store availability” webhook event every 5 minutes.
2. The Partner application must send the current store state using POST /v1/storefront/availability
When a user requests to pause/unpause a store Partners API sends a webhook event, the Partner application must perform the requested
operation (pause or unpause the store) and then send the result to /v1/storefront/{pause|unpause}. Finishing this workflow will trigger a “Get store
availability event flow”.
1. Partners API sends a webhook event requesting to pause unpause a store
2. Partner application must perform the required operation (pause or unpause) and then send the result to POST /v1/storefront/
{pause|unpause}.
3. Partners API sends a “get store availability”.
4. The Partner application must send the current store state using POST /v1/storefront/availability
Event requesting the current store availability state, after performing the operation, the result must be sent to the callback endpoint.
Webhook Event
Request
Headers
Authorization string (MAC <hash signature>) HMAC signature to validate the request origin.
Request Body
Specification
Field Type Required Description
metadata.storeId string Required Id of the store for which the event is being published.
metadata.applicationId string Required Id of the application for which the event is being published.
Example
{
"eventId": "5d779a68-c06f-4f94-a8e9-79c59ddd94e5",
"eventTime": "2021-05-20T18:57:12Z",
"eventType": "storefront.get_store_availability",
"metadata": {
"storeId": "25346",
"applicationId": "a8a33dc8-9842-4fc2-9c1a-532e3c92781a",
}
}
Expected Response
HTTP Status Code: 200 OK
Callback Endpoint
POST /v1/storefront/availability
Request
Headers
Field Description
Authorization Standard HTTP header is used to associate the request with the originating invoker. The content of this
header is a Bearer token generated from you client_secret, defined in the API Auth guide.
X-Store-Id The ID of the store in your system this call acts on behalf of.
X-Event-Id Unique identifier of the event that this callback refers to.
Request Body
Specification
statusChangedAt string (ISO 8601 Date and Time) Required, if The time when the store hours configuration
eventResultMetadata is changed(YYYY-MM-DDThh:mm:ssZ).
SUCCEEDED
eventResultMetadata EventResultMetadata Required Information about the result of the event.
Example
{
"storeState": "OPEN",
"statusChangedAt": "2021-07-20T22:24:48Z",
"eventResultMetadata": {
"operationStatus": "SUCCEEDED",
"additionalInformation": "details",
"operationFinishedAt": "2021-07-20T22:24:48Z"
}
}
Response
HTTP Status Code: 204 No content
Pause store
Event requesting to pause a given store, after performing the operation, the result must be sent to the callback endpoint.
Webhook Event
Request
Headers
Authorization string (MAC <hash signature>) HMAC signature to validate the request origin.
Request Body
Specification
metadata.storeId string Required Id of the store for which the event is being published.
metadata.applicationId string Required Id of the application for which the event is being published.
Example
{
"eventId": "5d779a68-c06f-4f94-a8e9-79c59ddd94e5",
"eventTime": "2021-05-20T18:57:12Z",
"eventType": "storefront.pause_store",
"metadata": {
"storeId": "25346",
"applicationId": "a8a33dc8-9842-4fc2-9c1a-532e3c92781a"
}
}
Expected Response
HTTP Status Code: 200 OK
Callback Endpoint
POST /v1/storefront/pause
Request
Headers
Field Description
Authorization Standard HTTP header is used to associate the request with the originating invoker. The content of this
header is a Bearer token generated from you client_secret, defined in the API Auth guide.
X-Store-Id The ID of the store in your system this call acts on behalf of.
X-Event-Id Unique identifier of the event that this callback refers to.
Request Body
Specification
Example
{
"eventResultMetadata": {
"operationStatus": "SUCCEEDED",
"additionalInformation": "details",
"operationFinishedAt": "2021-07-20T22:24:48Z"
}
}
Response
HTTP Status Code: 204 No content
Unpause store
Event Requesting to unpause a given store, after performing the operation, the result must be sent to the callback endpoint.
Webhook Event
Request
Headers
Authorization string (MAC <hash signature>) HMAC signature to validate the request origin.
Request Body
Specification
metadata.storeId string Required Id of the store for which the event is being published.
metadata.applicationId string Required Id of the application for which the event is being published.
Example
{
"eventId": "5d779a68-c06f-4f94-a8e9-79c59ddd94e5",
"eventTime": "2021-05-20T18:57:12Z",
"eventType": "storefront.unpause_store",
"metadata": {
"storeId": "25346",
"applicationId": "a8a33dc8-9842-4fc2-9c1a-532e3c92781a"
}
}
Expected Response
HTTP Status Code: 200 OK
Callback Endpoint
POST /v1/storefront/unpause
Request
Headers
Field Description
Authorization Standard HTTP header is used to associate the request with the originating invoker. The content of this
header is a Bearer token generated from you client_secret, defined in the API Auth guide.
X-Store-Id The ID of the store in your system this call acts on behalf of.
X-Event-Id Unique identifier of the event that this callback refers to.
Request Body
Specification
Example
{
"eventResultMetadata": {
"operationStatus": "SUCCEEDED",
"additionalInformation": "details",
"operationFinishedAt": "2021-07-20T22:24:48Z"
}
}
Response
HTTP Status Code: 204 No content
Models
OperationStatus - enum
Value Description
INVALID_STORE_STATE The operation could not be completed due to the internal state of the store.
INVALID_STORE_CONFIGURATION The store has not valid configuration to perform the requested operation.
EventResultMetadata
operationStatus string <enum: OperationStatus> Required Status of the operation requested by the event.
additionalInformation string Optional Additional details about the event result, if available.
operationFinishedAt string (ISO 8601 Date and Time) Required Time when the processing of the event finished (YYYY-MM-
DDThh:mm:ssZ).
StoreState - enum
Value Description
DayOfWeek - enum
Value
MONDAY
TUESDAY
WEDNESDAY
THURSDAY
FRIDAY
SATURDAY
SUNDAY
SpecialHourType - enum
Store state that should be applied during the configured special hour.
Value Description
OPEN The store state will be set to OPEN during the configured special hour.
CLOSED The store state will be set to CLOSED during the configured special hour.
StoreHoursConfiguration
timezone string (from Time Zone Database) Optional The store time zone identifier. (e.g. America/New_York)
StoreHours
Represents store hours configuration with regular hours and special hours.
RegularHours
dayOfWeek string <enum: Required The day of the week this configuration applies.
DayOfWeek>
timeRanges TimeRange Required Hours range applied to the provided day of the week.
SpecialHours
date string (ISO 8601 Date) Required Date the special hour configuration applies (yyyy-MM-dd).
specialHourType string <enum: SpecialHourType> Required Store state that should be applied in the configured date and time.
TimeRange
startTime string (ISO 8601 Time) Required Start time of the range in 24 hour format (HH:mm).
endTime string (ISO 8601 Time) Required End time of the range in 24 hour format (HH:mm).