1. Overview
This API is use to execute Payment request.
2. API Specification
HTTP Method | POST |
Endpoint |
|
SNAP Service Code | 54 |
3. Request
3.1. Request Header
Parameter Name | Type | Length | Required | Description | Sample | |
---|---|---|---|---|---|---|
1 | Authorization | String | 163 | M | Authorization access token. Bearer type. | Bearer eyJxxxx |
2 | X-SIGNATURE | String |
| M | Integrity check. 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) | eTCtU8YjKpwTzvOpao1g/ZQPxKzbsbVs6iTAAECB40aWoCVptjok59uHnbQemvyn3I0FHX/kreMgXMjhs/9NXYuaz3yBzk8TJ9fyYd6DbeeqDDBpTNVaC2dNjCtIjO1xi7ZJ+DLrqz7Wqwn+PwmY+0HJrbM9al5CS/WvjqFXN5FahIRxUfW8Dt3SQ0JNN/ySkz8ari/g7ygiIaLWZf3dSpACgEANiTFfi8YbAJRlMdoRPzwRups8QBdRce8yyW+RhpiEfTeV0CfLdTBiQ7r1HVCZ3V5iU2VxkKj4lXjwbEAJJm6XeEoXugUuLsOYOa8cKQ4bZ2Nxp+xFW6zd3Yk8lA== |
3 | X-TIMESTAMP | String |
| M | Timestamp request. Formatted as | 2022-09-28T13:00:00+07:00 |
4 | X-CLIENT-KEY | String | M | Merchant ID. Provided by Bank. |
| |
5 | X-EXTERNAL-ID | String |
| M | Merchant unique request ID. Must be unique per day. | |
6 | CHANNEL-ID | String |
| M | Bank Channel ID. | 88881 |
7 | Content-Type | String | M | Request body format type. | application/json |
3.2. Request Body
Name | Type | Length | Required | Description | Sample | |
---|---|---|---|---|---|---|
1 | partnerReferenceNo | String | 22 | M | Merchant reference number. |
|
2 | bankCardToken | String | 32 | M | User account bind token. |
|
3 | merchantId | String | 32 | M | Merchant ID. Provided by BNC. |
|
4 | subMerchantId | String | 32 | O | Sub Merchant ID of the Merchant. This property depends on merchant. Provided by BNC. |
|
5 | amount | Object | M | For hold amount of payment. | ||
6 | -> value | String | 19 | M | Amount value of payment. |
|
7 | -> currency | String | 3 | M | Currency of payment. | IDR |
3.2.1. Sample Request Body
{ "partnerReferenceNo": "230332344123781", "bankCardToken": "fe60e44d688f47f4af95cc4973ac7a77", "merchantId": "000580000134", "amount": { "value": "100000.00", "currency": "IDR" } }
4. Response
4.1. Response Body
Name | Type | Length | Required | Description | Remark | |
---|---|---|---|---|---|---|
1 | referenceNo | String | 22 | O | BNC transaction reference. | This value will be present if payment not exceed allowed non verification step. |
2 | partnerReferenceNo | String | 22 | O | Merchant reference number. | The value returned from request. |
3 | responseMessage | String | 200 | M | The message corresponding to the response code. | |
4 | responseCode | String | 7 | M | The BI Snap standard of response code. | |
5 | additionalInfo | Object | O | Additional information. If payment require second verification, this object will be present. | The value will be use in Resent OTP | |
6 | -> orderId | String | 22 | M | Order ID of the transaction. | Will be use in resent OTP. |
7 | -> journeyId | String | 32 | M | Journey ID identification. The value retrieve from the first request of X-EXTERNAL-ID. | Will be use in resent OTP. |
8 | -> traceId | String | 32 | M | BNC trace ID. Used for tracing in case problem happens |
4.1.1. Sample Response Body
Success:
{ "additionalInfo": { "traceId": "146ca9b7463dc261200f35498c819b90" }, "referenceNo": "3001568788361089425409", "partnerReferenceNo": "230332344123777053", "responseMessage": "Successful", "responseCode": "2005400" }
Success, require second verification:
{ "additionalInfo": { "orderId": "3001588427652917841921", "journeyId": "49942936", "traceId": "146ca9b7463dc261200f35498c819b90" }, "responseMessage": "Need To Request OTP", "responseCode": "4045406" }
Fail:
{ "responseMessage": "Inactive Card/Account/Customer", "responseCode": "4035418" }
Error Code | Error Message | Description | |
---|---|---|---|
1 | 4015404 | Customer Token Not Found | The bankCardToken is not registered. |
2 | 4035418 | Inactive Card/Account/Customer | The bankCardToken is not active. |
3 | 4035405 | Do Not Honor | The user account has been freeze by the bank. |
4 | 4035414 | Insufficient Funds | The user balance is not enough for the payment. |
5 | 4095401 | Duplicate partnerReferenceNo | The request already submitted and the payload is identical. |
6 | 4045418 | Inconsistent Request | The request already submitted but the payload is not identical. |
7 | 4045406 | Need To Request OTP | The request is pending. Require second action using Second Verification API. |
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 |