> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trio.com.br/llms.txt
> Use this file to discover all available pages before exploring further.

# Cash out

> Pay a Pix key, a BR code or a bank account from one of your bank accounts, asynchronously or after checking the receiver.

A cash-out payment is a Pix that leaves one of your bank accounts: a payout, a withdrawal or any transfer to a Pix key, a BR code (the Pix copy-and-paste code) or a bank account. Every payment debits the `bank_account_id` you send and creates an out document that you track through webhooks or the API.

All examples use the sandbox base URL `https://api.sandbox.trio.com.br`.

## Choose a flow

V2 offers two ways to pay a Pix. Both create the same out document and return the same response; they differ in when the receiver is checked.

| | Asynchronous | Check, then pay |
| - | - | - |
| Endpoints | [`POST /v2/out/pix/async`](https://docs.trio.com.br/v2/api-reference/banking-api/payments/pix/transfer-pix/generate-pix-payment-async) | [`POST /v2/out/pix/keys/check`](https://docs.trio.com.br/v2/api-reference/banking-api/payments/pix/transfer-pix/check-key) or [`POST /v2/out/pix/brcodes/check`](https://docs.trio.com.br/v2/api-reference/banking-api/payments/pix/brcode/check-brcode), then [`POST /v2/out/pix`](https://docs.trio.com.br/v2/api-reference/banking-api/payments/pix/transfer-pix/generate-pix-payment) |
| Destination | The Pix key or BR code, sent as `reference` | The `check_id` returned by the check, or a bank account sent as `counterparty` |
| Receiver check | Trio checks the key or BR code while it processes the payment | You check first and see the receiver's name and tax number before paying |
| Use it when | You want one call per payment, such as automated payouts, and optionally assert the receiver you expect | You want to confirm who receives the money before paying, or you need to pay a bank account directly |

> [!NOTE]
>
> Coming from V1? `POST /v2/out/pix/async` is the direct equivalent of the V1 cash out request.

## Asynchronous flow

### 1. Send the payment

```http theme={null}
POST /v2/out/pix/async
```

```json theme={null}
{
  "bank_account_id": "{{bank_account_id_out}}",
  "type": "key",
  "reference": "*5541900000000",
  "external_id": "{{$randomUUID}}",
  "amount": 50000,
  "description": "Withdrawal test"
}
```

| Field | Required | Description |
| - | - | - |
| `bank_account_id` | Yes | ID of the bank account that pays the Pix |
| `type` | Yes | `key` to pay a Pix key, `brcode` to pay a BR code |
| `reference` | Yes | The Pix key (CPF, CNPJ, email, phone number or random key) or the BR code |
| `external_id` | No | Your identifier for the transaction, used for reconciliation and webhook tracking |
| `amount` | Yes | Amount in cents (BRL 100.00 = `10000`) |
| `description` | No | Description stored for history and reporting |
| `counterparty` | No | The receiver you expect, see the next step |

### 2. Assert the expected receiver (optional)

Add `counterparty` when you know who should receive the money. Trio refuses the payment if the key or BR code belongs to another `tax_number`, or to none of the `bank_accounts` listed.

| Field | Required | Description |
| - | - | - |
| `counterparty.tax_number` | No | CPF or CNPJ the key or BR code must belong to |
| `counterparty.bank_accounts` | No | Up to 10 bank accounts the key or BR code may point to, each with `ispb` and `number`, and optionally `branch`, `digit` and `type` |

```json theme={null}
{
  "bank_account_id": "{{bank_account_id_out}}",
  "type": "key",
  "reference": "*5541900000000",
  "external_id": "{{$randomUUID}}",
  "amount": 50000,
  "description": "Withdrawal test",
  "counterparty": {
    "tax_number": "52998224725",
    "bank_accounts": [
      {
        "ispb": "12345678",
        "branch": "0001",
        "number": "123456",
        "digit": "1",
        "type": "checking"
      }
    ]
  }
}
```

### 3. Read the response

The API returns the ID of the out document right away:

```json theme={null}
{
  "data": {
    "out_document_id": "41234d60-f6a9-4c9c-8cc3-5769ce9bbea2",
    "approval_request_id": null
  }
}
```

`out_document_id` identifies the out document; use it to track the payment. When the payment needs approval, `approval_request_id` carries the ID of the approval request.

## Check-then-pay flow

`POST /v2/out/pix` processes the payment synchronously. For `type` `key` or `brcode`, check the destination first and send the `id` of the check as `check_id`.

### 1. Check the Pix key or BR code

```http theme={null}
POST /v2/out/pix/keys/check
```

```json theme={null}
{
  "entity_id": "41234d60-f6a9-4c9c-8cc3-5769ce9bbea2",
  "key": "john.doe@example.com"
}
```

* `entity_id` (required): entity that will pay the Pix.
* `key` (required): the Pix key: a CPF, a CNPJ, an email, a phone number (`+5511999999999`) or a random key.

The response identifies the receiver and returns the check `id`. For a CPF, `tax_number` is masked and the `branch`, `number`, `digit` and `type` of the bank account are `null`.

```json theme={null}
{
  "data": {
    "id": "019500b0-71d2-ac32-3712-e8ba5e06e0f7",
    "key": "john.doe@example.com",
    "type": "email",
    "counterparty": {
      "id": "0008d49c-e6d5-4d86-232a-a6f4b9138f10",
      "name": "John Doe",
      "tax_number": "***982247**",
      "bank_account": {
        "id": "0008d49c-e6d5-a58e-a742-449e9b38f795",
        "ispb": "12345678",
        "branch": null,
        "number": null,
        "digit": null,
        "type": null
      }
    },
    "inserted_at": "2026-02-13T19:01:58.354481Z",
    "updated_at": "2026-02-13T19:01:58.354481Z"
  }
}
```

A BR code is checked the same way: send the `entity_id` and the copy-and-paste code as `hash` to [`POST /v2/out/pix/brcodes/check`](https://docs.trio.com.br/v2/api-reference/banking-api/payments/pix/brcode/check-brcode).

### 2. Pay with the check ID

```http theme={null}
POST /v2/out/pix
```

```json theme={null}
{
  "bank_account_id": "{{bank_account_id_out}}",
  "type": "key",
  "check_id": "019500b0-71d2-ac32-3712-e8ba5e06e0f7",
  "external_id": "{{$randomUUID}}",
  "amount": 50000,
  "description": "Withdrawal test"
}
```

| Field | Required | Description |
| - | - | - |
| `bank_account_id` | Yes | ID of the bank account that pays the Pix |
| `type` | Yes | What the Pix pays: a checked `key`, a checked `brcode` or a `bank_account` |
| `check_id` | For `key` and `brcode` | ID of the check from `POST /v2/out/pix/keys/check` (type `key`) or `POST /v2/out/pix/brcodes/check` (type `brcode`) |
| `external_id` | No | Your identifier for the transaction, used for reconciliation and webhook tracking |
| `amount` | Yes | Amount in cents |
| `description` | No | Description stored for history and reporting |
| `counterparty` | For `bank_account` | Receiver of the Pix, see the next section |

The response has the same shape as the asynchronous one: `out_document_id` and, when the payment needs approval, `approval_request_id`.

## Pay a bank account directly

A `bank_account` payment goes through `POST /v2/out/pix` and needs no prior check. Send the receiver in `counterparty`:

| Field | Required | Description |
| - | - | - |
| `counterparty.name` | Yes | Person or company name |
| `counterparty.tax_number` | Yes | CPF or CNPJ |
| `counterparty.bank_account.ispb` | Yes | ISPB of the bank |
| `counterparty.bank_account.branch` | Yes | Branch |
| `counterparty.bank_account.number` | Yes | Account number |
| `counterparty.bank_account.digit` | Yes | Account digit |
| `counterparty.bank_account.type` | Yes | `checking`, `payment`, `salary` or `savings` |

```json theme={null}
{
  "bank_account_id": "1a760495-cb95-4023-96e8-0cff5776b010",
  "type": "bank_account",
  "counterparty": {
    "name": "John Doe",
    "tax_number": "52998224725",
    "bank_account": {
      "ispb": "12345678",
      "branch": "0001",
      "number": "123456",
      "digit": "1",
      "type": "checking"
    }
  },
  "external_id": "external_id 1",
  "amount": 100,
  "description": "description"
}
```

## Track the payment

Whichever flow you use, the payment continues after the response. Follow its status through [webhook events](https://docs.trio.com.br/v2/webhooks/events/overview.md), or read the out document with [`GET /v2/documents/out/{id}`](https://docs.trio.com.br/v2/api-reference/banking-api/documents/payments/get-payment) using the `out_document_id` from the response.

## Next steps

* [Pix key types](https://docs.trio.com.br/v2/guides/pix/using-pix-key.md): the key types V2 accepts and how they are validated.
* [List payments](https://docs.trio.com.br/v2/api-reference/banking-api/documents/payments/list-payments.md): list, read and search out documents.
* [Payments](https://docs.trio.com.br/v2/guides/payments/overview.md): boleto, utility, tax and DARF payments.


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