Replace the discount codes applied to a cart
Sets the complete set of discount codes on the cart — send every code the shopper should have, [] to clear — and returns the updated cart with a verdict per code. Partial success is normal: an unknown code never discards the valid ones sent with it. A real code the cart does not qualify for yet is kept as pending and applies on its own once it does. Automatic promotions are not codes; they appear in cart.discounts with source: AUTOMATIC, cannot be added or removed here, and are ignored if their code is sent. Safe to retry: the request states the desired end state. Does not extend the reservation.
Headers
Identifies which store this request is for. Required on every store-scoped route. It is not authentication and not a secret — it grants no privileges and is safe to send from a browser. You receive the value once your Entria backend has been created and configured. Missing header returns 400; an unknown store returns 404.
Request
Complete desired set of discount codes. Replaces whatever is on the cart; [] clears it.
Response
Shopper-entered codes on the cart after this write that produce a discount (cart.discounts with source: CODE). Automatic promotions are not codes and are never listed here, even if their code was sent.
Real codes on the cart after this write that do not qualify yet. The same list as cart.pendingDiscountCodes; they apply on their own once the cart qualifies.
