> For the complete documentation index, see [llms.txt](https://docs.pagsmile.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pagsmile.com/reference/payout/submit-a-payout/paypal.md).

# PayPal

## Submit a payout by PayPal globally.

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

This endpoint allows you to submit a payout by PayPal globally.

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

#### Request Body

| Name                                                 | Type   | Description                                                                                                                  |
| ---------------------------------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------- |
| name<mark style="color:red;">\*</mark>               | String | <p>Beneficiary's name</p><p>- Min.5 Max.100 -</p>                                                                            |
| phone                                                | String | Beneficiary's phone.                                                                                                         |
| email                                                | String | Beneficiary's email                                                                                                          |
| account<mark style="color:red;">\*</mark>            | String | PayPal account.                                                                                                              |
| account\_type<mark style="color:red;">\*</mark>      | String | Fixed: EMAIL                                                                                                                 |
| custom\_code<mark style="color:red;">\*</mark>       | String | Merchant's order id                                                                                                          |
| channel<mark style="color:red;">\*</mark>            | String | Fixed: PayPal                                                                                                                |
| method<mark style="color:red;">\*</mark>             | String | Fixed: WALLET                                                                                                                |
| document\_type                                       | String | Beneficiary document type                                                                                                    |
| document\_id                                         | String | Beneficiary document id                                                                                                      |
| source\_currency<mark style="color:red;">\*</mark>   | String | <p>Merchant's account currency</p><p>- supported: USD, GBP, EUR -</p>                                                        |
| fee\_bear<mark style="color:red;">\*</mark>          | String | One of \[beneficiary \| merchant]                                                                                            |
| amount<mark style="color:red;">\*</mark>             | String | <p>Payout Amount, 2 decimal numbers</p><p>- Min 0.01, Max 10,000.00 -</p>                                                    |
| arrival\_currency<mark style="color:red;">\*</mark>  | String | <p>Beneficiary's account currency.</p><p>@See <a href="/pages/Gbi863P3x2WW1oNNtsMM">supported currencies</a></p>             |
| notify\_url<mark style="color:red;">\*</mark>        | String | Where pagsmile will callback to                                                                                              |
| additional\_remark<mark style="color:red;">\*</mark> | String | <p>Payout Remark</p><p>- Max length: 40 -</p>                                                                                |
| country<mark style="color:red;">\*</mark>            | String | <p>Beneficiary's Country/Region code.</p><p>@See <a href="/pages/Gbi863P3x2WW1oNNtsMM">supported countries</a></p>           |
| amount\_type                                         | String | <p>Specify the amount value is fixed for merchant or beneficiary<br>- One of: source\_amount, arrival\_amount(default) -</p> |

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

```javascript
{
    "code": 200,
    "msg": "success",
    "time": 1628580845,
    "data": {
        "id": "TS202108100734054iRiUZFPXfQPB",
        "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" %}

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

{% endtab %}

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

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

{% endtab %}

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

```javascript
{
 // balance insufficient
{
    "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' \
--data-raw '{
    * "name" : "GUILHERME ****** SOUZA",
      "phone" : "468****068",
      "email" : "g******me@gmail.com",
    * "account" : "paid@pagsmile.com",
    * "account_type" : "EMAIL",
      "document_id" : "**********",
      "document_type" : "***",
    * "method" : "WALLET",
    * "channel" : "PayPal",
    * "custom_code" : "custom_code_your_order_id",
    * "fee_bear" : "merchant",
    * "amount" : "0.51",
    * "source_currency" : "USD",
    * "arrival_currency" : "USD",
    * "notify_url" : "https://your.notify.url",
    * "additional_remark" : "pagsmile payout test",
    * "country": "USA"
}'
```

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

{% hint style="success" %}
In sandbox environment, please use *<mark style="color:green;">**`paid@pagsmile.com`**</mark>* as <mark style="color:blue;">**PayPal**</mark> account for testing success payout, any other <mark style="color:blue;">**PayPal**</mark> account will be failed.
{% endhint %}
