Commerce · Commerce
Returns discounts, one page at a time. Works with Shopify and WooCommerce accounts.
https://api.pozy.ai/v1/commerce/discountsGuides: Commerce & blogs, Products and catalog
Request
Send your API key as Authorization: Bearer pz_live_.... Read-only keys can call it. Keys with the commerce resource group disabled get 403 resource_group_disabled. Authentication
Query parameters
| Name | Type | Notes |
|---|---|---|
accountIdrequired | string | |
limit | integer | Default 201 to 100 |
cursor | string | |
query | string | Up to 500 characters |
Example
curl -X GET "https://api.pozy.ai/v1/commerce/discounts?accountId=696e0b682d0a31188e7a2ba9&limit=20" \
-H "Authorization: Bearer $POZY_API_KEY"const res = await fetch("https://api.pozy.ai/v1/commerce/discounts?accountId=696e0b682d0a31188e7a2ba9&limit=20", {
headers: { Authorization: `Bearer ${process.env.POZY_API_KEY}` },
});
const data = await res.json();
if (!res.ok) throw new Error(data?.error ?? `Request failed with status ${res.status}`);
console.log(data);import os
import requests
resp = requests.get(
"https://api.pozy.ai/v1/commerce/discounts",
headers={"Authorization": f"Bearer {os.environ['POZY_API_KEY']}"},
params={
"accountId": "696e0b682d0a31188e7a2ba9",
"limit": 20,
},
timeout=30,
)
resp.raise_for_status()
print(resp.json())Response
200 on success
discountsarray of object20 child fields
idstringaccountIdstringplatformstringOne of
shopify.titlestringmethodstringOne of
code,automatic.typestringOne of
percentage,fixed_amount,free_shipping,buy_x_get_y,app.codesarray of stringcodeCountintegerCan be null.
valueobjectOne of:
Option 1 (2 fields)
typestringOne of
percentage.percentagenumber
Option 2 (3 fields)
typestringOne of
fixed_amount.amountobject2 child fields
amountstringrequiredcurrencystringrequired
appliesOnEachItemboolean
appliesToobjectCan be null.
4 child fields
typestringOne of
all,products,collections.productIdsarray of stringvariantIdsarray of stringcollectionIdsarray of string
minimumobjectCan be null.
3 child fields
typestringOne of
subtotal,quantity.amountobject2 child fields
amountstringrequiredcurrencystringrequired
quantityinteger
usageLimitintegerCan be null.
oncePerCustomerbooleanusageCountintegerstartsAtstring (date-time)endsAtstring (date-time)Can be null.
statusstringOne of
active,scheduled,expired.platformStatusstringsummarystringplatformDataobjectCan be null.
nextCursorstringCan be null.
{
"discounts": [
{
"id": "6bfebd43ddc270f6d2c56fc5",
"accountId": "696e0b682d0a31188e7a2ba9",
"platform": "shopify",
"title": "Launch day",
"method": "code",
"type": "percentage",
"codes": [
"string"
],
"codeCount": 42,
"value": {
"type": "percentage",
"percentage": 12.5
},
"appliesTo": {
"type": "all",
"productIds": [
"string"
],
"variantIds": [
"string"
],
"collectionIds": [
"string"
]
},
"minimum": {
"type": "subtotal",
"amount": {
"amount": "string",
"currency": "USD"
},
"quantity": 1
},
"usageLimit": 1,
"oncePerCustomer": true,
"usageCount": 42,
"startsAt": "2026-10-02T09:00:00.000Z",
"endsAt": "2026-10-02T09:00:00.000Z",
"status": "active",
"platformStatus": "instagram",
"summary": "string",
"platformData": {}
}
],
"nextCursor": "string"
}Errors
Errors use one shape: { error, type, code, param?, details? }. The ones you are most likely to see here:
| 400 | invalid_request_error | A parameter or body field is missing or invalid. param names it. |
| 401 | authentication_error | The API key is missing, revoked or expired. |
| 403 | permission_error | The key is scoped to other profiles or has this resource group disabled. |
| 429 | rate_limit_error | Too many requests this minute. Wait for Retry-After seconds. |
Every code is listed in Errors.