> ## 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/:id

> Retorna os detalhes de um desconto específico

Retorna as informações completas de um desconto pelo seu ID.

## Autenticação

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

## Parâmetros de Path

| Parâmetro | Tipo | Obrigatório | Descrição |
| - | - | - | - |
| `id` | `string` | Sim | ID do desconto |

## Campos da Resposta

| Campo | Tipo | Descrição |
| - | - | - |
| `id` | `string` | ID do desconto |
| `name` | `string` | Nome do desconto |
| `type` | `string` | Tipo (`fixed` ou `percentage`) |
| `amount` | `integer` | Valor fixo em centavos |
| `basisPoints` | `integer` | Percentual em basis points |
| `duration` | `string` | Duração |
| `maxRedemptions` | `integer` | Máximo de utilizações |
| `redemptionsCount` | `integer` | Número de utilizações |
| `code` | `string` | Código do cupom |
| `createdAt` | `datetime` | Data de criação |

## Exemplo de Requisição

```bash cURL theme={null}
curl -X GET "https://api.chargefy.io/api/v1/discounts/disc_abc123" \
  -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 discount = await chargefy.discounts.get('disc_abc123');
```

## Exemplo de Resposta

```json theme={null}
{
  "id": "disc_abc123",
  "name": "Desconto de Lançamento",
  "type": "percentage",
  "basisPoints": 2000,
  "duration": "once",
  "maxRedemptions": 100,
  "redemptionsCount": 23,
  "code": "LAUNCH20",
  "createdAt": "2026-02-01T10:00:00Z"
}
```


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