Create Virtual Account



Virtual Account is an artificial account that is not actually real or virtual. Usually in this account there is a customer ID number created by the Bank. Account creation can be done according to company requests for the purpose of making transactions. For each transaction, customers will get an account ID or commonly known as a VA number. Furthermore, each customer is given a unique and different virtual account, and can be arranged as needed

API URL
Development : https://sandbox-api.espay.id/rest/merchantpg/sendinvoice
Production: https://api.espay.id/rest/merchantpg/sendinvoice

The format of the message sent must be in the form of an encoded URL. Information for each field in the HTTP POST message:

Parameter Request

Field Name Attribute Mandatory Information
rq_uuid 64 Yes Request identifier. Unique id to identify this message with other messages
rq_datetime 19 Yes Date and time on the Espay application server when the message was sent
order_id 32 Yes Transaction Number / Invoice Id / unique id that can identify invoices owned by partner customers
amount 17 Yes The total amount of bills to be paid by partner customers with the last 2 digits is the decimal of the payment
ccy 3 Yes Currency code of the bill you want to pay, for example IDR
comm_code 32 Yes The merchant code is registered on the Espay application
remark1 32 No First description. Mandatory can "Yes" follow the scheme. Filled in with Mobile Number
remark2 32 Yes Second description. Filled with name
remark3 32 No Third description. Filled with email address
update 1 Yes Fill in Y if you want to update the data of the order_id that has been registered
Fill in N if you want to register a new order_id
bank_code 3 Yes Bank code that will be used as payment. Example: 008, 016 or etc.
va_expired 20 No To setup the expired time of the VA. (in minutes)
Example: 4000 (meaning it will expire in 4000 minutes)
signature 64 Yes Signature that must be validated by Espay, see this page for details

Then ESPAY conducts an inquiry on the Merchant

Inquiry Request Data

Field Name Attribute Mandatory Information
rq_uuid 64 Yes Request identifier. Unique ID to identify these messages with other messages
rq_datetime 19 Yes Date and time on the Espay application server when the message was sent
member_id 20 No Customer code if registered in the Espay application
comm_code 32 Yes The seller code is registered in the Espay application
order_id 20 Yes Transaction number / invoice ID / unique ID that identifies the order / invoice / invoice
password 32 No The password is used to identify and validate the mechanism by the seller to thoroughly identify requests from the Espay application
signature 64 Yes Signature is required for validation by the seller

After that, the Merchant will respond to the request

Inquiry Response Data

Field Name Attribute Mandatory Information
error_code 4 Yes The seller will provide information about requests based on this field.
0 = Success, the process at the seller has been successful
other = failed, the process at the seller has failed (validation has a problem, the business process is not appropriate, or other problems)
error_message 32 Yes If error_code is equal to 0 = Success
If error_code is not equal to 0, please insert a message or description of the problem in this field
order_id 20 No Transaction number / invoice ID / unique ID that identifies the order / invoice / invoice
amount 13.2 No Amount to be paid by customers
Format: 100000.00
ccy 3 No Transaction currency code. Example: IDR / USD
description 32 No Transaction description
trx_date 19 No Transaction date on seller's server
Format: DD / MM / YYYYhh: mm: ss

After making a request with the example above, the Merchant will get a response. With the following example:

Parameter Response

Field Name Attribute Mandatory Information
rq_uuid 4 Yes Request identifier. Unique id to identify this message with other messages
rs_datetime 32 Yes Date and time on the Espay application server when the message was sent
error_code 4 Yes Error code on the web service, 0000 means success
error_message 32 Yes Error description
va_number 16 Yes Virtual Account Number used by customers to pay.
expired 19 Yes The date and time of the Virtual Account Number will expire.
description 32 Yes Description.
total_amount 17 Yes Total Price of the Merchant + administrative fees.
amount 17 Yes Total Price of the Merchant.
fee 17 Yes administrative costs.
  

Sample Request

POST /rest/merchantpg/sendinvoice HTTP/1.1 Host: sandbox-api.espay.id Connection: keep-alive Content-Type: application/x-www-form-urlencoded Accept: */* rq_uuid=80784df2-accb-46fc-92f4-8d3103b38408 &rq_datetime=2021-10-23 22:51:45 &order_id=21102509019CO9R &amount=754000.00 &ccy=IDR &comm_code=SGWBUKUKUSC &remark1=53620211011190253332 &remark2=TravelAja OTA Web Tiara Iyay &remark3=likesupa@gmail.com &update=N &bank_code=008 &va_expired=10 &signature=e7bb3339e618b6fb8ce3035edc83456813efb962e9f2c2b286e92387615b6f15
  

Sample Inquiry Request

POST /rest/merchantpg/sendinvoice HTTP/1.1 Host: sandbox-api.espay.id Connection: keep-alive Content-Type: application/x-www-form-urlencoded Accept: */* rq_uuid=80784df2-accb-46fc-92f4-8d3103b38408 &rq_datetime=2021-10-23 22:51:45 &member_id=SGWMERCHANT &comm_code=SGWBUKUKUSC &order_id=21102509019CO9R &signature=e7bb3339e618b6fb8ce3035edc83456813efb962e9f2c2b286e92387615b6f15
  

Sample Inquiry Response

{ "error_code": "0000", "error_message": "Success", "order_id" : "21102509019CO9R", "amount" : "754000.00", "ccy" : "IDR", "description" : "notes here", "trx_date" : "23/10/2021 22:51:45" }
  

Sample Response

{ "rq_uuid" : "80784df2-accb-46fc-92f4-8d3103b38408", "rs_datetime" : "2021-10-23 22:51:45", "error_code": "0000", "error_message": "Success", "va_number" : "829306667221345556", "expired" : "2021-11-23 22:51:45", "description" : "notes here", "total_amount" : "756000.00", "amount" : "754000.00", "fee" : "2000.00", }