Creates a pre-order linked to the booking information.
POST ~/bookings/:booking-id/preorders
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 | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
:booking-id | String |
The ID of the reservation you'd like to create a preorder for |
||||||||||
order | Object |
An object containing Order details |
||||||||||
type | String |
The type of order should be one of the following
|
||||||||||
notesoptional | String |
Free-text entry for additional order details |
||||||||||
externalOrderRef | String |
The optional external order reference provided by the Partner when the order was created. |
||||||||||
phaseoptional | String |
Free-text representation of where the Order is in it's lifecycle at the venue. Eg: 'preparing', 'mains served', 'ready for delivery', etc... |
||||||||||
manuallyProcessedoptional | Boolean |
The order has been verified by a human, pass through |
||||||||||
requiredAt | Date |
A |
||||||||||
availableEtaoptional | Date |
A |
||||||||||
memberIdoptional | String |
A memberId associated to the order. |
||||||||||
items | Object[] |
Array of Product objects. |
||||||||||
name | String |
The display name of the Product |
||||||||||
quantity | String |
The quantity ordered. Accepts either String or Integer |
||||||||||
unitPrice | String |
The price of the Product in cents. Accepts either String or Integer |
||||||||||
totalBeforeSurcounts | String |
The price of the line item before the Surcounts are applied. Accepts either String or Integer |
||||||||||
totalAfterSurcounts | String |
The price of the line item after the Surcounts are applied. Accepts either String or Integer |
||||||||||
tagsoptional | String[] |
Array of strings to help group Products together |
||||||||||
posIdoptional | String |
The POS id of the Product. When not provided, is treated as a custom/open/generic item by the POS. |
||||||||||
descriptionoptional | String |
A short description of the Product |
||||||||||
typeoptional | String |
Either a type of 'single' or 'bundle'. Defaults to 'single' |
||||||||||
includedItemsoptional | 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 |
||||||||||
posIdoptional | String |
The POS id of the option |
||||||||||
nameoptional | String |
The display name of the option |
||||||||||
minoptional | String |
The minimum number that can be selected (0 for no min) |
||||||||||
maxoptional | String |
The maximum number that can be selected (0 for no max) |
||||||||||
variantsoptional | Object[] |
The available Variants for the option |
||||||||||
posIdoptional | String |
The POS id of the Variant |
||||||||||
nameoptional | String |
The display name of the Variant |
||||||||||
priceoptional | String |
The price of the Variant in cents |
||||||||||
surcounts | Object[] |
Array of Surcount objects. |
||||||||||
nameoptional | String |
Name of item. Required when |
||||||||||
typeoptional | String |
Whether this is an 'absolute' or 'percentage' Surcount. Required when |
||||||||||
amountoptional | String |
The amount to surcharge/discount (positive/negative integer). Required when |
||||||||||
valueoptional | String |
The value of the surcounts in cents. Accepts integer or string of integers. This value should be calculated if the Surcount is % based. Required when |
||||||||||
descriptionoptional | String |
Description of the item. |
||||||||||
posIdoptional | String |
Id of the item in the POS. Providing this will allow the POS to correctly print and report sales. |
||||||||||
options | Object[] |
Array of options that can be added to the Product |
||||||||||
nameoptional | String |
The display name of the option. Required when |
||||||||||
variantsoptional | Object[] |
The available Variants for the option. Required when |
||||||||||
nameoptional | String |
The display name of the Variant. Required when |
||||||||||
priceoptional | String |
The price of the Variant in cents. Required when |
||||||||||
posIdoptional | String |
The POS id of the Variant |
||||||||||
posIdoptional | String |
The POS id of the option |
||||||||||
surcounts | Object[] |
Array of Surcount objects. |
||||||||||
nameoptional | String |
Name of item. Required when |
||||||||||
typeoptional | String |
Whether this is an 'absolute' or 'percentage' Surcount. Required when |
||||||||||
amountoptional | String |
The amount to surcharge/discount (positive/negative integer). Required when |
||||||||||
valueoptional | String |
The value of the surcounts in cents. Accepts integer or string of integers. This value should be calculated if the Surcount is % based. Required when |
||||||||||
descriptionoptional | String |
Description of item. |
||||||||||
posIdoptional | String |
Id of the item in the POS |
||||||||||
logoptional | Object |
An optional object containing additional log properties you might want to store on the order. |
||||||||||
employeeIdoptional | String |
A Doshii employeeId for the employee making the action |
||||||||||
employeeNameoptional | String |
The name of the employee making the action |
||||||||||
employeePosRefoptional | String |
A POS reference for the employee making the action |
||||||||||
deviceRefoptional | String |
An internal reference for the device at which the request was made |
||||||||||
deviceNameoptional | String |
A name for the device at which the request was made |
||||||||||
areaoptional | String |
The area at which the request was made |
||||||||||
consumeroptional | Object |
An object containing Consumer details. Required when |
||||||||||
nameoptional | String |
The name of the Consumer. Required when |
||||||||||
phoneoptional | String |
The phone number of the Consumer. Required when |
||||||||||
emailoptional | String |
The email address of the Consumer |
||||||||||
addressoptional | String |
The consumer address details. Required when |
||||||||||
line1optional | String |
The street number and name. Required when |
||||||||||
line2optional | String |
Apartment/unit/level/suite. |
||||||||||
cityoptional | String |
City. Required when |
||||||||||
stateoptional | String |
State. Required when |
||||||||||
postalCodeoptional | String |
Postal code. Required when |
||||||||||
countryoptional | String |
2-character Country Code. Required when |
||||||||||
notesoptional | String |
Free-text entry for order or delivery notes such as "deliver to back door". |
||||||||||
transactionsoptional | Object[] |
An array of Transactions for the Order |
||||||||||
amountoptional | String |
The amount (in cents) the Transaction is for. Required if the |
||||||||||
methodoptional | String |
An enumerated value describing how the payment was made. The supported types are: 'cash', 'visa', 'mastercard', 'amex', 'diners', 'giftcard', 'loyalty', 'crypto', 'credit', 'directdeposit', 'cheque', 'alipay', 'wechatpay', 'zip', 'moto' and 'other' |
||||||||||
prepaidoptional | Boolean |
Whether the Transaction has already been charged to the Consumer. Must be set and |
||||||||||
referenceoptional | String |
A free-text reference. Eg: 'CASH' or 'VISA'. |
||||||||||
invoiceoptional | String |
A free-text invoice number. Eg: 'Inv2206-46'. |
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 that 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. |
||||||||||||||
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). 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 |
||||||||||||||
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. Must be one of ['pending', 'cancelled', 'voided'] |
||||||||||||||
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. |
||||||||||||||
externalOrderRef | String |
The optional external order reference provided by the Partner when the order was created. |
||||||||||||||
preorderBookingId | String |
The ID of the reservation that this preorder is associated to. |
||||||||||||||
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 |
Examples
Request: Create a pre-order for a booking (paid, with surcharges)
{
"transactions": [{
"reference":"VISA",
"invoice":"INV22627",
"amount":"2600",
"prepaid": true
}],
"order": {
"type":"dinein",
"requiredAt":"2014-09-05T04:12:52.547Z",
"availableEta":null,
"manuallyProcessed": false,
"log": {
"employeeId": "1",
"employeeName": "Jimmy C",
"employeePosRef": "432324tgr",
"deviceRef": "213-iPad",
"deviceName": "Dining Room iPad 1",
"area": "Dining Room",
},
"surcounts":[{
"posId":"13",
"name":"Delivery fee ($15)",
"amount":"1500",
"type":"absolute",
"value":"1500"
}],
"items":[{
"posId": "pep_pizza",
"name":"Pepperoni Pizza",
"quantity": 1,
"description":"Homemade and spicy",
"unitPrice":"1100",
"totalBeforeSurcounts":"1300",
"totalAfterSurcounts":"1400",
"type": "single",
"includedItems": [],
"options": [{
"name":"Extra Toppings",
"posId": "extra_toppings",
"variants": [{
"name":"Extra Pepperoni",
"posId": "extra_pepperoni",
"price": 200
}]
}],
"surcounts": [{
"name":"Custom Toppings Fee",
"amount":"100",
"type":"absolute",
"posId": "custom_toppings_fee",
"value": 100
}]
}]
}
}
Response
{
"transactions": [{
"reference":"VISA",
"invoice":"INV22627",
"amount":"2600",
"prepaid": true
}],
"order": {
"type":"delivery",
"requiredAt":"2014-09-05T04:12:52.547Z",
"availableEta":null,
"preorderBookingId": "6784",
"manuallyProcessed": false,
"log": {
"employeeId": "1",
"employeeName": "Jimmy C",
"employeePosRef": "432324tgr",
"deviceRef": "213-iPad",
"deviceName": "Dining Room iPad 1",
"area": "Dining Room",
},
"surcounts":[{
"posId":"13",
"name":"Delivery fee ($15)",
"amount":"1500",
"type":"absolute",
"value":"1500"
}],
"items":[{
"posId": "pep_pizza",
"name":"Pepperoni Pizza",
"quantity": 1,
"description":"Homemade and spicy",
"unitPrice":"1100",
"totalBeforeSurcounts":"1300",
"totalAfterSurcounts":"1400",
"type": "single",
"includedItems": [],
"options": [{
"name":"Extra Toppings",
"posId": "extra_toppings",
"variants": [{
"name":"Extra Pepperoni",
"posId": "extra_pepperoni",
"price": 200
}]
}],
"surcounts": [{
"name":"Custom Toppings Fee",
"amount":"100",
"type":"absolute",
"posId": "custom_toppings_fee",
"value": 100
}]
}]
}
}
Please note, whilst a type
and requiredAt
fields are mandatory for this request, their values may not be validated against the booking data by Doshii API . eg: Logically, one would expect the:
requiredAt
time to either correlate or fall soon after the time of the booking reservation.type
to be "dinein"
Comments
0 comments
Please sign in to leave a comment.