Validate Cart
Runs the checks that POST /cart/{cart_id}/checkout would run, without committing anything. Nothing about the stored cart changes, so you can call it as often as you like — on entering the checkout screen, for example, to find out whether the customer can proceed before you show them a payment form.
A failed check is still a 200. Read is_valid rather than the status code. The call only returns an error status when the cart itself cannot be loaded.
checks reports each group separately so you can tell which part failed. A group is skipped when it was not run: order_amount_limits is skipped if the cart check already failed, and house_account is skipped unless you ask for it.
Every failure is listed in issues, each with the check it came from, a stable code, and a title and message written for the customer. Show those rather than composing your own text.
The three order_amount_limits codes are fixed: order_amount_below_minimum, order_amount_exceeds_maximum and catering_minimum_not_reached. The cart check draws on a wider set of codes, so branch on check and display title and message rather than switching on every possible code.
Path Parameters
- Type: stringcart
_id requiredThe cart identifier returned by
POST /cart/init
Query Parameters
- Type: booleancheck
_house _account _credit Also check that the customer's house account has enough credit for this cart. Off by default, because it is only meaningful on a brand that offers house accounts.
Headers
- Type: stringApplicationrequired
White Label Application Key
- Type: stringApi
- Version requiredThe release version your integration was built against — see Versioning in API Basics.
- Type: stringContent
- Type requiredRequired even on requests with no body
- Type: stringAuthorization
Bearer token of the signed-in customer. Omit it for an anonymous guest
- Type: stringDlc
- Authorization Punchh customer token, on a brand integrated with Punchh.
Authorizationdoes not authenticate you to Punchh. Send it on every cart call for a signed-in registered customer — any cart with items triggers a loyalty calculation, with or without a discount — and for a guest only when the cart carries a reward, offer, credit or promo code. Omitting it falls back to the token stored for that customer at sign-in, which may be stale.Declared optional because it is conditional, not because it is safe to leave out. It applies only to a Punchh brand, so marking it required would be wrong for every brand without the integration. See Use Rewards, Offers, Customer Credits, and Promo Codes.
Body
No request body.
Responses
- application/json
- 403
The brand is not on the new product structure (NMG).
- 404
Unknown cart ID, or the cart belongs to another brand or customer.
curl 'https://api-public-demo.menu.app/api/cart/f6ce31f7b7549cc7c3e5326661cf1dc3b5ea5c3fd89cce634667e483e23fb51a/validate?check_house_account_credit=false' \
--request POST \
--header 'Application: ' \
--header 'Api-Version: ' \
--header 'Content-Type: application/json'
{
"status": "OK",
"code": 200,
"data": {
"cart": {
"id": "f6ce31f7b7549cc7c3e5326661cf1dc3b5ea5c3fd89cce634667e483e23fb51a"
},
"is_valid": true,
"checks": {
"cart": "ok",
"order_amount_limits": "ok",
"house_account": "skipped"
},
"issues": []
}
}