# List discounts

Returns discounts, one page at a time. Works with Shopify and WooCommerce accounts.

```http
GET https://api.pozy.ai/v1/commerce/discounts
```

- Area: Commerce / Commerce
- Auth: Authorization: Bearer pz_live_...

## Query parameters

- `accountId` (string, required)
- `limit` (integer)
- `cursor` (string)
- `query` (string)

## Example request

```bash
curl -X GET "https://api.pozy.ai/v1/commerce/discounts?accountId=696e0b682d0a31188e7a2ba9&limit=20" \
  -H "Authorization: Bearer $POZY_API_KEY"
```

```ts
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);
```

```python
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

- `discounts`, array of object
  - `id`, string
  - `accountId`, string
  - `platform`, string: One of `shopify`
  - `title`, string
  - `method`, string: One of `code`, `automatic`
  - `type`, string: One of `percentage`, `fixed_amount`, `free_shipping`, `buy_x_get_y`, `app`
  - `codes`, array of string
  - `codeCount`, integer: Can be null
  - `value`, object
    - one of: Option 1
      - `type`, string: One of `percentage`
      - `percentage`, number
    - one of: Option 2
      - `type`, string: One of `fixed_amount`
      - `amount`, object
        - `amount`, string, required
        - `currency`, string, required
      - `appliesOnEachItem`, boolean
  - `appliesTo`, object: Can be null
    - `type`, string: One of `all`, `products`, `collections`
    - `productIds`, array of string
    - `variantIds`, array of string
    - `collectionIds`, array of string
  - `minimum`, object: Can be null
    - `type`, string: One of `subtotal`, `quantity`
    - `amount`, object
      - `amount`, string, required
      - `currency`, string, required
    - `quantity`, integer
  - `usageLimit`, integer: Can be null
  - `oncePerCustomer`, boolean
  - `usageCount`, integer
  - `startsAt`, string (date-time)
  - `endsAt`, string (date-time): Can be null
  - `status`, string: One of `active`, `scheduled`, `expired`
  - `platformStatus`, string
  - `summary`, string
  - `platformData`, object: Can be null
- `nextCursor`, string: Can be null

```json
{
  "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"
}
```
