Receiving payments on your website using bunq.me
Imagine you're running a charity and want to collect donations directly through your website. After someone donates, you'd like to redirect them to a custom "Thank You" page— to show appreciation, share what their donation supports, or even offer a downloadable gift or receipt.
In this tutorial, you’ll learn how to use the bunq API to:
Create a payment link you can share or embed on your site
Add a redirect URL that sends users to a confirmation or thank-you page after payment
Make the experience smooth, branded, and personal
This works great for charities, event registrations, fundraising campaigns, or any situation where you want to acknowledge someone after they’ve completed a payment.
Let’s dive in and build a seamless donation flow with a touch of gratitude 💚
Let's create a link that we can embed in our own website
In order to create a custom link we'll need the bunq.me-tab endpoints. This allows you to create a payment request and embed the link on your site.
We start by creating a bunq.me tab
We post the following body. Note that you can set a redirect URL to your own thank you page. You can use this can also be used to add url parameters, for example a user id so you can retrieve the user in your own database. For this example we'll just redirect to the bunq homepage
This returns us a simple response with the ID of our new bunq.me tab
API call
So we created the tab, but what is the URL we can send our user to?
We'll need to make a second API call in order to retrieve all data. This one is simply a get request using the ID that we got from our POST message (see below. It returns us a object with one key called bunq-me-tab-share-url
This url is what you can add to your website. For instance on a button that says 'donate now' or 'go to checkout'.
When the user clicks on that link they will be send to a payment portal. That looks like this. The URL expires in 20 minutes and once the user pays they will be redirected to the redirect URL that we provided.
Example response that shows the bunqme_tab_share_url
As we can see our URL Will be: "https://bunqme.triage.bunq.net/o/6kwsisQcpUD4hWaBZUnuW4", So we can add that to our own webpage. Sending the user to that page brings them to this page where they can make their payment.
Be aware the URL to your tab eventually expires
It's good to know that bunq.me-tab links eventually expire. The bunqmetab object has a property time_expiry that tells you when.
The Redirect to your thank you page
This is already set up. When you made the initial POST request to set up your bunq.me tab you added a redirect_url and you can see it in the response. So when the user pays, they will be automatically forwarded to bunq.com which I specified in the initial POST request.
If you want to retrieve the user of your system to the thank you page (or any redirect page for that matter) then you may want to construct a bunqme-tab for each individual user. Let's assume your system keeps track of a userid then you could construct a redirect URL like so:
https://redirecturl.com/checkout_completed/{userid_of_your_user}
This allows you to retrieve the userdetails from your database and enable a subscription, or send them an email as a result.
How do I get a list of payments?
If you wonder how you got paid they you can always check the payments in your monetary account. But there is a much easier way. Simply by doing another GET request on the /bunqme-tab endpoint gets you the object that we already showed above.
Last updated
Was this helpful?