For more details on merchant migration & backward compatibility, please refer to this page
As regulated by Bank Indonesia, merchants will need to integrate to BI-SNAP-based Core API. This section describes how Midtrans merchant can move to this new API, we will also explain in detail what are the differences between BI-SNAP-based Core API and Midtrans existing Core API.
API Domain
| Environment | Legacy Core API | BI-SNAP-based Core API |
|---|---|---|
| Sandbox | api.sandbox.midtrans.com | - Get Auth Code API : merchants-app.sbx.midtrans.com - All other APIs: merchants.sbx.midtrans.com |
| Staging | - Get Auth Code API: merchants-app.stg.midtrans.com - All other APIs: merchants.stg.midtrans.com | |
| Production | api.midtrans.com | - Get Auth Code API: merchants-app.midtrans.com - All other APIs: merchants.midtrans.com |
Authorization
Merchant Credentials
| Legacy Core API | Credentials | Definition |
|---|---|---|
| Server key | Merchant’s key generated by Midtrans that is used for BASIC AUTH authentication for all Midtrans API | |
| Merchant ID (MID) | Merchant’s unique ID generated by Midtrans as part of the onboarding process |
While in SNAP-based Core API, the credentials differ based on the API scope as follow:
| BI-SNAP-based Core API | Credentials | Definition | Remarks |
|---|---|---|---|
| Both API scope | Merchant ID (MID) | Merchant’s unique ID generated by Midtrans | Existing |
| Access Token API scope | Merchant's public key | Created by merchant. Will be used by Midtrans to validate merchant’s signature | New |
| Client ID | Provided by Midtrans. Will be used as X-CLIENT-KEY on request header | New | |
| Transactional API scope | Client secret | Provided by Midtrans. Will be used for signature generation | New |
| Partner ID | Provided by Midtrans. Will be used as X-PARTNER-ID on request header | New |
Authorization Behavior
| Legacy Core API | BI-SNAP-based Core API |
|---|---|
| Merchant will only need to use server key to initiate API calls | 1. Merchant need to call Access Token API first to generate a token that will be used for subsequent APIs, up until the token expired 2. Merchant need to create signature for all API calls. Please refer to Signature Generation section. |
Transaction Status
| Legacy Core API | BI-SNAP-based Core API |
|---|---|
| PENDING | 03 (Pending) |
| AUTHORIZE | 01 (Initiated) |
| SETTLEMENT | 00 (Success) |
| REFUND & PARTIAL REFUND | 04 (Refunded) |
| CANCEL | 05 (Canceled) |
| FAILURE | 06 (Failed) |
| EXPIRY | 08 (Expiry) |
| DENY | 09 (Rejected) |
- Only transaction status on API response that will change. Transaction status on Midtrans dashboard and reporting will remain the same as Legacy API.* We will only return the transaction status numeric value in the actual API response. The text value (...) is only the status code description that won't be returned.
Transaction & Account Identification
Legacy Core API | BI-SNAP-based Core API |
|---|---|
|
|
|
|
|
|
|
|
Notification
Legacy Core API | BI-SNAP-based Core API |
|---|---|
Merchant only required to share one notification URL for all payment type notification in Midtrans | There will be differences in notification’s relative path per payment type flow. Merchant required to share their notification URL domain, where Midtrans will append the dynamic relative path based on payment type as follow: After appended by Midtrans, the URL will look like this:
|
To be able to receive notification from Midtrans, merchant will need to whitelist this set of IPs based on the environment.
Environment | IPs |
|---|---|
Staging | 3.1.141.98/32 |
Production | 13.228.166.126/32 |