GoCardless integration
In short
Collect Direct Debit: mandates, payments, subscriptions and payouts. Connect it on the Integrations page; your app then calls GoCardless through Sapilon without ever holding a GoCardless credential.
Lets your app set customers up for Direct Debit with a hosted page, take one-off and recurring payments against their mandates, and read customers, payments and payouts.
Connecting
On the Integrations page choose Connect on GoCardless and fill in:
- Environment — api for live, api-sandbox for the sandbox.
- Access token — GoCardless → Developers → Create → Access token, read-write.
Sapilon checks the key with the provider before it saves it, and stores it encrypted; it is never shown again.
- Use a sandbox token on Build and Rehearsal and a live one on Live: two connections, each on its own environments.
What your app can do
Only these requests are available; anything else is refused.
GET /creditorsPOST /billing_requestsPOST /billing_request_flowsGET /customersGET /customers/*GET /mandatesGET /mandates/*GET|POST /paymentsGET /payments/*POST /payments/*/actions/cancelGET|POST /subscriptionsGET /subscriptions/*GET /payouts
How the agent uses it
Use integrations.request('gocardless', …); paths are relative to https://api.gocardless.com.
Send headers: { 'Idempotency-Key': '<unique id>' } on every POST.
- Set a customer up:
POST /billing_requests(body: { billing_requests: { mandate_request: { scheme: 'sepa_core' } } }), thenPOST /billing_request_flows(body: { billing_request_flows: { redirect_uri, exit_uri, links: { billing_request: 'BRQ…' } } }) and send the customer toauthorisation_url. GET /customers,GET /customers/{id},GET /mandates(query: { customer }),GET /mandates/{id}.GET|POST /payments— Example:{ method: 'POST', path: '/payments', headers: { 'Idempotency-Key': 'order-A17' }, body: { payments: { amount: 2500, currency: 'EUR', links: { mandate: 'MD123' }, description: 'Order A-17' } } }(amounts in cents).GET /payments/{id},POST /payments/{id}/actions/cancel.GET|POST /subscriptions—{ amount, currency, interval_unit: 'monthly', day_of_month: 1, links: { mandate } }.GET /subscriptions/{id}.GET /payouts,GET /creditors.
Refunds are not allowed.
More from GoCardless: https://developer.gocardless.com/api-reference