GoPay Tokenization allows merchants to link customer's GoPay account to their platform to be used for subsequent transactions.
Initiate account linking
To initiate account linking in SNAP-based flow, merchants need to call 3 APIs as follows:
- Initiate access token B2B by calling POST v1.0/access-token/b2b
- Initiate get oauth URL request by calling GET v1.0/get-auth-code
- Initiate binding request by calling POST v1.0/registration-account-binding
What to do when merchant lost the customer-authorization token?
Peviously merchant cannot initiate another linking of the same phone number as it is already linked in Midtrans/GoPay side. Midtrans will return an error to merchant.
Now, to accommodate the scenario where due to various reasons merchant lost customer-authorization token after completing linking, Midtrans has made an improvement whereby instead of throwing an error (like before), Midtrans will:
- Let merchant do relinking of the same phone number
- Midtrans will return GoPay PIN/OTP page as part of the Get Auth Code API
- User will need to redo the user authorization by inputting their PIN/OTP
- Once authorized, Midtrans will send an authCode to merchant
- Merchant will then need to confirm the linking by calling the Binding API and passing the authCode.
- Midtrans will return the same customer-authorization token for that particular user account (phone number).
Please contact your Midtrans sales representative to enable this feature.
Receiving notification on account linking and unlinking
Soon, Midtrans will also be sending HTTP post notification on account linking and unlinking in BI-SNAP flow. Refer to this diagram below to see how it works!
Account Linking notification
Account Unlinking notification
To start accepting notification, merchants will need to integrate to our Account Linking Notification API. To learn how to set this up, merchant can refer to this API documentation.
Additional APIs
- To fetch account information such as account status, balance and payment option token, merchant need to initiate Binding Inquiry API call. Merchants are encouraged to always call this API before payment to make sure the merchant uses the updated token when creating payment as the payment option token may change from time to time due to various reasons (example: customer upgrade their GoPay account to GoPay Tabungan).
- To initiate account unbinding, merchant need to call Unbinding API
- To accept account linking and unlinking HTTP post notification from Midtrans, refer to this account linking and unlinking notification API