Discounts
Search discounts
Search and list discount codes for a store with filters and pagination.
get/v1/discounts/search
Query parameters
page_numbernumber
Example:1
The page number for pagination.
page_sizenumber
Example:10
The number of items per page.
product_idstring
Example:prod_1234567890
Filter discounts that apply to a specific product.
status'active' | 'deleted'
Filter by discount status.
type'percentage' | 'fixed'
Filter by discount type.
created_afterstring
Example:2024-01-01T00:00:00Z
Filter discounts created after this date.
created_beforestring
Example:2024-12-31T23:59:59Z
Filter discounts created before this date.
Response
Successfully retrieved the list of discounts
Example response
{
"items": [
{
"object": "discount",
"status": "active",
"name": "Holiday Sale",
"code": "HOLIDAY2024",
"type": "percentage",
"amount": 20,
"currency": "USD",
"percentage": 15,
"expiry_date": "2024-12-31T23:59:59Z",
"max_redemptions": 100,
"duration": "repeating",
"duration_in_months": 6,
"applies_to_products": [
"prod_123",
"prod_456"
],
"redeem_count": 15
}
],
"pagination": {
"current_page": 1,
"next_page": 2
}
}