# List discount codes

`GET https://rcur.app/api/v2/discounts`

## Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `page` | integer | no | Page number for pagination |

## Example request

```bash
curl -X GET https://rcur.app/api/v2/discounts \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json"
```

## Responses

### 200 List of discount codes

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | array of Discounts | no |  |
| `data[].id` | string | yes |  |
| `data[].code` | string | yes |  |
| `data[].name` | string | no |  |
| `data[].type` | string | yes | One of: `percentage`, `fixed`. |
| `data[].value` | string | yes | A percentage, or an amount in the currency of the code |
| `data[].currency` | string | no | Only for a fixed amount |
| `data[].duration` | string | yes | How many payments of a subscription get the discount: the first, the first duration_periods, or every payment One of: `once`, `repeating`, `forever`. |
| `data[].duration_periods` | integer | no |  |
| `data[].all_links` | boolean | yes | Valid for every payment link, or only for the links in links |
| `data[].links` | array of strings | no | Ids of the payment links the code is limited to |
| `data[].max_redemptions` | integer | no | How often the code can be used in total, by all customers together |
| `data[].times_redeemed` | integer | no |  |
| `data[].once_per_customer` | boolean | no |  |
| `data[].starts_at` | string | no |  |
| `data[].expires_at` | string | no |  |
| `data[].is_active` | boolean | yes |  |
| `data[].status` | string | yes | One of: `active`, `inactive`, `scheduled`, `expired`, `used_up`. |
| `data[].created_at` | string | yes |  |
| `links` | object | no |  |
| `links.first` | string | no |  |
| `links.last` | string | no |  |
| `links.prev` | string | no |  |
| `links.next` | string | no |  |
| `meta` | object | no |  |
| `meta.current_page` | integer | no |  |
| `meta.last_page` | integer | no |  |
| `meta.per_page` | integer | no |  |
| `meta.total` | integer | no |  |

```json
{
    "data": [
        {
            "id": "aB3dE5fG7h",
            "code": "SUMMER25",
            "name": "Summer campaign",
            "type": "percentage",
            "value": "25.00",
            "currency": "EUR",
            "duration": "repeating",
            "duration_periods": 3,
            "all_links": false,
            "links": [
                "xY1zA2bC3d"
            ],
            "max_redemptions": 100,
            "times_redeemed": 12,
            "once_per_customer": true,
            "starts_at": "2026-06-01",
            "expires_at": "2026-08-31",
            "is_active": true,
            "status": "active",
            "created_at": "2026-05-20 10:00:00"
        }
    ],
    "links": {
        "first": "string",
        "last": "string",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "last_page": 1,
        "per_page": 15,
        "total": 6
    }
}
```
