> For the complete documentation index, see [llms.txt](https://docs.brasilcashbank.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.brasilcashbank.com/pix-out/transfer-by-pix-key.md). Agents can also search and read this documentation through its [MCP server](https://docs.brasilcashbank.com/~gitbook/mcp).

# Transfer By PIX KEY

### Integration and Implementation Guide

#### 1. Overview

This document describes how to integrate with the PIX Payments API.

The endpoint allows an authenticated application to initiate a PIX payment by providing the creditor's information, PIX key, and payment amount.

#### 2. API Endpoint

<table><thead><tr><th width="206">Property</th><th>Value</th></tr></thead><tbody><tr><td>HTTP Method</td><td>POST</td></tr><tr><td>Endpoint</td><td><code>https://api-payments.brasilcashbank.com/pix/payments/dict</code></td></tr><tr><td>Content-Type</td><td><code>application/json</code></td></tr><tr><td>Accept</td><td><code>application/json</code></td></tr><tr><td>Authentication</td><td>Bearer Token</td></tr></tbody></table>

#### 3. Authentication

Before submitting a PIX payment, the application must obtain a valid access token through the RoutePag authentication process.

The following headers must be included in the request:

**Required HTTP Headers:**

```
Accept: application/json    
Authorization: Bearer YOUR_ACCESS_TOKEN
Content-Type: application/json
```

#### 4. Request Parameters

The request body must be sent in JSON format.

The payload contains three main objects:

* `creditor`: Identifies the payment recipient.
* `idempotencyKey`: Identifies the payment.&#x20;
* `pixKey`: Specifies the PIX key used to identify the recipient.
* `payment`: Contains the payment amount.

##### 4.1 Creditor Object

| Parameter | Type   | Required | Description                                                      |
| --------- | ------ | -------- | ---------------------------------------------------------------- |
| name      | String | Yes      | Full name of the payment recipient.                              |
| document  | String | Yes      | Recipient's identification document number, such as CPF or CNPJ. |

Example:

json

```
{
  "creditor": {
    "name": "John Lenon",
    "document": "00000000000"
  }
}
```

##### 4.2 PIX Key

| Parameter | Type   | Required | Description                                    |
| --------- | ------ | -------- | ---------------------------------------------- |
| pixKey    | String | Yes      | PIX key associated with the payment recipient. |

The PIX key must correspond to the intended recipient and be in a format supported by the Brazilian PIX payment system.

Example:

json

```
{
  "pixKey": "00000000000"
}
```

##### 4.3 Payment Object

| Parameter | Type   | Required | Description                                        |
| --------- | ------ | -------- | -------------------------------------------------- |
| amount    | Number | Yes      | Payment amount expressed in Brazilian cents (BRL). |

Example:

json

```
{
  "payment": {
    "amount": 1000
  }
}
```

In this example:

* `1000` represents R$ 10.00.
* `100` represents R$ 1.00.
* `5000` represents R$ 50.00.

**Important:** The monetary unit follows the convention demonstrated in the supplied integration example. Confirm the accepted amount format with BrasilCash before production deployment.

##### 4.4 idempotencyKey

The `idempotencyKey` is used to identify an individual payment request.

Its purpose is to help prevent duplicate payment processing when a request is retried due to network failures or communication interruptions.

Recommended implementation practices:

1. Generate a unique idempotency key for each new payment.
2. Store the key associated with the payment transaction.
3. Reuse the same key when retrying the same payment request.
4. Do not generate a new key when retrying a request whose processing status is unknown.
5. Generate a new key for a completely new payment transaction.

The idempotency key format, retention period, and duplicate-request behavior should be confirmed.

| Parameter      | Type   | Required | Description               |
| -------------- | ------ | -------- | ------------------------- |
| idempotencyKey | String | Yes      | prevent duplicate payment |

An idempotency key must also be provided to help prevent duplicate payment processing when the same request is submitted more than once.

Example:

json

```
{
  "idempotencyKey": "order01"
}
```

#### 5. Complete Request Example

**HTTP Request:**

http

{% code title="Body Param" lineNumbers="true" %}

```javascript
POST /pix/payments/dict HTTP/1.1
Host: api-payments.brasilcashbank.com
Accept: application/json
Authorization: Bearer YOUR_ACCESS_TOKEN
Content-Type: application/json

{
   "idempotencyKey": "order01"
   "creditor": {
      "name": "John Lenon",
      "document": "00000000000"
   },
   "pixKey": "00000000000",
   "payment" {
      "amount": 1000
   }
}
```

{% endcode %}

<table><thead><tr><th>Input</th><th width="130">Required</th><th width="117">TYPE</th><th>Description</th></tr></thead><tbody><tr><td>creditor.name</td><td>no</td><td>text</td><td>Final receiver name</td></tr><tr><td>creditor.document</td><td>no</td><td>text</td><td>Final receive document</td></tr><tr><td>pixKey</td><td>yes</td><td>text</td><td>E-mail. phone, evp, document</td></tr><tr><td>payment.amount</td><td>yes</td><td>Integer</td><td>1000 = R$ 10.00<br>Ex: (1000 / 100) = R$ 10.00</td></tr><tr><td>idempotencyKey</td><td>no</td><td>string</td><td></td></tr></tbody></table>

<details>

<summary> 🟢 200 - S<strong>uccessfully</strong></summary>

<sub>Response body</sub>

```javascript
{ 
  "amount" = 1000, 
  "status" = "PROCESSING",
  "txid": "123123910",
  "idempotencyKey": "12312312"
}
```

</details>

<details>

<summary>🔴400 - Bad request</summary>

</details>

<details>

<summary>🔴401 - Unauthorized</summary>

</details>

<details>

<summary>🔴500 - Internal server error</summary>

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.brasilcashbank.com/pix-out/transfer-by-pix-key.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
