One total on MCP carts
A build session never gets Layout's confirmation card, so the cart itself now carries the one total the person pays.
What changed
- The fee is in the total. On a build session, a ready cart's
totalMinor,priceandcart.totalMinorare the restaurant's total plus Layout's service fee, unless the fee is waived.cart.merchantTotalMinoris the restaurant's own total. Over REST, the cart'stotalMinoralready worked this way. fee_not_included. A confirm that sends the restaurant's total alone answersconfirm.error: "price_changed"withreason: "fee_not_included". Nothing is confirmed or charged.- Expired carts. A confirm more than fifteen minutes after the cart was ready answers
confirm_expired, and nothing is charged.not_confirmable_coldnow carriesreason:canceled,expired,closedornot_found. - Pickup only. A build with
fulfillment: "delivery",deliverToortipPercentbuilds nothing and answersdeliveryUnavailable: { reason: "not_enabled" }. It used to build a pickup. The build session's tool list no longer shows those fields. order_status. With no arguments it follows this application's latest build, or answersbuild.status: "not_found". An unknownorderIdanswersplacement.status: "not_found". A placed order carriesplacement.pickup, and achallengecarriessmsSentwhen Layout knows whether the approval link was texted.
Why it matters
The person agrees to the amount their card is charged, and on a build session the cart is the only place you can read it.
What to do
Show the person price, and confirm with the cart's totalMinor, unchanged:
order {
"action": "confirm",
"orderId": "0b6f2a54-…",
"expectedTotalMinor": 1890,
"idempotencyKey": "a7c1e0d2-…"
}
Never add the fee yourself, and never confirm with cart.merchantTotalMinor. See Confirm with the person's code.
Breaking changes
Yes, in two cases. A confirm that sends the restaurant's total alone is now refused with fee_not_included. A build that asks for delivery now gets no cart; build again without the delivery fields. Code that sends totalMinor back as it came keeps working.