> 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/payin/submit-a-payin/bahrain/wallet.md).

# Wallet

How to use Wallet to submit a payin in Bahrain.

Benefit is an e-wallet payment method in Bahrain that supports `BHD`. Payments are settled in real time and refunds are not supported. There is no fixed minimum or maximum transaction amount, and the actual payment limit depends on the user's wallet limit.

### Payin by Wallet

<mark style="color:green;">`POST`</mark> `https://gateway-test.pagsmile.com/trade/create`

This endpoint allows you to submit a payin by Wallet in Bahrain.

**Headers**

| Name                                            | Type   | Description                                                                   |
| ----------------------------------------------- | ------ | ----------------------------------------------------------------------------- |
| Content-Type<mark style="color:red;">\*</mark>  | string | `application/json; charset=UTF-8`                                             |
| Authorization<mark style="color:red;">\*</mark> | string | Basic authentication using the Base64-encoded value of `app_id:security_key`. |

**Request Body**

| Name                                              | Type   | Description                                                                                                                                  |
| ------------------------------------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------- |
| app\_id<mark style="color:red;">\*</mark>         | string | App ID assigned to the merchant application. Maximum length: 32 characters.                                                                  |
| out\_trade\_no<mark style="color:red;">\*</mark>  | string | Unique merchant order number. Maximum length: 64 characters.                                                                                 |
| order\_currency<mark style="color:red;">\*</mark> | string | Fixed value: `BHD`.                                                                                                                          |
| method<mark style="color:red;">\*</mark>          | string | Fixed value: `Wallet`.                                                                                                                       |
| channel<mark style="color:red;">\*</mark>         | string | Wallet provider. Fixed value: `Benefit` (BenefitPay wallet).                                                                                 |
| order\_amount<mark style="color:red;">\*</mark>   | string | Payment amount in BHD. No fixed min/max limit (subject to wallet limit).                                                                     |
| subject<mark style="color:red;">\*</mark>         | string | Payment reason or item title. Maximum length: 128 characters.                                                                                |
| trade\_type<mark style="color:red;">\*</mark>     | string | Fixed value: `Web`.                                                                                                                          |
| content<mark style="color:red;">\*</mark>         | string | Payment reason details or item details. Maximum length: 255 characters.                                                                      |
| timestamp<mark style="color:red;">\*</mark>       | string | Request time in `yyyy-MM-dd HH:mm:ss` format. Maximum length: 19 characters.                                                                 |
| notify\_url<mark style="color:red;">\*</mark>     | string | URL to which Pagsmile sends the asynchronous payment result notification.                                                                    |
| buyer\_id<mark style="color:red;">\*</mark>       | string | Merchant-defined identifier of the payer.                                                                                                    |
| timeout\_express                                  | string | Order expiration period (`m` for minutes, `h` for hours, `d` for days, `c` for end of current day; default `90m`, max `15d`, e.g. `21500m`). |

**Request Sample**

```json
{
    "app_id": "165***492",
    "out_trade_no": "out_trade_no_34***16",
    "order_currency": "BHD",
    "method": "Wallet",
    "channel": "Benefit",
    "order_amount": "123",
    "subject": "pagsmile test",
    "trade_type": "Web",
    "content": "pagsmile test ",
    "timestamp": "2024-07-04 18:50:42",
    "notify_url": "http://demo.gemini-tiger.cn/callback/success",
    "buyer_id": "buyer123",
    "timeout_express": "21500m"
}
```

**Response**

{% tabs %}
{% tab title="200 Submit successfully" %}

```json
{
    "code": "10000",
    "msg": "Success",
    "out_trade_no": "out_trade_no_31**8916",
    "trade_no": "2026**186",
    "web_url": "https://checkout-test.pagsmile.com?prepay_id=Tnpn***F3F1a",
    "prepay_id": "Tnpn****BF3F1a"
}
```

{% endtab %}

{% tab title="400 Duplicate out:trade:no" %}

```json
{
    "code": "40002",
    "msg": "Business Failed",
    "sub_code": "duplicate-out_trade_no",
    "sub_msg": "out_trade_no is duplicate"
}
```

{% endtab %}
{% endtabs %}

{% hint style="danger" %}
Use your own `app_id` and generate the corresponding authorization value when testing.
{% endhint %}
