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

The 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.

  1. Implement the discount Merchant API on your server.
  2. Respond to Bolt’s discount.code.apply POST request via your Merchant API.
  3. 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.

  1. Open Bolt Checkout and enter a discount code.
  2. Bolt should hit your discount merchant API.
  3. If the discount is valid, check that Bolt applies the correct discount amount to the cart.
  4. Repeat the test with an invalid discount too ensure that Bolt:
    • Does not apply any discount amount.
    • Correctly alerts the user.

Handling Errors

To respond with specific errors in merchant api responses visit the error codes reference article.

👎

How did we do?

📖On This Page