How to integrate with the GoCardless API
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 8 simple steps and our easy to use API libraries.
2. Log in to your dashboard and enable developer mode. To do this, click 'More…' in the navigation bar, then click 'Developer' and finally, click the 'Enable developer mode' button. We will then create a sandbox environment for you to test in and set you up with your API credentials.
3. Switch to the sandbox. To do this click 'Sandbox' near the top right of the dashboard to switch between the live and sandbox dashboards (to switch back simply click 'Live'). Once you have switched to the sandbox, click 'More…'' then 'Developer' to find your sandbox API credentials.
4. 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.
5. Take a look through our developer documentation - use the drop-down list at the top left of the page to select the library you’re using, and we’ll show you code examples for your preferred language.
6. Create a link for a one-off bill, subscription or pre-authorisation using your chosen client library. You’ll use your sandbox credentials to generate the link, so none of the payments you create will be sent to the banking system. The link you generate will take the customer to an online Direct Debit mandate form where they will need to enter their payment details.
7. Make a confirmation page on your website (if you'd like to). The customer will be redirected here when they’ve completed the online Direct Debit mandate form. You’ll need to confirm that they’ve reached you successfully and that you’ve received the details of the payment they’ve set up. Our libraries make this simple to do, just read through the confirming payments section of our documentation.
8. Now test it out. Try following the link you’ve generated and set up a sandbox payment to your merchant account. If it all works as expected, you can go back to your live dashboard and get your live API credentials - switch the sandbox credentials for the live ones in your code.
You’re now ready to start taking payments using Direct Debit!
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 GoCardless then please feel free to email us.