Calculate POS order
Method POST
https://my.easyweek.io/api/public/v2/orders/calculate
Description: This endpoint previews the totals for a set of goods, services and vouchers without creating an order. It returns the aggregate invoice breakdown. All amounts are integers in minor units.
Example Request
curl -i -X POST \
https://my.easyweek.io/api/public/v2/orders/calculate \
-H 'Authorization: Bearer <YOUR_SECRET>' \
-H 'Workspace: <YOUR_WORKSPACE>'
Request body
{
"location_uuid": "123b2980-3506-4f8c-abce-97e1ab653406",
"goods": [
{ "good_uuid": "9c2f1b7e-2f8a-4a1e-bd2c-6b3a1f9e0d11", "price": 1500, "quantity": 2 }
],
"services": [],
"vouchers": [],
"discount_amount": 500,
"promocode": "SUMMER",
"booking_uuids": []
}
Body Parameters
- location_uuid (string, required): The branch the order is calculated for.
- goods (array, optional): Line items — each
{ good_uuid, price, quantity }.priceis per unit in minor units. - services (array, optional): Line items — each
{ service_uuid, price, quantity }. - vouchers (array, optional): Line items — each
{ voucher_template_uuid, price, quantity }. - discount_amount (integer, optional): An order-level discount in minor units.
- promocode (string, optional): A promocode to apply.
- booking_uuids (array, optional): Bookings to exclude from the promocode usage count.
Example Response
{
"invoice": {
"base_amount": 3000,
"discount_amount": -500,
"promocode": null,
"promocode_discount_amount": 0,
"subtotal": 2500,
"taxes": [],
"total": 2500,
"base_price": 2500,
"amount_due": 2500,
"voucher_paid_amount": 0,
"account_paid_amount": -2500,
"amount_paid": 0,
"order_uuid": null,
"status": null
}
}