POST Order calculation
Calculate amount for the order
Headers
- Type: stringAcceptrequired
Accept header
- Type: stringAuthorizationrequired
Authorization header
- Type: stringContent
- Type requiredContent-Type header
- Type: stringA
P I - V E R S I O N requiredAPI version
- Type: stringApplicationrequired
Application key
- Type: stringX
- Request - I D requiredUnique request identifier
- enumX
- Q B - Enabled requiredHeader which if sent with value 'true' will allow usage of the query building feature in response (through the request's query params). It is mandatory for this part of the documentation.
values- true
- false
- Type: stringD
L C - Authorization DLC Authorization token key (Punchh)
- Type: stringX
- A P I - Authorization M2M authorization token
Body
application/json
- Type: booleancalculate
_accurate _tax required - Type: objectcombo
_meals required - Type: array object[]discount
_cards requiredcan be empty array - selected discount card ids in cart
Empty object - Type: stringsingular
_point _id requiredvenue area for that order type
- Type: objecttiprequired
- Type: array object[] ·discounts
- Type: stringfoodspot
_id venue foodspot_id - if the order type is foodspot
- Type: array object[] ·
- Type: objectorder
_type - Type: objectpayment
_info
Responses
- application/json
- 400
Bad Request
- 401
Unauthorized
- 403
Forbidden
Request Example for post/orders/calculate
curl https://api-public-demo.menu.app/api/orders/calculate \
--request POST \
--header 'Accept: application/json' \
--header 'Authorization: ' \
--header 'Content-Type: application/json' \
--header 'API-VERSION: ' \
--header 'Application: ' \
--header 'X-Request-ID: c10b4a70-6274-490d-80a0-03e7bb826937' \
--header 'X-QB-Enabled: true' \
--header 'DLC-Authorization: ' \
--header 'X-API-Authorization: ' \
--data '{
"foodspot_id": "fcb413bb-3111-4345-923e-db6730a74433",
"singular_point_id": "1844fcaf-ef92-4414-8b1b-430099e9dd7d",
"order_type": {
"id": 1,
"properties": {},
"delivery_info": {
"latitude": 45.2510104,
"longitude": 19.8418477
}
},
"tip": {
"amount": 5
},
"menu_items": [
{
"id": "19a394da-3f23-11ed-936c-1a67b454859d",
"price_level_id": "0ffb254c-3f23-11ed-936c-1a67b454859d",
"quantity": 1,
"modifiers": [
"2049c354-3f23-11ed-936c-1a67b454859d"
],
"comment": "Test comment",
"uniqueIdentifier": "FE-identifier-1"
}
],
"combo_meals": {
"id": "e7f56b48-3f22-11ed-936c-1a67b454859d",
"quantity": 1,
"items": [
{
"id": "e7f56b48-3f22-11ed-936c-1a67b454859d",
"modifiers": [
"2049c354-3f23-11ed-936c-1a67b454859d"
],
"comment": "test comment",
"uniqueIdentifier": "FE-identifier-4"
}
],
"combo_items": [
{
"id": "e7f56b48-3f22-11ed-936c-1a67b454859d",
"modifiers": "2049c354-3f23-11ed-936c-1a67b454859d",
"comment": "test comment",
"uniqueIdentifier": "FE-identifier-4"
}
],
"comment": "Lorem ipsum",
"uniqueIdentifier": "FE-identifier-6"
},
"discounts": [
{
"id": "3e9d7eed-48a6-484e-9755-b8b4a6d95413",
"type_id": 0,
"quantity": 1,
"redemption_code": "QTY52",
"menu_items": [
{
"id": "13d4bc32-3f23-11ed-936c-1a67b454859d",
"quantity": 1,
"modifiers": [
"1e498328-3f23-11ed-936c-1a67b454859d"
],
"comment": "Test comment"
}
],
"combo_meals": [
{
"id": "e7f56b48-3f22-11ed-936c-1a67b454859d",
"quantity": 1,
"items": [
{
"id": "e7f56b48-3f22-11ed-936c-1a67b454859d",
"modifiers": [
"2049c354-3f23-11ed-936c-1a67b454859d"
],
"comment": "test comment",
"uniqueIdentifier": "FE-identifier-4"
}
],
"combo_items": [
{
"id": "e7f56b48-3f22-11ed-936c-1a67b454859d",
"modifiers": "2049c354-3f23-11ed-936c-1a67b454859d",
"comment": "test comment",
"uniqueIdentifier": "FE-identifier-4"
}
],
"comment": "Lorem ipsum",
"uniqueIdentifier": "FE-identifier-6"
}
]
}
],
"discount_cards": [
{}
],
"calculate_accurate_tax": true,
"payment_info": {
"external": {
"amount": 0
}
}
}'
{
"status": "OK",
"code": 200,
"data": {
"calculations": {
"calculation_method": "inclusive",
"subtotal": 17692,
"discount": 0,
"subsidy": 0,
"delivery_fee": 0,
"minimum_surcharge": 0,
"tip": 0,
"tip_rate": 0,
"total": 17692,
"amount_for_payment": 17692,
"tax": 842,
"tax_exemption": 0,
"tax_rates": {
"10": 880
},
"customer_account_id": "6735e303-50a1-4887-9b11-915a6919cc66"
}
}
}