Commerce
Discounts
Create and manage discount codes with percentage or fixed-amount values, date ranges, and usage limits.
Create a discount
POST
/modules/commerce/discounts
Create a new discount code.
curl
curl -X POST https://api.saasignal.saastemly.com/modules/commerce/discounts \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{"code":"...","type":"driver","value":{"example":"data"}}'
json — 201 Created
{ "status": "ok" }
Body field
Type
Description
code requiredstring
1–64 chars
type requiredstring
value requirednumber
range >0
min_purchase_amountnumber
max_discount_amountnumber
applies_tostring
applies_to_idsarray
usage_limitinteger
range ≥-9007199254740991 .. ≤9007199254740991
per_customer_limitinteger
range ≥-9007199254740991 .. ≤9007199254740991
starts_atstring
ends_atstring
enabledboolean
buy_quantityinteger
range ≥-9007199254740991 .. ≤9007199254740991
get_quantityinteger
range ≥-9007199254740991 .. ≤9007199254740991
metadataobject
Error responses
401 Unauthorized
402 Insufficient tokens
429 Rate limited
List discounts
GET
/modules/commerce/discounts
List discount codes.
curl
curl https://api.saasignal.saastemly.com/modules/commerce/discounts \
-H "Authorization: Bearer sk_live_..."
json — 200 OK
{ "status": "ok" }
Query param
Type
Description
enabledboolean
typestring
limitinteger
range ≥1 .. ≤100default
25cursorstring
Error responses
401 Unauthorized
402 Insufficient tokens
429 Rate limited
Get a discount
GET
/modules/commerce/discounts/{discount_id}
Retrieve a single discount.
curl
curl https://api.saasignal.saastemly.com/modules/commerce/discounts/{discount_id} \
-H "Authorization: Bearer sk_live_..."
json — 200 OK
{ "status": "ok" }
Path param
Type
Description
discount_id requiredstring
Error responses
401 Unauthorized
402 Insufficient tokens
404 Not found
429 Rate limited
Update a discount
PATCH
/modules/commerce/discounts/{discount_id}
Update a discount code.
curl
curl -X PATCH https://api.saasignal.saastemly.com/modules/commerce/discounts/{discount_id} \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{}'
json — 200 OK
{ "status": "ok" }
Path param
Type
Description
discount_id requiredstring
Body field
Type
Description
codestring
1–64 chars
typestring
valuenumber
range >0
min_purchase_amountmixed
max_discount_amountmixed
applies_tostring
applies_to_idsarray
usage_limitmixed
per_customer_limitmixed
starts_atmixed
ends_atmixed
enabledboolean
buy_quantitymixed
get_quantitymixed
metadataobject
Error responses
401 Unauthorized
402 Insufficient tokens
404 Not found
429 Rate limited
Delete a discount
DELETE
/modules/commerce/discounts/{discount_id}
Permanently remove a discount.
curl
curl -X DELETE https://api.saasignal.saastemly.com/modules/commerce/discounts/{discount_id} \
-H "Authorization: Bearer sk_live_..."
json — 200 OK
{ "status": "ok" }
Path param
Type
Description
discount_id requiredstring
Error responses
401 Unauthorized
402 Insufficient tokens
404 Not found
429 Rate limited