External Account Inquiry

This section will explain how merchants can initiate external account inquiry using SNAP specification.

ServiceCodeMethodURLDescription
16POST/{version}/account-inquiry-externalAPI External Account Inquiry

Request

Header

The following table is a header of request parameter:

Field NameAttrib.DatatypeDescription
Content-TypeMStringRepresent media type of request e.g “application/json”
AuthorizationMBearer token obtained from Access Token API in the format Bearer
X-TIMESTAMPMString(25)Client's current local time in “yyyy-MM-ddTHH:mm:ssTZD” format
X-SIGNATUREMSee General API Symmetric Signature
X-PARTNER-IDMSee Credential Exchange
X-EXTERNAL-IDMString(max 36), NumericUnique request reference number from partner. Must be unique.
CHANNEL-IDMSee Credential Exchange

Body

The following table is a body of request parameter:

Field NameAttrib.DatatypeDescription
beneficiaryBankCodeMString(8)3 digit BI Bank Code + 4 digit BI Branch Code for the beneficiary bank
beneficiaryAccountNoMString(20)Beneficiary account number

Response

Header

The following table is a header of response parameter:

Field NameAttrib.DatatypeDescription
X-TIMESTAMPMString(25)“yyyy-MM-ddTHH:mm:ssTZD” format

Body

The following table is a body of response parameter:

Field NameAttrib.DatatypeDescription
responseCodeMString(7)Response code
responseMessageMString(150)Response description
referenceNoCString(64)Transaction identifier on service provider system. Must be filled upon successful transaction
beneficiaryAccountNameMString(100)Beneficiary account name
beneficiaryAccountNoMString(34)Beneficiary account number
beneficiaryBankCodeOString(8)3 digit BI Bank Code + 4 digit BI Branch Code for the beneficiary bank

Sample

Request

The following section is a sample of request parameter:

curl --location --request POST 'https://merchants.midtrans.com/v1.0/account-inquiry-external' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIxMmUzODE4Mi00YjIxLTQ0YWMtOTVkNi1mMjFhMjEwZmIxZTAiLCJjbGllbnRJZCI6IjY2ODA1MmUzNGYxOTRhYThiZTc5ZTE1YTIxZTRmYzJmIiwibmJmIjoxNjYzODQwNTU5LCJleHAiOjE2NjM4NDE0NTksImlhdCI6MTY2Mzg0MDU1OX0.fEr0vIbB2kY8alZ-SROl3ftAFbfRd0uU-lGq9XuFi8M' \
--header 'Content-Type: application/json' \
--header 'X-TIMESTAMP: 2022-03-04T08:02:09+07:00' \
--header 'X-SIGNATURE: yqmBXZ3yV6NPG1LtwXMm3quXzJMRX5Ms+r9ebc5xWIZGSKbZL3Oy871GHb7WQUucLa5nxN/HcnZYoNHc+KkWTQ==' \
--header 'X-PARTNER-ID: 668052e34f194aa8be79e15a21e4fc2f' \
--header 'X-EXTERNAL-ID: 91919644194391346361915387229113' \
--header 'CHANNEL-ID: 95221' \
--data-raw '{"beneficiaryBankCode": "0020307", "beneficiaryAccountNo": "1172993826"}'

Response

The following section is a sample of response parameter:

Content-Type : application/json
x-timestamp  : 2022-03-04T08:02:09+07:00
-------------------------------------------------------------------------------
{
   "responseCode": "2001600",
   "responseMessage": "Success",
   "referenceNo": "467314ff6bf84267a97f788917656eff",
   "beneficiaryBankCode": "0020307",
   "beneficiaryAccountNo": "1172993826",
   "beneficiaryAccountName": "Jon Snow"
}
Content-Type : application/json
x-timestamp  : 2022-03-04T08:02:09+07:00
-------------------------------------------------------------------------------
{"responseCode": "4041611", "responseMessage": "Invalid Account/Virtual Account"}

Migration

Request

The following table is a comparison of request parameter:

Payouts non-SNAP-based (current)Payouts SNAP-basedDescription
GET /api/v1/account_validation?bank=#{bank_name}&account=#{bank_account}POST /{version}/account-inquiry-external
bank_accountbeneficiaryAccountNoBeneficiary account number
beneficiaryBankCode3 digit BI Bank Code + 4 digit BI Branch Code for the beneficiary bank
Beneficiary bank nameBeneficiary bank name

Response

The following table is a comparison of response parameter:

Payouts non-SNAP-based (current)Payouts SNAP-basedDescription
responseCodeResponse code
responseMessageResponse description
idreferenceNoTransaction identifier on service provider system.
bank_nameBeneficiary bank name
account_namebeneficiaryAccountNameName of the beneficiary
account_nobeneficiaryAccountNoAccount number of the beneficiary
beneficiaryBankCode3 digit BI Bank Code + 4 digit BI Branch Code for the beneficiary bank
beneficiaryBankNameBeneficiary bank name

Response Codes

Payouts non-SNAP-based (current)Payout SNAP-basedDescription
2001600Successful
4001601Invalid Field Format [fieldName]
4001602Missing Mandatory Field [fieldName]
4011600Unauthorized
4011601Invalid Token (B2B)
4031609Dormant Account
4031614Insufficient Fund
4031618Inactive Card/Account/Customer
4041611Invalid Account/Virtual Account
5001601Internal Server Error
5001602External Server Error