Skip to content
Go to GoCardless homepage
LoginSign up

How to integrate with the GoCardless API

By Nicola PellattMay 20182 min read

What is the GoCardless API?

The GoCardless API is a way for developers to interact via software with GoCardless, allowing you to integrate us into your website, mobile app or desktop software. This means you can build your own customised integration to automate payment collection and reconciliation.

What do you need to do to integrate with the GoCardless API?

Integrating with the GoCardless API is incredibly simple and can be done in minutes with the following simple steps and our easy to use API libraries.

1. Sign up for a sandbox account if you haven’t already - it’ll only take a minute to create your account. If you already have a sandbox account, just log in to your dashboard.

2. Download one of our API client libraries for the language you’ll be developing in. These libraries take all the hard work out of using our API, so you’ll only need a few lines of code to get started. We maintain libraries in JavaPythonRubyPHP, and .NET.

3. Create a read-write access token through the Developer section of your sandbox dashboard. You’ll use this access token when sending any requests to the GoCardless API.

4. Take a look through our developer documentation - we have a getting started guide, and a full API reference. We’ll show you code examples for each request in your preferred language on the right hand side for each endpoint.

5. Create a redirect flow - using your chosen client library. This enables you to use GoCardless’ hosted payment pages to set up mandates with your customers. These pages are fully compliant and translated into Dutch, French, German, Italian, Portuguese, Spanish and Swedish. The complete flow is:

  • You create a redirect flow for your customer, and redirect them to the returned redirect url e.g.

  • Your customer supplies their name, email, address, and bank account details, and submits the form. This securely stores their details, and redirects them back to your success_redirect_url with redirect_flow_id=RE123 in the query string.

  • You complete the redirect flow, which creates a customercustomer bank account, and mandate, and returns the ID of the mandate. You may wish to create a subscription or payment at this point.If you’re going to be using GoCardless Pro, you can create your own custom payment pages and host these on your own website. You can find more information on this here.

6. Once you’ve created a couple of test customers, you may want to create some payments and subscriptions for them. You’ll need to use the customer’s mandate ID you received in the redirect flow to create a payment.

Depending on your needs, you may want to start receiving automatic notifications to your system when the status of a payment changes. We can send webhooks to your server to keep you up-to-date with your payments as they are processed - read through our webhook guide to find out how to add this to your application flow.

If you need any advice on how to integrate with GoCardless then please visit our help centre or feel free to email us.

GoCardless is used by over 55,000 businesses around the world. Learn more about how you can improve payment processing at your business today.

Learn moreSign Up

Interested in automating the way you get paid? GoCardless can help

Contact sales

Contact Us


Contact sales

+44 20 8338 9539


Request support

+44 20 8338 9540

Seen 'GoCardless Ltd' on your bank statement? Learn more

GoCardless Ltd., Sutton Yard, 65 Goswell Road, London, EC1V 7EN, United Kingdom

GoCardless (company registration number 07495895) is authorised by the Financial Conduct Authority under the Payment Services Regulations 2017, registration number 597190, for the provision of payment services. GoCardless SAS (23-25 Avenue Mac-Mahon, Paris, 75017, France), an affiliate of GoCardless Ltd (company registration number 834 422 180, R.C.S. PARIS), is authorised by the ACPR (French Prudential Supervision and Resolution Authority), Bank Code (CIB) 17118, for the provision of payment services.