Path | /{version}/registration-account/notify |
---|---|
HTTP Method | POST |
Version | v1.0 |
SNAP service code | 88 |
This API is not part of the BI-SNAP API specification provided by ASPI, hence merchant is not required to test this API during dev site test and functional test.
Midtrans will be send HTTP post notification to merchants during account linking completion and unlinking as shown in the diagram below:
Account Linking
Account Unlinking
Setting up
To start receiving notification on account linking and unlinking flow, merchant will first need to follow these steps:
- Set up a notification URL and share this URL to Midtrans team during onboarding process. Merchant can only set 1 notification URL prefix and this will be used for both account linking and payment notification.
- Midtrans will append a different path for each of notification type. For account linking notification the full URL endpoint will be [merchant's URL prefix]/v1.0/registration-account/notify
- Ensure merchant has whitelisted Midtrans outgoing IP address as follows:
Environment | IP address |
---|---|
Sandbox | 34.142.147.133/32 34.142.169.131/32 34.142.231.22/32 35.240.161.215/32 34.142.227.232/32 34.124.184.175/32 35.197.130.2/32 34.142.233.114/32 |
Staging | 3.1.141.98/32 52.76.190.190/32 13.251.192.204/32 |
Production | 13.228.166.126/32 52.220.80.5/32 3.1.123.95/32 |
Request Header
Field Name | Field Type | Mandatory | Field Description |
---|---|---|---|
Content-type | String | M | Media type of the resource, i.e. application/json |
X-TIMESTAMP | String | M | Client’s current local time in ISO-8601 format |
X-SIGNATURE | String | M | Created using asymmetric signature. Asymmetric-Signature format : SHA256withRSA (privateKey, stringToSign) with stringToSign = HTTPMethod +”:“+ EndpointUrl +":“+ Lowercase(HexEncode(SHA-256(minify(RequestBody)))) + ":“ + TimeStamp |
X-PARTNER-ID | String | M | Unique identifier for merchant. Merchant can send any value. |
X-EXTERNAL-ID | String | M | Alphanumeric string. We suggest merchant to use UUID format. Reference number that should be unique in the same day or 1 day idempotency key. |
CHANNEL-ID | String | M | Mandatory field from Bank Indonesia that can take any value with correct format 5 digits numeric string |
Content-type:application/json
X-TIMESTAMP:2024-03-19T14:30:00+07:00
X-SIGNATURE: da1fa417c72d6b91c257e01e54fac824
X-PARTNER-ID: BMRI
X-EXTERNAL-ID:12345678901234567890
CHANNEL-ID:12345
Request Body
Field Name | Field Type | Mandatory | Field Description |
---|---|---|---|
additionalInfo | Object | M | Some additional info |
additionalInfo.accessToken | String | M | Access token used for transaction (used for Authorization-Customer header). Can be acquired during Registration Account Binding API. |
additionalInfo.merchantId | String | M | Merchant's Midtrans merchant ID. Sample format: GXXXXXX |
additionalInfo.subMerchantId | String | M | Merchant's Midtrans PoP ID. Midtrans will return the PoP ID stated by merchant during Binding, or if merchant is NOT passing the PoP ID value, Midtrans will return a default PoP ID. |
additionalInfo.paymentType | String | M | Payment type used for linking. Example: gopay |
additionalInfo.accountStatus | String | M | ENABLED : Account is linked DISABLED : Account is unlinked |
additionalInfo.statusMessage | String | M | Status message - Account linked - User changed phone number - Account unlinked |
{
"additionalInfo":
{
"accessToken":"MjAyMjEwMTM2NjE1OGRiMS00NmM1LTQxMWQtYmU4NC01ODk1ZTdhMjg2NmY6OGNmM2U4NWUtZTc3Mi00NTJmLWFkYmEtNDcyNjRiOWZiZWIw",
"merchantId": "G123123",
"subMerchantId": "pop-id",
"paymentType": "gopay",
"accountStatus":"ENABLED"
"statusMessage":"Account linked"
}
}
Response Header
Field Name | Field Type | Mandatory | Field Description |
---|---|---|---|
Content-type | String | M | Media type of the resource, i.e. application/json |
X-TIMESTAMP | String | M | Client’s current local time in ISO-8601 format |
Content-type: application/json
X-TIMESTAMP: 2024-03-19T14:30:00+07:00
Response Body
Field Name | Field Type | Mandatory | Field Description |
---|---|---|---|
responseCode | String (7) | M | Error code to specify the error returned. |
responseMessage | String (150) | M | Debug message to provide more information. |
{
"responseCode":"2008800",
"responseMessage":"Request has been processed successfully"
}
List of Response Code
Response Code | HTTP Status Code | Response Message |
---|---|---|
2008800 | 200 | Successful |
5008800 | 500 | Internal Server Error |
Notification retry mechanism for Open API
In case we got an error response when sending notification (non 2xx response) to merchants, Midtrans will retry up to 3 times with exponential intervals. For now, our retry mechanism is as follows:
1st retry delay time = 20ms
2nd retry delay time = 40ms
3rd retry delay time = 80ms
Notes: this interval can change at any time as part of improvement, we will update it periodically.