Promotion Codes
You can apply promotions automatically to all customer carts, or you can create promotion codes that customers must enter to receive the discount. You can enable this feature by setting the automatic attribute to false
in the promotions schema when you create a promotion. For more information, see Create Promotion Codes.
You can generate and export codes for a promotion using the bulk code generation feature, which allows you to create a large number of unique codes and export them in CSV format. For details, refer to the Generating Bulk Codes and Managing Export Codes sections.
You can generate a maximum of 1000 codes for a promotion. If you need to generate more than 1000 codes, limit the promotion's duration to a maximum of 365 days from its start date. The promotion expiry date is 365 days.
With the consume unit feature, you can limit the number of usages of a code for a promotion. You must create a code for this promotion to track the usage of the promotion. The consume unit options are per_cart
and per_item
. For example, consider a store that offers 50% off on SKU1, but limits the promotion to a maximum of two usages. Under the per_cart
setting, a shopper can buy SKU1 twice in a separate transaction, each at a 50% discount. However, with the per_item
setting, if a shopper buys two SKU1s in a single purchase, both items count toward the promotion's usage limit. Therefore, the shopper would use up both usages of the promotion in a single purchase.
Promotion codes can be group codes or individual codes. For example, you can offer a seasonal discount to all customers, such as SUMMER-SALE, or you can offer preferred customers unique discount codes. Promotion codes expire automatically at the end of the promotion period and are removed from the promotion.
When a promotion expires, the promotion codes attached to the promotion automatically become invalid. However, when you re-enable the expired promotion, the promotion codes attached to the promotion are deleted.
When you checkout a cart with an expired promotion, the expired promotion will be automatically removed from a cart and the checkout process is initiated. As a best practice, we recommend to update your cart to remove the expired promotion before initiating the checkout process.
When extending the end date of an expired promotion with over 1000 codes, you will receive an error response. See Update a Promotion. In such cases, we recommend duplicating the promotion, allowing you to set the new end dates and create promotion codes as needed.
📄️ Get Promotion Codes
You can use this endpoint to retrieve promotion codes.
📄️ Create Promotion Codes
Use this endpoint to create promotion codes for a specific promotion.
📄️ Delete Multiple Promotion Codes
Use this endpoint to delete multiple promotion codes within a specific promotion.
📄️ Delete a Promotion Code
Use this endpoint to delete a single promotion code.