> 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/peru/virtual-account.md).

# Virtual Account

This section describes how to create and query a Virtual Account and receive payment notifications for Peru Virtual Account payments.

Peru Virtual Account payments use `VABankTransfer` as the payment method.

The Virtual Account is created before the payer initiates a transfer. Creating the Virtual Account does not create a fixed-amount payment order. After funds are transferred to the assigned `account_number`, Pagsmile creates the Payin transaction and sends an asynchronous notification to the merchant's `notify_url`.

{% hint style="info" %}
Peru VA BankTransfer supports real-time payment processing.
{% endhint %}

{% hint style="warning" %}
Peru VA BankTransfer does not support refunds.
{% endhint %}

{% hint style="info" %}
Each incoming transfer must be between `1` and `10000.00` PEN.
{% endhint %}

#### Create Virtual Account

Use this endpoint to create a Virtual Account for Peru.

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

**Request Body**

Only the required request parameters are listed below.

<table><thead><tr><th width="220">Parameter</th><th width="100">Type</th><th width="110">Required</th><th>Constraints</th><th>Description</th></tr></thead><tbody><tr><td><code>app_id</code></td><td>string</td><td>Required</td><td>Maximum length: 32 characters.</td><td>The merchant application ID assigned by Pagsmile.</td></tr><tr><td><code>timestamp</code></td><td>string</td><td>Required</td><td>Format: <code>yyyy-MM-dd HH:mm:ss</code>; maximum length: 19 characters.</td><td>Request timestamp.</td></tr><tr><td><code>notify_url</code></td><td>string</td><td>Required</td><td>Must be a valid, publicly accessible URL.</td><td>The URL that receives Virtual Account payment notifications.</td></tr><tr><td><code>region</code></td><td>string</td><td>Required</td><td>Fixed value: <code>PER</code>.</td><td>Country or region code.</td></tr><tr><td><code>method</code></td><td>string</td><td>Required</td><td>Fixed value: <code>VABankTransfer</code>.</td><td>Payment method.</td></tr><tr><td><code>customer</code></td><td>object</td><td>Required</td><td>Must contain all required customer fields listed below.</td><td>Customer information.</td></tr><tr><td><code>customer.username</code></td><td>string</td><td>Required</td><td>Maximum length: 128 characters.</td><td>Customer's full name.</td></tr><tr><td><code>customer.buyer_id</code></td><td>string</td><td>Required</td><td>Maximum length: 128 characters.</td><td>Merchant-side user ID.</td></tr><tr><td><code>customer.email</code></td><td>string</td><td>Required</td><td>Must be a valid email address; maximum length: 64 characters.</td><td>Customer's email address.</td></tr><tr><td><code>customer.phone</code></td><td>string</td><td>Required</td><td>Maximum length: 32 characters.</td><td>Customer's phone number, including the country code.</td></tr><tr><td><code>customer.identify</code></td><td>object</td><td>Required</td><td>Must contain <code>type</code> and <code>number</code>.</td><td>Customer identification information.</td></tr><tr><td><code>customer.identify.type</code></td><td>string</td><td>Required</td><td>One of: <code>DNI</code>, <code>RUC</code>.</td><td>Customer identification type.</td></tr><tr><td><code>customer.identify.number</code></td><td>string</td><td>Required</td><td>Maximum length: 64 characters.</td><td>Customer identification number.</td></tr></tbody></table>

**Request Sample**

```json
{
  "app_id": "16***08",
  "timestamp": "2026-08-24 15:30:00",
  "notify_url": "https://merchant.example.com/pagsmile/notify",
  "region": "PER",
  "method": "VABankTransfer",
  "customer": {
    "username": "Test User Name",
    "buyer_id": "peru-va-test-001",
    "email": "test@example.com",
    "phone": "5198***848",
    "identify": {
      "type": "RUC",
      "number": "502***14727"
    }
  }
}
```

**Response Sample**

```json
{
  "code": "10000",
  "msg": "Success",
  "account_id": "I1***INU",
  "account_number": "921***041",
  "buyer_id": "peru-va-test-001",
  "status": "ACTIVE",
  "notify_url": "https://merchant.example.com/pagsmile/notify",
  "method": "VABankTransfer"
}
```

Save the returned `account_id` and `account_number`. The payer transfers funds to the `account_number` to complete a payment.

#### Query Virtual Account

Use this endpoint to query the Virtual Account information and status.

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

**Request Body**

Only the required request parameters are listed below.

<table><thead><tr><th width="144.1640625">Parameter</th><th width="100">Type</th><th width="110">Required</th><th>Constraints</th><th>Description</th></tr></thead><tbody><tr><td><code>app_id</code></td><td>string</td><td>Required</td><td>Maximum length: 32 characters.</td><td>The merchant application ID assigned by Pagsmile.</td></tr><tr><td><code>timestamp</code></td><td>string</td><td>Required</td><td>Format: <code>yyyy-MM-dd HH:mm:ss</code>; maximum length: 19 characters.</td><td>Request timestamp.</td></tr><tr><td><code>account_id</code></td><td>string</td><td>Required</td><td>Maximum length: 64 characters.</td><td>The Virtual Account ID returned by the Create Virtual Account API.</td></tr></tbody></table>

**Request Sample**

```json
{
  "app_id": "163***108",
  "timestamp": "2025-03-20 11:11:11",
  "account_id": "M3S***EM6"
}
```

**Response Sample**

```json
{
  "code": "10000",
  "msg": "Success",
  "account_id": "M3S***EM6",
  "account_number": "921***041",
  "buyer_id": "peru-va-test-001",
  "status": "ACTIVE",
  "notify_url": "https://merchant.example.com/pagsmile/notify",
  "method": "VABankTransfer"
}
```

{% hint style="info" %}
The Query Virtual Account API returns the Virtual Account information and status. It does not return the result of an incoming transfer. Use the asynchronous notification as the final payment result.
{% endhint %}

#### Notification

After the payer transfers funds to the Virtual Account, Pagsmile sends an asynchronous notification to the merchant's `notify_url`.

**Notification Body**

<table><thead><tr><th width="300">Parameter</th><th width="100">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>amount</code></td><td>string</td><td>Payment amount received.</td></tr><tr><td><code>out_trade_no</code></td><td>string</td><td>Pagsmile-generated transaction reference for the incoming transfer.</td></tr><tr><td><code>method</code></td><td>string</td><td>Payment method. Fixed value: <code>VABankTransfer</code>.</td></tr><tr><td><code>trade_status</code></td><td>string</td><td>Transaction status. Value: <code>SUCCESS</code>.</td></tr><tr><td><code>trade_no</code></td><td>string</td><td>Pagsmile transaction number.</td></tr><tr><td><code>currency</code></td><td>string</td><td>Payment currency. Fixed value: <code>PEN</code>.</td></tr><tr><td><code>app_id</code></td><td>string</td><td>The merchant application ID assigned by Pagsmile.</td></tr><tr><td><code>user.buyer_id</code></td><td>string</td><td>Merchant-side user ID used when creating the Virtual Account.</td></tr><tr><td><code>user.email</code></td><td>string</td><td>Customer email address used when creating the Virtual Account.</td></tr><tr><td><code>user.phone</code></td><td>string</td><td>Customer phone number used when creating the Virtual Account.</td></tr><tr><td><code>user.identification.number</code></td><td>string</td><td>Customer identification number used when creating the Virtual Account.</td></tr><tr><td><code>user.identification.type</code></td><td>string</td><td>Customer identification type used when creating the Virtual Account.</td></tr><tr><td><code>timestamp</code></td><td>string</td><td>Unix timestamp in seconds indicating when the notification was generated.</td></tr><tr><td><code>transfer_account.account_id</code></td><td>string</td><td>Virtual Account ID.</td></tr><tr><td><code>transfer_account.account_number</code></td><td>string</td><td>Virtual Account number.</td></tr></tbody></table>

**Notification Sample**

```json
{
  "amount": "10.00",
  "out_trade_no": "16113d91aa0044048670d*****",
  "method": "VABankTransfer",
  "trade_status": "SUCCESS",
  "trade_no": "202608240001******",
  "currency": "PEN",
  "app_id": "16***08",
  "user": {
    "buyer_id": "peru-va-test-001",
    "email": "test@example.com",
    "phone": "5198***848",
    "identification": {
      "type": "RUC",
      "number": "502***14727"
    }
  },
  "timestamp": "1787556600",
  "transfer_account": {
    "account_id": "I1***INU",
    "account_number": "921***041"
  }
}
```

Use the asynchronous notification as the final payment result. The merchant callback endpoint must return HTTP status `200` with one of the following response bodies:

```
success
```

or

```json
{"result":"success"}
```

Pagsmile includes the following header in the notification:

```
Pagsmile-Signature: t=<unix_timestamp>,v2=<hmac_sha256>
```

Calculate the expected signature by applying HMAC-SHA256 to the original, unmodified Request Body using the merchant SecretKey. Do not parse and reserialize the JSON before signature verification. For more information, see [Notification](https://docs.pagsmile.com/payin/notification).
