How to Apply Discounts
Use the Merchant API to handle shopper’s coupons, promo codes, or other discounts added to their carts.
How to Use the Discounts API
discounts.code.apply endpoint is called when a shopper enters a discount code; it is recalled whenever the cart or chosen shipping option is updated.
- Implement the discount Merchant API on your server.
- Respond to Bolt’s
discount.code.applyPOST request via your Merchant API.
- Verify the authenticity of the request by confirming that it originated from Bolt.
How to Test
To ensure this step is complete, precisely follow the instructions below.
- Open Bolt Checkout and enter a discount code.
- Bolt should hit your discount merchant API.
- If the discount is valid, check that Bolt applies the correct discount amount to the cart.
- Repeat the test with an invalid discount too ensure that Bolt:
- Does not apply any discount amount.
- Correctly alerts the user.
To respond with specific errors in merchant api responses visit the error codes reference article.