Skip to main content
GoCardless API · invalid_api_usage · 401

GoCardless access_token_revoked: Odoo can no longer talk to your account

The access token is the key Odoo uses to talk to your GoCardless account. If it is revoked or disabled, GoCardless rejects every request and no collection can be taken. With the two-click connection, GoCardless warns and the connector records it.

FlexigoTech · Editor in charge: Víctor Gómez · Updated 6 November 2026

Key facts

Versions
Odoo 17, 18, 19 and 20
Checked
in the connector's source code, version 17.0, 18.0, 19.0 and 20.0 · against the sources linked at the end
Reading time
4 min

What GoCardless says

ReasonTypeGoCardless text
access_token_revokedinvalid_api_usageToken has been revoked by the user.
access_token_not_activeinvalid_api_usageToken has been disabled.
unauthorizedinvalid_api_usageCredentials not recognised.

For Odoo, the three mean the same thing: the credential used to make requests no longer works. In its HTTP status code table, GoCardless reserves 401 for that case: “Missing or invalid Authorization header, or the user has been disabled.”. They are invalid_api_usage errors, those caused by how the request is made, and for those GoCardless asks you to “alert your dev team”.

GoCardless access_token_revoked error card
The three reasons for a token that no longer works, their invalid_api_usage type and the HTTP 401 code.

When the token stops working

“Connect my GoCardless account” is the two-click connection, through FlexigoTech: a partner integration. According to GoCardless's partner guide, the merchant can revoke that access from their Dashboard (“they can revoke your access from the GoCardless dashboard”) or close their account. GoCardless then sends a last webhook and the token stops working: “Your access token stops working, so you can't make any more API calls for that user.”.

What Odoo does with the connector

With the two-click connection, that last webhook arrives without an event id, as organisations · disconnected. The connector applies it like this:

  1. It deletes the token and the webhook secret, and the provider connection changes to “Disconnected in GoCardless”.
  2. It writes on your company contact “GoCardless reports that the account was disconnected from Odoo on … (…). No collection can be taken until it is connected again.”, with the date and the cause sent by GoCardless.
  3. It creates the activity “GoCardless disconnected”, so someone is notified without opening the provider.

From then on the connector no longer calls GoCardless with that provider: the hourly task skips it, and a collection with a customer's saved payment method goes to “Error” with “This provider is not connected to GoCardless any more: connect it again first.”.

Without that warning, the token stays stored and GoCardless rejects every request. In a collection, the transaction goes to “Error” with “GoCardless rejected the request.” and, below it, GoCardless's message with the reason (access_token_revoked, access_token_not_active or unauthorized) and the request_id in square brackets. The invoice remains pending collection, and the hourly task does not resend a transaction in error.

The connector writes the contact notice and the activity without anyone present, when applying the webhook. The connector writes these texts in English, so in an English-language Odoo they appear exactly as quoted here, whether a user or a scheduled action triggers them: “GoCardless reports that the account was disconnected from Odoo on … (…). No collection can be taken until it is connected again.” and “GoCardless disconnected”. Messages from a collection come out in the language of whoever launches it; if a scheduled action launches it, such as a subscription renewal, the same rule applies: “This provider is not connected to GoCardless any more: connect it again first.” and “GoCardless rejected the request.”.

Diagram: what GoCardless sends when the token stops working and what Odoo does with the connector
Diagram based on the connector's code (17.0, 18.0, 19.0 and 20.0) and GoCardless's documentation.

What to do

  1. Open the transaction from the invoice, with the “Payment Transaction” button at the top; the transactions menu only appears in developer mode, and it does not exist in Odoo 20. If the message says the provider is no longer connected, or names one of the three reasons, the problem is the connection, not the customer or their mandate.
  2. With the two-click connection, open the GoCardless payment provider and connect again with “Connect my GoCardless account”.
  3. With the connection working again, retry the collection of the invoices that were left uncollected. Transactions in error are not resent automatically.
  4. If you need to contact GoCardless, keep the request_id from the message: its documentation asks you to include it when contacting its support.

Why does the connector delete the token instead of continuing to try?

Because GoCardless says that token no longer works. That way, later collections explain what is happening (that the provider is no longer connected) instead of receiving one rejection after another, and the company contact records when and why it was disconnected.

Does a sandbox token work with the production account?

No. The help text of the token field says so: sandbox tokens start with sandbox_ and only work with the sandbox API. To collect for real you need a production token.

With our connector

In Odoo 17, 18, 19 and 20 the connector does not let a dead token turn into a chain of failed collections without explanation: if GoCardless warns of the disconnection, it says so in the company record and in an activity, and if it does not warn, each rejection carries GoCardless's reason and request_id.

Keep reading

GoCardless webhook: 498 Token Invalid, 204 and the Webhook-Signature headerGoCardless stops retrying on 498 (signature mismatch) and 204 (unknown event). What Odoo 17, 18, 19 and 20 reply, and why Odoo 20 sends a 401.GoCardless internal_server_error and request_timed_out: the failure is on GoCardlessGoCardless returns 500 internal_server_error or 504 request_timed_out when it fails on its side. What the connector does in Odoo and how to avoid double chargesGoCardless 429 rate_limit_exceeded: too many requests per minuteGoCardless returns 429 rate_limit_exceeded above 1,600 requests per minute. How the connector waits and retries, and what to do if it fails again.

GoCardless guides

GoCardless refund_payment_invalid_state: this collection cannot be refunded yetGoCardless mandate_not_inactive: the mandate cannot be reinstatedGoCardless MD01: mandate_cancelled and authorisation_disputed in a SEPA collectionGoCardless refer_to_payer: MS02, MS03, RR04 and SL01 in a SEPA collectionGoCardless MD06: the customer asks their bank to refund a collectionGoCardless 409 idempotent_creation_conflict: the payment already existedGoCardless bank_account_closed: AC04 and MD07, the account no longer existsGoCardless invalid_bank_details: AC01 and BE06, the bank account specified does not existGoCardless bank_account_transferred: AMEND, the mandate moves to another account
Checked in the connector's source code (version 17.0, 18.0, 19.0 and 20.0) and the linked sources

Sources

  • docs.gocardless.com/docs/api-reference/responses-and-errors
  • docs.gocardless.com/docs/partner-integrations/connect-your-merchants
  • docs.gocardless.com/docs/partner-integrations/webhooks-for-partners
  • Module source code: flexigo_payment_gocardless: models/payment_provider.py, line 71 in 17.0 (d203ee6), 18.0 (e2ab18b), 19.0 (ce7f5a3) and 20.0 (688d86b)
  • Module source code: flexigo_payment_gocardless: i18n/flexigo_payment_gocardless.pot, line 143 in 17.0 (d203ee6), line 143 in 18.0 (e2ab18b), line 143 in 19.0 (ce7f5a3) and line 145 in 20.0 (688d86b)
  • Module source code: flexigo_payment_gocardless: i18n/flexigo_payment_gocardless.pot, line 888 in 17.0 (d203ee6), line 888 in 18.0 (e2ab18b), line 888 in 19.0 (ce7f5a3) and line 903 in 20.0 (688d86b)
  • Module source code: flexigo_payment_gocardless: models/payment_provider.py, line 1237 in 17.0 (d203ee6), line 1237 in 18.0 (e2ab18b), line 1237 in 19.0 (ce7f5a3) and line 1234 in 20.0 (688d86b)
  • Module source code: flexigo_payment_gocardless: models/payment_provider.py, line 1241 in 17.0 (d203ee6), line 1241 in 18.0 (e2ab18b), line 1241 in 19.0 (ce7f5a3) and line 1238 in 20.0 (688d86b)
  • Module source code: flexigo_payment_gocardless: i18n/flexigo_payment_gocardless.pot, line 265 in 17.0 (d203ee6), line 265 in 18.0 (e2ab18b), line 265 in 19.0 (ce7f5a3) and line 267 in 20.0 (688d86b)
  • Module source code: flexigo_payment_gocardless: i18n/flexigo_payment_gocardless.pot, line 545 in 17.0 (d203ee6), line 545 in 18.0 (e2ab18b), line 545 in 19.0 (ce7f5a3) and line 547 in 20.0 (688d86b)
  • Module source code: flexigo_payment_gocardless: i18n/flexigo_payment_gocardless.pot, line 456 in 17.0 (d203ee6), line 456 in 18.0 (e2ab18b), line 456 in 19.0 (ce7f5a3) and line 458 in 20.0 (688d86b)
  • Module source code: flexigo_payment_gocardless: models/payment_provider.py, line 732 in 17.0 (d203ee6), line 732 in 18.0 (e2ab18b), line 732 in 19.0 (ce7f5a3) and line 734 in 20.0 (688d86b)
  • Module source code: flexigo_payment_gocardless: models/payment_provider.py, line 336 in 17.0 (d203ee6), 18.0 (e2ab18b), 19.0 (ce7f5a3) and 20.0 (688d86b)
  • Module source code: flexigo_payment_gocardless: i18n/flexigo_payment_gocardless.pot, line 1740 in 17.0 (d203ee6), line 1740 in 18.0 (e2ab18b), line 1740 in 19.0 (ce7f5a3) and line 1745 in 20.0 (688d86b)
  • Module source code: flexigo_payment_gocardless: models/payment_provider.py, line 397 in 17.0 (d203ee6), 18.0 (e2ab18b), 19.0 (ce7f5a3) and 20.0 (688d86b)
  • Module source code: flexigo_payment_gocardless: models/payment_provider.py, line 462 in 17.0 (d203ee6), 18.0 (e2ab18b), 19.0 (ce7f5a3) and 20.0 (688d86b)
  • Module source code: flexigo_payment_gocardless: i18n/flexigo_payment_gocardless.pot, line 521 in 17.0 (d203ee6), line 521 in 18.0 (e2ab18b), line 521 in 19.0 (ce7f5a3) and line 523 in 20.0 (688d86b)
  • Module source code: flexigo_payment_gocardless: models/payment_transaction.py, line 281 in 17.0 (d203ee6), line 281 in 18.0 (e2ab18b), line 281 in 19.0 (ce7f5a3) and line 292 in 20.0 (688d86b)
  • Module source code: flexigo_payment_gocardless: models/payment_transaction.py, line 247 in 17.0 (d203ee6), line 247 in 18.0 (e2ab18b), line 247 in 19.0 (ce7f5a3) and line 258 in 20.0 (688d86b)
  • Module source code: flexigo_payment_gocardless: models/payment_provider.py, line 623 in 17.0 (d203ee6), line 623 in 18.0 (e2ab18b), line 623 in 19.0 (ce7f5a3) and line 625 in 20.0 (688d86b)
  • Module source code: flexigo_payment_gocardless: models/payment_provider.py, line 742 in 17.0 (d203ee6), line 742 in 18.0 (e2ab18b), line 742 in 19.0 (ce7f5a3) and line 744 in 20.0 (688d86b)
  • Module source code: flexigo_payment_gocardless: i18n/flexigo_payment_gocardless.pot, line 1100 in 17.0 (d203ee6), line 1100 in 18.0 (e2ab18b), line 1100 in 19.0 (ce7f5a3) and line 1107 in 20.0 (688d86b)
  • Module source code: flexigo_payment_gocardless: i18n/flexigo_payment_gocardless.pot, line 346 in 17.0 (d203ee6), line 346 in 18.0 (e2ab18b), line 346 in 19.0 (ce7f5a3) and line 348 in 20.0 (688d86b)
  • Module source code: flexigo_payment_gocardless: i18n/flexigo_payment_gocardless.pot, line 1167 in 17.0 (d203ee6), line 1167 in 18.0 (e2ab18b), line 1167 in 19.0 (ce7f5a3) and line 1174 in 20.0 (688d86b)
  • github.com/odoo/odoo/blob/20.0/addons/payment/i18n/payment.pot
  • github.com/odoo/odoo/blob/20.0/addons/account_payment/views/account_move_views.xml
  • github.com/odoo/odoo/blob/17.0/odoo/http.py
  • Module source code: flexigo_payment_gocardless: __manifest__.py, line 31 in 17.0 (d203ee6), 18.0 (e2ab18b), 19.0 (ce7f5a3) and 20.0 (688d86b)