application/json

Body Required

  • discount object
    Hide discount attributes Show discount attributes object
    • amount number
    • type string

      Values are percentage or fixed.

    • apply_all boolean
  • items array[object]
    Hide items attributes Show items attributes object
    • applyDiscount boolean
    • item_id string(uuid)
    • price number
    • quantity integer
    • staff_id string(uuid)
    • option_id array[string]

Responses

  • 200 application/json

    Successful calculation

POST /pos/checkout-calculate
curl \
 --request POST 'https://api.mahjoz.io/api/v1/pos/checkout-calculate' \
 --header "X-Api-Key: $API_KEY" \
 --header "Content-Type: application/json" \
 --data '{"items":[{"price":50,"item_id":"707915cd-dfe1-4375-b9fb-c33b819475da","quantity":1,"staff_id":"21831c95-dcce-44db-8a59-a7eb6d200687","applyDiscount":true},{"price":50,"item_id":"1fe5e660-3736-43b6-88da-9faf7520bc03","quantity":1,"staff_id":"21831c95-dcce-44db-8a59-a7eb6d200687","applyDiscount":true}],"discount":{"type":"percentage","amount":20,"apply_all":true}}'
Request example
{
  "items": [
    {
      "price": 50,
      "item_id": "707915cd-dfe1-4375-b9fb-c33b819475da",
      "quantity": 1,
      "staff_id": "21831c95-dcce-44db-8a59-a7eb6d200687",
      "applyDiscount": true
    },
    {
      "price": 50,
      "item_id": "1fe5e660-3736-43b6-88da-9faf7520bc03",
      "quantity": 1,
      "staff_id": "21831c95-dcce-44db-8a59-a7eb6d200687",
      "applyDiscount": true
    }
  ],
  "discount": {
    "type": "percentage",
    "amount": 20,
    "apply_all": true
  }
}
Response examples (200)
{}