POST Order calculation

Calculate amount for the order

Headers
  • Accept
    Type: string
    required

    Accept header

  • Authorization
    Type: string
    required

    Authorization header

  • Content-Type
    Type: string
    required

    Content-Type header

  • API-VERSION
    Type: string
    required

    API version

  • Application
    Type: string
    required

    Application key

  • X-Request-ID
    Type: string
    required

    Unique request identifier

  • X-QB-Enabled
    enum
    required

    Header 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
  • DLC-Authorization
    Type: string

    DLC Authorization token key (Punchh)

  • X-API-Authorization
    Type: string

    M2M authorization token

Body
application/json
  • calculate_accurate_tax
    Type: boolean
    required
  • combo_meals
    Type: object
    required
  • discount_cards
    Type: array object[]
    required

    can be empty array - selected discount card ids in cart

    Empty object
  • singular_point_id
    Type: string
    required

    venue area for that order type

  • tip
    Type: object
    required
  • discounts
    Type: array object[] ·
  • foodspot_id
    Type: string

    venue foodspot_id - if the order type is foodspot

  • menu_items
    Type: array object[] ·
  • order_type
    Type: object
  • payment_info
    Type: object
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"
    }
  }
}