Account Linking and Unlinking Notification

Path/{version}/registration-account/notify
HTTP MethodPOST
Versionv1.0
SNAP service code88

📘

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:

  1. 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.
  2. 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
  3. Ensure merchant has whitelisted Midtrans outgoing IP address as follows:
EnvironmentIP address
Sandbox34.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
Staging3.1.141.98/32
52.76.190.190/32
13.251.192.204/32
Production13.228.166.126/32
52.220.80.5/32
3.1.123.95/32

Request Header

Field NameField TypeMandatoryField Description
Content-typeStringMMedia type of the resource, i.e. application/json
X-TIMESTAMPStringMClient’s current local time in ISO-8601 format
X-SIGNATUREStringMCreated using asymmetric signature. Asymmetric-Signature format :

SHA256withRSA (privateKey, stringToSign) with

stringToSign = HTTPMethod +”:“+ EndpointUrl +":“+ Lowercase(HexEncode(SHA-256(minify(RequestBody)))) + ":“ + TimeStamp
X-PARTNER-IDStringMUnique identifier for merchant. Merchant can send any value.
X-EXTERNAL-IDStringMAlphanumeric string. We suggest merchant to use UUID format. Reference number that should be unique in the same day or 1 day idempotency key.
CHANNEL-IDStringMMandatory 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 NameField TypeMandatoryField Description
additionalInfoObjectMSome additional info
additionalInfo.accessTokenStringMAccess token used for transaction (used for Authorization-Customer header). Can be acquired during Registration Account Binding API.
additionalInfo.merchantIdStringMMerchant's Midtrans merchant ID. Sample format: GXXXXXX
additionalInfo.subMerchantIdStringMMerchant'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.paymentTypeStringMPayment type used for linking. Example: gopay
additionalInfo.accountStatusStringMENABLED: Account is linked
DISABLED: Account is unlinked
additionalInfo.statusMessageStringMStatus 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 NameField TypeMandatoryField Description
Content-typeStringMMedia type of the resource, i.e. application/json
X-TIMESTAMPStringMClient’s current local time in ISO-8601 format
Content-type: application/json
X-TIMESTAMP: 2024-03-19T14:30:00+07:00

Response Body

Field NameField TypeMandatoryField Description
responseCodeString (7)MError code to specify the error returned.
responseMessageString (150)MDebug message to provide more information.
{
   "responseCode":"2008800",
   "responseMessage":"Request has been processed successfully"
}

List of Response Code

Response CodeHTTP Status CodeResponse Message
2008800200Successful
5008800500Internal 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.