In order to access the following endpoints and complete the required actions integrators will need the custom payment pages upgrade enabled on their account.
Even if integrators complete a selection of actions themselves, Billing Request Flows can be used to complete the remaining actions.
Our recommendations for whether integrators should implement each action are:
collect_customer_details, implement this if you want a white label flow to collect customer details or have already collected the details (prefilling, etc)
collect_bank_account, as with customer details, but be aware that Billing Request Flows can avoid this step for certain schemes which can improve conversion by reducing the number of details a payer has to manually input
confirm_payer_details, this action is not required for PayTo.
bank_authorisation, implement this as the final step
The actions presented on a Billing Request are unordered, but each action may have dependencies, or have other actions depending on it.
These are specified in the fields completes_actions and requires_actions.
requires_actions: Actions can only be executed if the actions listed in requires_action have been completed- in this example, we can’t complete the bank authorisation until we’ve collected the bank.
completes_actions: Actions can complete other actions, which can help streamline checkout flows. The example shows how a bank authorisation might collect customer details, completing that action as a side effect.
For most integrators, we suggest building flows that process actions in the order of:
collect_customer_details, so customer contact details are prioritised
collect_bank_account, if it is required and another action won’t complete it
bank_authorisation, as the penultimate step before completing the checkout flow
confirm_payer_details, only applicable if it is a mandate_request
The hosted checkout flow provided by Billing Request Flows is built to optimise conversion, and will follow the minimum number of steps to fulfil the Billing Request. Most integrators should lean on the flow to complete anything beyond collection of customer details.
Billing Requests aim to create billing resources against a customer, either a mandate (PayTo or Direct Debit), an Instant Bank Payment, or both.
Payment schemes vary in what customer details you are required to collect. The collect_customer_details action is about collecting all the details required by either the mandate or the payment scheme, to ensure we meet regulatory needs.
As an example, we can create a Billing Request for a AUD mandate:
The collect_customer_details.incomplete_fields object tells us what fields we need to collect, for both resources. Which fields are required changes depending on the schemes of the mandate (or payment).
The collect_customer_details action is now completed, meaning we can move on to other actions
As a result of us collecting the details, our customer and customer_billing_detail has been populated with the details we collected
Most integrators will collect these details via web forms, filled by their payers. Integrators are expected to build forms that can collect all possible customer and customer_billing_detail fields (see the Collect customer details schema) but only display the inputs required, as per incomplete_fields.
Depending on the scheme, we might need to collect bank account details before fulfilling the Billing Request. An example is a PayTo mandate, where we need to capture the payer’s bank in order to create payments against them.
As an example, we can create a Billing Request for a PayTo mandate:
As with all action endpoints, the response is the Billing Request. What we get back is:
1{2"billing_requests":{3"id":"BRQ000010NMDMH2",4"status":"ready_to_fulfil",5"mandate_request":{6"scheme":"pay_to",7"currency":"AUD"8},9"links":{10"customer":"CU00016WDAM7BS",11"customer_billing_detail":"CBD000010P52VRF",12"customer_bank_account":"BA0000QDWEEAFB",13"organisation":"OR123"14},15"actions":[16{17"type":"collect_bank_account",18"required":true,19"completes_actions":[20"choose_currency"21],22"requires_actions":[],23"status":"completed"24},25 ...,26],27"resources":{28"customer_bank_account":{29"id":"BA0000QDWEEAFB",30"created_at":"2021-04-08T15:30:36.019Z",31"account_number_ending":"70",32"account_holder_name":"PADDINGTON BEAR",33"account_type":null,34"bank_name":"NATIONAL AUSTRALIA BANK",35"currency":"AUD",36"country_code":"AU",37"metadata":{},38"enabled":true,39"links":{40"customer":"CU00016WDAM7BS"41}42}43}44}45}
Note that:
The collect_bank_account action is now completed, meaning we can move on to other actions
As a result of us collecting the bank account, we have created a customer_bank_account resource and you can see the links.customer_bank_account ID has been set
We advise most integrators use Billing Request Flows to complete this action, as the hosted flows will try skipping this action if it can be fulfilled by another (such as bank authorisation).
To authorise the PayTo mandate, the payer needs to log in to their bank. This is initiated by the bank_authorisation.
In other words, hitting the bank_authorisation endpoint will trigger the creation of the PayTo mandate which is the final action required. The rest is up to the payer.
As an example, we can create a Billing Request for PayTo:
In order to automatically receive new features and always remain scheme compliant without having to change your integration, GoCardless will need to adjust actions by adding new actions or making optional actions required. This means it will break your integration if you don’t fall back to Billing Request Flow. Therefore if you are building custom payment pages you needs to Implement the actions you are aware of and want to process.
If you reach the last action and the Billing Request is still pending (as opposed to ready_to_fulfil or fulfilled), then you need to create a Billing Request Flow and send the payers through that flow.