# Cashout

## Submit a payout by Cashout in Colombia

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

This endpoint allows you to submit a payout by Cashout in Colombia.

#### Headers

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

#### Request Body

| Name                                                 | Type   | Description                                                                                                                  |
| ---------------------------------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------- |
| name<mark style="color:red;">\*</mark>               | String | Beneficiary's name, length must between 5 and 100                                                                            |
| phone<mark style="color:red;">\*</mark>              | String | <p>Beneficiary's phone</p><p>- Max 15, valid phone -</p>                                                                     |
| document\_type<mark style="color:red;">\*</mark>     | String | Beneficiary ***document type***, should be one of CC, CE, PEP, PPT, CV, TI, PAS                                              |
| document\_id<mark style="color:red;">\*</mark>       | String | Beneficiary document id                                                                                                      |
| amount<mark style="color:red;">\*</mark>             | String | <p>Payout amount, should be an Integer.</p><p>- Min 20,000, Max 1,500,000 COP per transaction -</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's order id</p><p>- Max.50 -</p>                                                                                  |
| method<mark style="color:red;">\*</mark>             | String | Fixed Value: CASHOUT                                                                                                         |
| country<mark style="color:red;">\*</mark>            | String | Fixed value: COL, for Colombia                                                                                               |
| arrival\_currency<mark style="color:red;">\*</mark>  | String | <p>Beneficiary's account currency.</p><p>- Fixed Value: COP -</p>                                                            |
| source\_currency<mark style="color:red;">\*</mark>   | String | <p>Merchant's account currency</p><p>-  supported: USD, GBP, EUR, COP -</p>                                                  |
| amount\_type                                         | String | <p>Specify the amount value is fixed for merchant or beneficiary<br>- One of: source\_amount, arrival\_amount(default) -</p> |
| additional\_remark<mark style="color:red;">\*</mark> | String | <p>Additional Remark<br>- Max Length: 40 - </p>                                                                              |
| notify\_url<mark style="color:red;">\*</mark>        | String | Where pagsmile will callback to                                                                                              |

## Request 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" : "570123456789", 
    * "method" : "CASHOUT",
    * "custom_code" : "your_order_id", // merchant order id
    * "fee_bear" : "merchant",
    * "amount" : "30000", //Amount must be an integer, the fraction is not supported (e.g. 30000 or 30000.00 is acceptable, but 30000.01 is not)
    * "source_currency" : "COP",
    * "arrival_currency" : "COP",
    * "notify_url" : "https://notify.url",
    * "additional_remark" : "pagsmile payout test",
    * "country": "COL"
}'
```

{% 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 %}

## Response Example

{% tabs %}
{% tab title="200: OK success" %}

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

{% endtab %}

{% tab title="400: Bad Request bad request" %}

```
{
    "code": 4001000,
    "msg": "invalid parameter",
    "time": 1637224716,
    "data": {
        "err": "error detail message"
    }
}
```

{% endtab %}

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

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

{% endtab %}

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

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

{% endtab %}

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

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

{% endtab %}

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

```
{
    "code": 5001000,
    "msg": "system error",
    "time": 1637224716,
    "data": {
        "err": "error detail message"
    }
}
```

{% endtab %}
{% endtabs %}

## Payment Flow

{% hint style="warning" %}
After successfully creating a CASHOUT payout order, call the [Payout Detail](https://docs.pagsmile.com/payout/payout-detail) API to obtain the PIN code and validity period (in days) of that order.

It is recommended to notify the recipient of the following information via email, SMS, etc.:

1. Order amount
2. The recipient's information (name, ID number) corresponding to this order
3. The PIN code for this order

Remind the recipient to visit an Efecty service point within the valid period to withdraw the cash. When withdrawing, the recipient must bring the original ID card, as Efecty staff will need to verify the order amount, the recipient's identity, and the PIN before completing the order.
{% endhint %}

<figure><img src="https://4142198059-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MgOGd5QxlX-U1mkQpVU%2Fuploads%2FyIuCtIJptB9NWw6SiNFm%2F3d2dd4a032267d862bb0062d52124c4.png?alt=media&#x26;token=707843fb-c831-43e9-982c-f04d90f17f4e" alt=""><figcaption></figcaption></figure>

## Document Type

<table><thead><tr><th width="249.33333333333331">Name</th><th>Description</th><th>Length</th><th>Type</th></tr></thead><tbody><tr><td>CC</td><td>CEDULA DE CIUDADANIA</td><td>Between 6 to 10</td><td>numeric</td></tr><tr><td>CE</td><td>CEDULA DE EXTRANJERIA</td><td>up to 12</td><td>characters</td></tr><tr><td>PEP</td><td>PERMISO ESPECIAL DE PERMANENCIA</td><td>up to 15</td><td>numeric</td></tr><tr><td>PPT</td><td>PERMISO POR PROTECCION TEMPORAL</td><td>usually 15 digits</td><td>numeric</td></tr><tr><td>CV</td><td>CEDULA VENEZOLA</td><td></td><td></td></tr><tr><td>TI</td><td>TARJETA DE IDENTIDAD</td><td>6 to 10</td><td>numeric</td></tr><tr><td>PAS</td><td>PASAPORTE</td><td>up to 9</td><td>numeric</td></tr></tbody></table>
