Partners: Setting up mandates

Setting up Direct Debit mandates

You’ll need to provide a way for your users to set up Direct Debit mandates with their customers (whom we’ll refer to from now on as “end customers”) so they can start collecting payments from them.

A mandate allows you to pull money from an end customer’s bank account with a simple API call.

Making API Calls on behalf of your merchant

Prerequisite: We must have gotten and saved merchants' access tokens after following the steps here

To make an API call against a merchant's account, we will have to use the saved access token. See an example below:

1<?php 2require 'vendor/autoload.php'; 3 4$client = new \GoCardlessPro\Client([ 5 // You'll need to identify the user that the customer is paying and fetch their 6 // access token 7 'access_token' => $user->gocardlessAccessToken, 8 // Change me to LIVE when you're ready to go live 9 'environment' => \GoCardlessPro\Environment::SANDBOX 10]);

Creating Mandates

Setting up Direct Debit mandates or Instant Bank Payments using a Billing Request Flow

You can read all about Billing Request Flows and the experience for your payers in our documentation here.

Setting up Direct Debit mandates using the Hosted Payment Pages

You can read all about how to set up mandates using our Hosted Payment Pages in our documentation here.

UX guide for requesting a mandate

At this point, it’s worth thinking through how your users will want to send their end customers to the Direct Debit setup flow - making this work in a way that suits their workflow and how they use your product will hugely improve their experience. Here are some ideas you might like to consider:

  • In KashFlow, end customers can set up a Direct Debit by clicking a button on their invoice

  • In GoCardless for Xero, users collecting payments can copy a personalised link to allow a customer to set up a Direct Debit, ready to paste into their own emails or add as a link on their website

  • In the GoCardless Dashboard, users collecting payments can send an email to a customer in one click with their own customised copy, asking them to set up a Direct Debit, either for a single customer or for tens or hundreds at a time

You can read some of our suggestions on the best ways for your users to send their end customers to the Direct Debit setup flow in our user experience guide.

What's Next?

Responding to mandate events