GoPay & QRIS

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 Mode

We 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.uiMode in Snap JS. UI Mode is specified to auto by default.

This guide will assume that the value of uiMode in Snap.JS options is auto, the recommended value.


📘

GoPay Deeplink & Tokenization redirection to GoPay app only

With 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?

  1. By default user will be redirected to GoPay app if the app is installed.
  2. 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.
  3. 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

  1. Merchant should ensure that they can support redirection URL in universal link format to be able to be redirected to GoPay / Gojek app
  1. 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.
  1. 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 \

iOS




When users make a purchase using GoPay on a Web Browser(on a computer)


  1. Users see a QR code on their Web Browser
  2. Users open the GoPay app on their phone
  3. Users tap the Pay function on the GoPay app
  4. Users point their camera to the QR Code
  5. Users check their payment details on the GoPay app and then tap Pay


  1. The transaction is complete and the users' GoPay balance is deducted

  2. 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


  1. Users are automatically redirected to the GoPay app when making purchases on their SmartPhone

  2. Users finish the payment on the GoPay app

  3. The transaction is complete and their GoPay balance is deducted

  4. 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"
  }
}
ParameterDescription
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.


📘

Prerequisites

E-commerce needs to prepare a deeplink which accepts two query parameters.


Query ParameterDescriptionType
order_idOrder ID sent on the API Request.String
resultResult 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.


  1. Set enable_callback parameter in the api request to true.
  2. Set callback_url with the deeplink URL redirecting to E-commerce apps via API request or configure it in Dashboard > Snap Preferences.
  3. 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 result to update status on backend. There is HTTP notification for this use case.