Payment Method : Bank Transfer

This section will explain how merchants can initiate bank transfer (virtual account) transactions using BI-SNAP-based CoreAPI specification.

Creating bank transfer (virtual account) transaction

Path/{version}/transfer-va/create-va
HTTP MethodPOST
Versionv1.0
SNAP version code27

Request Header

Field Name

Field Type

Mandatory

Field Description

Content-Type

String

M

Media type of the resource, i.e. application/json

X-TIMESTAMP

String

M

Client’s current local time in ISO-8601 format

Authorization

String

M

Represents access_token of a request; string starts with keyword “Bearer ” followed by access_token. Can get this from Access Token B2B API response.

X-SIGNATURE

String

M

Created using symmetric signature HMAC_SHA512 algorithm

X-PARTNER-ID

String

M

Unique identifier for caller (merchant_id)

CHANNEL-ID

String

M

Mandatory field from Bank Indonesia that can take any value with correct format 5 digits numeric string

X-EXTERNAL-ID

String

M

Alphanumeric string. We suggest merchant to use UUID format. The value should be unique. In case of timeout, merchant can do:

  1. Use this value in get status API to get status transaction
  2. Retry this request with the same X-EXTERNAL-ID and request body to avoid creating duplicate transaction

    The value should also be the same as request_body.trxId
Content-type:application/json
X-TIMESTAMP:2020-01-01T00:00:00+07:00
X-SIGNATURE:da1fa417c72d6b91c257e01e54fac824
Authorization:Bearer gp9HjjEj813Y9JGoqwOeOPWbnt4CupvIJbU1Mmu4a11MNDZ7Sg5u9a
X-PARTNER-ID:G12345678
X-EXTERNAL-ID:midtrans-testing-001
CHANNEL-ID:12345

Request Body


Field Name

Field Type

Mandatory

Field Description

partnerServiceId

String(8)

M

This field will be shared by Midtrans during the onboarding process. This will be associated with the bank's company code.
The value should be left-padded with spaces until it’s 8 characters long.

customerNo

String(20)

M

Merchant-defined number. The value will be used to generate the VA number.

virtualAccountNo

String(28)

M

This field will be the combination of partnerServiceId + customerNo

Please refer to the "Custom VA Number" below this section if you're looking to define your own VA number for your customers.

If you want to randomize your VA number, please refer to the additionalInfo.flags.shouldRandomizeVaNumber field

virtualAccountName

String(255)

M

The customer name

virtualAccountEmail

String(255)

O

The customer’s email

virtualAccountPhone

String(30)

O

The customer’s phone number

trxId

String(36)

M

Alphanumeric string. Preferably UUID. Reference number that should be unique across 3 months. This value should be filled with the same value as X-EXTERNAL-ID

totalAmount

Object

M

For Multi-use VA with flexible amount, merchant should fill the totalAmount field with a totalAmount.value of at least 1.00

totalAmount.value

String (16, 2)

M

The numeric string of the amount up to two decimal places

totalAmount.currency

String (3)

M

The currency of the value paid. Should be IDR

expiredDate

String (25)

O

Indicate the deadline the virtual account should be paid at the latest. Beyond the specified time it will be marked as expired.

The default expiry time is 24 hours.

For Multi-use VA, this value will be ignored and the expiry time will always be 6 months after creation for the first payment and indefinite for the next payments

additionalInfo

Object

M

additionalInfo.bank

String

M

Indicates the bank chosen to create the VA at. The banks that can be used will differ based on the banks chosen by the merchant during the onboarding process. Possible values are

  • Permata
  • BCA
  • Mandiri
  • CIMB
  • BNI
  • BRI
  • Danamon
  • BSI

additionalInfo.merchantId

String(10)

M

This will be the merchantId shared during the onboarding process

additionalInfo.subCompanyCode

String

O

This field can be used if the VA being created is BCA. It can filled with BCA’s sub company code value

  • *Note:** Default is 00000.

additionalInfo.freeText

Array of Objects

O

Will be used by the bank to show to the consumer in the bank app

  • *Note:** Right now only used for BCA VA.

additionalInfo.freeText.inquiry

Object

O

Will be used by the bank to show to the consumer at the inquiry process

additionalInfo.freeText.inquiry.english

String

O

English description of the inquiry text

additionalInfo.freeText.inquiry.indonesia

String

O

Bahasa Indonesia version of the inquiry text

additionalInfo.freeText.payment

Object

O

Will be used by the bank to show to the consumer after the payment process

additionalInfo.freeText.payment.english

String

O

English description of the payment text

additionalInfo.freeText.payment.indonesia

String

O

Bahasa Indonesia version of the payment text

additionalInfo.mandiri

Array of Objects

C

Array of Mandiri bill description.
(this will become mandatory , if Mandiri is chosen as the VA method - additionalInfo.bank = "mandiri")

additionalInfo.mandiri.billInfo1

String (10)

C

Label 1. Mandiri allows only 10 characters. Exceeding characters will be truncated.
(this will become mandatory , if Mandiri is chosen as the VA method - additionalInfo.bank = "mandiri")

additionalInfo.mandiri.billInfo2

String (30)

C

Value for Label 1. Mandiri allows only 30 characters. Exceeding characters will be truncated.
(this will become mandatory, if Mandiri is chosen as the VA method - additionalInfo.bank = "mandiri")

additionalInfo.mandiri.billInfo3

String (10)

O

Label 2. Mandiri allows only 10 characters. Exceeding characters will be truncated.

additionalInfo.mandiri.billInfo4

String (30)

O

Value for Label 2. Mandiri allows only 30 characters. Exceeding characters will be truncated.

additionalInfo.mandiri.billInfo5

String (10)

O

Label 3. Mandiri allows only 10 characters. Exceeding characters will be truncated.

additionalInfo.mandiri.billInfo6

String (30)

O

Value for Label 3. Mandiri allows only 30 characters. Exceeding characters will be truncated.

additionalInfo.mandiri.billInfo7

String (10)

O

Label 4. Mandiri allows only 10 characters. Exceeding characters will be truncated.

additionalInfo.mandiri.billInfo8

String (30)

O

Value for Label 4. Mandiri allows only 30 characters. Exceeding characters will be truncated.

additionalInfo.customField

Object

O

A collection of up to three fields that can be customized by the merchant. These fields will be sent by Midtrans on the HTTP notification. It will also be displayed on the Dashboard under “order detail”

additionalInfo.customField.1

String(255)

O

First field that contains the custom data set by the merchant

additionalInfo.customField.2

String(255)

O

Second field that contains the custom data set by the merchant

additionalInfo.customField.3

String(255)

O

Third field that contains the custom data set by the merchant

additionalInfo.customerDetails

Object

O

Customer Detail Information

additionalInfo.customerDetails.phone

String(15)

O

Customer Phone number

additionalInfo.customerDetails.email

String(255)

O

Customer email

additionalInfo.customerDetails.firstName

String(255)

O

Customer First Name
Will be shown to user during inquiry

additionalInfo.customerDetails.lastName

String(255)

O

Customer Last Name
Will be shown to user during inquiry

additionalInfo.customerDetails.billingAddress

Object

O

Customer billing address

additionalInfo.customerDetails.billingAddress.firstName

String(255)

O

Billing address first name

additionalInfo.customerDetails.billingAddress.lastName

String(255)

O

Billing address last name

additionalInfo.customerDetails.billingAddress.phone

String(15)

O

Billing address phone

additionalInfo.customerDetails.billingAddress.address

String(255)

O

Billing address detail

additionalInfo.customerDetails.billingAddress.city

String(255)

O

Billing address city

additionalInfo.customerDetails.billingAddress.postalCode

String(255)

O

Billing address postal code

additionalInfo.customerDetails.billingAddress.countryCode

String(15)

O

Billing address country code

additionalInfo.customerDetails.shippingAddress

Object

O

Customer shipping address

additionalInfo.customerDetails.shippingAddress.firstName

String(255)

O

Shipping address first name

additionalInfo.customerDetails.shippingAddress.lastName

String(255)

O

Shipping address last name

additionalInfo.customerDetails.shippingAddress.phone

String(15)

O

Shipping address phone

additionalInfo.customerDetails.shippingAddress.address

String(255)

O

Shipping address detail

additionalInfo.customerDetails.shippingAddress.city

String(255)

O

Shipping address city

additionalInfo.customerDetails.shippingAddress.postalCode

String(255)

O

Shipping address postal code

additionalInfo.customerDetails.shippingAddress.countryCode

String(15)

O

Shipping address country code
Note: Currently only IDN is supported.

additionalInfo.items

Array of Objects

C

Item Details
Mandatory for Mandiri B2B VA only

additionalInfo.items[x].id

String(32)

O

Item ID

additionalInfo.items[x].price

Object

M

Price of the item in IDR.

additionalInfo.items[x].price.value

String (16,2)

M

The numeric string of the amount up to two decimal places

additionalInfo.items[x].price.currency

String(3)

M

Item Price currency. Should be IDR.

additionalInfo.items[x].quantity

Number

M

Quantity of the item purchased by the customer.

additionalInfo.items[x].name

String(64)

M

Name of the item.

additionalInfo.items[x].merchantName

String(64)

O

Name of the merchant selling the item.

additionalInfo.items[x].brand

String(64)

O

Brand name of the item.

additionalInfo.items[x].category

String(64)

O

Category of the item.

additionalInfo.items[x].url

String(64)

O

HTTP URL of the item in the merchant site

additionalInfo.flags

Object

O

additionalInfo.flags.shouldRandomizeVaNumber

Boolean

O

When this field is set to true, then the VA number suffix (customerNo) will be randomized.

We also suggest to fill customerNo with "0000000000" and virtualAccountNo with partnerServiceId + "0000000000".

If this value is not sent, Midtrans will acknowledge that merchant do not want to randomize the VA number.



🚧

Note: this is an exhaustive list, please read the API specification above on how to use it.


📘

Specific bank requirements

For BCA VA, limit the customer names (first_name and last_name), to only 30 characters.

For BNI VA, phone number format should start with +62 or 0 +[area code] with max char = 30. If passed incorrectly, trx will be rejected.



📘

Custom VA Number

As per mentioned above, this field will be the combination of partnerServiceId + customerNo , there's some rules that needs to be followed if we want to define our own VA number for our customer :

General Rules

  • Only digits are allowed.
  • Different banks have different specs on their custom VA numbers. (Please refer to the "Additional Rules" below this section)
  • If the number provided is already utilized for another order, then a different unique number will be used instead.
  • If the number provided is longer than the maximum character (MaxChar), then the unnecessary digits in the end will be trimmed.
  • If the number provided is shorter than the minimum character (MinChar), then customerNo will be prefixed with zeros.

Additional Rules

These additional rules need to be implemented because each bank have their own accepted format and some of them have unique logic that we need to follow, so the VA number that we create could be accepted by the respective banks.

  • CIMB : MaxChar = 16 ; MinChar = 16
  • BCA : MaxChar = 23 ; MinChar = partnerServiceId + 6
  • BRI : MaxChar = 18 ; MinChar = 18
  • Mandiri : MaxChar = partnerServiceId + 12 ; MinChar = partnerServiceId + 6
  • Permata : MaxChar = 16 ; MinChar = 16 ; partnerServiceId will always be suffixed with 2 random char sequence number.
  • Danamon : MaxChar = partnerServiceId + 12 ; MinChar = partnerServiceId + 12
  • BSI: MaxChar = partnerServiceId + 12 ; MinChar = partnerServiceId + 12

BNI VA Unique rules

For BNI, partnerServiceId will be altered first, and then MinChar & MaxChar logic will be adjusted using the result of altered partnerServiceId

If partnerServiceId == 3 char, partnerServiceId will prefixed by "8", other than that, it'll be prefixed with "988"

For

Prefix = "8" , then MaxChar = partnerServiceId + 12 ; MinChar = partnerServiceId + 12

Prefix = "988" , then MaxChar = parterServiceId + 8 ; MinChar = partnerServiceId + 8

*When you see MaxChar having an equals value with MinChar, that means any exceeding number will be trimmed, and any deficient number will be left padded with 0.

{
    "partnerServiceId": "   70012",
    "customerNo": "6280123456",
    "virtualAccountNo": "   700126280123456",
    "virtualAccountName": "Jokul Doe",
    "virtualAccountEmail": "[email protected]",
    "virtualAccountPhone": "6281828384858",
    "trxId": "midtrans-testing-001",
    "totalAmount": {
        "value": "10000.00",
        "currency": "IDR"
    },
    "additionalInfo": {
        "merchantId": "G059876677",
        "bank": "mandiri",
        "flags": {
                "shouldRandomizeVaNumber": false
            },
        "mandiri": {
            "billInfo1": "bank_name",
            "billInfo2": "mandiri",
            "billInfo3": "Name:",
            "billInfo4": "Budi Utomo",
            "billInfo5": "Class:",
            "billInfo6": "Computer Science",
            "billInfo7": "ID:",
            "billInfo8": "VT-12345"
        },
        "customerDetails": {
            "firstName": "Jokul",
            "lastName": "Doe",
            "email": "[email protected]",
            "phone": "+6281828384858",
            "billingAddress": {
                "firstName": "Jukul",
                "lastName": "Doe",
                "address": "Kalibata",
                "city": "Jakarta",
                "postalCode": "12190",
                "phone": "+6281828384858",
                "countryCode": "IDN"
            },
            "shippingAddress": {
                "firstName": "Jukul",
                "lastName": "Doe",
                "address": "Kalibata",
                "city": "Jakarta",
                "postalCode": "12190",
                "phone": "+6281828384858",
                "countryCode": "IDN"
            }
        },
        "customField": {
            "1": "custom-field-1",
            "2": "custom-field-2",
            "3": "custom-field-3"
        },
        "items": [
            {
                "id": "a1",
                "price": {
                    "value": "1000.00",
                    "currency": "IDR"
                },
                "quantity": 3,
                "name": "Apel",
                "brand": "Fuji Apple",
                "category": "Fruit",
                "merchantName": "Fruit-store"

            },
            {
                "id": "a2",
                "price": {
                    "value": "1000.00",
                    "currency": "IDR"
                },
                "quantity": 7,
                "name": "Apel Malang",
                "brand": "Fuji Apple",
                "category": "Fruit",
                "merchantName": "Fruit-store"
            }
        ]
    }
}

Response Header

Field NameField TypeMandatoryField Description
Content-TypeStringMMedia type of the resource, i.e application/json
X-TIMESTAMPStringMClient's current local time in ISO-8601
Content-type:application/json
X-TIMESTAMP:2020-01-01T00:00:00+07:00

Response Body

Field NameField TypeMandatoryField Description
responseCodeString(7)MStatus code of transaction charge result.
responseMessageString(150)MDescription of transaction charge result.
virtualAccountDataMObject
virtualAccountData.partnerServiceIdMString(8)Company code - will be shared by Midtrans during the onboarding process. Will be left-padded up to 8 characters long
virtualAccountData.customerNoMString(20)Suffix of the VA number. The value will either be randomized or contains the customerNo sent in the request as a substring. Maximum length depends on the bank.
virtualAccountData.virtualAccountNoMString(28)Number generated using the partnerServiceId and the given customerNo in the request.
Note: The VA number generated will not always be the request.partnerServiceid + request.customerNo. Please use this field as the source of truth for VA number.
virtualAccountData.virtualAccountNameMString (255)The customer name
virtualAccountData.virtualAccountEmailString(255)OThe customer’s email
virtualAccountData.virtualAccountPhoneString(30)OThe customer's phone number
virtualAccountData.trxIdString(36)MThe identifier for the merchant to use for inquiryRequestId in Inquiry Status API.
This value will be the same as the request's trxId and X-EXTERNAL-ID
virtualAccountData.totalAmountOObject
virtualAccountData.totalAmount.valueMString (16,2)Total Amount up to 2 decimal places based with ISO 4217 format
virtualAccountData.totalAmount.currencyMString(3)Currency of amount based on ISO 4217
virtualAccountData.expiredDateOString(25)ISO 8601 Datetime when the VA will be expired if not paid
Notes: Multi Use VA will not have this field
additionalInfoObjectM
additionalInfo.bankStringMIndicates the bank chosen to create the VA at. The banks that can be used will differ based on the banks chosen by the merchant during the onboarding process. Possible values are: Permata, BCA, Mandiri, CIMB, BNI, BRI, Danamon
additionalInfo.merchantIdString(10)MThis will be the merchantId shared during the onboarding process
additionalInfo.subCompanyCodeStringOThis field can be used if the VA being created is BCA. It can filled with BCA's sub company code value
additionalInfo.freeTextArray of ObjectsOWill be used by the bank to show to the consumer in the bank app
additionalInfo.freeText[x].inquiryObjectOWill be used by the bank to show to the consumer after the inquiry process
additionalInfo.freeText[x].inquiry.englishStringOEnglish description of the inquiry text
additionalInfo.freeText[x].inquiry.indonesiaStringOBahasa Indonesia version of the inquiry text
additionalInfo.freeText[x].paymentObjectOWill be used by the bank to show to the consumer after the payment process
additionalInfo.freeText[x].payment.englishStringOEnglish description of the payment text
additionalInfo.freeText[x].payment.indonesiaStringOBahasa Indonesia version of the payment text
additionalInfo.mandiriObjectOArray of Mandiri bill description
additionalInfo.mandiri.billInfo1StringOLabel 1. Mandiri allows only 10 characters. Exceeding characters will be truncated.
additionalInfo.mandiri.billInfo2StringOValue for Label 1. Mandiri allows only 30 characters. Exceeding characters will be truncated.
additionalInfo.mandiri.billInfo3StringOLabel 2. Mandiri allows only 10 characters. Exceeding characters will be truncated.
additionalInfo.mandiri.billInfo4StringOValue for Label 2. Mandiri allows only 30 characters. Exceeding characters will be truncated.
additionalInfo.mandiri.billInfo5StringOLabel 3. Mandiri allows only 10 characters. Exceeding characters will be truncated.
additionalInfo.mandiri.billInfo6StringOValue for Label 3. Mandiri allows only 30 characters. Exceeding characters will be truncated.
additionalInfo.mandiri.billInfo7StringOLabel 4. Mandiri allows only 10 characters. Exceeding characters will be truncated.
additionalInfo.mandiri.billInfo8StringOValue for Label 4. Mandiri allows only 30 characters. Exceeding characters will be truncated.
additionalInfo.customerDetailsObjectOCustomer Detail Information
additionalInfo.customerDetails.phoneString(15)OCustomer Phone number
additionalInfo.customerDetails.emailString(255)OCustomer email
additionalInfo.customerDetails.firstNameString(255)OCustomer First Name
additionalInfo.customerDetails.lastNameString(255)OCustomer Last Name
additionalInfo.customerDetails.billingAddressObjectOCustomer billing address
additionalInfo.customerDetails.billingAddress.firstNameString(255)OBilling address first name
additionalInfo.customerDetails.billingAddress.lastNameString(255)OBilling address last name
additionalInfo.customerDetails.billingAddress.phoneString(15)OBilling address phone
additionalInfo.customerDetails.billingAddress.addressString(255)OBilling address detail
additionalInfo.customerDetails.billingAddress.cityString(255)OBilling address city
additionalInfo.customerDetails.billingAddress.postalCodeString(255)OBilling address postal code
additionalInfo.customerDetails.billingAddress.countryCodeString(15)OBilling address country code
additionalInfo.customerDetails.shippingAddressObjectOCustomer shipping address
additionalInfo.customerDetails.shippingAddress.firstNameString(255)OShipping address first name
additionalInfo.customerDetails.shippingAddress.lastNameString(255)OShipping address last name
additionalInfo.customerDetails.shippingAddress.phoneString(15)OShipping address phone
additionalInfo.customerDetails.shippingAddress.addressString(255)OShipping address detail
additionalInfo.customerDetails.shippingAddress.cityString(255)OShipping address city
additionalInfo.customerDetails.shippingAddress.postalCodeString(255)OShipping address postal code
additionalInfo.customerDetails.shippingAddress.countryCodeString(15)OShipping address country code
additionalInfo.itemsArray Of ObjectOItem Details
additionalInfo.items[x].idString(32)OItem ID
additionalInfo.items[x].priceObjectMPrice of the item in IDR.
additionalInfo.items[x].price.valueString (ISO4217)MItem Price value
additionalInfo.items[x].price.currencyString(3)MItem Price currency
additionalInfo.items[x].quantityString(16)MQuantity of the item purchased by the customer.
additionalInfo.items[x].nameString(64)OName of the item.
additionalInfo.items[x].merchantNameString(64)OName of the merchant selling the item.
additionalInfo.items[x].brandString(64)OBrand name of the item.
additionalInfo.items[x].categoryString(64)OCategory of the item.
additionalInfo.items[x].urlString(64)OHTTP URL of the item in the merchant site
{
    "responseMessage": "Successful",
    "virtualAccountData": {
        "partnerServiceId": "   70012",
        "customerNo": "6280123456",
        "virtualAccountNo": "   700126280123456",
        "expiredDate": "2024-01-27T14:04:54+07:00",
        "virtualAccountEmail": "[email protected]",
        "totalAmount": {
            "value": "10000.00",
            "currency": "IDR"
        },
        "virtualAccountPhone": "6281828384858",
        "additionalInfo": {
            "merchantId": "G059876677",
            "bank": "mandiri",
            "mandiri": {
                "billInfo1": "bank_name",
                "billInfo2": "mandiri",
                "billInfo3": "Name:",
                "billInfo4": "Budi Utomo",
                "billInfo5": "Class:",
                "billInfo6": "Computer Science",
                "billInfo7": "ID:",
                "billInfo8": "VT-12345"
            },
            "customerDetails": {
                "firstName": "Jokul",
                "lastName": "Doe",
                "email": "[email protected]",
                "phone": "+6281828384858",
                "billingAddress": {
                    "firstName": "Jukul",
                    "lastName": "Doe",
                    "address": "Kalibata",
                    "city": "Jakarta",
                    "postalCode": "12190",
                    "phone": "+6281828384858",
                    "countryCode": "IDN"
                },
                "shippingAddress": {
                    "firstName": "Jukul",
                    "lastName": "Doe",
                    "address": "Kalibata",
                    "city": "Jakarta",
                    "postalCode": "12190",
                    "phone": "+6281828384858",
                    "countryCode": "IDN"
                }
            },
            "customField": {
                "1": "custom-field-1",
                "2": "custom-field-2",
                "3": "custom-field-3"
            },
            "items": [
                {
                    "id": "a1",
                    "price": {
                        "value": "1000.00",
                        "currency": "IDR"
                    },
                    "quantity": 3,
                    "name": "Apel",
                    "brand": "Fuji Apple",
                    "category": "Fruit",
                    "merchantName": "Fruit-store",
                    "url": "https://www.google.com/search?q=apel"
                },
                {
                    "id": "a2",
                    "price": {
                        "value": "1000.00",
                        "currency": "IDR"
                    },
                    "quantity": 7,
                    "name": "Apel Malang",
                    "brand": "Fuji Apple",
                    "category": "Fruit",
                    "merchantName": "Fruit-store",
                    "url": "https://www.google.com/search?q=apel-malang"
                }
            ]
        },
        "virtualAccountName": "Jokul Doe",
        "trxId": "midtrans-testing-001"
    },
    "responseCode": "2002700"
}

List Response Code

Response CodeHTTP Status CodeResponse Message
2002700200Success
4012700401Unauthorized. Signature
5002700500Internal Server Error
4002700400Bad Request
4042713404Transaction Not Found
4002601400Invalid Field Format X-TIMESTAMP
4092700409Conflict


Inquiry Status - Single Use VA

Path/{version}/transfer-va/status
HTTP MethodPOST
Versionv1.0
SNAP version code26

Request Header

Field Name

Field Type

Mandatory

Field Description

Content-Type

String

M

Media type of the resource, i.e. application/json

X-TIMESTAMP

String

M

Client’s current local time in ISO-8601 format

Authorization

String

M

Represents access_token of a request; string starts with keyword “Bearer ” followed by access_token. Can get this from Access Token B2B API response.

X-SIGNATURE

String

M

Created using symmetric signature HMAC_SHA512 algorithm

X-PARTNER-ID

String

M

Unique identifier for caller (merchant_id)

CHANNEL-ID

String

M

Mandatory field from Bank Indonesia that can take any value with correct format 5 digits numeric string

X-EXTERNAL-ID

String

M

Alphanumeric string. Preferably UUID. Reference number that should be unique across 3 months. The value should also be the same as request_body.trxId

  • *It’s recommended that the merchant appends the said value with their client_id** (client_key)
Content-type:application/json
X-TIMESTAMP:2020-01-01T00:00:00+07:00
X-SIGNATURE:da1fa417c72d6b91c257e01e54fac824
Authorization:Bearer gp9HjjEj813Y9JGoqwOeOPWbnt4CupvIJbU1Mmu4a11MNDZ7Sg5u9a
X-PARTNER-ID:G12345678
X-EXTERNAL-ID:midtrans-testing-001
CHANNEL-ID:12345

Request Body

Field NameField TypeMandatoryField Description
partnerServiceIdMString(8)partnerServiceId from Create VA Response
customerNoMString(20)customerNo from Create VA Response
virtualAccountNoMString(28)virtualAccountNo from Create VA Response
inquiryRequestIdMString(128)The trxId from createVA response.
additionalInfoObject
additionalInfo.merchantIdString(10)MThis is the merchantId shared by Midtrans during the onboarding process
{
   "inquiryRequestId": "midtrans-testing-001",
   "partnerServiceId": "   70012",
   "customerNo": "6280123456",
   "virtualAccountNo": "   700126280123456",
   "additionalInfo": {
       "merchantId": "G059876677"
   }
}

Response Header

Field NameField TypeMandatoryField Description
Content-TypeStringMMedia type of the resource, i.e application/json
X-TIMESTAMPStringMClient's current local time in ISO-8601
Content-type:application/json
X-TIMESTAMP:2020-01-01T00:00:00+07:00

Response Body

Field NameField TypeMandatoryField Description
responseCodeString(7)MStatus code of transaction charge result.
responseMessageString(150)MDescription of transaction charge result.
virtualAccountDataMObject
virtualAccountData.paymentFlagReasonOObject
virtualAccountData.paymentFlagReason.englishOString(200)Reason for Payment Status in English
virtualAccountData.partnerServiceIdMString(8)customerNo from Create VA Response
virtualAccountData.customerNoMString(20)virtualAccountNo from Create VA Response
virtualAccountData.virtualAccountNoMString(28)The trxId from createVA response
virtualAccountData.inquiryRequestIdMString(128)Identifier to be used for performing inquiry
This will be the same value as the request.inquiryRequestId
virtualAccountData.paymentRequestIdCString(128)Unique identifier for this Payment from Midtrans.
This value will exist if the payment has been completed
virtualAccountData.totalAmountOObject
virtualAccountData.totalAmount.valueMString (16,2)Total Amount up to 2 decimal places based with ISO 4217 format
virtualAccountData.totalAmount.currencyMString(3)Currency of amount based on ISO 4217
virtualAccountData.trxDateTimeODate(25)ISO-8601 datetime in GMT+7 when the VA is created
virtualAccountData.transactionDateODate(25)ISO-8601 datetime in GMT+7 when the VA was paid
This field will exist if the VA has been paid
virtualAccountData.paymentFlagStatusOString(2)Status for Payment Flag
00 - Success
03 - Pending
05 - Canceled
08 - Expired
virtualAccountData.paymentFlagReasonOObjectContains explanation for the payment flag status in different languages
virtualAccountData.paymentFlagReason.englishOStringExplanation for payment flag status in English
additionalInfoOObject
additionalInfo.merchantIdMString (10)This is the merchantId shared by Midtrans during the onboarding process
{
    "additionalInfo": {
        "merchantId": "G059876677"
    },
    "responseMessage": "Successful",
    "virtualAccountData": {
        "partnerServiceId": "   70012",
        "customerNo": "6280123456",
        "virtualAccountNo": "   700126280123456",
        "totalAmount": {
            "currency": "IDR",
            "value": "10000.00"
        },
        "paymentFlagReason": {
            "english": "settlement"
        },
        "paymentFlagStatus": "00",
        "trxDateTime": "2024-04-19T15:18:13+07:00",
        "transactionDate": "2024-04-19T15:19:09+07:00",
        "inquiryRequestId": "midtrans-testing-001",
        "paymentRequestId": "A120240419081813bceyKQUK3iID"
    },
    "responseCode": "2002600"
}

List Response Code

Response CodeHTTP Status CodeResponse Message
2002600200Success
4012600401Unauthorized. Signature
4012600401Unauthorized. Merchant does not have access
4042601404Transaction Not Found
4002602400Invalid Mandatory Field
5002600500Internal Server Error


Inquiry Status - Multi Use VA

Path/{version}/transfer-va/status
HTTP MethodPOST
Versionv1.0
SNAP version code26

Request Header

Field Name

Field Type

Mandatory

Field Description

Content-Type

String

M

Media type of the resource, i.e. application/json

X-TIMESTAMP

String

M

Client’s current local time in ISO-8601 format

Authorization

String

M

Represents access_token of a request; string starts with keyword “Bearer ” followed by access_token. Can get this from Access Token B2B API response.

X-SIGNATURE

String

M

Created using symmetric signature HMAC_SHA512 algorithm

X-PARTNER-ID

String

M

Unique identifier for caller (merchant_id)

CHANNEL-ID

String

M

Mandatory field from Bank Indonesia that can take any value with correct format 5 digits numeric string

X-EXTERNAL-ID

String

M

Alphanumeric string. Preferably UUID. Reference number that should be unique across 3 months. The value should also be the same as request_body.trxId

  • *It’s recommended that the merchant appends the said value with their client_id** (client_key)
Content-type:application/json
X-TIMESTAMP:2020-01-01T00:00:00+07:00
X-SIGNATURE:da1fa417c72d6b91c257e01e54fac824
Authorization:Bearer gp9HjjEj813Y9JGoqwOeOPWbnt4CupvIJbU1Mmu4a11MNDZ7Sg5u9a
X-PARTNER-ID:G12345678
X-EXTERNAL-ID:midtrans-testing-001
CHANNEL-ID:12345

Request Body

partnerServiceIdString(8)MpartnerServiceId from Create VA Response
customerNoString(20)McustomerNo from Create VA Response
virtualAccountNoString(28)MvirtualAccountNo from Create VA Response
inquiryRequestIdString(128)MThe trxId from createVA response.
additionalInfoObject
additionalInfo.merchantIdString(10)MThis is the merchantId shared by Midtrans during the onboarding process
additionalInfo.pageStringOIndex of the search. Default is 0. Min page is 0.
additionalInfo.pageSizeStringONumber of transactions displayed per page. Default is 10. Max page_size is 15. Min page_size is 1.
Example : Merchant has five transactions created under a certain order_id. The transactions are A, B, C, D, E, F (ordered to the latest).
Below are the examples on how merchants can use page and pageSize parameters.
pageSize is not set, page is not set: Merchant gets F, E, D, C, B, A
pageSize is set 2, page is not set: Merchant gets F, E
pageSize is set 2, page is set 1: Merchant gets D, C
pageSize is set 3, page is set 1: Merchant gets C, B, A
{
   "inquiryRequestId": "midtrans-testing-001",
   "partnerServiceId": "   70012",
   "customerNo": "6280123456",
   "virtualAccountNo": "   700126280123456",
   "additionalInfo": {
       "merchantId": "G059876677",
       "page": "0",
       "pageSize": "2"
   }
}

Response Body

Field NameField TypeMandatoryField Description
responseCodeString(7)MStatus code of transaction charge result.
responseMessageString(150)MDescription of transaction charge result.
virtualAccountDataObjectM
virtualAccountData.partnerServiceIdString(8)MDerivative of X- PARTNER- ID, similar to company code, 8 digit left padding space.
virtualAccountData.customerNoString(20)MUnique number (up to 20 digits).
virtualAccountData.virtualAccountNoString(28)MpartnerServiceId (8 digit left padding 0) + customerNo (up to 20 digits).
virtualAccountData.inquiryRequestIdString(128)MtrxId sent in Create VA
additionalInfo
additionalInfo.merchantIdStringMThis is the merchantId shared by Midtrans during the onboarding process
additionalInfo.recurringPaymentDetailObjectO
additionalInfo.recurringPaymentDetail.recurringOrdersArray of ObjectsMAll payments related to the parent order trxId
additionalInfo.recurringPaymentDetail.recurringOrders[0].totalAmountObjectM
additionalInfo.recurringPaymentDetail.recurringOrders[0].totalAmount.valueString(ISO 4217) (16,2)MTotal Amount with 2 decimal
additionalInfo.recurringPaymentDetail.recurringOrders[0].totalAmount.currencyString(3)MCurrency of amount based on ISO 4217
additionalInfo.recurringPaymentDetail.recurringOrders[0].paymentFlagReasonObjectM
additionalInfo.recurringPaymentDetail.recurringOrders[0].paymentFlagReason.englishStringMReason for Payment Status in English
additionalInfo.recurringPaymentDetail.recurringOrders[0].paymentRequestIdStringMMidtrans order id
additionalInfo.recurringPaymentDetail.recurringOrders[0].paymentFlagStatusStringMStatus for Payment Flag
00 - Success
03 - Pending
05 - Canceled
08 - Expired
additionalInfo.recurringPaymentDetail.recurringOrders[0].trxDateTimeStringMDatetime when the order created in GMT+7. ISO-8601
additionalInfo.recurringPaymentDetail.recurringOrders[0].transactionDateStringMDatetime when the payment happened in GMT+7. ISO-8601
additionalInfo.recurringPaymentDetail.recurringOrders[0].trxIdStringMtrxId, appended with randomly generated identifier for second payment and so on
Sample first payment: merchant_order_id
Sample: merchant_order_id-030424072903549oVvY
additionalInfo.recurringPaymentDetail.paginationMetadataObjectMPagination of the orders
additionalInfo.recurringPaymentDetail.paginationMetadata.totalStringMTotal orders related to the trxId
additionalInfo.recurringPaymentDetail.paginationMetadata.pageSizeStringMNumber of transactions displayed per page.
additionalInfo.recurringPaymentDetail.paginationMetadata.pageStringMIndex of the search.
{
    "responseCode": "2002600",
    "responseMessage": "Successful"
    "virtualAccountData": {
        "partnerServiceId": "   70012",
        "customerNo": "6280123456",
        "virtualAccountNo": "   700126280123456"
    },
    "additionalInfo": {
        "merchantId": "G12345463",
        "recurringPaymentDetail": {
            "recurringOrders": [
                {
                    "totalAmount": {
                        "currency": "IDR",
                        "value": "150000.00"
                    },
                    "paymentFlagReason": {
                        "english": "settlement"
                    },
                    "paymentRequestId": "A120240403072903E6HgHZoE3bID",
                    "paymentFlagStatus": "00",
                    "trxDateTime": "2024-04-03T14:29:03+07:00",
                    "transactionDate": "2024-04-03T14:29:03+07:00",
                    "trxId": "midtrans-testing-001-030424072903549oVvY"
                },
                {
                    "totalAmount": {
                        "currency": "IDR",
                        "value": "5000.00"
                    },
                    "paymentFlagReason": {
                        "english": "settlement"
                    },
                    "paymentRequestId": "A120240403072821jJ3pwMIFEyID",
                    "paymentFlagStatus": "00",
                    "trxDateTime": "2024-04-03T14:28:21+07:00",
                    "transactionDate": "2024-04-03T14:28:49+07:00",
                    "trxId": "midtrans-testing-001"
                }
            ],
            "paginationMetadata": {
                "total": "4",
                "pageSize": "2",
                "page": "1"
            }
        }
    }


Delete VA

Path/{version}/transfer-va/delete-va
HTTP MethodPOST
Versionv1.0
SNAP version code31

Request Header

Field NameField TypeMandatoryField Description
Content-TypeStringMMedia type of the resource, i.e. application/json
X-TIMESTAMPStringMClient’s current local time in ISO-8601 format
AuthorizationStringMRepresents access_token of a request; string starts with keyword “Bearer ” followed by access_token. Can get this from Access Token B2B API response.
X-SIGNATUREStringMCreated using symmetric signature HMAC_SHA512 algorithm
X-PARTNER-IDStringMUnique identifier for caller (merchant_id)
CHANNEL-IDStringMMandatory field from Bank Indonesia that can take any value with correct format 5 digits numeric string
X-EXTERNAL-IDStringMAlphanumeric string. Preferably UUID. Reference number that should be unique across 3 months
Content-type:application/json
X-TIMESTAMP:2020-01-01T00:00:00+07:00
X-SIGNATURE:da1fa417c72d6b91c257e01e54fac824
Authorization:Bearer gp9HjjEj813Y9JGoqwOeOPWbnt4CupvIJbU1Mmu4a11MNDZ7Sg5u9a
X-PARTNER-ID:G12345678
X-EXTERNAL-ID:12345678901234567890
CHANNEL-ID:12345

Request Body

Field NameField TypeMandatoryField Description
partnerServiceIdString(8)MpartnerServiceId from Create VA Response
customerNoString(20)McustomerNo from Create VA Response
virtualAccountNoString(28)MvirtualAccountNo from Create VA Response
trxIdString(64)MThis value will be the trxId used in the create VA request.
additionalInfoObjectO
additionalInfo.merchantIdString(10)MThis is the merchantId shared by Midtrans during the onboarding process
{
    "partnerServiceId": "   70012",
    "customerNo": "6280123456",
    "virtualAccountNo": "   700126280123456",
    "trxId": "midtrans-testing-001",
    "additionalInfo": {
        "merchantId": "G059876677"
    }
}

Response Header

Field NameField TypeMandatoryField Description
Content-TypeStringMMedia type of the resource, i.e application/json
X-TIMESTAMPStringMClient's current local time in ISO-8601
Content-type:application/json
X-TIMESTAMP:2020-01-01T00:00:00+07:00

Response Body

Field NameField TypeMandatoryField Description
responseCodeString(7)MResponse code
responseMessageString(150)MResponse description
virtualAccountDataObjectM
virtualAccountData.partnerServiceIdString(8)MpartnerServiceId from Create VA Response
virtualAccountData.customerNoString(29)McustomerNo from Create VA Response
virtualAccountData.virtualAccountNoString (28)MvirtualAccountNo from Create VA Response
virtualAccountData.trxIdString(64)MThe identifier used by the merchant during create VA. This will be the same as the trxId in the create VA process
additionalInfo.merchantIdString(10)MThis is the merchantId shared by Midtrans during the onboarding process
{
    "responseMessage": "Successful",
    "virtualAccountData": {
        "partnerServiceId": "   70012",
        "customerNo": "6280123456",
        "virtualAccountNo": "   700126280123456",
        "additionalInfo": {
            "merchantId": "G059876677"
        },
        "trxId": "midtrans-testing-001"
    },
    "responseCode": "2003100"
}

List Response Code

Response CodeHTTP Status CodeResponse Message
2003100200Success
4003102400Invalid Mandatory Field
4013101401Unauthorized
5003101500Internal Server Error
5042700504Timeout

Additional APIs

  1. Get transaction status API
  2. Cancel API