List your discount codes
GET
/api/v1/scent/discount-codes
const url = 'https://api-omni.linra.net/api/v1/scent/discount-codes?page=1&pageSize=20&activeOnly=true';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://api-omni.linra.net/api/v1/scent/discount-codes?page=1&pageSize=20&activeOnly=true' \ --header 'Authorization: Bearer <token>'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”page
integer
pageSize
integer
activeOnly
boolean
Filter to active-only codes.
Responses
Section titled “Responses”A page of your own codes, including usage stats.
Media typeapplication/json
object
state
required
string
payload
required
details
object
payload
required
object
items
Array<object>
object
id
string format: uuid
partnerId
string format: uuid
code
string
discountType
A percentage (0,100] off, or a flat SAR amount off.
string
value
number format: decimal
validFrom
string format: date-time
validTo
string format: date-time
isActive
boolean
totalUsageCap
integer
perCustomerCap
integer
productScope
Applies to your whole catalog, or to an explicit variant list (see scopedVariantIds).
string
scopedVariantIds
Array<string>
minOrderValue
number format: decimal
usageCount
Running total of successful redemptions.
integer
createdAt
string format: date-time
lastModifiedAt
string format: date-time
pagination
object
page
integer
pageSize
integer
totalCount
integer
totalPages
integer
Example
{ "state": "SUCCESS", "payload": { "items": [ { "discountType": "Percent", "productScope": "All" } ] }}Too many requests — see the Rate limits guide. Retry after the Retry-After header (seconds).
Media typeapplication/json
The envelope every /api/v1 ERROR response uses. state carries the machine-readable error code (see the Errors guide).
object
state
required
string
payload
required
Always null on an error response.
object
details
object
Example
{ "state": "NOT_FOUND_ORDER", "payload": null}Headers
Section titled “Headers”Retry-After
integer
Seconds to wait before retrying.