The steps to integrate with Permata Virtual Account are given below.
- Send the charge API request to Midtrans.
- Display the virtual account number.
- Handle notifications.
Send a Charge API request with the details of the transaction such as payment_type
, transaction_details
, bank_transfer
, item_details
, and customer_details
. Successful request returns a VA number.
By default, default expiry time for bank transfer is 24 hours unless specified by merchant (min 20s, max 180 days).
Sometimes, because of a reversal triggered by the corresponding payment provider, the transaction status can change from
SETTLEMENT
toDENY
. It may happen within the span of one minute.
Permata Charge API Request
{
"payment_type": "bank_transfer",
"bank_transfer": {
"bank": "permata",
"permata": {
"recipient_name": "SUDARSONO"
}
},
"transaction_details": {
"order_id": "H17550",
"gross_amount": 145000
}
}
JSON Attribute | Description | Type | Required |
---|---|---|---|
payment_type | Set Bank Transfer payment method. Value: bank_transfer . | String | Required |
bank_transfer | Charge details using bank transfer. | Object | Required |
transaction_details | The details of the specific transaction such as order_id and gross_amount . | Object | Required |
item_details | Details of the item(s) purchased by the customer. | Object | Optional |
customer_details | Details of the customer. | Object | Optional |
Permata Virtual Account Response and Notifications
{
"status_code": "201",
"status_message": "Success, PERMATA VA transaction is successful",
"transaction_id": "6fd88567-62da-43ff-8fe6-5717e430ffc7",
"order_id": "H17550",
"gross_amount": "145000.00",
"payment_type": "bank_transfer",
"transaction_time": "2016-06-19 13:42:29",
"transaction_status": "pending",
"fraud_status": "accept",
"permata_va_number": "8562000087926752",
"expiry_time": "2017-01-09 09:56:44"
}
{
"status_code": "201",
"status_message": "midtrans payment notification",
"transaction_id": "6fd88567-62da-43ff-8fe6-5717e430ffc7",
"order_id": "H17550",
"gross_amount": "145000.00",
"payment_type": "bank_transfer",
"transaction_time": "2016-06-19 13:42:29",
"transaction_status": "pending",
"fraud_status": "accept",
"permata_va_number": "8562000087926752",
"signature_key": "66aa11a65b18e9ee5da966ed18d5d2163812000eee37824ceb59aba1ded005e992e05a7dfac39098ebdb0e2c8b484e140b586246d34b4ca313c690cc6eae48cf",
"expiry_time": "2017-01-09 09:56:44"
}
{
"status_code": "200",
"status_message": "midtrans payment notification",
"transaction_id": "6fd88567-62da-43ff-8fe6-5717e430ffc7",
"order_id": "H17550",
"gross_amount": "145000.00",
"payment_type": "bank_transfer",
"transaction_time": "2016-06-19 18:23:21",
"transaction_status": "settlement",
"fraud_status": "accept",
"permata_va_number": "8562000087926752",
"signature_key": "0c0df82489931602577d9e434966c0540249b7c0aeaae2b718305af89a11e2bf9b4008aba07d1b3b248b15b4fbecdd15e81dbb2648b974efc4e0656e8c976094",
"expiry_time": "2017-01-09 09:56:44"
}
{
"status_code": "202",
"status_message": "midtrans payment notification",
"transaction_id": "6fd88567-62da-43ff-8fe6-5717e430ffc7",
"order_id": "H17550",
"gross_amount": "145000.00",
"payment_type": "bank_transfer",
"transaction_time": "2016-06-20 13:42:30",
"transaction_status": "expire",
"fraud_status": "accept",
"permata_va_number": "8562000087926752",
"signature_key": "f1066b06ec8a4b7d6ffb941fd9772f6df304618e15e02cf17c2914cec12793e19c71653042f7f617b027eae6ecb6759529c67eca9af55264b736408d8b4df2b9",
"expiry_time": "2017-01-09 09:56:44"
}
JSON Attribute | Description | Type |
---|---|---|
status_code | Status code of transaction charge result. | String |
status_message | Description of transaction charge result. | String |
transaction_id | Transaction ID given by Midtrans. | String |
order_id | Order ID specified by you. | String |
gross_amount | Total amount of transaction in IDR. | String |
payment_type | Transaction payment method. | String |
transaction_time | Timestamp of transaction in ISO 8601 format. Time Zone: GMT+7. | String |
transaction_status | Status of bank transfer transaction. Value:pending : Bank Transfer transaction is created. | String |
fraud_status | Detection result by Fraud Detection System (FDS). Value:accept : Approved by FDS. | String |
permata_va_number | Virtual Account number generated by Midtrans. Customer has to know this number to complete the payment. | String |
signature_key | Combination of parameters such as order_id , status_code , gross_amount , server_key to verify integrity of payload/response. | String |
Note
Possible error codes are 400, 401, 402, 406, 410