Applying and Removing Discounts
There are two options for applying a discount code:
- During initial cart creation
- To a cart that already exists
Apply Discount Code at Cart Creation
During cart creation by providing a list of codes
and merchant_ids
Add discounts to cart creation request:
Merchant ids must match with the merchant id on one of the provided SKUs otherwise they will be ignored.
Apply Discount Code to Existing Cart
Add discount to existing cart by providing a single code
and merchant_id
in the dedicated endpoint
Merchant ids must match with existing sku merchant ids in cart otherwise it will be ignored.
Both endpoints will return the entire cart with the discounts applied to correct bags. See the “discounts” sections below:
Once the cart is priced all available discount information is filled and returned. See “discounts” section below:
Notice that discounts are non-blocking at Violet. It means that when a cart
with discounts is submitted, only APPLIED
discounts are considered, all
other discount statuses and errors are removed from cart.
Removing Discounts
Removing discounts is simple. Discounts can be removed from bags through the [DELETE] /checkout/cart/:cart_id/discounts/:discount_id
endpoint. The cart will be returned with current status without the previously applied discount.