Link customer account - GoPay Tokenizations
Create Pay Account is triggered to link the customer's account to be used for payments using specific payment channel.
HTTP Method | Endpoint | Definition |
---|---|---|
POST | BASE_URL/v2/pay/account | Link the customer account to be used for specific payment channels. |
Create Pay Account Request
{
"payment_type": "gopay",
"gopay_partner": {
"phone_number": "81212345678",
"country_code": "62",
"redirect_url": "https://www.gojek.com"
}
}
JSON Attribute | Description | Type | Required | |
---|---|---|---|---|
payment_type | Payment channel where the account is register to. | String | Required | |
gopay_partner | GoPay linking specific parameters. | Object | Conditional | |
phone_number | Phone number linked to the customer's account. | String | Required | |
country_code | Country code associated with the phone number. | String | Required | |
redirect_url | URL where user is redirected to after finishing the confirmation on Gojek app. | String | Optional | |
Create Pay Account Response
"status_code": "201",
"payment_type": "gopay",
"account_id": "00000269-7836-49e5-bc65-e592afafec14",
"account_status": "PENDING",
"actions": [
{
"name": "activation-link-url",
"method": "GET",
"url": "http://api.midtrans.com/v2/gopay/redirect/gpar_6123269-1425-21e3-bc44-e592afafec14/link"
},
{
"name": "activation-link-app",
"method": "GET",
"url": "http://api.midtrans.com/v2/gopay/redirect/gpad_6123269-1425-21e3-bc44-e592afafec14/link"
}
]
}
{
"status_code": "202",
"payment_type": "gopay",
"channel_response_code": "105",
"channel_response_message": "User Not Found"
}
JSON Attribute | Description | Type |
---|---|---|
status_code | Status code of the API result. | String |
payment_type | Payment channel associated with the account. | String |
account_id | Customer account id to be used for payment. | String |
account_status | Status of the account. Possible values are PENDING , EXPIRED , ENABLED , and DISABLED . | String |
channel_response_code | Response code from payment channel provider. | String |
channel_response_message | Response message from payment channel provider. | String |
actions | Follow up actions to be performed. | Array(Object) |
Use any one of the two redirection URLs given below.
-
activation-link-url
is for customer authentication in browser or WebView. This redirection is recommended for desktop. The customer needs to scan the QR code shown on this page using their Gojek app to verify the linking. Once the linking is verified, then this page is redirected back to the merchant page. For merchants with special agreement with GoPay, this page may show OTP/PIN page instead. -
activation-link-app
is for customer authentication in Gojek app (This might not be applicable for all merchants). The customer needs to input OTP/PIN from the Gojek app.
Note
Merchant can use these phone numbers to perform failed linking scenarios on Sandbox environment
- User not registered: 123450001
- User is blocked: 123450002
Pay Account Link Notification
{
"account_id": "00000269-7836-49e5-bc65-e592afafec14",
"merchant_id": "M099098",
"payment_type": "gopay",
"signature_key": "ad7ccda03d8ec6f2f415661fb511d47fcd17dcc7d7e1ade96a305dd5d3bc2bea5438a8bdfe1aeedabdefb226000338ac169fc18d5ae73788fd5e78dbac945ce4",
"status_code": "200",
"account_status": "ENABLED",
"status_message": "Midtrans account_linked notification"
}
Pay Account link notification will be sent to merchant after user have been redirected to provider app and successfully input their pin/OTP. This notification sample can be seen on the side, and you can see Handle notifications section to know how to handle the notifications.
Specifically for GoPay Tokenization, after notification is recived, merchant needs to call Get Pay Account to fetch the account balance, status, and payment option token.