Using Robotic Process Automation and the bunq API to automate finding and buying discounted products on a webstore

Ming
bunq Developers’ Corner
3 min readJul 1, 2019

The combined use of automation tools and bank payment interfaces may be beneficial for both personal use and business automation. With this in mind, I have decided to cover using Robotic Process Automation (RPA) and bunq API in this simple demo tutorial.

Why RPA: I like to automate repetitive tasks and free up time.

Why bunq API: bunq has an excellent API and easy-to-use payment SDK.

This tutorial includes the following steps:

1. The use of RPA to distinguish discounts in the weekly Kruidvat brochure using Optical Character Recognition (OCR).

2. The implementation of RPA to search for the discount keywords at the Kruidvat webshop and get the iDEAL payment QR-code image snapshot.

3. The employment of the bunq API to post and iDEAL QR-code string and confirm the payment.

Running the UiPath Studio script
The robot searches the keywords on the Kruidvat webstore
The robot uses the bunq API to pay via the iDEAL QR code

Using RPA (steps 1 and 2)

For RPA, I used UiPath Studio. It helps to create a software robot without programming. The tool can record operations (e.g. click, input, open, or close) within an application (e.g. browser, email client, or SAP). It also lets you drag and drop activities tasks that your robot will repeat.

UiPath Studio is free and easy to install. This tutorial will help you get started with UiPath Studio.

Here are the steps I took within the UiPath Studio interface:

Main Flow Chart on the demo
Activities for the robot to carry out: open the browser, search for the keywords, and get the IDEAL QR snapshot
Invoking shell to run the PHP script

I assume that you have installed PHP, opened a composer at your computer (Windows OS in my case), and have connected to the bunq API.

You can also download my demo from my GitHub page, where I use PHP QR decode (ZXing library) and Bunq PHP SDK.

How to install the demo:

Clone from Github, and then do the following:

1) Move the images folder to your computer desktop.

2) Move the bunq folder to c:\ .

3) Type the following in the dos command line. This will install the bunq packages and the QR code decoder.

4) Use UiPath Studio to open OCRImagestoFindProduct\project.json. Run it.

How to write the PHP code:

1) Check composer.json for the QR-code decoder. I use the ZXING library (khanamiryan/qrcode-detector-decoder).

2) Get the QR-code string.

3) Post the iDEAL QR-code string using the bunq API. Check tinker\scanqr.php. The bunq PHP SDK offers the TokenQrRequestIdeal class.

4) Accept the iDEAL payment request.

That’s it! I hope you’ve had fun! Looking forward to hearing about your creative ideas on using RPA with the bunq API. Let me know if you have questions!

Also, don’t forget to clap to this tutorial if you have enjoyed it! :)

--

--