Setting Up a DD 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 a Pay By Bank, or a Direct Debit mandate and subsequent Direct Debit payment or a Pay By Bank 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 Pay By Bank 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 a Pay By Bank). 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 in billing request actions if you're interested.
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.