0. Both the consumer and the merchant have a bunq account.
The consumer wants to pay with bunq. They enter their alias in the bunq payment field at checkout and press the enter button.
The merchant sends a payment request to the consumer.
The consumer receives a push notification, opens the bunq app and accepts to the payment request in the bunq app.
The merchant gets an immediate confirmation of the payment.
Please be aware that if you will gain access to account information of other bunq users or initiate a payment for them, you require a PSD2 permit.
Make sure that you have opened a session
Make sure you pass the session Token in the X-Bunq-Client-Authentication
header in all the following requests of the session.
The perfect time to open a session on the bunq server is when the consumer is at checkout and selects the bunq payment method.
List all your monetary accounts and choose the one you want to use to receive the payments to. Save its id
and later use it in the payment request.
Optionally, you can attach an image to the request for payment.
Make sure you set the Content-Type
header to match the MIME type of the image.
Pass a description of the image via the X-Bunq-Attachment-Description
header.
The payload of this request is the binary representation of the image file. Do not use any JSON formatting.
Save the id
of the posted attachment. You’ll need it to attach the attachment to the payment request. payment.
Request a payment by sending a POST /request-inquiry
request.
A request inquiry is a request for payment that your customer can respond to by either accepting or rejecting it.
Pass the customer’s email address, phone number or IBAN in the counterparty_alias
field.
Set the correct type
for the alias (e.g. EMAIL). Note that if you choose to pass the IBAN, the name of the counterparty_alias
is required.
Provide the id
of the created attachment (optional).
Receive the id
of the created request inquiry in the response
Save this id
.
Use it to check if the customer has responded to the request yet.
After you send the payment request and get its id
, you can poll it to see if its status has changed.
If the status
is ACCEPTED
, the customer has accepted the request and paid the money. You will have received the money on the connected monetary account.
If the status
is REJECTED
, the customer did not accept the request.