Logo
GoCardless API API Documentation

πŸš€ Getting Started-Next steps-Custom Payment Pages-Direct Debit

Number of APIs: 6


1. Create a Billing Request (Mandate)

POST {{url}}/billing_requests

Billing Requests help create resources that require input or action from a customer. An example of required input might be additional customer billing details, while an action would be asking a customer to authorise a payment using their mobile banking app.

See Billing Requests: Overview for how-to’s, explanations and tutorials.

Create a Billing Request API Docs



2. Collect Customer Details

POST {{url}}/billing_requests/{{billing_request}}/actions/collect_customer_details

If the billing request has a pending collectcustomerdetails action, this endpoint can be used to collect the details in order to complete it.

The endpoint takes the same payload as Customers, but checks that the customer fields are populated correctly for the billing request scheme.

Whatever is provided to this endpoint is used to update the referenced customer, and will take effect immediately after the request is successful.

Note: the region field should be uncommented for US customer addresses.

Collect Customer Details API Docs



3. Collect Bank Account Details

POST {{url}}/billing_requests/{{billing_request}}/actions/collect_bank_account

If the billing request has a pending collectbankaccount action, this endpoint can be used to collect the details in order to complete it.

The endpoint takes the same payload as Customer Bank Accounts, but check the bank account is valid for the billing request scheme before creating and attaching it.

Note: Customer bank accounts can be created with local or international bank details. You can find the different local bank detail formats, and how they should be used with the GoCardless API here.

Collect Bank Account Details API Docs



4. Create a Payment

POST {{url}}/payments

Creates a new payment object.

This fails with a mandateisinactive error if the linked mandate is cancelled or has failed. Payments can be created against mandates with status of: pendingcustomerapproval, pending_submission, submitted, and active.

Create a Payment API Docs



5. Fulfill a Billing Request

POST {{url}}/billing_requests/{{billing_request}}/actions/fulfil

If a billing request is ready to be fulfilled, call this endpoint to cause it to fulfil, executing the payment.

Fulfil a Billing Request API Docs



6. Confirm Customer & Bank Account Details

POST {{url}}/billing_requests/{{billing_request}}/actions/confirm_payer_details

This is needed when you have mandate_request. As a scheme compliance rule we are required to allow the payer to crosscheck the details entered by them and confirm it.

Confirm Customer & Bank Account Details API Docs



ENDPOINTS