Guides
Setting up mandates
Direct Debit Mandates Verified Mandates PayTo Agreements and Payments Build a client to create mandates offline Supporting mandates set up outside of your product Importing Mandates Blocking mandatesRecurring payments
Taking Subscription payments Taking Instalment payments Variable Recurring PaymentsCombining one-off and recurring payments
Take a first Instant Payment with mandate
 set upSend an outbound payment
Adding a new recipient Initiate an outbound payment Approve an outbound payment Cancel an outbound paymentSetting up mandates / collecting payments
Billing Request with Actions: Setting up a Direct Debit mandate Collecting a Direct Debit payment Billing Request with Actions: Taking an Instant Bank Payment Billing Request with Actions Dual Flow: Taking an Instant Bank Payment and setting up a Direct Debit mandateBilling Request with Actions: Setting up a Direct Debit mandate
What is the aim of this tutorial?
This tutorial aims to familiarise Embed PSP integrators with the Billing Request with Actions / Billing Request and will explain setting up either an Instant Bank Payment (IBP), or a Direct Debit mandate and subsequent Direct debit payment or an Instant Bank Payment as well as Direct Debit mandate in a dual flow.
Getting started
For this tutorial, you will need:
An API token
The GoCardless client library of your choice configured in your language of choice
A Creditor to collect payments against
Billing Request with Actions: Setting up a Direct Debit mandate
We can start by creating a Billing Request with Actions. This will allow us to set up a mandate, which is linked to a creditor.
In order to create a mandate, we'll initiate a mandate_request and specify the scheme (for Instant Bank Pay it would be a payment_request).
In this instance, we are going to use bacs for a GBP mandate.
You will need to pass the full payer's billing address to create a bacs Direct Debit mandate.
If you want to collect in EUR, use sepa_core. We link the Billing Request with Actions to the creditor we wish to pay out to, CR123.
With this endpoint you'll be able to complete all required actions to fulfil the mandate request in one single API call.
The required actions of the Billing Request can change depending on the type of payment being taken or set up (e.g a Direct Debit mandate or an Instant Bank payment). We don’t need to worry about them too much in this tutorial - but it’s good to be aware of them! You can read more about them here if you’re interested.
The customer's email is a mandatory field for Payment Providers using our Embed product!
1POST https://api.gocardless.com/billing_requests/create_with_actions HTTP/1.1
2Content-Type: application/json
3{
4 "billing_request_with_actions": {
5 "mandate_request": {
6 "scheme": "bacs",
7 ...
8 },
9 "actions": {
10 "collect_customer_details": {
11 "customer": {
12 "given_name": "Alice",
13 "family_name": "Smith",
14 "email": "alice.smith@example.com",
15 ...
16 },
17 "customer_billing_detail": {
18 "address_line1": "1 Somewhere Lane",
19 ...
20 }
21 },
22 "collect_bank_account": {
23 "country_code": "GB",
24 "account_holder_name": "Alice Smith",
25 "account_number": "55779911",
26 "branch_code": "200000"
27 }
28 },
29 "links": {
30 "creditor": "CR123"
31 }
32 }
33}
34
35HTTP/1.1 200 OK
36Content-Type: application/json
37{
38 "billing_request_with_actions": {
39 "billing_requests": {
40 "id": "BRQ123",
41 "created_at": "2025-12-04T10:59:05.144Z",
42 "status": "fulfilled",
43 "mandate_request": {
44 "currency": "GBP",
45 "scheme": "bacs",
46 "links": {
47 "mandate": "MD123"
48 },
49 ...
50}For the purpose of this tutorial, we will only need to keep track of the mandate ID (MD123) from the API response in order to create a Direct Debit payment.
