Calculate Tax and Savings

It is possible, for some integrations, to be able to calculate the tax and savings for an order object passed across if the POS at your location is setup for this calculation step.

If your location supports this calculation, you can make the following call:

Calculate Tax and Savings

POST /ordering/v3/calculate
{
  "locationId": 1,
  "items": [
    {
      "uuid": "22db85f1-bf06-46d7-926d-4cd54a29a043",
      "modifiers": [
        {
          "uuid": "d7a87e95-03b6-4bb2-aae8-b31ce113dedd",
          "pickOptions": [
            {
              "uuid": "0e995d4a-8104-4eb2-8ba3-f2b1dccd0d0b",
              "modifiers": [
                {
                  "uuid": "fa558992-7d82-46b4-97e8-89bc36c3e5c0",
                  "pickOptions": [
                    {
                      "uuid": "ccd59108-56bc-4ede-984f-e840df3af3af"
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    }
  ],
  "externalReference": "your-unique-referece",
  "fulfillmentType": "delivery-by-delivery-partner",
  "version": 1,
  "notifications": [
    {
      "type": "webhook",
      "uri": "https://path.to/your/webhook/receiver"
    }
  ]
}
202 Accepted
{
	"context": {
		"version": 1,
		"fulfillmentType": "delivery-by-delivery-partner",
		"externalReference": "your-unique-referece"
	}
}
  • The items and locationId fields follow the same object and structure as for the POST order endpoint.

  • The version field can be any integer positive value. It iss to be incremented by you each time you call this endpoint.

  • The externalReference field is your unique reference for this order calculation.

  • The fultillmentType field can be set as delivery-by-delivery-partner, delivery-by-operator or collection-by-customer.

  • The notifications field is an array of endpoints (defined by you) that will receive a POST back with the webhooks.

Webhook Response

For each request that you send across you will receieve either a successful webhook, or a failed webhook and a reason

Success Response

{
  "type": "CALCULATE_REQUEST_SUCCEEDED",
  "timestamp": "2018-03-14T14:59:40+00:00",
  "data": {
		"requestId": "XXXX-XXXX-XXXX-XXXX",
		"context": {
			"version": 1,
			"fulfillmentType": "delivery-by-delivery-partner",
			"externalReference": "your-unique-referece"
		},
	  "final": {
			"excTax": 2000,
			"incTax": 3000,
			"tax": 1000
		},
	  "taxes": [
        {
          "description": "VAT",
          "amount": 1000
	    }
	  ],
	  "savings": [
        {
          "description": "Savings",
	      "amount": 2000
        }
	  ]
  }
}

Failure Response

{
  "type": "CALCULATE_REQUEST_FAILED",
  "timestamp": "2018-03-14T14:59:40+00:00",
  "data": {
    "requestId": "XXXX-XXXX-XXXX-XXXX",
    "context": {
        "version": 1,
        "fulfillmentType": "delivery-by-delivery-partner",
        "externalReference": "your-unique-reference"
    },
    "error": {
        "code": 0,
        "message": "This operation is not support at this location"
    }
  }
}