# QRCODE

## Retrieve recipient data from QRCODE.

Retrieve the recipient's data from the [API](https://docs.pagsmile.com/payout/retrieve-qrcode-data).

## Submit a payout by QRCODE in Brazil.

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

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

#### Headers

| Name                                            | Type   | Description                                                                             |
| ----------------------------------------------- | ------ | --------------------------------------------------------------------------------------- |
| Content-Type<mark style="color:red;">\*</mark>  | string | application/json; chartset=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)                                                     |
| X-Exchange-Rate-Id                              | string | Optional. exchange\_rate\_id from [API](https://docs.pagsmile.com/payout/exchange-rate) |

#### Request Body

<table><thead><tr><th width="171">Name</th><th width="108.6666259765625">Type</th><th>Description</th></tr></thead><tbody><tr><td>account<mark style="color:red;">*</mark></td><td>string</td><td>Beneficiary's PIX QRCode<br>- Max 255 -</td></tr><tr><td>account_type<mark style="color:red;">*</mark></td><td>string</td><td>Beneficiary's account type<br>- Fixed value: qrcode -</td></tr><tr><td>method<mark style="color:red;">*</mark></td><td>string</td><td>Fixed value: QRCODE</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_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><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 length: 40 -</td></tr><tr><td>country<mark style="color:red;">*</mark></td><td>string</td><td>BRA for Brazil</td></tr><tr><td>name<mark style="color:red;">*</mark></td><td>string</td><td><p>Beneficiary's name (Can identify from <a href="../../retrieve-qrcode-data">API</a>)<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>email</td><td>string</td><td>Beneficiary's email<br>- Max 64, valid email -</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>document_type<mark style="color:red;">*</mark></td><td>string</td><td><p>Beneficiary's personal identification type (Can identify from <a href="../../retrieve-qrcode-data">API</a></p><p>- One of: CPF, CNPJ -</p></td></tr><tr><td>document_id<mark style="color:red;">*</mark></td><td>string</td><td>Beneficiary's personal identification number (Can identify from <a href="../../retrieve-qrcode-data">API</a></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="400: Bad Request order already existed" %}

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

{% endtab %}

{% tab title="400: Exchange rate has expired" %}

```
//Only applicable when X-Exchange-Rate-Id header
{
    "code": 4001020,
    "msg": "Exchange rate has expired. Please apply again",
    "time": 1628580940,
    "data": {}
}
```

{% endtab %}

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

```javascript
{
    "code": 4004003,
    "msg": "permission denied",
    "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 balance insufficient" %}

```javascript
// system error
{
    "code": 5001102,
    "msg": "balance insufficient",
    "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' \
--header 'X-Exchange-Rate-Id: ERxxxxxxxxxx' \
--data-raw '{
    * "name": "GUILHERME ****** SOUZA",
      "phone": "",
      "email": "payout@pagsmile.com",
    * "amount": 150,
    * "arrival_currency": "BRL", // fixed value: BRL
    * "custom_code" : "custom_code_your_order_id",
    * "document_id": "22*******99",
    * "document_type": "CPF",
    * "fee_bear": "merchant",
    * "method": "QRCODE",   // fixed value: QRCODE
    * "notify_url": "https://notify.url",
    * "account": "00020101021226800014br.gov.bcb.pix2558pix.com.br/v2/cob/vcharge53c9621******",
    * "account_type": "qrcode",
    * "source_currency": "BRL", 
    * "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 %}
