canonical: https://jentic.com/apis/gocardless.com/gocardless

# GoCardless API

Jentic publishes the only available OpenAPI specification for GoCardless API, keeping it validated and agent-ready. The GoCardless API powers recurring payment collection via bank debit schemes including Bacs (UK), SEPA (Eurozone), ACH (US), BECS (Australia), Autogiro (Sweden), and PAD (Canada). It exposes customers, customer bank accounts, mandates, payments, subscriptions, payouts, refunds, events, redirect flows, billing requests, and webhooks. It is the standard interface for SaaS billing, membership organisations, and any business that wants to charge customers directly from their bank account on a recurring basis.

## For AI agents

Collect direct debit payments, manage mandates and subscriptions, and reconcile payouts across major bank debit schemes. Designed for recurring billing automation.

## Scope

Does not handle card payments, digital wallets, or accounting and tax filing - use for bank-debit payment collection and reconciliation only.

## Capabilities

- Create a customer and attach a customer bank account before setting up a mandate
- Authorise a mandate via redirect flow or billing request and reuse it for ongoing collection
- Charge a one-off payment against an existing mandate and check its settlement status
- Schedule a recurring subscription and pause, resume, or cancel it without re-authorising the mandate
- Issue a refund against a settled payment and track refund completion
- Reconcile payouts to the merchant bank account with the underlying payments and refunds via payout items

## Use cases

### SaaS Subscription Billing

A SaaS company collects monthly subscription fees by direct debit. The integration creates a customer, walks the user through a redirect flow or billing request to authorise a mandate, then schedules a subscription against that mandate via /subscriptions. Failed payments surface through /events, and the system can pause, resume, or cancel the subscription without re-authorising the mandate.

Example prompt: Create a monthly subscription for customer 'CU12345' against mandate 'MD789' for £29 starting on the 1st of next month.

### One-Off Invoice Collection

Membership and professional services firms use GoCardless to collect one-off invoices once a mandate is in place. POST /payments charges a specific amount against a mandate and the payment lifecycle (pending, submitted, confirmed, paid_out, failed) is observable via /events for accounting reconciliation.

Example prompt: Create a £450 payment against mandate 'MD789' with description 'Invoice 2026-04-118' and poll /events until it reaches paid_out.

### Payout Reconciliation

Finance teams reconcile GoCardless payouts against their bank statements by pulling /payouts and the matching /payout_items. Each payout item links a settled payment, refund, or charge back to a specific payout, so accounting systems can trace every line on the bank statement.

Example prompt: List all payouts in May 2026 and pull the payout_items for each so finance can map them to the merchant bank deposits.

### AI Agent Billing Operations

A finance AI agent uses Jentic to automate dunning and refund operations. It listens to GoCardless webhooks, retrieves failed payment events, and either retries the payment or cancels the subscription based on policy - all without holding the GoCardless access token in its prompt.

Example prompt: Search Jentic for 'retry failed gocardless payment', load the schema, and retry every payment that failed in the last 24 hours.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | `/customers` | Create a new customer record |
| POST | `/mandates` | Create a mandate against a customer bank account |
| POST | `/payments` | Collect a one-off payment against a mandate |
| POST | `/payments/{identity}/actions/retry` | Retry a failed payment |
| POST | `/subscriptions` | Schedule a recurring subscription |
| POST | `/subscriptions/{identity}/actions/cancel` | Cancel a subscription |
| POST | `/refunds` | Issue a refund against a settled payment |
| GET | `/payout_items` | List the items inside a payout |

## Key resources

- **Customers** — Create and manage customer records and their bank accounts
- **Mandates** — Authorise, cancel, and reinstate direct debit mandates
- **Payments** — Create one-off payments and retry or cancel them
- **Subscriptions** — Schedule recurring collections against a mandate
- **Payouts** — Reconcile settlements to the merchant bank account
- **Refunds** — Issue and track refunds against settled payments
- **Events** — Read the lifecycle events for every resource
- **Redirect Flows** — Hosted mandate authorisation journey
- **Billing Requests** — Newer combined mandate plus payment authorisation
- **Webhooks** — Manage webhook endpoints for event delivery

## Why Jentic

- **Setup:** Wiring GoCardless by hand means implementing its bearer token auth against api.gocardless.com, managing idempotency and the retry actions on payments and subscriptions, and mapping the customer, mandate, and payment lifecycle yourself. Through Jentic you install once, import GoCardless from the API Directory, store the token once, and your agent calls it.
- **Permission scoping:** GoCardless creates customers, mandates, and payments through top-level POST bodies rather than a resource in the URL path, so scope the agent to the operations it needs, such as creating a payment or reading payout items. You choose the operations it may call, so destructive ones like cancelling a subscription or a mandate are not included unless you add them.
- **Credential handling:** Your GoCardless token is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'collect a direct debit' or 'retry a failed payment', and Jentic returns the matching GoCardless operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Stripe API** — Stripe collects card and ACH debits with broader global card coverage but higher per-transaction fees on bank debits.
- **Plaid API** — Plaid verifies bank accounts and provides instant account validation that complements GoCardless mandate setup.
- **TrueLayer API** — TrueLayer offers UK and EU open-banking payment initiation as a faster alternative or complement to direct debit.

## FAQ

### Why is there no official OpenAPI spec for GoCardless API?

GoCardless publishes detailed reference documentation but does not ship a maintained OpenAPI specification. Jentic generates and maintains this spec so AI agents and developers can call GoCardless API via structured tooling. It is validated against the live API and kept up to date. Get started with Jentic One, the self-hosted execution layer.

### What authentication does the GoCardless API use?

GoCardless uses HTTP bearer token authentication. Live and sandbox tokens are issued from the GoCardless dashboard. Through Jentic, the access token is stored encrypted in the vault and never enters the agent context.

### Can I cancel a subscription with the GoCardless API?

Yes. POST `/subscriptions/{identity}/actions/cancel` cancels a subscription so no further payments are scheduled. The underlying mandate stays active so the customer can be re-subscribed without a new authorisation.

### What are the rate limits for the GoCardless API?

The OpenAPI spec does not declare numeric rate limits. GoCardless publishes per-account limits in its developer documentation; in practice, paginate list endpoints and back off on HTTP 429 responses.

### How do I retry a failed direct debit payment through Jentic?

Run a Jentic search for 'retry gocardless payment', load the schema for POST `/payments/{identity}/actions/retry`, and execute it with the payment ID. Install with pip install jentic and chain search, load, and execute.

### Does the GoCardless API support refunds?

Yes. POST /refunds creates a refund against a settled payment, and GET `/refunds/{identity}` returns its status. Refunds settle through the payout cycle and appear as line items on the next /payout_items response.

### Can I limit what my agent is allowed to do with the GoCardless API?

Yes. Because Jentic One is self-hosted, you decide which GoCardless operations your agent may call, so you can grant only what a task needs, such as creating a payment against a mandate or reading payout items. Since GoCardless acts on customers, mandates, and payments through top-level POST bodies rather than a resource in the URL path, destructive operations like cancelling a subscription or a mandate are excluded unless you explicitly add them. Your GoCardless token stays with your own instance and is injected at execution time, so the agent never sees the credential or any operation you did not allow.
