Add Discount to Cart
Once items are added to a cart, it’s possible to add discounts to it.
POST /checkout/cart/{cart_id}/discounts
Add a discount to a cart. API Reference: Add Discount to Cart
Request
the ID of the cart you would like to add this SKU to.
Required Body Parameters:
the code (provided by the merchant) of the discount you wish to add to the cart.
the merchant ID the code belongs to.
Discount is only applied when the cart has at least one product from the provided merchant_id
.
Response
Discount Considerations
When submitting a cart with discounts, only APPLIED
discounts are considered, all other discount statuses will be cleaned from cart.
Discount statuses:
PENDING
- Discount added to cart, but not applied to merchant platform yetAPPLIED
- Discount added to cart, validated and applied to merchant platformINVALID
- Invalid discount in merchant platform, check order errors for detailsNOT_SUPPORTED
- Platform currently not supportedERROR
- Unexpected error applying discount, check order errors for detailsEXPIRED
- Discount previously applied that is no longer valid in the merchant platform
Current supported platforms:
- BigCommerce
- Magento
- WooCommerce
- Shopify (beta)
Using Discount Codes in Shopify
The Shopify Draft Orders API does not support discount codes by default. This limitation required us to integrate more deeply with Shopify and utilized other resources from the Shopify API to recreate their discounting engine. While most discount codes are now supported there are still a few scenarios we have not yet added support for. Support for these will come in the next release of this discounting engine.
Unsupported Shopify Discount Configurations
- Collection ID Requirements
- Customer ID Requirements
- Customer Group Requirements
- Country Requirements
- Buy X Get Y
If a discount code with any of these requirements is entered the discount object will be returned with a status of NOT_SUPPORTED
and an order error will be generated with a message indicating that the discount code configuration was too complex.
Was this page helpful?