# Instant First Payment with Mandate

Source: https://docs.gocardless.com/docs/collect-payments/recurring-payments/instant-first-payment-with-mandate

# Instant Payment with Direct Debit Setup

## What are Instant Payment with Direct Debit Setup?

Take an immediate payment via Instant Bank Pay while automatically setting up a Direct Debit mandate for future payments. This gives you the speed of instant confirmation for the first payment and the flexibility of Direct Debit for ongoing charges.

**Integration options:** This guide shows the API flow. You can also use [Hosted Payment Pages](/integration-types/gocardless-hosted-pages) for a no-code approach. Drop-in Flow does not support Instant Bank Pay.

**Availability:** GBP (Faster Payments), EUR (SEPA Instant)

**When to use this combined flow**

- Subscription services requiring immediate activation
- Sign-up fee plus ongoing billing (e.g., gym membership)
- Trial conversions with instant first charge
- Any service where you need payment confirmation before providing access

## Comparison between other recurring payment options

|                        | Subscriptions                                        | Instalments                                    | Variable Recurring Payments                                                          | Instant Bank Pay + Direct Debit                          |
| ---------------------- | ---------------------------------------------------- | ---------------------------------------------- | ------------------------------------------------------------------------------------ | -------------------------------------------------------- |
| Mandate required       | Yes                                                  | Yes                                            | Yes (consent)                                                                        | Yes                                                      |
| Customer authorisation | Once                                                 | Once                                           | Once (with agreed limits and frequency)                                              | Once                                                     |
| Payment amounts        | Fixed (per subscription)                             | Fixed per instalment, can vary across schedule | Variable within agreed constraints                                                   | First payment fixed; subsequent payments flexible        |
| Payment schedule       | Merchant-defined recurring (weekly, monthly, yearly) | Merchant-defined schedule with a defined end   | Flexible - merchant triggers payments as needed                                      | Flexible after first payment                             |
| Confirmation speed     | 2-x business days                                    | 2-x business days                              | Seconds                                                                              | First payment: minutes; subsequent: 2-x business days    |
| Chargeback risk        | Yes                                                  | Yes                                            | None                                                                                 | First payment: none; subsequent: yes                     |
| Missed payment retries | Yes (with Success+)                                  | Yes (with Success+)                            | Yes                                                                                  | Subsequent payments: yes                                 |
| Best for               | SaaS, memberships, gym fees, insurance               | Payment plans, tuition, professional services  | Usage-based regulated billing and utilities, financial services, government services | Subscription services needing immediate, initial payment |
| Availability           | All schemes                                          | All schemes                                    | GBP only                                                                             | GBP and EUR                                              |

## How it works

1. Customer authorises an instant payment and a Direct Debit mandate in a single flow
2. The instant payment is confirmed within minutes
3. The Direct Debit mandate is set up for future payments
4. You can then collect recurring or one-off payments against the mandate

## Step-by-step guide

### Create a billing request

```http
curl -X POST https://api.gocardless.com/billing_requests \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d ',
      "mandate_request": 
    }
  }'
```

```php
<?php
require 'vendor/autoload.php';

$client = new \GoCardlessPro\Client([
    'access_token' => getenv('GC_ACCESS_TOKEN'),
    'environment' => \GoCardlessPro\Environment::SANDBOX
]);

$response = $client->billingRequests()->create([
    'params' => [
        'payment_request' => [
            'description' => 'First payment',
            'amount'      => 5000,
            'currency'    => 'GBP',
            'scheme'      => 'faster_payments',
        ],
        'mandate_request' => [
            'scheme' => 'bacs',
        ],
    ],
]);
```

```python

client = gocardless_pro.Client(
    access_token=os.environ['GC_ACCESS_TOKEN'],
    environment='sandbox'
)

response = client.billing_requests.create(
    params=,
        'mandate_request': ,
    }
)
```

```ruby
  require 'gocardless_pro'

  client = GoCardlessPro::Client.new(
      access_token: ENV['GC_ACCESS_TOKEN'],
      environment: :sandbox
  )

  response = client.billing_requests.create(
    params: ,
      mandate_request: 
    }
  )
```

```java

GoCardlessClient client = GoCardlessClient
    .newBuilder(System.getenv("GC_ACCESS_TOKEN"))
    .withEnvironment(GoCardlessClient.Environment.SANDBOX)
    .build();

BillingRequestCreateResponse response = client.billingRequests()
    .create()
    .withPaymentRequestDescription("First payment")
    .withPaymentRequestAmount(5000)
    .withPaymentRequestCurrency("GBP")
    .withPaymentRequestScheme("faster_payments")
    .withMandateRequestScheme("bacs")
    .execute();
```

```javascript
const gocardless = require("gocardless-nodejs");
const constants = require("gocardless-nodejs/constants");

const client = gocardless(process.env.GC_ACCESS_TOKEN, constants.Environments.Sandbox);

const response = await client.billingRequests.create(,
  mandate_request: ,
});
```

```cs
using GoCardless;

var client = GoCardlessClient.Create(
    Environment.GetEnvironmentVariable("GC_ACCESS_TOKEN"),
    GoCardlessClient.Environment.SANDBOX
);

var response = await client.BillingRequests.CreateAsync(
    new BillingRequestCreateRequest
    ,
        MandateRequest = new BillingRequestCreateRequest.BillingRequestMandateRequest
        
    }
);
```

```go
package main

    "context"
    "fmt"
    "os"

    gocardless "github.com/gocardless/gocardless-pro-go/v6"
)

func main() 

    params := gocardless.BillingRequestCreateParams,
        MandateRequest: &gocardless.BillingRequestCreateParamsMandateRequest,
    }

    result, err := client.BillingRequests.Create(context.TODO(), params)
    if err != nil 
    fmt.Println(result)
}
```

**Response:**

```json
,
    "mandate_request": ,
    "actions": [
      ,
      ,
      ,
      ,
      
    ]
  }
}
```

### Confirm the mandate and payment

After creating the Billing Request, direct the customer to authorise the mandate. How you do this depends on your integration type:

- Hosted Pages - Create a Billing Request Flow and redirect the customer to the authorisation_url. See [Hosted Payment Pages](/integration-types/gocardless-hosted-pages).
- Custom API - Collect customer details and bank account via Billing Request actions, then confirm. See [Custom Payment Pages](/integration-types/custom-payment-pages).

> **Warning:**
> Don't use the redirect to confirm the outcome. Always use webhooks.

### Handle the outcome

Once fulfilled, retrieve both mandate ID and payment ID from the billing request:

```http
curl https://api.gocardless.com/billing_requests/BRQ000123 \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
```

```php
<?php
require 'vendor/autoload.php';

$client = new \GoCardlessPro\Client([
    'access_token' => getenv('GC_ACCESS_TOKEN'),
    'environment' => \GoCardlessPro\Environment::SANDBOX
]);

$response = $client->billingRequests()->get('BRQ000123');

$paymentId = $response->payment_request->links->payment;
$mandateId = $response->mandate_request->links->mandate;
```

```python

client = gocardless_pro.Client(
    access_token=os.environ['GC_ACCESS_TOKEN'],
    environment='sandbox'
)

response = client.billing_requests.get('BRQ000123')

payment_id = response.payment_request.links.payment
mandate_id = response.mandate_request.links.mandate
```

```ruby
require 'gocardless_pro'

client = GoCardlessPro::Client.new(
    access_token: ENV['GC_ACCESS_TOKEN'],
    environment: :sandbox
)

response = client.billing_requests.get('BRQ000123')

payment_id = response.payment_request.links.payment
mandate_id = response.mandate_request.links.mandate
```

```java

GoCardlessClient client = GoCardlessClient
    .newBuilder(System.getenv("GC_ACCESS_TOKEN"))
    .withEnvironment(GoCardlessClient.Environment.SANDBOX)
    .build();

BillingRequest billingRequest = client.billingRequests()
    .get("BRQ000123")
    .execute();

String paymentId = billingRequest.getPaymentRequest().getLinks().getPayment();
String mandateId = billingRequest.getMandateRequest().getLinks().getMandate();
```

```javascript
const gocardless = require("gocardless-nodejs");
const constants = require("gocardless-nodejs/constants");

const client = gocardless(process.env.GC_ACCESS_TOKEN, constants.Environments.Sandbox);

const billingRequest = await client.billingRequests.find("BRQ000123");

const paymentId = billingRequest.payment_request.links.payment;
const mandateId = billingRequest.mandate_request.links.mandate;
```

```cs
using GoCardless;

var client = GoCardlessClient.Create(
    Environment.GetEnvironmentVariable("GC_ACCESS_TOKEN"),
    GoCardlessClient.Environment.SANDBOX
);

var billingRequest = await client.BillingRequests.GetAsync("BRQ000123");

var paymentId = billingRequest.PaymentRequest.Links.Payment;
var mandateId = billingRequest.MandateRequest.Links.Mandate;
```

```go
package main

    "context"
    "fmt"
    "os"

    gocardless "github.com/gocardless/gocardless-pro-go/v6"
)

func main() 

    billingRequest, err := client.BillingRequests.Get(context.TODO(), "BRQ000123")
    if err != nil 

    paymentId := billingRequest.PaymentRequest.Links.Payment
    mandateId := billingRequest.MandateRequest.Links.Mandate

    fmt.Println(paymentId, mandateId)
}
```

**Response:**

```json

    },
    "mandate_request": 
    }
  }
}
```

Listen for webhooks to confirm the payment and mandate status:

| Event                     | Meaning                                                    |
| ------------------------- | ---------------------------------------------------------- |
| billing_request_fulfilled | Customer authorised mandate and payment is being processed |
| payments_confirmed        | Payment confirmed and settled                              |
| payments_failed           | Payment failed (e.g., insufficient funds)                  |
| mandates_active           | Mandate active and ready for recurring payments            |

### Set up recurring payments

Once the mandate is active, set up recurring payments against it:

```http
curl -X POST https://api.gocardless.com/subscriptions \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '
    }
  }'
```

```php
<?php
require 'vendor/autoload.php';

$client = new \GoCardlessPro\Client([
    'access_token' => getenv('GC_ACCESS_TOKEN'),
    'environment' => \GoCardlessPro\Environment::SANDBOX
]);

$response = $client->subscriptions()->create([
    'params' => [
        'amount'        => 2500,
        'currency'      => 'GBP',
        'name'          => 'Monthly Magazine',
        'interval_unit' => 'monthly',
        'interval'      => 1,
        'day_of_month'  => 1,
        'start_date'    => '2024-11-01',
        'links'         => [
            'mandate' => 'MD123',
        ],
    ],
]);
```

```python

client = gocardless_pro.Client(
    access_token=os.environ['GC_ACCESS_TOKEN'],
    environment='sandbox'
)

response = client.subscriptions.create(
    params=,
    }
)
```

```ruby
  require 'gocardless_pro'

  client = GoCardlessPro::Client.new(
      access_token: ENV['GC_ACCESS_TOKEN'],
      environment: :sandbox
  )

  response = client.subscriptions.create(
    params: 
    }
  )
```

```java

GoCardlessClient client = GoCardlessClient
    .newBuilder(System.getenv("GC_ACCESS_TOKEN"))
    .withEnvironment(GoCardlessClient.Environment.SANDBOX)
    .build();

Subscription subscription = client.subscriptions()
    .create()
    .withAmount(2500)
    .withCurrency("GBP")
    .withName("Monthly Magazine")
    .withIntervalUnit(Subscription.IntervalUnit.MONTHLY)
    .withInterval(1)
    .withDayOfMonth(1)
    .withStartDate("2024-11-01")
    .withLinksMandate("MD123")
    .execute();
```

```javascript
const gocardless = require("gocardless-nodejs");
const constants = require("gocardless-nodejs/constants");

const client = gocardless(process.env.GC_ACCESS_TOKEN, constants.Environments.Sandbox);

const subscription = await client.subscriptions.create(,
});
```

```cs
using GoCardless;

var client = GoCardlessClient.Create(
    Environment.GetEnvironmentVariable("GC_ACCESS_TOKEN"),
    GoCardlessClient.Environment.SANDBOX
);

var subscription = await client.Subscriptions.CreateAsync(
    new SubscriptionCreateRequest
    
    }
);
```

```go
package main

    "context"
    "fmt"
    "os"

    gocardless "github.com/gocardless/gocardless-pro-go/v6"
)

func main() 

    params := gocardless.SubscriptionCreateParams,
    }

    subscription, err := client.Subscriptions.Create(context.TODO(), params)
    if err != nil 
    fmt.Println(subscription)
}
```

**Response:**

```json
,
      
    ],
    "links": 
  }
}
```

Listen for webhooks to confirm the mandate status and notifications about future payments:

| **Event**                     | **Meaning**                              |
| ----------------------------- | ---------------------------------------- |
| subscriptions_created         | Subscription set up successfully         |
| subscriptions_payment_created | A scheduled payment was created          |
| payments_confirmed            | Recurring payment collected successfully |
| payments_failed               | Recurring payment failed                 |
| subscriptions_cancelled       | Subscription cancelled                   |

## What's next?

  
#### [Setting Up Mandates](/docs/collect-payments/setting-up-mandates)

Create mandates and collect bank account details via the API.

  
#### [Subscriptions](/docs/collect-payments/recurring-payments/subscriptions)

Collect a fixed amount on a regular schedule against an active mandate.

  
#### [Payment Events](/docs/api-reference/events/payments)

Understand the webhook events fired during payment and mandate lifecycle.

  
#### [GoCardless Hosted Pages](/docs/collect-payments/integration-types/gocardless-hosted-pages)

Use hosted pages for a no-code integration approach.