GC Logo
Developer Docs

Partners

Partners: Setting up mandates

View as Markdown

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.

Sending merchants to your app

Firstly - once a merchant completes verification, there are two ways they might make their way to your platform to start setting up payments:

  1. Via the post-onboarding redirect - if you've configured a post onboarding URL in your App settings, GoCardless redirects the merchant there automatically after they finish verification. In this case they land directly on your platform can finish setting up their account with you and start setting up payments.

  2. Via the GoCardless dashboard - some merchants will land on the GoCardless dashboard, either by navigating there directly or returning after verification. To handle this, you can set a payment setup URL in your App settings. This controls where the "Get started with payments" prompt in the dashboard takes them - it should link to the page on your platform where they can begin creating mandates and payments.

If no payment_setup_url is set, the prompt falls back to your post_onboarding_url, or your website_url if neither is configured.

Making API Calls on behalf of your merchant

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

Once a merchant lands on your platform, you'll need to make API calls on their behalf to start creating mandates and payments. To do this, you'll use the merchant's saved access token obtained during the OAuth flow. 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.

What's Next?

Webhooks for partners

View docs
Responding to mandate events