# BankTransfer

## Submit a payout by Bank Transfer in Brazil

<mark style="color:green;">`POST`</mark> `https://sandbox.transfersmile.com/api/payout`

This endpoint allows you to submit a payout by Bank Transfer in Brazil.

#### Headers

| Name                                            | Type   | Description                         |
| ----------------------------------------------- | ------ | ----------------------------------- |
| Content-Type<mark style="color:red;">\*</mark>  | string | application/json; charset=UTF-8     |
| AppId<mark style="color:red;">\*</mark>         | string | Your App ID in payout platform.     |
| Authorization<mark style="color:red;">\*</mark> | string | SHA256($sorted\_params + $app\_key) |

#### Request Body

<table><thead><tr><th width="175.6666259765625">Name</th><th width="175.666748046875">Type</th><th>Description</th></tr></thead><tbody><tr><td>name<mark style="color:red;">*</mark></td><td>string</td><td><p></p><p>Beneficiary's name<br>- Length between 5 and 100 -</p><ul><li><strong>When <code>document_id = CPF</code></strong><br>The <code>name</code> field <strong>only supports English alphabet characters</strong> (<code>A–Z</code>, <code>a–z</code>) and spaces.</li><li><p><strong>When <code>document_id = CNPJ</code></strong><br>The <code>name</code> field supports:</p><ul><li>English alphabet characters (<code>A–Z</code>, <code>a–z</code>)</li><li>Numbers (<code>0–9</code>)</li><li>Dot (<code>.</code>)</li><li>Hyphen (<code>-</code>)</li><li>Spaces</li></ul></li></ul></td></tr><tr><td>phone</td><td>string</td><td><p>Beneficiary's phone</p><p>- Max 15, valid phone -</p></td></tr><tr><td>email</td><td>string</td><td>Beneficiary's email<br>- Max 64, valid email -</td></tr><tr><td>document_id<mark style="color:red;">*</mark></td><td>string</td><td>Beneficiary's personal identification number.</td></tr><tr><td>bank_code<mark style="color:red;">*</mark></td><td>string</td><td>ISPB (see <a href="/pages/oAonWXYM24bASq79YVfu"><em>ISPB list</em></a>)<br>- 8 digits -</td></tr><tr><td>branch<mark style="color:red;">*</mark></td><td>string</td><td><p>Bank Branch Code</p><p>- 4 digits -</p></td></tr><tr><td>account<mark style="color:red;">*</mark></td><td>string</td><td><p>Beneficiary's Bank Account</p><p>- 1 ~ 20 digits -</p></td></tr><tr><td>account_type<mark style="color:red;">*</mark></td><td>string</td><td>Beneficiary's Account Type<br>- One of: SAVINGS, PAYMENT, CURRENT, SALARY -</td></tr><tr><td>account_digit</td><td>string</td><td><p>Account Digit</p><p>- 1 or 2 digits. Left empty if the account_digit is included in the account field -</p></td></tr><tr><td>branch_digit</td><td>string</td><td>Branch digit</td></tr><tr><td>method<mark style="color:red;">*</mark></td><td>string</td><td>Fixed value: BANKTRANSFER</td></tr><tr><td>custom_code<mark style="color:red;">*</mark></td><td>string</td><td>Merchant Payout ID<br>- Max. 50 chars -</td></tr><tr><td>fee_bear<mark style="color:red;">*</mark></td><td>string</td><td>All fees charge to merchant or beneficiary<br>- One of: merchant, beneficiary -</td></tr><tr><td>amount<mark style="color:red;">*</mark></td><td>number</td><td><p>Payout Amount, 2 decimal numbers</p><p>- Min 0.01, Max 15,000 - </p></td></tr><tr><td>source_currency<mark style="color:red;">*</mark></td><td>string</td><td>Merchant Account Currency<br>- One of: USD, EUR, GBP, BRL -</td></tr><tr><td>arrival_currency<mark style="color:red;">*</mark></td><td>string</td><td>Fixed value: BRL</td></tr><tr><td>notify_url<mark style="color:red;">*</mark></td><td>string</td><td>Where pagsmile will send notification to.</td></tr><tr><td>additional_remark<mark style="color:red;">*</mark></td><td>string</td><td>Descriptor on the user's bank bill<br>- Max. 40 chars -</td></tr><tr><td>country<mark style="color:red;">*</mark></td><td>string</td><td>BRA for Brazil</td></tr><tr><td>document_type<mark style="color:red;">*</mark></td><td>string</td><td><p>Beneficiary's personal identification type</p><p>- One of: CPF, CNPJ -</p></td></tr><tr><td>amount_type</td><td>string</td><td>Specify the amount value is fixed for merchant or beneficiary<br>- One of: source_amount, arrival_amount(default) -</td></tr></tbody></table>

{% tabs %}
{% tab title="200: OK submit successfully" %}

```
{
    "code": 200,
    "msg": "success",
    "time": 1628580845,
    "data": {
        "id": "TS202108100734054iRiUZFPXfQM",
        "custom_code": "custom_code9982674851738108",
        "arrival_amount": "0.51",
        "arrival_currency": "BRL",
        "source_amount": "0.07",
        "source_currency": "USD",
        "status": "IN_PROCESSING"
    }
}
```

{% endtab %}

{% tab title="401: Unauthorized unauthorized" %}

```javascript
{
    "code": 4004003,
    "msg": "permission denied",
    "time": 1637224716,
    "data": {
        ... ...
    }
}
```

{% endtab %}

{% tab title="400: Bad Request order already existed" %}

```
{
    "code": 4001020,
    "msg": "order already existed",
    "time": 1628580940,
    "data": {}
}
```

{% endtab %}

{% tab title="500: Internal Server Error balance insufficient" %}

```javascript
{
    "code": 5001102,
    "msg": "balance insufficient",
    "time": 1637224716,
    "data": {
        ... ...
    }
}
```

{% endtab %}

{% tab title="500: Internal Server Error system error" %}

```javascript
{
    "code": 5001000,
    "msg": "system error",
    "time": 1637224716,
    "data": {
        ... ...
    }
}
```

{% endtab %}

{% tab title="500: Internal Server Error fee not configured" %}

```javascript
{
    "code": 5001003,
    "msg": "fee not configured",
    "time": 1637224716,
    "data": {
        ... ...
    }
}
```

{% endtab %}
{% endtabs %}

## Example

```
curl --location --request POST 'https://sandbox.transfersmile.com/api/payout' \
--header 'AppId: 94FAC**********************68548' \
--header 'Authorization: d6181db0d6548b94b162e75d095b59147172d914699f83b2bd17951a671b6302' \
--header 'Content-Type: application/json' \
--data-raw '{
    * "name" : "GUILHERME ****** SOUZA",
      "phone": "",
      "email": "payout@pagsmile.com",
    * "bank_code": "00000000",
    * "account_type": "SAVINGS", // should be one of SAVINGS, PAYMENT, CURRENT, SALARY
    * "account": "006*****84", // "4" is the account digit
      "account_digit": "",
    * "branch": "0**8",
    * "document_id": "12*******91",
    * "document_type": "CPF",  // should be one of CPF, CNPJ
    * "source_currency": "BRL", 
    * "arrival_currency": "BRL", // fixed value: BRL
    * "fee_bear": "merchant", // should be one of merchant, beneficiary
    * "method": "BANKTRANSFER", // fixed value: BANKTRANSFER
    * "amount": "1.80", 
    * "notify_url": "https://notify.url",
    * "custom_code" : "custom_code9982674851738108",
    * "additional_remark": "pagsmile payout test remark",
    * "country": "BRA"  // fixed value: BRA
}
'
```

{% hint style="info" %}
Note:  ***94FAC\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*68548*** is Pagsmile's test App ID for sandbox, and ***d6181db0d6548b94b162e75d095b59147172d914699f83b2bd17951a671b6302*** is authorization token associated with the test App ID.
{% endhint %}

## Example of Document

| Document Type | Document ID              | Descritpion |
| ------------- | ------------------------ | ----------- |
| CPF           | 22\*\*\*\*\*\*\*99       | 11 digits   |
| CNPJ          | 23\*\*\*\*\*\*\*\*\*\*31 | 14 digits   |

## Example of Brazil Bank Account

* X --> Numeric character
* D --> Alphanumeric character

<table><thead><tr><th width="171">Bank code (ISPB)</th><th width="152">Bank name</th><th width="146">Bank branch</th><th width="168">Checking account</th><th>Savings account</th></tr></thead><tbody><tr><td>00000000</td><td>Banco do Brasil S.A.</td><td>XXXX, XXXXD or XXXX-D</td><td>XXXXXXXX or XXXXXXXX-X</td><td>XXXXXXXXX or XXXXXXXXX-X Prefixes: 00, 01, 51, 02, 52, 91, 92, 96 or 97</td></tr><tr><td>90400888</td><td>Banco Santander Brasil S.A.</td><td>XXXX</td><td>XXXXXXXX-X Prefixes: 01, 02, 03, 05, 09, 13 or 92</td><td>XXXXXXXX-X Prefixes: 60</td></tr><tr><td>00360305</td><td>CAIXA ECONOMICA FEDERAL</td><td>XXXX, XXXXX or XXXX-X</td><td>XXX.XXXXXXXX-X or any combination with or without ',' or '-' characters and prefix or verification code Prefixes: 001, 010, 003 or 023 </td><td>XXXX.XXXXXXXXX-X //XXX.XXXXXXXX-X or any combination with or without ',' or '-' characters and prefix or verification code Prefixes: 1288 or 013, 022</td></tr><tr><td>60746948</td><td>Banco Bradesco S.A.</td><td>XXXX, XXXXX or XXXX-X</td><td>XXXXXXX or XXXXXXX-X</td><td>XXXXXXX or XXXXXXX-X</td></tr><tr><td>60701190</td><td>Itau Unibanco S.A.</td><td>XXXX</td><td>XXXXX-X</td><td>XXXXX-X</td></tr><tr><td>53518684</td><td>BCO HSBC S.A.</td><td>XXXX, XXXXD, XXXXDD, XXXX-D or XXXX-DD</td><td>XXXXX-XX</td><td>XXXXX-XX</td></tr><tr><td>-</td><td>Other banks</td><td>XXXX, XXXXD, XXXXDD, XXXX-D or XXXX-DD</td><td>-</td><td>-</td></tr></tbody></table>

{% hint style="info" %}
"account\_digit" is optional. If the user fills full account number in the "account" field, the "account\_digit" field should be removed or left empty. For example, if the complete account number is 1234-5, then the request can be

`"account": "12345"`

or

`"account": "1234",`

`"account_digit": "5"`
{% endhint %}

## Third-party CPF/CNPJ Validator

* <mark style="color:blue;">**Go:**</mark> [<mark style="color:blue;">https://github.com/paemuri/brdoc</mark>](<https://github.com/paemuri/brdoc&#xA;>)
* <mark style="color:blue;">**JavaScript:**</mark> <https://www.npmjs.com/package/cpf-cnpj-validator>
* <mark style="color:blue;">**Online:**</mark> [<mark style="color:blue;">https://4app.net/tools/validator/document/cpf\_validator</mark>](https://4app.net/tools/validator/document/cpf_validator)


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.pagsmile.com/payout/submit-a-payout/brazil/bank-transfer.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
