Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
113 lines (81 sloc) 4.47 KB


{% hint style="info" %} OAuth 2.0 is a protocol that will let your app connect to bunq users in a safe and easy way. 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. {% endhint %}

What can my apps do with OAuth?

The permissions OAuth allows are the following:

  • read Monetary Accounts;
  • read Payments & Transactions;
  • create Payments, however you can only transfer money between Monetary Accounts of the same user;
  • create Draft-Payments;
  • assign a Monetary account to a Card;
  • read Request-Inquiries and Request-Responses.

Get started with OAuth

Follow these steps to get started with OAuth:

  1. Register an OAuth Client in the bunq app. You can find the OAuth menu by going Profile → Security & Settings → Developers → OAuth.
  2. Add one or more redirect URLs.
  3. Get your Client ID and Client Secret from the bunq app.
  4. Redirect your users to the OAuth authorization URL as described here.
  5. If the user accepts the authorization request, they will be redirected to the previously specified redirect_uri with an authorization Code parameter.
  6. Use the token endpoint to exchange the authorization Code for an Access Token.
  7. Use the Access Token as a normal API Key. Open a session or use our SDKs to get started.

Authorization Request

Your web or mobile app must redirect users using the following parameters:

  • response_type - bunq supports the authorization code grant. Provide code as a parameter (required);
  • client_id - your Client ID that you can get from the bunq app (required);
  • redirect_uri - the URL you wish the user to be redirected to after the authorization is complete (required);
  • state - a unique string to be passed back upon completion (optional).

Authorization request example:

Authorization request response example:

Token Exchange

If the authorization request is accepted by the user, you get the authorization Code. Exchange it for an Access Token.

Make a POST call to Pass the following parameters as GET variables:

  • grant_type - the grant type used, use authorization_code for now (required)
  • code - the authorization Code you received after the authorization request was accepted (required)
  • redirect_uri - the same redirect URL you used with the authorization request (required)
  • client_id - your Client ID (required)
  • client_secret - your Client Secret (required)

Token request example:

{% hint style="info" %} The request only contains URL parameters. {% endhint %}

Example of a successful response:

    "access_token": "8baec0ac1aafca3345d5b811042feecfe0272514c5d09a69b5fbc84cb1c06029",
    "token_type": "bearer",
    "state": "594f5548-6dfb-4b02-8620-08e03a9469e6"

Example of an error response:

    "error": "invalid_grant",
    "error_description": "The authorization code is invalid or expired."

{% hint style="info" %}

What's next?

The access_token you've received can be used as a normal API key. Use it to create an authorized session with the user account. {% endhint %}

Using the Connect button

Ready to connect to bunq users to your application? Do it with a Connect to bunq button. Feel free to use our style guide and prebuilt design assets.

You can’t perform that action at this time.