GoPay is an e-Wallet payment method. Users will pay using the GoPay app. The user flow varies when using a Web Browser (on a computer) compared to a SmartPhone.
This API reference describes implementation of regular payment flow with GoPay and QRIS issued by GoPay. To implement GoPay Tokenizations in Snap, see this page.
You can also get a static QRIS version of your GoPay QRIS. To do so, once you have GoPay activated in your business, go to Dashboard > + New Payment Methods, then proceed with the activation. Once done, in the same page, you should see a new tab called 'Manage Static QRIS', create your Static QRIS and label it with your own identifier (to help you identify the trx in your reports), then download the PDF file.
By default, GoPay Deeplink and Dynamic QRIS's transaction expiry is 15 minutes (min 20s, max 7 days).
UI ModeWe will show either QRIS or Deeplink based on customer's screen size (wide screen will get QRIS, while small screen will get deeplink). Merchant can however specify whether GoPay will be shown in deeplink or QR format persistently using
options.uiModein Snap JS. UI Mode is specified toautoby default.This guide will assume that the value of
uiModein Snap.JS options isauto, the recommended value.
GoPay Deeplink & Tokenization redirection to GoPay app onlyWith the launch of GoPay standalone app, starting from 1 January 2026, user will be redirected to GoPay app only to complete their payment.
How will this impact the user experience?
- By default user will be redirected to GoPay app if the app is installed.
- If GoPay app is not installed (even if user has Gojek app), user will see GoPay webpage and asked to download GoPay app from the play store or app store.
- After downloading the app, user can continue to complete linking or payment.
How can merchant support this flow?
Just like the previous Gojek and GoPay app redirection flow, merchant just need to ensure that they have done these 3 items below:
What merchants need to do
- Merchant should ensure that they can support redirection URL in universal link format to be able to be redirected to GoPay / Gojek app
- In case merchants have whitelisting in place, merchants should whitelist
gopay.co.id/*,*.gopay.co.id/*,gojek.link/*. Please ensure that the existing URLs are also kept whitelisted on merchants' side.
- In case merchants have webview implementation, merchant should ensure that the webview redirection is not blocked by Android/iOS platform. Fore more details on how to do this please read this FAQ page: Android \
When users make a purchase using GoPay on a Web Browser(on a computer)
- Users see a QR code on their Web Browser
- Users open the GoPay app on their phone
- Users tap the Pay function on the GoPay app
- Users point their camera to the QR Code
- Users check their payment details on the GoPay app and then tap Pay
-
The transaction is complete and the users' GoPay balance is deducted
-
Midtrans will mark the payment_type of the transaction as
qris. This will also impact the following:
-
The JSON fields format (returned on Webhook/HTTP Notifications & Get Status API response) is
"payment_type": "qris" -
The
"payment_type": "qris"displayed on Midtrans Dashboard, and when you download transactions.
Detailed payment Flow for GoPay on a Desktop PC/Laptop
This is the payment flow if customers process GoPay Payments on a Desktop PC/Laptop.
When users make a purchase on their SmartPhone
-
Users are automatically redirected to the GoPay app when making purchases on their SmartPhone
-
Users finish the payment on the GoPay app
-
The transaction is complete and their GoPay balance is deducted
-
Midtrans will mark the payment_type of the transaction as
gopay. This will also impact the following:
-
The JSON fields format (returned on Webhook/HTTP Notifications & Get Status API response) is
"payment_type": "gopay" -
The
"payment_type": "gopay"displayed on Midtrans Dashboard, and when you download transactions.
Note: For a list of failure cases, please refer here.
Detailed Payment Flow for GoPay on a Smartphone
This is the payment flow if customers process GoPay Payments on a smartphone.
Sample JSON Request Body
{
"transaction_details": {
"order_id": "ORDER-101",
"gross_amount": 10000
},
"item_details": [{
"id": "ITEM1",
"price": 10000,
"quantity": 1,
"name": "Midtrans Bear",
"brand": "Midtrans",
"category": "Toys",
"merchant_name": "Midtrans"
}],
"customer_details": {
"first_name": "TEST",
"last_name": "MIDTRANSER",
"email": "[email protected]",
"phone": "+628123456"
},
"enabled_payments": ["gopay"],
"gopay": {
"enable_callback": true,
"callback_url": "http://gopay.com"
}
}| Parameter | Description |
|---|---|
| transaction details Transaction Details Object (required)_ | Unique transaction ID |
| item details Item Details Object (optional)_ | Item details will be paid by customer |
| customer details Customer Details Object (optional)_ | Details of the customer |
| enabled_payments Array (optional) | Set what payment method to show in Snap's payment list. Value: gopay |
| gopay Gopay (optional) | GoPay payment options |
Implementing GoPay Deeplink Callback
In addition to the standard mobile apps flow, you can implement deeplink callback to redirect customer back from GoPay to your app.
PrerequisitesE-commerce needs to prepare a deeplink which accepts two query parameters.
| Query Parameter | Description | Type |
|---|---|---|
| order_id | Order ID sent on the API Request. | String |
| result | Result of the transaction to decide what kind of page to show to customer. Possible values are success or failure. | String |
The steps to integrate with GoPay deeplink (Please look into the GoPay API Request for sample implementation) are given below.
- Set
enable_callbackparameter in the api request totrue. - Set
callback_urlwith the deeplink URL redirecting to E-commerce apps via API request or configure it in Dashboard > Snap Preferences. - Handle redirection with above parameters.
For a full list of request body parameters please refer to the Request Body (JSON Parameter) section.
It is highly recommended to avoid using value passed on
resultto update status on backend. There is HTTP notification for this use case.