.png)
GoCardless Integration Guide
Connect GoCardless bank debit and open-banking payment workflows with enterprise systems through its REST API and signed webhook events.
GoCardless integration options at a glance
GoCardless provides a JSON REST API for Customers, Mandates, Payments, Subscriptions, Payouts, Refunds, Billing Requests, and related resources. Signed webhooks notify integrations about selected mandate, payment, subscription, and payout state changes. API access commonly uses merchant-specific Bearer tokens, while OAuth is available for delegated or multi-merchant applications. List endpoints use cursor-based pagination, and a general-purpose bulk mutation API was not confirmed. Martini can securely call the REST API, validate webhook signatures, orchestrate asynchronous workflows, map payment data, persist cursors and event identifiers, and apply retry-safe reconciliation logic across sandbox and live environments.
Common GoCardless integration patterns
Common GoCardless data objects used in integrations
Authentication and security considerations
Bearer tokens and OAuth
GoCardless API requests use Bearer access tokens. OAuth is available for applications that connect on behalf of multiple GoCardless merchants or organisations.
Secrets and environments
Store API tokens, OAuth credentials, webhook secrets, and account settings in Martini environment configuration rather than source code. Keep sandbox and live credentials and webhook endpoints separate.
Webhook verification
GoCardless webhook requests include a signature. Validate the signature with the configured webhook secret before routing or storing the event, and avoid logging secrets or unnecessary sensitive payment data.
Operational considerations for GoCardless integrations
Pagination and rate limits
Follow GoCardless cursor-based pagination and persist synchronization checkpoints. Use controlled concurrency, backoff, and bounded retries for throttling and transient HTTP failures.
Idempotency and event ordering
Use idempotency keys for supported mutations and deduplicate webhook event identifiers. Because events may not be processed in business-action order, compare event metadata and current resource state before applying transitions.
Asynchronous status
An accepted payment request does not necessarily mean collection has completed. Store initial statuses and use later webhook events to distinguish payment collection, failure, chargeback, refund, and payout settlement.
Testing and change management
Test sandbox and live configurations independently. Manage the GoCardless API version explicitly and test changes to resource fields, event actions, status values, and pagination behavior before production release.
Reconciliation and data protection
Reconcile gross amounts, fees, currencies, payment references, settlement dates, and net payout amounts. Limit logs and stored data to what the business process requires and protect personal and financial information.
Why use Martini instead of scripts or point-to-point integrations?
Centralized orchestration
Martini provides a workflow layer for REST calls, signed webhook intake, asynchronous payment processing, reconciliation, and downstream updates instead of scattering logic across scripts.
Maintainable transformations
Mappings, canonical identifiers, business rules, pagination, and state transitions can be managed as reusable integration logic across GoCardless and multiple enterprise applications.
Reliable operations
Martini supports controlled retries, validation, deduplication, checkpointing, monitoring, and environment-specific configuration. These capabilities help integrations recover from transient failures without creating duplicate payments or accounting records.
API-led flexibility
Martini can consume GoCardless APIs and expose controlled APIs to internal systems, allowing payment processes to evolve without creating a separate point-to-point implementation for every application.