# Wallet

## Submit a payout by Wallet in Turkey

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

This endpoint allows you to submit a payout by e-Wallet in Turkey.

#### Headers

| Name                                            | Type   | Description                         |
| ----------------------------------------------- | ------ | ----------------------------------- |
| Content-Type<mark style="color:red;">\*</mark>  | string | application/json; charset=UTF-8     |
| 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      |

#### Request Body

| Name                                                 | Type   | Description                                                                                                                  |
| ---------------------------------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------- |
| method<mark style="color:red;">\*</mark>             | string | Fixed value: Wallet                                                                                                          |
| channel<mark style="color:red;">\*</mark>            | string | Fixed value: UPTION                                                                                                          |
| account\_type<mark style="color:red;">\*</mark>      | string | <p>Beneficiary's UPT account type<br>- One of: UPTION\_IBAN, UPTION\_ACCOUNT\_NO, UPTION\_CLIENT\_NO -</p>                   |
| account<mark style="color:red;">\*</mark>            | string | <p>Beneficiary UPT account.</p><p>- Max 64 -</p>                                                                             |
| name<mark style="color:red;">\*</mark>               | string | <p>Beneficiary's name</p><p>- Min.5 Max.100 -</p>                                                                            |
| amount<mark style="color:red;">\*</mark>             | number | <p>Payout Amount, 2 decimal numbers</p><p>- Min 10, Max 400,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<br>- Max. 50 chars - </p>                                                                              |
| notify\_url<mark style="color:red;">\*</mark>        | string | Where pagsmile will send notification to.                                                                                    |
| arrival\_currency<mark style="color:red;">\*</mark>  | string | Fixed value: TRY                                                                                                             |
| source\_currency<mark style="color:red;">\*</mark>   | string | <p>Merchant Account Currency<br>- One of: USD, EUR, GBP, TRY -</p>                                                           |
| amount\_type                                         | string | <p>Specify the amount value is fixed for merchant or beneficiary<br>- One of: source\_amount, arrival\_amount(default) -</p> |
| country<mark style="color:red;">\*</mark>            | string | Fixed Value: TUR for Turkey                                                                                                  |
| additional\_remark<mark style="color:red;">\*</mark> | string | <p>Descriptor on the user's bank bill<br>- Max length: 40 -</p>                                                              |

{% 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": "TRY",
        "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="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" %}

```
// system error
{
    "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": {}
}
```

{% 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",
    * "amount": "10.01",
    * "arrival_currency": "TRY", // fixed value: TRY
    * "custom_code" : "custom_code_your_order_id",
    * "fee_bear": "merchant",
    * "method": "Wallet",   // fixed value: Wallet
    * "channel": "UPTION",  // fixed value: UPTION
    * "notify_url": "https://notify.url",
    * "account": "16******58",
    * "account_type": "UPTION_ACCOUNT_NO",  // should be one of UPTION_IBAN, UPTION_ACCOUNT_NO, UPTION_CLIENT_NO
    * "source_currency": "USD", 
    * "additional_remark": "pagsmile payout test remark",
    * "country": "TUR", // fixed value: TUR
}'
```

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