This section will explain how merchants can initiate customer topup account inquiry using SNAP specification.
ServiceCode | Method | URL | Description |
---|---|---|---|
37 | POST | /{version}/emoney/account-inquiry | API Account Inquiry - Customer Top Up |
Request
Header
The following table is a header of request parameter:
Field Name | Attrib. | Datatype | Description |
---|---|---|---|
Content-Type | M | String | Represent media type of request e.g “application/json” |
Authorization | M | Bearer token obtained from Access Token API in the format Bearer | |
X-TIMESTAMP | M | String(25) | Client's current local time in “yyyy-MM-ddTHH:mm:ssTZD” format |
X-SIGNATURE | M | See General API Symmetric Signature | |
X-PARTNER-ID | M | See Credential Exchange | |
X-EXTERNAL-ID | M | String(max 36), Numeric | Unique request reference number from partner. Must be unique. |
CHANNEL-ID | M | See Credential Exchange |
Body
The following table is a body of request parameter:
Field Name | Attrib. | Datatype | Description |
---|---|---|---|
customerNumber | M | String(20) | Customer account number |
amount.value | M | String(16,2) | Send nominal value “1.00” This nominal value will not be used for any operation in our side (will not deducted). But still mandatory to be sent due to the SNAP spec. |
amount.currency | M | String(3) | Currency (should always be IDR) |
additionalInfo.beneficiaryProvider | M | String(40) | Beneficiary Provider, See Emoney Providers |
Response
Header
The following table is a header of response parameter:
Field Name | Attrib. | Datatype | Description |
---|---|---|---|
X-TIMESTAMP | M | String(25) | “yyyy-MM-ddTHH:mm:ssTZD” format |
Body
The following table is a body of response parameter:
Field Name | Attrib. | Datatype | Description |
---|---|---|---|
responseCode | M | String(7) | Response code |
responseMessage | M | String(150) | Response description |
referenceNo | C | String(64) | Transaction identifier on service provider system. Must be filled upon successful transaction |
customerName | M | String(255) | Customer account name |
customerNumber | M | String(34) | Customer account number |
additionalInfo.beneficiaryProvider | O | String(8) | Beneficiary provider |
Sample
Request
The following section is a sample of request parameter:
curl --location --request POST 'https://merchants.midtrans.com/v1.0/emoney/account-inquiry \
--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 '
{
"customerNumber": "6287377388272",
"amount": {
"value": "1.00",
"currency": "IDR",
},
"additionalInfo": {
"beneficiaryProvider": "gopay"
}
}'
Response
The following section is a sample of response parameter:
Content-Type : application/json
x-timestamp : 2022-03-04T08:02:09+07:00
x-client-key : mpn6yhtxa0wfulz65p9pjjw8r0yot8oo
-------------------------------------------------------------------------------
{
"responseCode": "2003700",
"responseMessage": "Success",
"referenceNo": "467314ff6bf84267a97f788917656eff",
"customerNumber": "6287377388272",
"customerName": "Jon Snow",
"additionalInfo": {
"beneficiaryProvider": "gopay"
}
}
Content-Type : application/json
x-timestamp : 2022-03-04T08:02:09+07:00
x-client-key : mpn6yhtxa0wfulz65p9pjjw8r0yot8oo
-------------------------------------------------------------------------------
{"responseCode": "4043711", "responseMessage": "Invalid Account"}
Migration
Request
The following table is a comparison of request parameter:
Payouts non-SNAP-based (current) | Payouts SNAP-based | Description |
---|---|---|
GET /api/v1/account_validation?bank=#{bank_name}&account=#{bank_account} | POST /{version}/account-inquiry-external | |
bank_account | beneficiaryAccountNo | Beneficiary account number |
beneficiaryBankCode | 3 digit BI Bank Code + 4 digit BI Branch Code for the beneficiary bank | |
Beneficiary bank name | Beneficiary bank name |
Response
The following table is a comparison of response parameter:
Payouts non-SNAP-based (current) | Payouts SNAP-based | Description |
---|---|---|
responseCode | Response code | |
responseMessage | Response description | |
id | referenceNo | Transaction identifier on service provider system. |
bank_name | Beneficiary bank name | |
account_name | customerName | Name of the customer |
account_no | customerNumber | Account number of the customer |
Response Codes
Payouts non-SNAP-based (current) | Payouts SNAP-based | Description |
---|---|---|
2003700 | Successful | |
4003701 | Invalid Field Format [fieldName] | |
4003702 | Missing Mandatory Field [fieldName] | |
4013700 | Unauthorized | |
4013701 | Invalid Token (B2B) | |
Account does not exist | 4043711 | Invalid Account/Virtual Account |
5003701 | Internal Server Error | |
5003702 | External Server Error |