> ## Documentation Index
> Fetch the complete documentation index at: https://scaleup-c34c4386.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# GET /api/v1/discounts/

> Retorna uma lista paginada de descontos da organização

Retorna todos os descontos configurados na organização.

## Autenticação

> [!NOTE]
>
> Requer um token de acesso válido (`CHARGEFY_ACCESS_TOKEN`) no header `Authorization`.

## Parâmetros de Query

| Parâmetro | Tipo | Obrigatório | Descrição |
| - | - | - | - |
| `page` | `integer` | Não | Número da página (default: 1) |
| `limit` | `integer` | Não | Itens por página (default: 10, máx: 100) |
| `sorting` | `string` | Não | Ordenação (ex: `-created_at`) |

## Campos da Resposta

| Campo | Tipo | Descrição |
| - | - | - |
| `items` | `array` | Lista de descontos |
| `items[].id` | `string` | ID do desconto |
| `items[].name` | `string` | Nome do desconto |
| `items[].type` | `string` | Tipo (`fixed` ou `percentage`) |
| `items[].amount` | `integer` | Valor fixo em centavos (quando `type: fixed`) |
| `items[].basisPoints` | `integer` | Percentual em basis points (quando `type: percentage`) |
| `items[].duration` | `string` | Duração (`once`, `repeating`, `forever`) |
| `items[].maxRedemptions` | `integer` | Máximo de utilizações |
| `items[].redemptionsCount` | `integer` | Número de utilizações |
| `pagination` | `object` | Informações de paginação |

## Exemplo de Requisição

```bash cURL theme={null}
curl -X GET "https://api.chargefy.io/api/v1/discounts/" \
  -H "Authorization: Bearer $CHARGEFY_ACCESS_TOKEN"
```

```typescript SDK theme={null}
import { Chargefy } from '@chargefy/sdk';

const chargefy = new Chargefy({
  accessToken: process.env.CHARGEFY_ACCESS_TOKEN,
});

const discounts = await chargefy.discounts.list();
```

## Exemplo de Resposta

```json theme={null}
{
  "items": [
    {
      "id": "disc_abc123",
      "name": "Desconto de Lançamento",
      "type": "percentage",
      "basisPoints": 2000,
      "duration": "once",
      "maxRedemptions": 100,
      "redemptionsCount": 23,
      "createdAt": "2026-02-01T10:00:00Z"
    }
  ],
  "pagination": {
    "total_count": 5,
    "max_page": 1
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.