Discount Object
A discount contains the following information:Discount Types
Discount Statuses
Listing Discounts
Retrieve all discounts for your store:Query Parameters
Filtering Examples
Example Response
Getting a Single Discount
Retrieve a specific discount by its public ID:Applying Discounts at Checkout
Use a discount code when initiating checkout:Discount Restrictions
Discounts can have various restrictions:Usage Limits
Usage Limits
Limit how many times a discount can be used:When
usage_count reaches usage_limit, the discount is rejected at checkout. usage_limit_per_customer caps the successful uses by a single customer email.Date Restrictions
Date Restrictions
Set start and end dates for the discount:The discount is only valid between these dates.
Product Restrictions
Product Restrictions
Limit the discount to specific products:If
products is empty, the discount applies to all products.Customer Restrictions
Customer Restrictions
Limit the discount to a specific customer:Only the specified customer can use this discount.
Discount Validation
When applying a discount at checkout, it’s automatically validated against these criteria:- Status - Must be
active - Date range - Current date must be within
start_dateandend_date(if specified) - Usage limit -
usage_countmust not have reachedusage_limit(if specified) - Per-customer limit - The customer must not have reached
usage_limit_per_customersuccessful uses (if specified) - Product eligibility - Product must be in the
productsarray (if not empty, applies to all products) - Customer eligibility - Customer email must match
customer_email(if specified) - Fixed amount - A
fixeddiscount cannot exceed the product’s current price
expired once its end_date has passed (a scheduled task updates it). A discount that has reached its usage limit, or whose start_date is still in the future, keeps its active status but is rejected at checkout.
If validation fails during checkout, the API will return an appropriate error message.
Common Use Cases
Promotional Campaigns
Promotional Campaigns
Track discount performance for marketing campaigns:
Affiliate Codes
Affiliate Codes
Create unique discount codes for affiliates and track usage:
VIP Customers
VIP Customers
Create single-use discounts for VIP customers:
Related Resources
Checkout Guide
Apply discounts during checkout
Discounts API
View the complete Discounts API reference