1. Overview
BNC call merchant backend to inquiry VA information before payment.
2. API Specification
HTTP Method | POST |
Endpoint | N/A |
SNAP Service Code | 24 |
3. Request
3.1. Request Header
Name | Type | M/O | Length | Description |
|---|---|---|---|---|
X-TIMESTAMP | String | M | 25 | The request timestamp. Formatted with "yyyy-MM-ddTHH:mm:ssZ". E.g. 2022-09-06T13:00:00+07:00 |
X-SIGNATURE | String | M | 2048 | The Merchant or Client generated signature. Using Asymmetric-Signature mechanism to get the token, encrypted with SHA256withRSA. e.g. stringToSign = <HTTP Method> + ":" + <Service Endpoint> + ":" + toLowercase(hexEncode(SHA256(minify(<Request Body>)))) + ":" + <X-TIMESTAMP> X-SIGNATURE = SHA256withRSA(PrivateKey, stringToSign) |
X-ORIGIN | String | M | 256 | Client's host origin. |
X-PARTNER-ID | String | M | 32 | The Merchant or Client Id. Provided by BNC. |
X-EXTERNAL-ID | String | M | 36 | The Merchant External ID of request. e.g. 77778042022091500001 |
CHANNEL-ID | String | M | 5 | PJP Channel ID. 95221 |
3.1.1 Sample Request Header
Content-type: application/json Authorization: Bearer gp9HjjEj813Y9JGoqwOeOPWbnt4CUpvIJbU1mMU4a11MNDZ7Sg5u9a" X-TIMESTAMP: 2020-12-21T14:56:11+07:00 X-SIGNATURE: 85be817c55b2c135157c7e89f52499bf0c25ad6eeebe04a986e8c862561b19a5 X-ORIGIN: www.hostname.com X-PARTNER-ID: 82150823919040624621823174737537 X-EXTERNAL-ID: 41807553358950093184162180797837 CHANNEL-ID: 95221
3.2 Request Body
Name | Type | M/O | Length | Description |
|---|---|---|---|---|
partnerServiceId | String | M | 8 | Derivative of X- PARTNER- ID, similar to company code,8 digit leftpadding space. partnerServiceId + customerNo or virtualAccountNo |
customerNo | String | M | 20 | Unique number (up to 20 digits). partnerServiceId + customerNo or virtualAccountNo |
virtualAccountNo | String | M | 28 | partnerServiceId (8 digit left padding0) +customerNo (up to 20 digits). partnerServi ceId + customerNo or virtualAccountNo |
trxDateInit | Date | O | 25 | PJP internal system datetime with timezone, which follows the ISO-8601 standard |
channelCode | Number | O | 4 | Channel code based on ISO18245 |
language | String | O | 2 | Language code based on ISO 639-1 |
amount | Object | O | ||
-> value | String | M | 16.2 | Transaction Amount. Nominal inputted by Customer with 2 decimal (ISO4217) |
-> currency | String | M | 3 | Currency (ISO4217) |
hashedSourceAccountNo | String | O | 32 | Source account number in hash |
sourceBankCode | String | O | 3 | Source account bank code based on |
passApp | String | O | 64 | Key for 3rdparty to access API like client secret |
inquiryRequestId | String | M | 128 | Unique identifier for this Inquiry. Generated by PJP. |
additionalInfo | Object | O | Additional Information for custom use |
3.2.1 Sample Request Body
{
"partnerServiceId":" 88899",
"customerNo":"12345678901234567890",
"virtualAccountNo":" 08889912345678901234567890",
"txnDateInit":"20201231T235959Z",
"channelCode":6011,
"language":"ID",
"amount":{
"value":"12345678.00",
"currency":"IDR"
},
"hashedSourceAccountNo":"abcdefghijklmnopqrstuvwxyz123456",
"sourceBankCode":"008",
"passApp":"abcdefghijklmnopqrstuvwxyz",
"inquiryRequestId":"abcdef-123456-abcdef",
"additionalInfo":{
"deviceId":"12345679237",
"channel":"mobilephone"
}
}
4. Response
4.1 Response Body
Name | Type | M/O | Length | Description |
|---|---|---|---|---|
responseCode | String | M | 7 | The BI Snap standard of response code. |
responseMessage | String | M | 150 | The message corresponding to the response code. |
virtualAccountData | Object | M |
| |
-> inquiryStatus | String | O | 2 | Status of inquiry |
-> inquiryReason | Object | O | Reason for Inquiry Status multi language | |
->-> english | String | O | 64 | Reason for Inquiry Status in English |
->-> indonesia | String | O | 64 | Reason for Inquiry Status in Bahasa |
-> partnerServiceId | String | M | 8 | Derivative of X- PARTNER-ID , similar to company code,8 digit left padding space. partnerServiceId + customerNo or virtualAccountNo |
-> customerNo | String | M | 20 | Unique number (up to 20 digits). partnerServiceId + customerNo or virtualAccountNo |
-> virtualAccountNo | String | M | 28 | partnerServiceId (8 digit left padding0) + customerNo (up to 20 digits). partnerServiceId + customerNo or virtualAccountNo |
-> virtualAccountName | String | M | 255 | Customer name |
-> virtualAccountEmail | String | O | 255 | Customer email |
-> virtualAccountPhone | String | O | 30 | Customer’s phone number Format:62xxxxxxxxx xxxx |
-> inquiryRequestId | String |
| 128 | From Inquiry Request |
-> totalAmount | Object | O |
| |
->-> value | String(ISO4217) | M | 16,2 | Transaction Amount. Total Amount with 2 decimal |
->-> currency | String | M | 3 | Currency |
-> subCompany | String | O | 5 | Sub Company code generated by Partner |
-> billDetails | Array of Objects | O | Array with maximum 24 Objects | |
->-> billCode | String | O | 2 | Bill code for Customer choose |
->-> billNo | String | O | 18 | Bill number from Partner |
->-> billName | String | O | 20 | Bill Name |
->-> billShortName | String | O | 10 | Bill Name to shown to |
->-> billDescription | Object | O | Bill Description | |
->->-> english | String | O | 18 | Bill Description in English |
->-> -> indonesia | String | O | 18 | Bill Description in Bahasa |
->-> billSubCompany | String | C | 5 | Partner’s product code. Mandatory if subCompany sent |
->-> billAmount | Object | O | ||
->->-> value | String(ISO4217) | M | 16,2 | Transaction Amount |
->->-> currency | String | M | 3 | Currency |
->-> billAmountLabel | String | O | ? | Label for bill Amount |
->-> billAmountValue | String | O | ? | Value that will be shown for bill Amount |
->-> additionalInfo | Object | O | unlimited | Additional Information for custom use for each bill |
-> freeTexts | Array of Objects | O | Array with maximum 25 Objects | |
->-> english | String | O | 32 | Will be shown in Channel |
->-> indonesia | String | O | 32 | Will be shown in Channel |
-> virtualAccountTrxType | String | O | 1 | Type of Virtual Account
|
->-> feeAmount | Array of Objects | O | ||
->-> value | String(ISO4217) | M | 16,2 | Transaction Amount. Nominal inputted by Customer with 2 decimal |
->-> currency | String | M | 3 | Currency |
-> additionalInfo | Object | O | Additional Information for custom use |
4.1.1 Sample Response Body
Success:
{
"responseCode":"2002400",
"responseMessage":"Success",
"virtualAccountData":{
"inquiryStatus":"00",
"inquiryReason":{
"english":"Success",
"indonesia":"Sukses"
},
"partnerServiceId":" 088899",
"customerNo":"12345678901234567890",
"virtualAccountNo":" 08889912345678901234567890",
"virtualAccountName":"Jokul Doe",
"virtualAccountEmail":"john@email.com",
"virtualAccountPhone":"6281828384858",
"inquiryRequestId":"abcdef-123456-abcdef",
"totalAmount":{
"value":"12345678.00",
"currency":"IDR"
},
"subCompany":"12345",
"billDetails":[
{
"billCode":"01",
"billNo":"123456789012345678",
"billName":"Bill A for Jan",
"billShortName":"Bill A",
"billDescription":{
"english":"Maintenance",
"indonesia":"Pemeliharaan"
},
"billSubCompany":"00001",
"billAmount":{
"value":"12345678.00",
"currency":"IDR"
},
"billAmountLabel":"Total Tagihan",
"billAmountValue":"Rp. 50.000,-",
"additionalInfo":{
}
}
],
"freeTexts":[
{
"english":"Free text",
"indonesia":"Tulisan bebas"
}
],
"virtualAccountTrxType":"1",
"feeAmount":{
"value":"12345678.00",
"currency":"IDR"
},
"additionalInfo":{
"deviceId":"12345679237",
"channel":"mobilephone"
}
}
}
Fail:
Response Code | HTTP Code | Service Code | Case Code | Response Message | Description | |
|---|---|---|---|---|---|---|
| 1 | 2002400 | 200 | any | 00 | Successful | Successful |
| 2 | 4002400 | 400 | any | 00 | Bad Request | General request failed error, including message parsing failed. |
| 3 | 4002401 | 400 | any | 01 | Invalid Field Format {field name} | Invalid format |
| 4 | 4002402 | 400 | any | 02 | Invalid Mandatory Field {field name} | Missing or invalid format on mandatory field |
| 5 | 4012400 | 401 | any | 00 | Unauthorized. [reason] | General unauthorized error (No Interface Def, API is Invalid, Oauth Failed, Verify Client Secret Fail, Client Forbidden Access API, Unknown Client, Key not Found) |
| 6 | 4012401 | 401 | any | 01 | Invalid Token (B2B) | Token found in request is invalid (Access Token Not Exist, Access Token Expiry) |
| 7 | 4012403 | 401 | any | 03 | Token Not Found (B2B) | Token not found in the system. This occurs on any API that requires token as input parameter |
| 8 | 4042408 | 404 | any | 08 | Invalid Merchant | Merchant does not exist or status abnormal |
| 9 | 4042411 | 404 | any | 11 | Invalid Card/Accoun t/Customer [info]/Virtual Account | Card information may be invalid, or the card account may be blacklisted, or Virtual Account number maybe invalid. |
| 10 | 4042412 | 404 | any | 12 | Invalid Bill/Virtual Account [Reason] | The bill is blocked/suspended/not found.Virtual account is suspend/not found. |
| 11 | 4042413 | 404 | any | 13 | InvalidAmount | The amount doesn't match with what supposed to |
| 12 | 4092401 | 409 | any | 01 | Duplicate partnerReferenceNo | Transaction has previously been processed indicates the same partnerReferenceNo already success |
| 13 | 5002402 | 500 | Any | 02 | External Server Error | Backend system failure, etc |
6. Reference
Field Code | Field Name | Description | |
|---|---|---|---|
| 1 | M | Mandatory | Mandatory |
| 2 | ME | Mandatory Equal | Mandatory Equal - value in the request and the response must be the same. |
| 3 | C | Conditional | Conditional |
| 4 | CE | Conditional Equal | Conditional Equal - value in the request and the response must be the same. |
| 5 | O | Optional | Optional |