---
title: "List coupons"
method: GET
path: "/v1/coupons"
tags: ["Coupons"]
---

# List coupons

`GET /v1/coupons`

## Request

- Base URL: `https://api.affiliaterail.com`
- URL: `https://api.affiliaterail.com/v1/coupons`
- Auth: HTTP bearer

Coupon codes are created by you in your payment processor and registered here so a checkout that used one is attributed to the partner.

**Scope:** `read`

## Query parameters

- `program_id` string, required: Required on every list
- `limit` string: 1 to 100, default 25
- `starting_after` string: Object id; returns the page after it (older)
- `ending_before` string: Object id; returns the page before it (newer)
- `expand[]` union: Relations to embed: partner, group
  - string
  - string[]
- `include[]` union: Extras to include: stats
  - string
  - string[]
- `partner_id` string

## Response `200`

Coupons

- CouponList
  - `data` Coupon[], required
    - `id` string, required: Prefixed id (`cpn_…`)
    - `object` 'coupon', required
    - `program_id` string, required: Prefixed id (`prg_…`)
    - `partner_id` string, nullable, required: Prefixed id (`part_…`)
    - `group_id` string, nullable, required: Prefixed id (`grp_…`)
    - `code` string, required
    - `external_id` string, nullable, required: The processor's own promotion id, and the only thing a sale is matched on
    - `stats` object
      - `customers` integer, required
    - `created_at` string, date-time, required: ISO-8601, UTC
    - `updated_at` string, date-time, required: ISO-8601, UTC
  - `has_more` boolean, required: Pass the last object's id as `starting_after` to fetch the next page
  - `total_count` integer, required: Count of every object matching the filters, ignoring the cursor

## Other responses

- `400`: Invalid request
- `401`: Missing or unknown API key
- `403`: Key lacks the required scope
- `404`: No such object in your organization
- `422`: The request was understood and refused
- `429`: Rate limited: see Retry-After

---

[API](https://skmtc.dev/affiliaterail/apis/affiliaterail-api.md) · [All operations](https://skmtc.dev/affiliaterail/apis/affiliaterail-api/llms.txt) · [OpenAPI document](https://skmtc.dev/affiliaterail/apis/affiliaterail-api/revisions/ea41f345c092?raw)
