How You Can Integrate POS Device with GoPay and QRIS Payment Easily and Quickly

Rizda Prasetya
Midtrans
Published in
5 min readJul 21, 2021
Customer Completing Payment on a POS Device

Money doesn’t sound like “KA-CHING!” anymore. Nowadays, money sounds like nothing at all. Gone were the days when a cash register was always opened every time your customer purchased something. It’s all digitized now with the presence of Point of Sale (POS) device.

The good news is, you can accept payment from your customers anytime and anywhere you want, as long as you have an internet connection and an internet-enabled device like a tablet or smartphone. It’s paperless (though you can choose to print the receipt, no pressure at all!) and can automatically create a POS report to see how much you’re selling or earning that day.

If you’re a business owner who uses POS, or perhaps you’re a POS vendor, you can actually upgrade it to enable GoPay and QRIS (QR Indonesian Standard) payment. Why is this considered as an upgrade? Well, that way, your customers can pay via GoPay, e-wallet, or their favorite banking products. Surely this will make customers like you more, making it much easier for them to pay.

If you think it’s hard to integrate your POS with GoPay and QRIS, give me 3–5 minutes to change your mind.

What You Need to Start

There are three basic things you need to have before you start integrating POS with GoPay and QRIS:

*FYI, this integration can also be implemented to non-POS devices, such as IoT, IPTV, Set Top Box TV Digital, Smart TV, Wearables, Vending Machine, Kiosk, Printer, and any device that can be connected to the internet.

Illustration for the 3 overview steps

Next, there are 3 simple steps that you must do for every transaction using GoPay and/or QRIS:

  1. Obtaining the QR by sending API request charge.
  2. Showing the QR to the customer so they can scan it and pay.
  3. Completing the payment status.

Yes, these 3 simple steps must be done for every single transaction. But don’t fret because the whole process is much faster than you can sing, “So no one told you life was gonna be this way *clap* *clap* *clap*”.

Obtaining QR Code by Sending API Request Charge

Let’s break down the process of sending the API request charge to get a unique QR code for each transaction. First, send the HTTP request to Midtrans API from your backend. The minimum parameters are mainly:

  • The total payment (in rupiah) to be put as gross_amount, and
  • Payment identifier to be put as order_id. You are free to choose the identifier, just make sure that every transaction has a unique identifier.

Here’s an example of API request:

API request for Gopay — QRIS

P.S.: The example above uses CURL command as HTTP client, though you can copy-paste and import it to Postman (or similar tools, like: https://curl.trillworks.com/) to be used on your backend programming language.

Don’t forget to change YOUR_SERVER_KEY with your own server key, YOUR_BACKEND_URL_TO_RECEIVE_NOTIFICATION with your backend url to receive webhook/HTTP notification when payment status is confirmed.

You’ll receive a response in JSON format like this:

API response

The “status_message”: “QRIS transaction is created” and “transaction_status”: “pending” mean that the QR code and transaction is activated for payment. By default it will be active for 15 minutes. The “url” inside “actions” with “name”: “generate-qr-code” is the URL to display the QR code image. The “qr_string” is the text version of the QR code.

Showing the QR Code to the Customer

Now, it’s time to send the response to your POS system. If it’s possible, you can just show the “url” and the QR code will be displayed on the POS device. Alternatively, you can also use the “qr_string” to generate the QR code in your POS device.

Display QRIS Code to Let Customer Scan & Pay — source: https://gobiz.co.id/images/perangkat/perangkat-banner.webp

Moving forward, show the QR code to the customer. Help the customer to pay using QRIS enabled applications, like Gojek with GoPay. The best thing about this is we are using online QRIS, so the customer doesn’t have to input the payment details, they just have to input their PIN on the mobile app. Hold your horses, pal. A successful payment on the customer’s device does not indicate that the payment has been successfully confirmed by the acquirer.

Completing the Payment Status

By using Midtrans, you don’t have to directly handle the payment confirmation from the acquirer. Once Midtrans has confirmed the payment acceptance, Midtrans will send a webhook/HTTP notification to your URL backend server (that you’ve set in the ‘X-Override-Notification’). This is an instant process, so you and your customer don’t have to wait at all.

Your backend server will receive HTTPs request method POST with JSON format, like this:

Transaction Notification Sample JSON

The “transaction_status” is the status of the confirmed payment and “settlement” means that the payment has been successfully received and you can process the customer’s order. If the value is “expire”, then the payment was not successfully received, whereas “pending” indicates that it’s still waiting for payment to be received.

After your backend server receives the status update, your backend can update the status in the database or send the information to the POS system, so that the POS display can be updated accordingly.

If due to some backend problems you haven’t received any status change information, you can also make an inquiry-get-status via the API to get the latest payment status. For more detailed information regarding this integration, you can also see the full documentation here.

Out with the old, in with the new. POS device & QRIS has definitely transformed the whole business scene, especially with the trend of cashless society. Don’t get stuck in second gear, this is a sign for you to start integrating your POS device with QRIS payment. Think of it as a benefit for you and your customer. Happy customers, hefty profit!

--

--

Rizda Prasetya
Midtrans
Writer for

Empowering Business using Technology @Midtrans — Gojek Group