List Discounts
GET
/v2/discountsAuthorization
AuthorizationBearer token · headerrequiredMerchant API key scoped to one merchant and environment. Read operations require api:read, normal write operations require api:write, and broadcast mutations also require explicit broadcasts:write.
Query parameters
statusstring | anydefault: "active"
limitintegermin 1 · max 100 · default: 25
cursorstringmatches ^\d+$
Header parameters
x-request-idstringOptional caller-provided request correlation ID.
min length 1
Responses
200OK
nextCursorstring | anyrequiredShow propertiesHide properties
Any of:
string
stringany
anydiscountsobject[]requiredShow propertiesHide properties
Array of
objectidstring<uuid>requiredmerchantIdstring<uuid>requiredenvironmentstringrequiredAllowed:
sandboxproductionnamestringrequiredcodestringrequiredstatusstringrequiredAllowed:
activedisabledarchivedoriginstringrequiredAllowed:
merchantembedded_coupon_backfillduplicatedFromDiscountIdstring<uuid> | anyrequiredShow propertiesHide properties
Any of:
string<uuid>
string<uuid>any
anyrevisionintegerrequiredmin -9007199254740991 · max 9007199254740991
discountTypestringrequiredAllowed:
percentfixed_amountpercentOffBpsinteger | anyrequiredShow propertiesHide properties
Any of:
integer
integerany
anyamountOffHalalasinteger | anyrequiredShow propertiesHide properties
Any of:
integer
integerany
anycurrencyanyrequireddurationstringrequiredAllowed:
onceforeverrepeatingrepeatingBillingCyclesinteger | anyrequiredShow propertiesHide properties
Any of:
integer
integerany
anyactiveFromstring<date-time>requiredactiveUntilstring<date-time> | anyrequiredShow propertiesHide properties
Any of:
string<date-time>
string<date-time>any
anytotalRedemptionLimitinteger | anyrequiredShow propertiesHide properties
Any of:
integer
integerany
anyperCustomerRedemptionLimitinteger | anyrequiredShow propertiesHide properties
Any of:
integer
integerany
anyactiveReservationCountintegerrequiredmin 0 · max 9007199254740991
redeemedCountintegerrequiredmin 0 · max 9007199254740991
eligibilityobject[]requiredShow propertiesHide properties
Array of
objectAny of:
object
scopeTypeanyrequiredproductIdstring<uuid>requiredplanIdanyofferIdanyobject
scopeTypeanyrequiredplanIdstring<uuid>requiredproductIdanyofferIdanyobject
scopeTypeanyrequiredofferIdstring<uuid>requiredproductIdanyplanIdanyarchivedAtstring<date-time> | anyrequiredShow propertiesHide properties
Any of:
string<date-time>
string<date-time>any
anycreatedByUserIdstring<uuid> | anyrequiredShow propertiesHide properties
Any of:
string<uuid>
string<uuid>any
anycreatedAtstring<date-time>requiredupdatedAtstring<date-time>required401Standard Cipay error response.
errorobjectrequiredShow propertiesHide properties
codestringrequiredmin length 1
messagestringrequiredmin length 1
requestIdstringrequiredmin length 1
detailsobject403Standard Cipay error response.
errorobjectrequiredShow propertiesHide properties
codestringrequiredmin length 1
messagestringrequiredmin length 1
requestIdstringrequiredmin length 1
detailsobject404Standard Cipay error response.
errorobjectrequiredShow propertiesHide properties
codestringrequiredmin length 1
messagestringrequiredmin length 1
requestIdstringrequiredmin length 1
detailsobject409Standard Cipay error response.
errorobjectrequiredShow propertiesHide properties
codestringrequiredmin length 1
messagestringrequiredmin length 1
requestIdstringrequiredmin length 1
detailsobject422Standard Cipay error response.
errorobjectrequiredShow propertiesHide properties
codestringrequiredmin length 1
messagestringrequiredmin length 1
requestIdstringrequiredmin length 1
detailsobject429Standard Cipay error response.
errorobjectrequiredShow propertiesHide properties
codestringrequiredmin length 1
messagestringrequiredmin length 1
requestIdstringrequiredmin length 1
detailsobject500Standard Cipay error response.
errorobjectrequiredShow propertiesHide properties
codestringrequiredmin length 1
messagestringrequiredmin length 1
requestIdstringrequiredmin length 1
detailsobjectRequest
curl -X GET "https://api.cipay.net/v2/discounts" \
-H "Authorization: Bearer YOUR_TOKEN"const response = await fetch("https://api.cipay.net/v2/discounts", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_TOKEN"
}
});Response
{
"nextCursor": "string",
"discounts": [
{
"id": "<uuid>",
"merchantId": "<uuid>",
"environment": "sandbox",
"name": "string",
"code": "string",
"status": "active",
"origin": "merchant",
"duplicatedFromDiscountId": "<uuid>",
"revision": 0,
"discountType": "percent",
"percentOffBps": 0,
"amountOffHalalas": 0,
"currency": "SAR",
"duration": "once",
"repeatingBillingCycles": 0,
"activeFrom": "2024-01-01T00:00:00Z",
"activeUntil": "2024-01-01T00:00:00Z",
"totalRedemptionLimit": 0,
"perCustomerRedemptionLimit": 0,
"activeReservationCount": 0,
"redeemedCount": 0,
"eligibility": [
{
"scopeType": "product",
"productId": "<uuid>",
"planId": "string",
"offerId": "string"
}
],
"archivedAt": "2024-01-01T00:00:00Z",
"createdByUserId": "<uuid>",
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-01T00:00:00Z"
}
]
}{
"error": {
"code": "string",
"message": "string",
"requestId": "string",
"details": {}
}
}{
"error": {
"code": "string",
"message": "string",
"requestId": "string",
"details": {}
}
}{
"error": {
"code": "string",
"message": "string",
"requestId": "string",
"details": {}
}
}{
"error": {
"code": "string",
"message": "string",
"requestId": "string",
"details": {}
}
}{
"error": {
"code": "string",
"message": "string",
"requestId": "string",
"details": {}
}
}{
"error": {
"code": "string",
"message": "string",
"requestId": "string",
"details": {}
}
}{
"error": {
"code": "string",
"message": "string",
"requestId": "string",
"details": {}
}
}