Register interest in an order for the purposes of receiving Doshii events when the order is updated. This endpoint is implicitly called for those Apps already associated to the order, for example, if the order is created or updated by the App then they will automatically be subscribed to receive future events related to that order. This is also the case for any Apps making payments against the order.
This is often used by Pay @ Table style Apps that require notifications when an order created elsewhere has been updated so it can be accurately, in real-time, be reflected in the App's UI.
It is possible to unregister interest at a later date through the unsubscribe endpoint.
POST ~/orders/:order-id/subscription
Headers
Field | Type | Description |
---|---|---|
doshii-location-id | String |
The hashed ID of the location you're targeting. See Hashed Location IDs |
Parameters
Field | Type | Description |
---|---|---|
:order-id | String |
The ID of the order you'd like to subscribe to |
Response
Field | Type | Description | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
id | String |
Unique number identifying this resource |
||||||||||||||
checkinId | String |
Id of the Checkin resource |
||||||||||||||
locationId | String |
Id of the Location resource |
||||||||||||||
memberId | String |
Id of the loyalty member made the order |
||||||||||||||
notes | String |
Free-text entry for additional order details |
||||||||||||||
phase | String |
Free-text representation of where the Order is in it's lifecycle at the venue. Eg: 'preparing', 'mains served', 'ready for delivery', etc... |
||||||||||||||
status | String |
The current state of the Order. Can be one of the following:
Please note that a |
||||||||||||||
type | String |
The type of order should be one of the following
|
||||||||||||||
requiredAt | String |
A |
||||||||||||||
availableEta | String |
An estimated |
||||||||||||||
manuallyProcessed | Boolean |
The order has been verified by a human, pass through |
||||||||||||||
items | Object[] |
Array of Product objects. |
||||||||||||||
uuid | String |
A UUID for the item. Automatically generated by Doshii. |
||||||||||||||
posId | String |
The POS id of the item. Will not be available if the item is a custom/open/generic item. |
||||||||||||||
name | String |
The display name of the Product |
||||||||||||||
quantity | String |
The quantity ordered. Returns either a String or an Integer |
||||||||||||||
description | String |
A short description of the Product |
||||||||||||||
unitPrice | String |
The price of the Product in cents. Returns either a String or an Integer |
||||||||||||||
totalBeforeSurcounts | String |
The price of the line item before the Surcounts are applied. Returns either a String or an Integer |
||||||||||||||
totalAfterSurcounts | String |
The price of the line item after the Surcounts are applied. Returns either a String or an Integer |
||||||||||||||
tags | String[] |
Array of strings to help group Products together |
||||||||||||||
menuDir | String[] |
An array of strings representing a menu directory. Eg. For a Flat White - |
||||||||||||||
type | String |
Either a type of 'single' or 'bundle'. Defaults to 'single' |
||||||||||||||
includedItems | Object[] |
Array of items that are included in a bundle |
||||||||||||||
name | String |
The name of the included item |
||||||||||||||
posId | String |
The posId of the included item |
||||||||||||||
quantity | String |
The quantity of the included item |
||||||||||||||
unitPrice | String |
The unitPrice of the included item |
||||||||||||||
options | Object[] |
Array of options that can be added to the Product |
||||||||||||||
posId | String |
The POS id of the option |
||||||||||||||
name | String |
The display name of the option |
||||||||||||||
min | String |
The minimum number that can be selected (0 for no min) |
||||||||||||||
max | String |
The maximum number that can be selected (0 for no max) |
||||||||||||||
variants | Object[] |
The available Variants for the option |
||||||||||||||
posId | String |
The POS id of the Variant |
||||||||||||||
name | String |
The display name of the Variant |
||||||||||||||
price | String |
The price of the Variant in cents |
||||||||||||||
surcounts | Object[] |
Array of Surcount objects. See details on what a surcount is in Doshii. |
||||||||||||||
posId | String |
Id of the item in the POS. Providing this will allow the POS to correctly print and report sales. |
||||||||||||||
rewardId | String |
Id of the Reward that created this Surcount |
||||||||||||||
name | String |
Name of item. |
||||||||||||||
description | String |
Description of item. |
||||||||||||||
type | String |
Whether this is an 'absolute' or 'percentage' Surcount |
||||||||||||||
amount | String |
The amount to surcharge/discount (positive/negative integer). This holds either the percentage amount if the surcount type is `percentage` (e.g. -12.5 for 12.5% discount) or an amount in cents if the surcount type is `absolute` (e.g. -110 for $1.10 discount). Returns either a String or an Integer |
||||||||||||||
value | String |
The value of the surcounts in cents. Accepts integer or string of integers. This value should be calculated if the Surcount is % based. This value always returns the surcount in cents, regardless of the surcount type. Returns either a String or an Integer |
||||||||||||||
options | Object[] |
Array of options that can be added to the Product |
||||||||||||||
posId | String |
The POS id of the option |
||||||||||||||
name | String |
The display name of the option |
||||||||||||||
variants | Object[] |
The available Variants for the option |
||||||||||||||
posId | String |
The POS id of the Variant |
||||||||||||||
name | String |
The display name of the Variant |
||||||||||||||
price | String |
The price of the Variant in cents. Returns either a String or an Integer |
||||||||||||||
unapprovedItems | Object[] |
Array of Product objects that have a status that is NOT |
||||||||||||||
uuid | String |
A UUID for the item. Automatically generated by Doshii. |
||||||||||||||
posId | String |
The POS id of the Product |
||||||||||||||
status | String |
The status of the unapproved item. If the unapproved item is accepted, it would no longer appear in this list, it will be moved to the
|
||||||||||||||
name | String |
The display name of the Product |
||||||||||||||
quantity | String |
The quantity ordered |
||||||||||||||
description | String |
A short description of the Product |
||||||||||||||
unitPrice | String |
The price of the Product in cents |
||||||||||||||
totalBeforeSurcounts | String |
The price of the line item before the Surcounts are applied |
||||||||||||||
totalAfterSurcounts | String |
The price of the line item after the Surcounts are applied |
||||||||||||||
tags | String[] |
Array of strings to help group Products together |
||||||||||||||
type | String |
Either a type of 'single' or 'bundle'. Defaults to 'single' |
||||||||||||||
includedItems | Object[] |
Array of items that are included in a bundle |
||||||||||||||
name | String |
The name of the included item |
||||||||||||||
posId | String |
The posId of the included item |
||||||||||||||
quantity | String |
The quantity of the included item |
||||||||||||||
unitPrice | String |
The unitPrice of the included item |
||||||||||||||
options | Object[] |
Array of options that can be added to the Product |
||||||||||||||
posId | String |
The POS id of the option |
||||||||||||||
name | String |
The display name of the option |
||||||||||||||
min | String |
The minimum number that can be selected (0 for no min) |
||||||||||||||
max | String |
The maximum number that can be selected (0 for no max) |
||||||||||||||
variants | Object[] |
The available Variants for the option |
||||||||||||||
posId | String |
The POS id of the Variant |
||||||||||||||
name | String |
The display name of the Variant |
||||||||||||||
price | String |
The price of the Variant in cents |
||||||||||||||
surcounts | Object[] |
Array of Surcount objects. |
||||||||||||||
posId | String |
Id of the item in the POS. Providing this will allow the POS to correctly print and report sales. |
||||||||||||||
rewardId | String |
Id of the Reward that created this Surcount |
||||||||||||||
name | String |
Name of item. |
||||||||||||||
description | String |
Description of item. |
||||||||||||||
amount | String |
The amount to surcharge/discount (positive/negative integer) |
||||||||||||||
value | String |
The value of the surcounts in cents. Accepts integer or string of integers. This value should be calculated if the Surcount is % based. |
||||||||||||||
options | Object[] |
Array of options that can be added to the Product |
||||||||||||||
posId | String |
The POS id of the option |
||||||||||||||
name | String |
The display name of the option |
||||||||||||||
variants | Object[] |
The available Variants for the option |
||||||||||||||
posId | String |
The POS id of the Variant |
||||||||||||||
name | String |
The display name of the Variant |
||||||||||||||
price | String |
The price of the Variant in cents |
||||||||||||||
surcounts | Object[] |
Array of Surcount objects. |
||||||||||||||
posId | String |
Id of the item in the POS |
||||||||||||||
rewardId | String |
Id of the Reward that created this Surcount |
||||||||||||||
name | String |
Name of item. |
||||||||||||||
description | String |
Description of item. |
||||||||||||||
type | String |
Whether this is an 'absolute' or 'percentage' Surcount |
||||||||||||||
amount | String |
The amount to surcharge/discount (positive/negative integer). Returns either a String or an Integer |
||||||||||||||
value | String |
The value of the surcounts in cents. Accepts integer or string of integers. This value should be calculated if the Surcount is % based. Returns either a String or an Integer |
||||||||||||||
consumer | Object |
An object containing any available Consumer details. |
||||||||||||||
name | String |
The name of the Consumer |
||||||||||||||
phone | String |
The phone number of the Consumer |
||||||||||||||
String |
The email of the Consumer |
|||||||||||||||
address | Object |
An object containing any available Consumer address details. |
||||||||||||||
line1 | String |
The street number and name. |
||||||||||||||
line2 | String |
Apartment/unit/level/suite. |
||||||||||||||
city | String |
City. |
||||||||||||||
state | String |
State. |
||||||||||||||
postalCode | String |
Postal code. |
||||||||||||||
country | String |
2-character Country Code. |
||||||||||||||
notes | String |
Free-text entry for order or delivery notes such as "deliver to back door". |
||||||||||||||
rejectionCode | String |
The code for a rejection. More information can be found by a GET on /rejection-codes/:rejectionCode. Will not return if not set. |
||||||||||||||
rejectionReason | String |
The reason defined by the POS as why the order was rejected. Will not return if not set. |
||||||||||||||
preorderBookingId | String |
The ID of the booking that this pre-order is associated to (See POST /bookings/:booking-id/preorders). Will not return if not a pre-order. |
||||||||||||||
externalOrderRef | String |
The optional external order reference provided by the Partner when the order was created. |
||||||||||||||
posRef | String |
The POS reference for the order. |
||||||||||||||
posCreatedAt | String |
Date when the order is created in the POS |
||||||||||||||
updatedAt | String |
Date when the record is last updated |
||||||||||||||
createdAt | String |
Date when the record is created |
||||||||||||||
version | String |
An obfuscated string representation of the version |
||||||||||||||
uri | String |
URI of the order |
||||||||||||||
log | String |
The url for accessing the Logs for this order |
Examples
Response
{
"id": "1",
"posRef": "6574",
"status": "accepted",
"type": "pickup",
"checkinId": "3",
"locationId": "Xuy8K3a0",
"requiredAt":null,
"availableEta":null,
"manuallyProcessed": false,
"surcounts": [],
"items": [
{
"uuid":"32f342f3-fqwefqwef23f2-f3432g23g32",
"name":"Toasted Sourdough Bread & Eggs",
"description":"Just ye old classic",
"unitPrice":"1100",
"posId":"lol12",
"quantity":1,
"type": "single",
"includedItems": [],
"surcounts": [],
"options": []
}
],
"unapprovedItems": [
{
"uuid":"32f342f3-f34f23f34f34-f3432g23g32",
"name":"Coke",
"status":"pending",
"description":"classic cola",
"unitPrice":"450",
"posId":"rwqed1",
"quantity":1,
"type": "single",
"includedItems": [],
"surcounts": [],
"options": []
}
],
"consumer":{
"name":"Tony T",
"phone":"01234567890"
},
"externalOrderRef": "ANQ1235",
"posCreatedAt": "2016-04-12T20:54:27.223Z",
"createdAt": "2016-04-12T20:54:25.289Z",
"updatedAt": "2016-04-12T20:54:26.289Z",
"transactions": [],
"version":"iwgjr2NJ014",
"uri": "https://sandbox.doshii.co/partner/v3/orders/1",
"log": "https://sandbox.doshii.co/partner/v3/orders/1/logs"
}
Comments
0 comments
Please sign in to leave a comment.