SNAP Introduction
SNAP Overview
SNAP (Standar Nasional Open API Pembayaran) is the standard payment API in Indonesia that established by Bank Indonesia and developed together with ASPI (Asosiasi Sisten Pembayaran Indonesia). This standard aim for the payment gateway provider like NICEPAY can communicate in the similar way.
Based on Bank Indonesia dev portal, SNAP regulate three main things:
- Standard format and URL API. Endpoint path, field name, and response structure follow the similar specification for every provider.
- Security standard. Every request need Access Token and digital Signature.
- Structured response code. Every code contain status information, service, and case.
SNAP API Request Component
The following is some component that contain in every SNAP API request.
Component | Function |
|---|---|
Endpoint | Standard URL /nicepay/v1.0/access-token/b2b for request token. |
Access Token | Access authorization, valid for 15 minutes, sent as Authorization: Bearer {accessToken}. |
Signature | Digital signature on X-SIGNATURE header to ensure integrity and non-repudiation. |
Timestamp | Header X-TIMESTAMP with format ISO-8601, also sign to prevent reuse of old request. |
Partner Identity | Client ID from NICEPAY, sent on X-CLIENT-KEY header |
Body | Transaction data in JSON format with field name based on SNAP standard. |
Response code | 7 code number explain request result. |
Detail to grain Access Token and create Signature could be seen on page.
Common Used General
Header | Used on | Remark |
|---|---|---|
Content-Type | All request | application/json |
X-TIMESTAMP | All request | Request time, ISO-8601 with timezone GMT+7, example 2024-12-31T10:11:40+07:00 |
X-CLIENT-KEY | Request Access Token | Client ID from NICEPAY |
X-SIGNATURE | All request | Digital signature created by Merchant |
Authorization | Request service | Bearer {accessToken} |
X-PARTNER-ID | Request service | Client ID from NICEPAY |
X-EXTERNAL-ID | Request service | Unique reference number for every request created |
CHANNEL-ID | Request service | Client ID add with 01 |
Understanding SNAP Response Code
SNAP response code consist of 7 number digit with three parts:
BPart | Total Digit | Definition |
|---|---|---|
SHTT status | 3 | Example: 200 Success 400 Wrong Request 401 Unauthorized |
Service code | 2 | MShowing the called service |
Case code | 2 | Explain detail result |
CExample: 2007300
- 200 is status HTTP success.
- 73 is service code for Access Token.
- 00 is success case.
Please visit page to view service code list and page to view the complete list of response code
NICEPAY Service's SNAP Support
Service | Availability API |
|---|---|
Virtual Account | |
E-Wallet (Direct Debit) | |
QRIS | |
Payout (Disbursement) |
Difference with Non-SNAP NICEPAY API
Difference between API NICEPAY SNAP with Non-SNAP is on the authentication and response format. Every SNAP request use Access Token and digital Signature also SNAP response have parameter in Bank Indonesia standard (like responseCode parameter owned by Bank Indonesia with responseCd parameter owned by NICEPAY).
Please check Implementasi SNAP for the complete guide of implementation and migration.