---
updatedAt: 2026-11-05T12:49:46.000Z
agentTools:
  projectIndex: https://docs.developer.rabobank.com/payments/llms.txt
---

# Error codes

This page explains the most common OAuth 2.0 errors and how to resolve them.

## Authorization

### Invalid client ID

**HTTP status:** `401 Unauthorized`

**Error message:** `invalid client id or secret`

This error occurs when:

* The client ID is invalid.
* Your Third-Party Provider (TPP) application is not subscribed to an OAuth 2.0 API.

<Accordion title="Resolution" icon="fa-info-circle">
  * Verify that the client ID is correct.
  * Make sure your application is subscribed to an OAuth 2.0 API.
</Accordion>

### Redirect URI mismatch

The `redirect_uri` in the authorization request must match a redirect URI registered in the Rabobank Developer Portal.

If the values do not match, authorization fails.

<Image src="https://files.readme.io/231a55c9748f91c490c33185163c78c788de02a81ab88f422a3f098668aedb30-Screenshot_2025-08-20_173441.png" align="center" />

<Accordion title="Resolution" icon="fa-info-circle">
  - Verify that the `redirect_uri` parameter exactly matches a registered redirect URI.
  - If multiple redirect URIs are registered, use one of the configured values.
</Accordion>

## Access token request

### Invalid authorization code

**HTTP status:** `400 Bad Request`

```json
{
  "error": "invalid_grant"
}
```

The authorization code is expired, invalid, or has already been used.

<Accordion title="Resolution" icon="fa-info-circle">
  - Use a valid authorization code.
  - Exchange the authorization code within 5 minutes.
  - Use each authorization code only once.

  <Callout icon="👍" theme="okay">
    Add a 1000 ms delay before calling the token endpoint. This helps synchronize authorization codes across our servers.
  </Callout>
</Accordion>

### Invalid refresh token

**HTTP status:** `401 Unauthorized`

```json
{
  "error": "invalid_grant"
}
```

The refresh token is invalid, expired, or has already been used.

<Accordion title="Resolution" icon="fa-info-circle">
  - Use a valid refresh token.
  - Use each refresh token only once.
</Accordion>

### Invalid authorization header

**HTTP status:** `401 Unauthorized`

```json
{
  "error": "invalid_client"
}
```

The client ID and client secret in the Authorization header do not match the application credentials.

<Accordion title="Resolution" icon="fa-info-circle">
  - Verify the client ID and client secret.
  - Create the Authorization header according to the OAuth PSD2 or Premium API documentation.
</Accordion>

**HTTP status:** `400 Bad Request`

```json
{
  "error": "invalid_request"
}
```

The `grant_type` parameter is missing or contains an invalid value.

<Accordion title="Resolution" icon="fa-info-circle">
  - Include the `grant_type` parameter in the request.
  - Use the correct value:
    - `authorization_code` for authorization code exchange.
    - `refresh_token` for refresh token exchange.
</Accordion>

## Resource access

### Invalid access token

**HTTP status:** `401 Unauthorized`

```json
{
  "httpCode": "401",
  "httpMessage": "Unauthorized",
  "moreInformation": "This server could not verify that you are authorized to access the URL"
}
```

The access token is expired or invalid.

<Accordion title="Resolution" icon="fa-info-circle">
  - Check the access token expiry time.
  - Use a refresh token to request a new access token.
  - If refreshing fails, verify the consent status using the Consent Details Service API.
  - Start a new consent flow if the consent has expired or been revoked.
</Accordion>

### Invalid consent

A consent is invalid when its status is:

* `expired`
* `revokedByPsu`
* `terminatedByTpp`
* `received`
* `rejected`

**HTTP status:** `403 Forbidden`

```json
{
  "httpCode": "403",
  "httpMessage": "Forbidden",
  "moreInformation": "CONSENT_INVALID"
}
```

<Accordion title="Resolution" icon="fa-info-circle">
  - Retrieve the consent using the Consent Details Service API.
  - Verify the consent status.
  - Start a new authorization flow and collect consent again if the consent is no longer valid.
</Accordion>

### Expired or revoked consent

Access and refresh tokens may still be active after a consent has expired or been revoked.

This results in a `403 Forbidden` error with `CONSENT_INVALID`.

<Accordion title="Resolution" icon="fa-info-circle">
  - Check the consent status using the Consent Details Service API.
  - Start a new consent flow when required.
</Accordion>

<Callout icon="👍" theme="okay">
  Regularly validate consent status to prevent unexpected authorization failures.
</Callout>

### Missing required scope

**HTTP status:** `403 Forbidden`

**Error message:** `FORBIDDEN`

The access token does not contain the required scope for the API.

**Example**

An access token with scope `paymentRequest` cannot access the Account Information API, which requires scopes such as `ais.balances.read`.

<Accordion title="Resolution" icon="fa-info-circle">
  - Request the correct scopes during authorization.
  - Verify that the required API scope is included in the access token.
</Accordion>

## Troubleshooting checklist

### Authorization issues

* Verify the client ID and client secret.
* Verify the redirect URI configuration.

### Token request issues

* Use a valid authorization code.
* Exchange authorization codes within 5 minutes.
* Use authorization codes and refresh tokens only once.
* Include the correct `grant_type`.

### Resource access issues

* Monitor access token expiry.
* Verify consent status.
* Verify that the access token contains the required scopes.