# BankTransfer

## Submit a payout by Bank Transfer in Panama.

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

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

#### 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

| Name                                                 | Type   | Description                                                                                                                     |
| ---------------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------- |
| document\_type<mark style="color:red;">\*</mark>     | String | <p>Beneficiary's identification type.</p><p>- One of: RUC, PASS or CE -</p>                                                     |
| document\_id<mark style="color:red;">\*</mark>       | String | Beneficiary's identification number.                                                                                            |
| email<mark style="color:red;">\*</mark>              | String | <p>Beneficiary's email<br>- Max 64, valid email -</p>                                                                           |
| phone<mark style="color:red;">\*</mark>              | String | <p>Beneficiary's phone</p><p>- Max 15, valid phone -</p>                                                                        |
| name<mark style="color:red;">\*</mark>               | String | <p>Beneficiary's name<br>- Length must between 5 and 100 -</p>                                                                  |
| country<mark style="color:red;">\*</mark>            | String | Fix value: PAN, for Panama                                                                                                      |
| method<mark style="color:red;">\*</mark>             | String | Fixed value: BANKTRANSFER                                                                                                       |
| account\_type<mark style="color:red;">\*</mark>      | String | <p>Beneficiary's Account Type</p><p>- One of: SAVINGS, CHEKCING -</p>                                                           |
| account<mark style="color:red;">\*</mark>            | String | <p>Beneficiary's Bank Account</p><p>- 5 \~ 12 digits -</p>                                                                      |
| bank\_code<mark style="color:red;">\*</mark>         | String | Bank Code in Panama, see [***bank list***](https://docs.pagsmile.com/payout/banklist/bank-in-panama)                            |
| additional\_remark<mark style="color:red;">\*</mark> | String | <p>The descriptor on the user's bank bill</p><p>- Max. 40 chars -</p>                                                           |
| notify\_url<mark style="color:red;">\*</mark>        | String | Where pagsmile will send notifications to.                                                                                      |
| arrival\_currency<mark style="color:red;">\*</mark>  | String | Fixed value: USD                                                                                                                |
| source\_currency<mark style="color:red;">\*</mark>   | String | <p>Merchant Account Currency</p><p>- One of: USD, EUR, GBP -</p>                                                                |
| amount\_type                                         | String | <p>Specify the amount value is fixed for merchant or beneficiary</p><p>- One of: source\_amount, arrival\_amount(default) -</p> |
| amount<mark style="color:red;">\*</mark>             | String | <p>Payout Amount, 2 decimal numbers</p><p>- Min 1, Max 7,000,000,000 -</p>                                                      |
| fee\_bear<mark style="color:red;">\*</mark>          | String | <p>All fees charge to merchant or beneficiary<br>- One of: merchant, beneficiary -</p>                                          |
| custom\_code<mark style="color:red;">\*</mark>       | String | <p>Merchant Payout ID</p><p>- Max. 50 chars -</p>                                                                               |

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

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

{% endtab %}

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

```javascript
{
    "code": 4001020,
    "msg": "order already existed",
    "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 fee not configured" %}

```javascript
{
    "code": 5001003,
    "msg": "fee not configured",
    "time": 1637224716,
    "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 %}
{% 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": "12******9",
    * "email": "payout@pagsmile.com",
    * "bank_code": "1067",
    * "account_type": "CHECKING", // should be one of SAVINGS, CHECKING
    * "account": "1******49",
    * "document_id": "15*********01",
    * "document_type": "RUC",  // should be one of RUC, PASS or CE
    * "source_currency": "USD", 
    * "arrival_currency": "USD", // fixed value: USD
    * "fee_bear": "merchant", // should be one of merchant, beneficiary
    * "method": "BANKTRANSFER", // fixed value: BANKTRANSFER
    * "amount": "1.01",
    * "notify_url": "https://notify.url",
    * "custom_code" : "custom_code9982674851738108",
    * "additional_remark": "pagsmile payout test remark",
    * "country": "PAN"  // fixed value: PAN
}
'
```

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

## Example of Document

| Document Type | Length | Document                                                                              | Description              |
| ------------- | ------ | ------------------------------------------------------------------------------------- | ------------------------ |
| RUC           | 5\~15  | 1790095389001                                                                         | Single Taxpayer Registry |
| PASS          | 5\~20  | PD0404102                                                                             | Passport                 |
| CE            | 5\~12  | <p>8-211-1816<br>1-1234-12345<br>PE-1234-123456<br>E-1234-12345<br>1AV-1234-12345</p> | Cedula                   |

## Example of Account

| Account Type | Account Length | Account Formart |
| ------------ | -------------- | --------------- |
| SAVINGS      | 5\~20          | Numberic        |
| CHECKING     | 5\~20          | Numberic        |
