Skip to navigation

Remove discount codes from a cart

Removes the named codes — applied or pending — from the cart, or every code when codes is omitted, and returns the updated cart. Automatic promotions cannot be removed; naming one is a 400. A code that is not on the cart is ignored, so a retry is harmless.

Headers

x-entriastringRequired

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

This endpoint expects an object.
cartIdstringRequired
Id of the cart.
codeslist of stringsOptional
Codes to remove. Omit to remove every code on the cart.

Response

The updated cart; accepted/pending describe the codes that remain on it.

cartobject
acceptedlist of strings

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.

pendinglist of strings

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.

rejectedlist of objects
Codes from this request that cannot apply in this session. Not kept anywhere.

Errors

400
Bad Request Error
401
Unauthorized Error
404
Not Found Error
409
Conflict Error
500
Internal Server Error
501
Not Implemented Error