Order Validation

Purpose

This allows ordering platforms to pre-validate a customer’s basket at the checkout stage, before the order is completed. As the source of truth for item availability, pricing rules and tax calculation, the POS verifies each of these, so any issues can be flagged to the guest before payment is captured.

Format

The complete basket content is sent in the request body of a webhook event to a specified webhook endpoint. The order schema is the same as the Order Notification payload , with two additional top-level fields validationId and callbackUrl

No Order Creation
Do not treat this request as an order to inject. Do not create a ticket, hold inventory, or return a POS order ID.

Response

The POS is expected to validate the following;

  • Confirmed Item availability
  • Correct pricing
  • Correct tax details

There are two methods of responding;

Synchronous validation

Return 200 OK with a JSON body containing the validation result. This is recommended where possible, so validation errors reach the guest straight away.

See flow diagram here

Asynchronous validation

Use this when validation requires a round trip to in-store systems and cannot complete within a few seconds.

Return 202 or a 200 with an empty body. Deliverect then marks the validation as pending and waits for a POST to the providedcallbackUrl ( see Validation Response Async )​

See flow diagram here

Validation Errors

The response should include structured validation errors as shown in the Response section below which are relayed back to the ordering channel to surface any issues to the guest, for example to prompt them to adjust their cart as items are out of stock.

Once all corrections are applied and a customer completes checkout, an order would then be created and delivered to the POS Order Notification endpoint.

Inference rules

You can return a minimal response and let Deliverect infer the errors, see examples in the 200 response body below.

The rules are applied in order listed below:

Prefer explicit errors
When you know the failure mode, return explicit "errors": [] entries with the correct code. This gives ordering channels the clearest signal to surface to customers.

RuleApplies when your response includesDeliverect's result
Explicit errorsEntries in errors[]Errors take precedence, so never set isValid: true while also reporting errors.

See list of error codes here
Partial stockitems[] with available: false and quantity > 0 but below the requested quantityquantity_unavailable
Full unavailabilityitems[] with available: false and quantity of 0 or omittedproduct_snoozed
Price comparisonitems[].priceCompared to the matching request line (by itemId, then plu). A difference over 1 cent returns price_mismatch.
Tax comparisoncharges.tax or taxTotalCompared to the request's taxTotal. A difference over 1 cent returns tax_mismatch.
De-duplicationIdentical (code, path) pairsReturned once only.
Payload

Sent by Deliverect as a JSON payload.

The body is the standard Order Notification payload with two additional top-level fields, validationId and callbackUrl. Prices and amounts are integer values in the smallest currency unit (cents).

Please note any Deprecated parameters should be ignored

string

Unique identifier for this validation round. Echo this in async callbacks.

string

Deliverect URL to POST the completed result when using async validation. Format: {apiBaseUrl}/orderValidation/{validationId}

date-time

Time the order was created in Deliverect, in the format yyyy-MM-ddTHH:mm:ss.SSSSSSZ.

date-time

Time the order was last updated in Deliverect, in the format yyyy-MM-ddTHH:mm:ss.SSSSSSZ.

string

Deliverect's identifier for the transient cart.

string

Unique customer account ID in Deliverect.

string

The full unique ID from the delivery channel. Together with the channel is guaranteed to be unique for 48h after pickup.

string

Alternative order ID set by ordering channel, primarily for convenience and readability. This is not unique and typically a shortened version of channelOrderId consisting of 4-5 alphanumeric characters, although may go up to 12 characters.

string

The POS order ID.

string

Provided by the POS in response to incoming orders as a reference to a specific POS receipt.

string

posLocationId is an identifier of the location known on the POS side, it is stored within the POS config in Deliverect.

string

locationId is the unique ID for the POS to identify the store location.

channelLinkId is the unique identifier of the channel (merchant store) in Deliverect. Retrieve all IDs per account via GET Channel Links.

integer

Current order status (see all Order statuses here).

statusHistory
array of objects

All status changes of the order up to the point the webhook is sent.

statusHistory
packaging
object

Order-level packaging preferences.

string

Order source (if known) e.g. app or mobile, not the same as channel that specifies the ordering platform (see guide here).

integer
enum

Type of order.

  • Pickup: 1
  • Delivery: 2
  • Eat in: 3
  • Curbside: 4
  • Drive thru: 5
Allowed:
integer

Unique ID of the channel (see GET Integrated channels).

integer

Unique ID of the POS.

rating
array of objects
deprecated

Legacy attribute, not to be referenced as part of an integration.

rating
date-time

Time the order is due to be picked up, in the format yyyy-MM-ddTHH:mm:ss.SSSSSSZ.

date-time

Time the order is due to be delivered, in the format yyyy-MM-ddTHH:mm:ss.SSSSSSZ.

boolean

Signifies if the order is required as soon as possible.

courier
object

Details of courier.

courierUpdateHistory
array of objects

History of every courier update received for the order.

courierUpdateHistory
customer
object

Customer is the end-consumer.

deliveryAddress
object

Provided address for an order.

boolean

Statement of whether an order was paid online or not.

taxes
array of objects

All taxes applied to an order (in tax exclusive regions only).

taxes
payment
object

Payment details.

string

Overall note for an order.

items
array of objects

All the items included in an order.

items
integer

Decimal precision of order and payment amounts.

integer

Indicates how many diners (applicable to table ordering).

string

Deliverect internal ID of an order.

channelOrderHistoryRawIds
array of strings
deprecated

Legacy attribute, not to be referenced as part of an integration.

channelOrderHistoryRawIds
integer

Service charge applied. It will be sent as an integer with 2 decimal digits e.g. 1 euro would be sent as 100.

integer

Delivery cost applied. It will be sent as an integer with 2 decimal digits e.g. 1 euro would be sent as 100.

integer

A surcharge applied for the packaging. It will be sent as an integer with 2 decimal digits e.g. 1 euro would be sent as 100.

integer

A tip intended for the restaurant operator. It will be sent as an integer with 2 decimal digits e.g. 1 euro would be sent as 100.

integer

A tip intended for the driver/courier. It will be sent as an integer with 2 decimal digits e.g. 1 euro would be sent as 100.

integer

A surcharge applied by channels who impose minimum basket fees. It will be sent as an integer with 2 decimal digits e.g. 1 euro would be sent as 100.

integer

Ordering platforms may offer multiple forms of discount e.g. % discount. A discount total is sent as a minus value representing the deduction from the total order (see guide here). It will be sent as an integer with 2 decimal digits e.g. 1 euro would be sent as 100.

discounts
array of objects

All applied discounts within an order.

discounts
capacityUsages
array of objects
deprecated

Legacy attribute, not to be referenced as part of an integration.

capacityUsages
boolean
deprecated

Legacy attribute, not to be referenced as part of an integration.

string
deprecated

Legacy attribute, not to be referenced as part of an integration.

string

Appears where the customer operates multiple brands from one location (see Get account brands).

boolean

Only applicable as true in staging environment via menu preview orders.

string

Timezone of the location, e.g. Europe/London (see TZ list here).

integer

Order created date in format YMD.

tags
array of strings

Custom tag(s) applied to the store location, typically a brand name, e.g. ["Best Burger"].

tags
integer

Sum of deliveryTax + serviceChargeTax + deliveryCostTax. It will be sent as an integer with 2 decimal digits e.g. 1 euro would be sent as 100.

integer

Some ordering platforms collect and pay taxes and share this info as a value-remitted tax. It will be sent as an integer with 2 decimal digits e.g. 1 euro would be sent as 100.

string

With 'Eat-in' orders ("orderType": 3) a table identifier can be sent (see more details here).

Headers
string
required

Identifies Deliverect as the sender, in the format Deliverect/{version}.

string
required

Signature of the raw request body using your shared secret; recompute it on receipt to verify the request came from Deliverect (see HMAC authentication guide).

Responses

LoadingLoading…