Build a client to create mandates offline
Collecting your client’s payment authorisation via an online form isn’t always possible or doesn’t match how you would normally interact with your customers.
To help with this, we also offer paper and phone authorisation collection options (subject to regional availability).
Please note: This feature only applies to merchants on our Custom and self-serve Pro packages, and with our Custom Payment Pages feature enabled. If you’re currently on our Standard or Plus package and wish to upgrade, or would like this feature enabled please get in touch.
Collect paper or telephone authorisation from your customers
This page details the steps required for you to collect authorisation this way. Please ensure that you read it and are comfortable with the compliance requirements.
If you're implementing offline mandates for ACH, please follow the instructions on this page.
If you are interested in using one or both of these methods but haven’t yet had this feature enabled on your account, please see here for more information on how to get this set up.
Build a client to create mandates offline
There are two approaches you may take based on your current integration and future plans.
Core Endpoints: This API supports bank debit features. Use it if you are already integrated with it and don’t intend to implement Instant Bank Pay..
Billing Requests API: This is our newest API, which supports both bank debit and open banking use cases. Use it if you intend to build open banking functionality in future.
Billing Request Actions
Whenever you create a Billing Request, it will have a list of actions
that require completion before it’s possible to fulfil the request.
The possible actions are:
choose_currency
, have the payer choose from a list of supported currenciescollect_customer_details
, collect customer details required for the schemescollect_bank_account
, create the bank account for the mandate/payment
confirm_payer_details
, confirm customer and bank account details provided by the payer
Once all required actions have been completed, the Billing Request will become ready_to_fulfil
, and an integrator can use the fulfil action to create all associated resources.
Which actions should I implement?
When creating a Billing Request, the response will show you which actions you need to implement to complete it. We will also go through the actions you need to implement in the following steps.
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
.
Taking collect_customer_details
as an example:
1{
2 "type": "collect_customer_details",
3 "required": true,
4 "completes_actions": [],
5 "requires_actions": [
6 "choose_currency"
7 ],
8 "status": "pending"
9}
Action status
is either pending
or completed
.
requires_actions:
Actions can only be executed if the actions listed in requires_action
have been completed- in this example, we can't complete collect_customer_details
until we've chosen the currency.
completes_actions:
Actions can complete other actions, which can help streamline checkout flows. In this example, collect_customer_details does not complete any other action as a side effect.
For offline mandates, we suggest building the flow that process the actions in the order of:
collect_customer_details
, requires thechoose_currency
action to be completed but this will be completed automatically when creating the ACH mandate via the Billing Request create APIcollect_bank_account
, collect the customer's bank account detailsconfirm_payer_details
, as a scheme compliance rule it is required to crosscheck the details entered and confirm them
Create a Billing Request that specifies the type of mandate you wish to create via the mandate_request
field. In this example, we are specifying the scheme as ACH which will default the currency to USD.
For ACH specific mandates, you can provide the authorisation_source
field to create an offline mandate. The authorisation_source
field specifies the way in which the payer gave authorisation to the merchant. This is sometimes referred to as SEC code. This field takes values of either telephone
, paper
or web
.
Use the Create a Billing Request endpoint:
1$client = new \GoCardlessPro\Client(array(
2 'access_token' => 'your_access_token_here',
3 'environment' => \GoCardlessPro\Environment::SANDBOX
4));
5
6$client->billingRequests()->create([
7 "params" => [
8 "mandate_request" => [
9 "scheme" => "ach",
10 "authorisation_source" => "telephone"
11 ]
12 ]
13]);
You’ll receive a full Billing Request resource back.
It will look like this, some detail omitted:
{
"billing_requests": {
"id": "BRQ123",
"status": "pending",
"payment_request": null,
"mandate_request": {
"currency": "USD",
"scheme": "ach",
"authorisation_source": "telephone"
},
"links": {
"customer": "CU00016WDAM7BS",
"customer_billing_detail": "CBD000010PDF4WD",
"mandate_request": "MRQ123",
"organisation": "OR123"
},
"actions": [
{
"type": "collect_customer_details",
"status": "pending",
},
{
"type": "collect_bank_account",
"status": "pending"
}
]
}
}
This completes the choose_currency
action, and we can now continue with completing the rest of the Billing Request actions to set up this mandate.
Action: collect_customer_details
Billing Requests aim to create billing resources against a customer, either a mandate (Direct Debit, PayTo or VRPs), 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 created a Billing Request for ACH scheme:
1POST /billing_requests
2{
3 "billing_requests": {
4 "mandate_request": {
5 "scheme": "ach",
6 "authorisation_source": "telephone"
7 }
8 }
9}
This returns a Billing Request that looks like this:
1{
2 "billing_requests": {
3 "id": "BRQ123",
4 "status": "pending",
5 "mandate_request": {
6 "currency": "USD",
7 "scheme": "ach",
8 "authorisation_source": "telephone"
9 },
10 "links": {
11 "customer": "CU00016WDAM7BS",
12 "customer_billing_detail": "CBD000010PDF4WD",
13 "mandate_request": "MRQ123",
14 "organisation": "OR123"
15 },
16 "actions": [
17 {
18 "type": "collect_customer_details",
19 "required": true,
20 "completes_actions": [],
21 "requires_actions": [
22 "choose_currency"
23 ],
24 "status": "pending",
25 "collect_customer_details": {
26 "incomplete_fields": {
27 "customer": [
28 "email",
29 "given_name",
30 "family_name"
31 ],
32 "customer_billing_detail": [
33 "address_line1",
34 "city",
35 "postal_code",
36 "country_code",
37 "region",
38 "ip_address"
39 ]
40 }
41 }
42 },
43 ...,
44 ],
45 "resources": {
46 "customer": {
47 "id": "CU00016WDAM7BS",
48 "created_at": "2021-04-08T14:06:30.977Z",
49 "email": null,
50 "given_name": null,
51 "family_name": null,
52 "company_name": null,
53 "language": "en",
54 "phone_number": null,
55 "metadata": {}
56 },
57 "customer_billing_detail": {
58 "id": "CBD000010PDF4WD",
59 "created_at": "2021-04-08T14:06:30.997Z",
60 "address_line1": null,
61 "address_line2": null,
62 "address_line3": null,
63 "city": null,
64 "region": null,
65 "postal_code": null,
66 "country_code": null,
67 "swedish_identity_number": null,
68 "danish_identity_number": null
69 }
70 }
71 }
72}
Note that:
There is a
collect_customer_details
action, which ispending
A new customer has been created for us, as the Billing Request wasn’t attached to an existing customer
The
customer
andcustomer_billing_detail
resources are presented back to us, and they have no filled fields
The collect_customer_details
action is designed to help us collect the required information from our customers.
Taking a closer look at the action:
1{
2 "type": "collect_customer_details",
3 "required": true,
4 "completes_actions": [],
5 "requires_actions": [
6 "choose_currency"
7 ],
8 "status": "pending",
9 "collect_customer_details": {
10 "incomplete_fields": {
11 "customer": [
12 "email",
13 "given_name",
14 "family_name"
15 ],
16 "customer_billing_detail": [
17 "address_line1",
18 "city",
19 "postal_code",
20 "country_code",
21 "region",
22 "ip_address"
23 ]
24 }
25 }
26}
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).
We can complete this action by POST’ing to the Collect customer details for the billing request endpoint.
Note that:
For online mandates with
"authorisation_source": "web"
, you will need to provide payer'sip_address
as a result of their completion of a mandate setup flow in their browser.For
paper
andtelephone
mandates, you will still need to provide anip_address
in thecustomer_billing_detail
, however, this can just be a dummyip_address
(e.g. 192.0.0.0).
1$client = new \GoCardlessPro\Client(array(
2 'access_token' => 'your_access_token_here',
3 'environment' => \GoCardlessPro\Environment::SANDBOX
4));
5
6$client->billingRequests()->collectCustomerDetails("BR123", [
7 "params" => [
8 "customer" => [
9 "email" => "user@example.com",
10 "given_name" => "Frank",
11 "family_name" => "Osborne"
12 ],
13 "customer_billing_detail" => [
14 "address_line1" => "1 Somewhere Lane",
15 "city" => "Los Angeles",
16 "postal_code" => "90213",
17 "country_code" => "US",
18 "region" => "CA"
19 "ip_address" => "192.0.2.1"
20 ]
21 ]
22]);
As with all action endpoints, the response is the Billing Request. What we get back is:
1{
2 "billing_requests": {
3 "id": "BRQ123",
4 "status": "pending",
5 "mandate_request": {
6 "scheme": "ach",
7 "currency": "USD",
8 "authorisation_source": "telephone"
9 },
10 "links": {
11 "customer": "CU00016WDAM7BS",
12 "customer_billing_detail": "CBD000010PDF4WD",
13 "organisation": "OR123",
14 "mandate_request": "MRQ123"
15 },
16 "actions": [
17 {
18 "type": "collect_customer_details",
19 "required": true,
20 "completes_actions": [],
21 "requires_actions": [
22 "choose_currency"
23 ],
24 "status": "completed",
25 "collect_customer_details": {
26 "incomplete_fields": {
27 "customer": [],
28 "customer_billing_detail": []
29 }
30 }
31 },
32 ...,
33 ],
34 "resources": {
35 "customer": {
36 "id": "CU00016WDAM7BS",
37 "created_at": "2021-04-08T14:06:30.977Z",
38 "email": "user@example.com",
39 "given_name": "Frank",
40 "family_name": "Osborne",
41 "company_name": null,
42 "language": "en",
43 "phone_number": null,
44 "metadata": {}
45 },
46 "customer_billing_detail": {
47 "id": "CBD000010PDF4WD",
48 "created_at": "2021-04-08T14:06:30.997Z",
49 "address_line1": "27 Acer Road",
50 "address_line2": null,
51 "address_line3": null,
52 "city": "Los Angeles",
53 "region": null,
54 "postal_code": "90213",
55 "country_code": "US",
56 "swedish_identity_number": null,
57 "danish_identity_number": null
58 }
59 }
60 }
61}
Note that:
The
collect_customer_details
action is nowcompleted
, meaning we can move on to other actionsAs a result of us collecting the details, our
customer
andcustomer_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 Direct Debit mandate, where we need to capture the payer’s bank in order to create Direct Debit payments against them.
As an example, we created a Billing Request for ACH scheme:
1POST /billing_requests
2{
3 "billing_requests": {
4 "mandate_request": {
5 "scheme": "ach",
6 "authorisation_source": "telephone"
7 }
8 }
9}
This returns a Billing Request that looks like this:
1{
2 "billing_requests": {
3 "id": "BRQ123",
4 "status": "pending",
5 "mandate_request": {
6 "currency": "USD",
7 "scheme": "ach",
8 "authorisation_source": "telephone"
9 },
10 "links": {
11 "customer": "CU00016WDAM7BS",
12 "customer_billing_detail": "CBD000010PDF4WD",
13 "mandate_request": "MRQ123",
14 "organisation": "OR123"
15 },
16 "actions": [
17 {
18 "type": "collect_bank_account",
19 "required": true,
20 "completes_actions": [
21 "choose_currency"
22 ],
23 "available_country_codes": [
24 "US"
25 ],
26 "requires_actions": [],
27 "status": "pending"
28 },
29 ...,
30 ],
31 }
32}
Note that:
There is a
collect_bank_account
action that ispending
We have no
links.customer_bank_account
, confirming no bank account is attached
We can complete this action by POST’ing to the Collect bank account for the billing request endpoint:
1$client = new \GoCardlessPro\Client(array(
2 'access_token' => 'your_access_token_here',
3 'environment' => \GoCardlessPro\Environment::SANDBOX
4));
5
6$client->billingRequests()->collectBankAccount("BRQ000010NMDMH2", [
7 "params" => [
8 "account_number" => "2715500356",
9 "bank_code" => "026073150",
10 "account_holder_name" => "Frank Osborne",
11 "country_code" => "US",
12 "account_type": "checking"
13 ]
14]);
As with all action endpoints, the response is the Billing Request. What we get back is:
1{
2 "billing_requests": {
3 "id": "BRQ123",
4 "status": "pending",
5 "mandate_request": {
6 "currency": "USD",
7 "scheme": "ach",
8 "authorisation_source": "telephone"
9 },
10 "links": {
11 "customer": "CU00016WDAM7BS",
12 "customer_billing_detail": "CBD000010P52VRF",
13 "customer_bank_account": "BA123",
14 "organisation": "OR123"
15 },
16 "actions": [
17 {
18 "type": "collect_bank_account",
19 "required": true,
20 "completes_actions": [
21 "choose_currency"
22 ],
23 "requires_actions": [],
24 "status": "completed"
25 },
26 ...,
27 ],
28 "resources": {
29 "customer_bank_account": {
30 "id": "BA123",
31 "created_at": "2021-04-08T15:30:36.019Z",
32 "account_number_ending": "56",
33 "account_holder_name": "FRANK OSBORNE",
34 "account_type": "checking",
35 "bank_name": "Community Federal Savings Bank",
36 "currency": "USD",
37 "country_code": "US",
38 "metadata": {},
39 "enabled": true,
40 "links": {
41 "customer": "CU00016WDAM7BS"
42 }
43 }
44 }
45 }
46}
Note that:
The
collect_bank_account
action is nowcompleted
, meaning we can move on to other actionsAs a result of us collecting the bank account, we have created a
customer_bank_account
resource and you can see thelinks.customer_bank_account
ID has been set
As part of scheme compliance, we need to ensure the payer was presented with a confirmation screen before fulfilling the Billing Request. All mandate requests will require this action.
As an example, we created a Billing Request for ACH scheme:
1POST /billing_requests
2{
3 "billing_requests": {
4 "mandate_request": {
5 "scheme": "ach",
6 "authorisation_source": "telephone"
7 }
8 }
9}
This returns a Billing Request that looks like this:
1{
2 "billing_requests": {
3 "id": "BRQ123",
4 "status": "pending",
5 "mandate_request": {
6 "currency": "USD",
7 "scheme": "ach",
8 "authorisation_source": "telephone"
9 },
10 "links": {
11 "customer": "CU00016WDAM7BS",
12 "customer_billing_detail": "CBD000010PDF4WD",
13 "mandate_request": "MRQ123",
14 "organisation": "OR123"
15 },
16 "actions": [
17 {
18 "type": "confirm_payer_details",
19 "required": true,
20 "completes_actions": [],
21 "requires_actions": [
22 "collect_customer_details",
23 "collect_bank_account"
24 ],
25 "status": "pending"
26 }
27 ...,
28 ],
29 }
30}
Note that:
There is a
confirm_payer_details
action that ispending
The action is
required
- all mandate requests will require thisThe action requires
collect_customer_details
andcollect_bank_account
, as we can only show the confirmation page once these actions are completed.
We can complete this action by POST’ing to the confirm payer details endpoint:
1$client = new \GoCardlessPro\Client(array(
2 'access_token' => 'your_access_token_here',
3 'environment' => \GoCardlessPro\Environment::SANDBOX
4));
5
6$client->billingRequests()->confirmPayerDetails("BR123");
As with all action endpoints, the response is the Billing Request. What we get back is:
1{
2 "billing_requests": {
3 "id": "BRQ123",
4 "status": "ready_to_fulfil",
5 "mandate_request": {
6 "currency": "USD",
7 "scheme": "ach",
8 "authorisation_source": "telephone"
9 },
10 "links": {
11 "customer": "CU00016WDAM7BS",
12 "customer_billing_detail": "CBD000010P52VRF",
13 "customer_bank_account": "BA0000QDWEEAFB",
14 "mandate_request": "MRQ123",
15 "organisation": "OR123"
16 },
17 "actions": [
18 {
19 "type": "confirm_payer_details",
20 "required": true,
21 "completes_actions": [],
22 "requires_actions": [
23 "collect_customer_details",
24 "collect_bank_account"
25 ],
26 "status": "completed"
27 },
28 ...,
29 ],
30 "resources": {
31 ...,
32 }
33 }
34 }
35}
Note that:
The
confirm_payer_details
action is nowcompleted
, and the billing request is inready_to_fulfil
state.
We can now move on to fulfilling this Billing Request.
Once the billing request is in ready_to_fulfil
state we can complete setting up this mandate by POST'ing to the billing request fulfil endpoint.
1$client = new \GoCardlessPro\Client(array(
2 'access_token' => 'your_access_token_here',
3 'environment' => \GoCardlessPro\Environment::SANDBOX
4));
5
6$client->billingRequests()->fulfil("BR123");
As with all action endpoints, the response is the Billing Request. What we get back is:
1{
2 "billing_requests": {
3 "id": "BRQ123",
4 "status": "fulfilled",
5 "mandate_request": {
6 "currency": "USD",
7 "scheme": "ach",
8 "authorisation_source": "teleohone"
9 },
10 "links": {
11 "customer": "CU00016WDAM7BS",
12 "customer_billing_detail": "CBD000010P52VRF",
13 "customer_bank_account": "BA123",
14 "organisation": "OR123",
15 "mandate_request": "MRQ123"
16 },
17 "actions": [],
18 "resources": {
19 ...,
20 }
21 }
22 }
23}
Done!
The mandate has now been created and is ready to create payments against. The Billing Request is fulfilled
, and cannot be modified.