For the complete documentation index, see llms.txt. This page is also available as Markdown.

Virtual Account

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

Peru Virtual Account payments use VABankTransfer as the payment method and PEN as the payment currency.

For Peru Virtual Account payments, the Virtual Account is created first. After the payer transfers funds to the assigned account_number, Pagsmile creates the Payin transaction and sends an asynchronous notification to the merchant's notify_url.

Each incoming transfer must be between 1.00 and 10000.00 PEN. Payments are processed in real time.

Create Virtual Account

Use this endpoint to create a Virtual Account for Peru.

POST https://gateway-test.pagsmile.com/virtual-account/create

Request Body

Parameter
Type
Required
Constraints
Description

app_id

string

Required

Maximum length: 32 characters.

The merchant application ID assigned by Pagsmile.

timestamp

string

Required

Format: yyyy-MM-dd HH:mm:ss; maximum length: 19 characters.

Request timestamp.

notify_url

string

Required

Must be a valid, publicly accessible URL.

The URL that receives Virtual Account payment notifications.

region

string

Required

Fixed value: PER.

Country or region code.

method

string

Required

Fixed value: VABankTransfer.

Payment method.

customer.username

string

Required

Must be a non-empty full name.

Customer's full name.

customer.buyer_id

string

Optional

Maximum length: 128 characters.

Merchant-side customer ID associated with the Virtual Account.

customer.email

string

Optional

Maximum length: 64 characters.

Customer's email address.

customer.phone

string

Optional

—

Customer's phone number.

customer.identify.type

string

Optional

Example: DNI. If provided, submit it together with customer.identify.number.

Customer's identification type.

customer.identify.number

string

Optional

Maximum length: 64 characters. If provided, submit it together with customer.identify.type.

Customer's identification number.

Request Sample

Response Sample

After the Virtual Account is created successfully, save the returned account_id and provide the account_number to the payer to complete the bank transfer.

Query Virtual Account

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

POST https://gateway-test.pagsmile.com/virtual-account/query

Request Body

Parameter
Type
Required
Constraints
Description

app_id

string

Required

Maximum length: 32 characters.

The merchant application ID assigned by Pagsmile.

timestamp

string

Required

Format: yyyy-MM-dd HH:mm:ss; maximum length: 19 characters.

Request timestamp.

account_id

string

Required

Maximum length: 64 characters.

The Virtual Account ID returned by the Create Virtual Account API.

Request Sample

Response Sample

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.

Notification

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

Notification Body

Parameter
Type
Description

amount

string

Payment amount received.

out_trade_no

string

Pagsmile-generated transaction reference for the incoming transfer.

method

string

Payment method. Fixed value: VABankTransfer.

trade_status

string

Transaction status. Example: SUCCESS.

trade_no

string

Pagsmile transaction number.

currency

string

Payment currency. Fixed value: PEN.

app_id

string

The merchant application ID assigned by Pagsmile.

user.buyer_id

string

Merchant-side user ID associated with the Virtual Account, when available.

user.email

string

Customer email address, when available.

user.identification.number

string

Customer identification number, when available.

user.identification.type

string

Customer identification type, when available. Example: DNI.

user.identify.number

string

Customer identification number in the legacy identification object, when available.

user.identify.type

string

Customer identification type in the legacy identification object, when available. Example: DNI.

user.ip

string

IP address stored with the customer information.

user.phone

string

Customer phone number, when available.

payer.account.number

string

Payer account number reported by the payment provider.

payer.account.type

string

Payer account type reported by the payment provider. This value may be empty.

payer.identification.number

string

Payer identification number.

payer.identification.type

string

Payer identification type. Example: DNI.

payer.username

string

Payer's full name.

timestamp

string

Unix timestamp in seconds indicating when the notification was generated.

transfer_account.account_id

string

Virtual Account ID.

transfer_account.account_number

string

Virtual Account number.

Notification Sample

Notification Header Sample

Use the asynchronous notification as the final transaction result. The merchant callback endpoint must return HTTP status 200 with the following JSON response body:

Calculate the expected v2 signature by applying HMAC-SHA256 to the original, unmodified notification body using the merchant SecretKey. Do not parse and reserialize the JSON before signature verification. For more information, see Notification.

Last updated