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

> Lista todas as transações de cobrança de uma assinatura

Retorna todas as transações (cobranças) associadas a uma assinatura, ordenadas da mais recente para a mais antiga. Não inclui linhas de estorno.

## Autenticação

> [!NOTE]
>
> Requer um token de acesso válido (`CHARGEFY_ACCESS_TOKEN`) no header `Authorization`. Escopos necessários: `web:read`, `web:write` ou `subscriptions:read`.

## Parâmetros de Path

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

## Campos da Resposta

| Campo | Tipo | Descrição |
| - | - | - |
| `items` | `array` | Lista de transações |
| `items[].id` | `string` | ID da transação |
| `items[].status` | `string` | Status da transação: `new`, `pending`, `succeeded`, `failed`, `canceled`, `pre_authorized`, `reversed`, `refunded`, `partial_refunded`, `dispute`, `charged_back` |
| `items[].payment_type` | `string` | Tipo de pagamento: `credit`, `boleto`, `pix` |
| `items[].amount` | `number` | Valor em centavos |
| `items[].currency` | `string` | Moeda (`BRL`) |
| `items[].installments` | `number \| null` | Número de parcelas |
| `items[].card_data` | `object \| null` | Dados do cartão utilizado |
| `items[].billing_reason` | `string \| null` | Motivo da cobrança |
| `items[].description` | `string \| null` | Descrição da transação |
| `items[].confirmed_at` | `datetime \| null` | Data de confirmação do pagamento |
| `items[].created_at` | `datetime` | Data de criação |

## Exemplo de Requisição

```bash cURL theme={null}
curl -X GET "https://api.chargefy.io/api/v1/subscriptions/sub_1a2b3c4d/transactions" \
  -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 result = await chargefy.subscriptions.getTransactions('sub_1a2b3c4d');
```

## Exemplo de Resposta

```json theme={null}
{
  "items": [
    {
      "id": "txn_abc123",
      "status": "succeeded",
      "payment_type": "credit",
      "amount": 4990,
      "currency": "BRL",
      "installments": 1,
      "card_data": {
        "brand": "Visa",
        "last4": "4242"
      },
      "billing_reason": "subscription_cycle",
      "description": null,
      "confirmed_at": "2026-03-01T10:05:00Z",
      "created_at": "2026-03-01T10:00:00Z"
    }
  ]
}
```


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