Become a Stream DSP (0.1)
Download OpenAPI specification:Download
This is a spec for integrating with Stream as a DSP. We are prescribing an OAuth System for Location Configuration and a 2-Way Webhook System for an Event Driven Partnership. Please send any feedback or questions to marc@streamorders.com.
Request Token (Stream –> DSP)
You will have to build this endpoint into your system. This is where Stream will request and refresh access tokens.
Request Body schema: application/json
grant_type required | string Default: "authorization_code" |
client_id required | string The client ID to be provided to Stream for identifying us. |
client_secret required | string The client secret to be provided to Stream for security. |
code required | string The authorization code received from successful authorization. |
Responses
Request samples
- Payload
{- "grant_type": "authorization_code",
- "client_id": "string",
- "client_secret": "string",
- "code": "string"
}
Response samples
- 200
{- "access_token": "string",
- "refresh_token": "string",
- "expire_time": 0,
- "refresh_token_expire_time": 0,
- "id": "string"
}
Get Locations (Stream –> DSP via OAuth)
You will have to build this endpoint into your system. This is where Stream will query the locations attached to the OAuth token.
header Parameters
authorization required | string |
Authorization | string The OAuth Bearer token for the merchant. Format will be |
Responses
Response samples
- 200
{- "locations": [
- {
- "provider_id": "string",
- "name": "string",
- "address": {
- "address_line_1": "string",
- "address_line_2": "string",
- "city": "string",
- "state": "string",
- "postal_code": "string",
- "country": "string"
}
}
]
}
Connect Location (Stream –> DSP via OAuth)
You will have to build this endpoint into your system. This is where Stream will notify you about locations connected to Stream.
header Parameters
Authorization | string The OAuth Bearer token for the merchant. Format will be |
Request Body schema: application/json
location_id required | string |
Responses
Request samples
- Payload
{- "location_id": "string"
}
Get Location Connection (Stream –> DSP via OAuth)
You will have to build this endpoint into your system. This is where Stream will check a locations connection state to Stream.
query Parameters
location_id required | string |
header Parameters
Authorization | string The OAuth Bearer token for the merchant. Format will be |
Responses
Response samples
- 200
{- "location_id": "string",
- "connected": true
}
Disconnect Location (Stream –> DSP via OAuth)
You will have to build this endpoint into your system. This is where Stream will notify you about locations disconnected from Stream.
header Parameters
Authorization | string The OAuth Bearer token for the merchant. Format will be |
Request Body schema: application/json
location_id required | string |
Responses
Request samples
- Payload
{- "location_id": "string"
}
New Webhook Event (Stream –> DSP via Webhook)
You will have to build this endpoint into your system. This is where Stream will send all webhook events.
header Parameters
Authorization | string The OAuth Bearer token for the merchant. Format will be |
Request Body schema: application/json
type required | string Default: "location.paused" The type of event that this is. |
location_id required | string The location ID that should be paused |
until_ms | number The time in milliseconds to pause until. If not specified, the location will be paused indefinitely. |
Responses
Request samples
- Payload
{- "type": "location.paused",
- "location_id": "string",
- "until_ms": 0
}
Response samples
- 201
{ }
Menu Ingestion File (DSP -> URL)
This is where you will retrieve all menu contents, the URL will be provided in the location.publish event. Response schema version (v1 or v2) is determined by partner configuration flag. Partners must contact support to enable v2 schema access.
Responses
Response samples
- 200
{- "prep_time_minutes": 30,
- "menus": [
- {
- "schedule": {
- "monday": [
- "08:00-12:00",
- "14:00-20:00"
], - "tuesday": [
- "08:00-12:00",
- "14:00-20:00"
], - "wednesday": [
- "08:00-12:00",
- "14:00-20:00"
], - "thursday": [
- "08:00-12:00",
- "14:00-20:00"
], - "friday": [
- "08:00-12:00",
- "14:00-02:00"
], - "saturday": [
- "08:00-12:00",
- "14:00-02:00"
], - "sunday": [
- "08:00-12:00",
- "14:00-18:00"
]
}, - "stream_id": "string",
- "categories": [
- {
- "stream_id": "string",
- "name": "string",
- "items": [
- {
- "is_alcohol": true,
- "tax_ids": [
- "string"
], - "stream_id": "string",
- "name": "string",
- "description": "string",
- "images": {
- "url": "string"
}, - "variations": [
- {
- "price": 150,
- "currency": "usd",
- "stream_id": "string",
- "name": "string",
- "is_active": true
}
], - "modifier_groups": [
- {
- "default_modifier_quantities": {
- "modifier_id": 1
}, - "stream_id": "string",
- "name": "string",
- "modifiers": [
- null
], - "rules": {
- "minimum_unique_modifiers_allowed": null,
- "maximum_unique_modifiers_allowed": null,
- "amount_of_modifiers_free": null,
- "selection_type": null
}
}
], - "is_active": true
}
]
}
], - "name": "string"
}
], - "holidays": [
- {
- "date": "string",
- "hours": [
- "string"
], - "recurring_yearly": true,
- "specific_years": [
- 0
], - "name": "string"
}
], - "taxes": [
- {
- "is_inclusive": true,
- "stream_id": "string",
- "rate": 0,
- "name": "string",
- "is_default": true
}
]
}
New Webhook Event (DSP –> Stream via Webhook)
You will have to call this endpoint from your system. This is how you will notify Stream about events that happen in your system.
header Parameters
Stream-Webhook-Signature | string The HMAC-SHA256 signature of the request body, using the webhook secret as the key. |
Request Body schema: application/json
type required | string Default: "new_order" |
required | object A new order. This property should only exist if this is a new order event. |
location_id required | string The ID of the location that this event is for. |
Responses
Request samples
- Payload
{- "type": "new_order",
- "order": {
- "id": "string",
- "customer": {
- "name": "string",
- "email": "string",
- "phone": "string",
- "masked_phone_code": "string"
}, - "items": [
- {
- "id": "string",
- "item_id": "string",
- "category_id": "string",
- "name": "string",
- "quantity": 0,
- "price": 0,
- "modifiers": [
- {
- "id": "string",
- "modifier_group_id": "string",
- "name": "string",
- "quantity": 0,
- "price": 0,
- "currency": "usd",
- "modifiers": [
- { }
]
}
], - "currency": "string",
- "special_instructions": "string"
}
], - "subtotal": 0,
- "customer_facing_id": "string",
- "fulfillment_type": "curbside",
- "tax": 0,
- "tax_withheld": 0,
- "driver_tip": 0,
- "store_tip": 0,
- "service_charge": 0,
- "delivery_fee": 0,
- "delivery_fee_taxes": 0,
- "discounts": [
- {
- "id": "string",
- "amount": 0,
- "item_id": "string"
}
], - "estimated_ready_at_ms": 0,
- "should_include_utensils": true,
- "delivery_address": {
- "address_line_1": "string",
- "address_line_2": "string",
- "city": "string",
- "state": "string",
- "postal_code": "string",
- "country": "string"
}, - "special_instructions": "string",
- "fulfillment_instructions": "string",
- "is_future_order": true,
- "unpaid": true
}, - "location_id": "string"
}