Coupons
Create, edit and view your store's discount coupons.
List coupons
GET
/api/v1/couponsAbilitycoupons.readReturns the store's coupons, newest first.
Query parameters
codestring- The exact coupon code.
is_activeboolean- 1 for active ones only, 0 for inactive ones only.
per_pageinteger- Items per page, from 1 to 100. Default 20. A value outside that range returns 422.
pageinteger- Page number, from 1 to 10000. Default 1. A value outside that range returns 422.
curl "https://sellitex.com/api/v1/coupons?is_active=1" \
-H "Authorization: Bearer sk_live_..." \
-H "Accept: application/json"Response200
{
"data": [
{
"id": 9,
"code": "BLACK10",
"type": "percentage",
"value": 10,
"scope": "products",
"product_ids": [12, 14],
"min_order_total": 2000,
"times_used": 0,
"max_uses": 100,
"max_uses_per_customer": 1,
"is_active": true,
"starts_at": "2026-11-27T00:00:00+00:00",
"ends_at": "2026-11-30T23:59:59+00:00",
"created_at": "2026-11-20T12:00:00+00:00"
}
],
"links": {
"first": "…?page=1",
"last": "…?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"per_page": 20,
"to": 1,
"total": 1
}
}Retrieve a coupon
GET
/api/v1/coupons/{coupon}Abilitycoupons.readA record that belongs to another store answers 404, exactly like one that doesn't exist.
Path parameters
couponintegerrequired- The coupon id.
curl "https://sellitex.com/api/v1/coupons/9" \
-H "Authorization: Bearer sk_live_..." \
-H "Accept: application/json"Response200
{
"data": {
"id": 9,
"code": "BLACK10",
"type": "percentage",
"value": 10,
"scope": "products",
"product_ids": [12, 14],
"min_order_total": 2000,
"times_used": 0,
"max_uses": 100,
"max_uses_per_customer": 1,
"is_active": true,
"starts_at": "2026-11-27T00:00:00+00:00",
"ends_at": "2026-11-30T23:59:59+00:00",
"created_at": "2026-11-20T12:00:00+00:00"
}
}Create a coupon
POST
/api/v1/couponsAbilitycoupons.writeCreates a coupon under the same rules as the panel. The code is stored in uppercase and must be unique in the store. Without is_active, the coupon starts active.
Request body (JSON)
codestringrequired- The code the buyer types, up to 40 characters.
typestringrequired- percentage or fixed.
valueintegerrequired- Percentage (1 to 100) or fixed amount in cents, depending on type.
scopestringrequired- store_wide (the whole store) or products (only the products in product_ids).
product_idsinteger[]- Ids of the store's products. Required when scope is products.
min_order_totalinteger- Minimum order amount, in cents.
max_usesinteger- Total usage limit.
max_uses_per_customerinteger- Usage limit per buyer.
starts_atdate- Start of the validity window.
ends_atdate- End of the validity window — after starts_at.
is_activeboolean- Whether the coupon can be used.
curl -X POST "https://sellitex.com/api/v1/coupons" \
-H "Authorization: Bearer sk_live_..." \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"code":"BLACK10","type":"percentage","value":10,"scope":"products","product_ids":[12,14],"min_order_total":2000,"max_uses":100,"max_uses_per_customer":1,"starts_at":"2026-11-27T00:00:00-03:00","ends_at":"2026-11-30T23:59:59-03:00"}'Response201
{
"data": {
"id": 9,
"code": "BLACK10",
"type": "percentage",
"value": 10,
"scope": "products",
"product_ids": [12, 14],
"min_order_total": 2000,
"times_used": 0,
"max_uses": 100,
"max_uses_per_customer": 1,
"is_active": true,
"starts_at": "2026-11-27T00:00:00+00:00",
"ends_at": "2026-11-30T23:59:59+00:00",
"created_at": "2026-11-20T12:00:00+00:00"
}
}Update a coupon
PUT
/api/v1/coupons/{coupon}Abilitycoupons.writeReplaces the coupon's settings: send every field, as on creation. Without is_active, its current state is kept.
Path parameters
couponintegerrequired- The coupon id.
Request body (JSON)
codestringrequired- The code the buyer types, up to 40 characters.
typestringrequired- percentage or fixed.
valueintegerrequired- Percentage (1 to 100) or fixed amount in cents, depending on type.
scopestringrequired- store_wide (the whole store) or products (only the products in product_ids).
product_idsinteger[]- Ids of the store's products. Required when scope is products.
min_order_totalinteger- Minimum order amount, in cents.
max_usesinteger- Total usage limit.
max_uses_per_customerinteger- Usage limit per buyer.
starts_atdate- Start of the validity window.
ends_atdate- End of the validity window — after starts_at.
is_activeboolean- Whether the coupon can be used.
curl -X PUT "https://sellitex.com/api/v1/coupons/9" \
-H "Authorization: Bearer sk_live_..." \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"code":"BLACK10","type":"percentage","value":15,"scope":"products","product_ids":[12,14],"min_order_total":2000,"max_uses":100,"max_uses_per_customer":1,"starts_at":"2026-11-27T00:00:00-03:00","ends_at":"2026-11-30T23:59:59-03:00"}'Response200
{
"data": {
"id": 9,
"code": "BLACK10",
"type": "percentage",
"value": 15,
"scope": "products",
"product_ids": [12, 14],
"min_order_total": 2000,
"times_used": 0,
"max_uses": 100,
"max_uses_per_customer": 1,
"is_active": true,
"starts_at": "2026-11-27T00:00:00+00:00",
"ends_at": "2026-11-30T23:59:59+00:00",
"created_at": "2026-11-20T12:00:00+00:00"
}
}Delete a coupon
DELETE
/api/v1/coupons/{coupon}Abilitycoupons.writeDeletes a coupon nobody used. A used coupon explains how past orders were priced and cannot be deleted — deactivate it with is_active: false.
Path parameters
couponintegerrequired- The coupon id.
Possible refusals
coupon_already_used409- The coupon has already been used on an order.
curl -X DELETE "https://sellitex.com/api/v1/coupons/9" \
-H "Authorization: Bearer sk_live_..." \
-H "Accept: application/json"Response204
(no body)The object
The fields this resource's endpoints return. Money is an integer in cents and dates are ISO 8601, in UTC.
idinteger- The coupon identifier.
codestring- Code the buyer types.
typestring- percentage or fixed.
valueinteger- Percentage (1 to 100) or fixed amount in cents, depending on type.
scopestring- store_wide or products.
product_idsinteger[]- The products the coupon applies to, when scope is products.
min_order_totalinteger|null- Minimum order amount, in cents.
times_usedinteger- How many times the coupon has been used.
max_usesinteger|null- Total usage limit, when there is one.
max_uses_per_customerinteger|null- Usage limit per buyer, when there is one.
is_activeboolean- Whether the coupon can be used.
starts_atstring|null- Start of the validity window.
ends_atstring|null- End of the validity window.
created_atstring- When it was created.