Applying And Removing Discounts

There are two options for applying a discount code:

  1. During initial cart creation

  2. 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:

{
  "base_currency": "USD",
  "wallet_based_checkout": false,
  "skus": [
    {
      "sku_id": 99638,
      "quantity": 1
    }
  ],
  "discounts": [
    {
      "code": "20p_off",
      "merchant_id": 22
    }
  ]
}

Apply Discount Code to Existing Cart

Add discount to existing cart by providing a single code and merchant_id in the dedicated endpoint

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:

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.

Last updated

Was this helpful?