Send your first API request
Create your first test payment authorisation in 5 minutes
We’ll walk you through making your first API requests by creating and completing a Billing Request, which allows customers to securely authorise payments.
What you’ll need
A GoCardless Sandbox account and your API access token
A developer environment capable of making requests to the GoCardless API
Creating a billing request
A Billing Request enables you to collect all types of GoCardless payments. For now, we’ll handle a recurring, direct debit (mandate) request.
Copy your access token from the Developers page in the GoCardless dashboard.
ACCESS_TOKEN="your_access_token_here"
Create your first billing request by sending the request below
1POST https://api.gocardless.com/billing_requests HTTP/1.1
2Content-Type: application/json
3{
4 "billing_requests": {
5 "mandate_request": {
6 "scheme": "bacs"
7 }
8 }
9}
10
11HTTP/1.1 201 Created
12Location: /billing_requests/BRQ123
13Content-Type: application/json
14{
15 "billing_requests": {
16 "id": "BRQ123",
17 "created_at": "2023-03-22T15:20:08.397Z",
18 "status": "pending",
19 "mandate_request": {
20 "currency": "GBP",
21 "scheme": "bacs",
22 "links": {}
23 },
24 ...
25}
Make a note of the billing request ID returned in the response - eg. BRQ123. This ID will be used when creating a payment link for your customer in the next step.