Coupon Service Tutorials
How to create a new coupon
To create a new coupon, you need to send a request to theCreating a free shipping coupon with minimum order value and 1 usage per customer
attention
When creating a free shipping coupon, ensure that the
categoryRestricted
parameter is set to false
. Creating a coupon with a fixed discount amount for a specific customer
To limit a coupon to a specific customer, you need to provide the customer ID in therestrictions.validFor
array and issuedTo
field.Creating a category coupon with percentage discount
To limit a coupon to a specific category, you need to set thecategoryRestricted
parameter to true
and provide the category ID in the restrictions.includedCategories
array.How to update an existing coupon
To update an existing coupon, you need to send a request to theinfo
For more information on managing carts, check out the Carts guide.
How to apply coupons to a cart
You can apply one or more coupons to a cart. Coupons of different types can be applied all at once.
Specify the number of coupons per cart
If you want to specify how many coupons can be added to a cart, first you need to send a request to theIn the following example, we are changing the maximum number of coupons that can be applied to a single cart to 3.
Apply a coupon to a cart
To apply a coupon to a cart, you need to send a request to theinfo
If you want to apply more than one coupon to a cart, you need to send a separate request for each discount coupon.
attention
Applying the coupon to cart does not mean that the coupon is automatically redeemed. For more information, check out How to redeem a coupon.
How to redeem a coupon
A coupon can be redeemed in the following ways:
- When a coupon is added to a cart and the order is completed at checkout, the coupon is automatically redeemed by the Checkout Service.
- When you send a request to the
Redeeming the coupon by creating a redemption endpoint. This process is independent of the checkout, so a coupon can be used even after an order is created and processed at checkout. This can be done by a merchant on behalf of a customer.
In the following example, we are redeeming a coupon on behalf of a customer.
Redeem a coupon on behalf of a customer by sending a request to thecoupon.coupon_redeem_on_behalf
info
The redeemed coupon cannot be used used again during checkout.