# Pay for a booking

> Pay for a booking by invoice, payment link or Stripe Connect.

Section: Partners · Last updated: 2026-11-18

You will pay for a booking so that Transferz starts processing its journeys. You need the booking
`id` from [Create a booking](https://developers.test.transferz.com/guides/partners/create-a-booking) and at least one payment method
enabled for your account.

A booking that is not paid stays `NOT_PAID` and nobody drives. Once it is paid, its journeys move to
`PENDING` (or `AWAITING_APPROVAL` while Transferz checks them) and Transferz looks for a transfer
company.

## Step 1: Choose a payment method

| Method         | Who takes the money from the booker | How you pay                                          | Call                                                                                                            |
| -------------- | ----------------------------------- | ---------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
| Invoice        | You                                 | Transferz invoices you periodically for the journeys | [Pay by invoice](https://developers.test.transferz.com/reference/partners/pay-booking-by-invoice)               |
| Payment link   | Transferz                           | The booker pays on a page hosted by Transferz        | [Generate payment link](https://developers.test.transferz.com/reference/partners/generate-booking-payment-link) |
| Stripe Connect | You, in your own Stripe account     | You pass the Stripe payment intent to Transferz      | [Pay by Stripe Connect](https://developers.test.transferz.com/reference/partners/pay-booking-by-stripe-connect) |

Each method is enabled per partner account by Transferz. Invoice payment needs agreement with your
partner success manager; Stripe Connect is set up on request. If none of these fits how you collect
payment, other set-ups are arranged with Transferz: [ask in a support ticket](https://developers.test.transferz.com/support/new).

> **To be confirmed by Transferz:** Which payment methods a new partner account has by default, and whether payment links are
> unavailable for accounts on net prices (a mark-up model), is still to be confirmed by Transferz.

## Step 2: Pay

Use the section for your method.

### Step 3: On invoice

Call [Pay by invoice](https://developers.test.transferz.com/reference/partners/pay-booking-by-invoice) with the booking id. There is no request body.

**Request:** [`POST /bookings/312840/pay-by-invoice`](https://developers.test.transferz.com/reference/partners/pay-booking-by-invoice)

```bash title="cURL"
curl --request POST \
  --url 'https://warpdrive.staging.transferz.com/partners/bookings/312840/pay-by-invoice' \
  --header 'Accept: application/json' \
  --header 'X-API-Key: YOUR_STAGING_API_KEY'
```

```javascript title="JavaScript"
const response = await fetch("https://warpdrive.staging.transferz.com/partners/bookings/312840/pay-by-invoice", {
  method: "POST",
  headers: {
    Accept: "application/json",
    "X-API-Key": "YOUR_STAGING_API_KEY",
  },
});

const data = await response.json();
console.log(response.status, data);
```

```java title="Java"
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class Example {
  public static void main(String[] args) throws Exception {
    HttpRequest request = HttpRequest.newBuilder()
        .uri(URI.create("https://warpdrive.staging.transferz.com/partners/bookings/312840/pay-by-invoice"))
        .header("Accept", "application/json")
        .header("X-API-Key", "YOUR_STAGING_API_KEY")
        .method("POST", HttpRequest.BodyPublishers.noBody())
        .build();

    HttpResponse<String> response = HttpClient.newHttpClient()
        .send(request, HttpResponse.BodyHandlers.ofString());
    System.out.println(response.statusCode());
    System.out.println(response.body());
  }
}
```

```csharp title="C#"
using System.Net.Http;
using System.Text;

using var client = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Post, "https://warpdrive.staging.transferz.com/partners/bookings/312840/pay-by-invoice");
request.Headers.TryAddWithoutValidation("Accept", "application/json");
request.Headers.TryAddWithoutValidation("X-API-Key", "YOUR_STAGING_API_KEY");

using var response = await client.SendAsync(request);
Console.WriteLine((int)response.StatusCode);
Console.WriteLine(await response.Content.ReadAsStringAsync());
```

```php title="PHP"
<?php

$ch = curl_init('https://warpdrive.staging.transferz.com/partners/bookings/312840/pay-by-invoice');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Accept: application/json',
        'X-API-Key: YOUR_STAGING_API_KEY',
    ],
]);

$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);

echo $status, PHP_EOL, $response, PHP_EOL;
```

**Response (200):**

```json
{
  "id": 312840,
  "code": "TZ7K4QM",
  "partnerReference": "ORDER-10023",
  "journeys": [{ "id": 488213, "code": "TZ7K4QM-1", "status": "PENDING" }]
}
```

The response is the booking. The payment is processed asynchronously, so a journey can still show
`NOT_PAID` in this response. A `200` response means the payment was accepted.

### Step 4: With a payment link

Call [Generate payment link](https://developers.test.transferz.com/reference/partners/generate-booking-payment-link) and send the booker to the `url`.
Optionally give the `locale` of the payment page and a `returnUrl` to send the booker back to your
site after paying.

**Request:** [`POST /bookings/312840/generate-payment-link`](https://developers.test.transferz.com/reference/partners/generate-booking-payment-link)

```bash title="cURL"
curl --request POST \
  --url 'https://warpdrive.staging.transferz.com/partners/bookings/312840/generate-payment-link' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: YOUR_STAGING_API_KEY' \
  --data '{
  "locale": "nl",
  "returnUrl": "https://shop.example.com/payment-complete"
}'
```

```javascript title="JavaScript"
const response = await fetch("https://warpdrive.staging.transferz.com/partners/bookings/312840/generate-payment-link", {
  method: "POST",
  headers: {
    Accept: "application/json",
    "Content-Type": "application/json",
    "X-API-Key": "YOUR_STAGING_API_KEY",
  },
  body: JSON.stringify({
    "locale": "nl",
    "returnUrl": "https://shop.example.com/payment-complete"
  }),
});

const data = await response.json();
console.log(response.status, data);
```

```java title="Java"
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class Example {
  public static void main(String[] args) throws Exception {
    String body = """
        {
          "locale": "nl",
          "returnUrl": "https://shop.example.com/payment-complete"
        }
        """;

    HttpRequest request = HttpRequest.newBuilder()
        .uri(URI.create("https://warpdrive.staging.transferz.com/partners/bookings/312840/generate-payment-link"))
        .header("Accept", "application/json")
        .header("Content-Type", "application/json")
        .header("X-API-Key", "YOUR_STAGING_API_KEY")
        .method("POST", HttpRequest.BodyPublishers.ofString(body))
        .build();

    HttpResponse<String> response = HttpClient.newHttpClient()
        .send(request, HttpResponse.BodyHandlers.ofString());
    System.out.println(response.statusCode());
    System.out.println(response.body());
  }
}
```

```csharp title="C#"
using System.Net.Http;
using System.Text;

using var client = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Post, "https://warpdrive.staging.transferz.com/partners/bookings/312840/generate-payment-link");
request.Headers.TryAddWithoutValidation("Accept", "application/json");
request.Headers.TryAddWithoutValidation("X-API-Key", "YOUR_STAGING_API_KEY");

var json = """
    {
      "locale": "nl",
      "returnUrl": "https://shop.example.com/payment-complete"
    }
    """;
request.Content = new StringContent(json, Encoding.UTF8, "application/json");

using var response = await client.SendAsync(request);
Console.WriteLine((int)response.StatusCode);
Console.WriteLine(await response.Content.ReadAsStringAsync());
```

```php title="PHP"
<?php

$body = <<<'JSON'
{
  "locale": "nl",
  "returnUrl": "https://shop.example.com/payment-complete"
}
JSON;

$ch = curl_init('https://warpdrive.staging.transferz.com/partners/bookings/312840/generate-payment-link');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Accept: application/json',
        'Content-Type: application/json',
        'X-API-Key: YOUR_STAGING_API_KEY',
    ],
    CURLOPT_POSTFIELDS => $body,
]);

$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);

echo $status, PHP_EOL, $response, PHP_EOL;
```

**Response (200):**

```json
{
  "url": "https://test.adyen.link/PLTZ7K4QM0001",
  "expiresAt": "2026-11-21T10:50:00"
}
```

The link stops working at `expiresAt`. The journeys move to `PENDING` once the booker has paid,
usually within seconds. Do not treat the booking as paid when you generate the link; wait for the
status change (see the last step).

### Step 5: With Stripe Connect

Transferz links its Stripe account to yours. You take the payment from the traveller in your own
Stripe checkout and pass the id of the [payment intent](https://docs.stripe.com/api/payment_intents)
to [Pay by Stripe Connect](https://developers.test.transferz.com/reference/partners/pay-booking-by-stripe-connect):

**Request:** [`POST /bookings/312840/pay-by-stripe-connect`](https://developers.test.transferz.com/reference/partners/pay-booking-by-stripe-connect)

```bash title="cURL"
curl --request POST \
  --url 'https://warpdrive.staging.transferz.com/partners/bookings/312840/pay-by-stripe-connect' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: YOUR_STAGING_API_KEY' \
  --data '{
  "paymentIntent": "pi_3TzExample0000000001"
}'
```

```javascript title="JavaScript"
const response = await fetch("https://warpdrive.staging.transferz.com/partners/bookings/312840/pay-by-stripe-connect", {
  method: "POST",
  headers: {
    Accept: "application/json",
    "Content-Type": "application/json",
    "X-API-Key": "YOUR_STAGING_API_KEY",
  },
  body: JSON.stringify({
    "paymentIntent": "pi_3TzExample0000000001"
  }),
});

const data = await response.json();
console.log(response.status, data);
```

```java title="Java"
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class Example {
  public static void main(String[] args) throws Exception {
    String body = """
        {
          "paymentIntent": "pi_3TzExample0000000001"
        }
        """;

    HttpRequest request = HttpRequest.newBuilder()
        .uri(URI.create("https://warpdrive.staging.transferz.com/partners/bookings/312840/pay-by-stripe-connect"))
        .header("Accept", "application/json")
        .header("Content-Type", "application/json")
        .header("X-API-Key", "YOUR_STAGING_API_KEY")
        .method("POST", HttpRequest.BodyPublishers.ofString(body))
        .build();

    HttpResponse<String> response = HttpClient.newHttpClient()
        .send(request, HttpResponse.BodyHandlers.ofString());
    System.out.println(response.statusCode());
    System.out.println(response.body());
  }
}
```

```csharp title="C#"
using System.Net.Http;
using System.Text;

using var client = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Post, "https://warpdrive.staging.transferz.com/partners/bookings/312840/pay-by-stripe-connect");
request.Headers.TryAddWithoutValidation("Accept", "application/json");
request.Headers.TryAddWithoutValidation("X-API-Key", "YOUR_STAGING_API_KEY");

var json = """
    {
      "paymentIntent": "pi_3TzExample0000000001"
    }
    """;
request.Content = new StringContent(json, Encoding.UTF8, "application/json");

using var response = await client.SendAsync(request);
Console.WriteLine((int)response.StatusCode);
Console.WriteLine(await response.Content.ReadAsStringAsync());
```

```php title="PHP"
<?php

$body = <<<'JSON'
{
  "paymentIntent": "pi_3TzExample0000000001"
}
JSON;

$ch = curl_init('https://warpdrive.staging.transferz.com/partners/bookings/312840/pay-by-stripe-connect');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Accept: application/json',
        'Content-Type: application/json',
        'X-API-Key: YOUR_STAGING_API_KEY',
    ],
    CURLOPT_POSTFIELDS => $body,
]);

$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);

echo $status, PHP_EOL, $response, PHP_EOL;
```

**Response (200):**

```json
{
  "id": 312840,
  "code": "TZ7K4QM",
  "journeys": [{ "id": 488213, "code": "TZ7K4QM-1", "status": "PENDING" }]
}
```

## Step 6: Check that the booking is paid

Wait until each journey has left `NOT_PAID` before you confirm the order to the traveller. Either
receive the [`journeyStatusChangedEvent`](https://developers.test.transferz.com/reference/webhooks/journey-status-changed) for each journey, or
call [Get booking](https://developers.test.transferz.com/reference/partners/get-booking) and read `journeys[].status`:

**Request:** [`GET /bookings/312840`](https://developers.test.transferz.com/reference/partners/get-booking)

```bash title="cURL"
curl --request GET \
  --url 'https://warpdrive.staging.transferz.com/partners/bookings/312840' \
  --header 'Accept: application/json' \
  --header 'X-API-Key: YOUR_STAGING_API_KEY'
```

```javascript title="JavaScript"
const response = await fetch("https://warpdrive.staging.transferz.com/partners/bookings/312840", {
  method: "GET",
  headers: {
    Accept: "application/json",
    "X-API-Key": "YOUR_STAGING_API_KEY",
  },
});

const data = await response.json();
console.log(response.status, data);
```

```java title="Java"
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class Example {
  public static void main(String[] args) throws Exception {
    HttpRequest request = HttpRequest.newBuilder()
        .uri(URI.create("https://warpdrive.staging.transferz.com/partners/bookings/312840"))
        .header("Accept", "application/json")
        .header("X-API-Key", "YOUR_STAGING_API_KEY")
        .method("GET", HttpRequest.BodyPublishers.noBody())
        .build();

    HttpResponse<String> response = HttpClient.newHttpClient()
        .send(request, HttpResponse.BodyHandlers.ofString());
    System.out.println(response.statusCode());
    System.out.println(response.body());
  }
}
```

```csharp title="C#"
using System.Net.Http;
using System.Text;

using var client = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Get, "https://warpdrive.staging.transferz.com/partners/bookings/312840");
request.Headers.TryAddWithoutValidation("Accept", "application/json");
request.Headers.TryAddWithoutValidation("X-API-Key", "YOUR_STAGING_API_KEY");

using var response = await client.SendAsync(request);
Console.WriteLine((int)response.StatusCode);
Console.WriteLine(await response.Content.ReadAsStringAsync());
```

```php title="PHP"
<?php

$ch = curl_init('https://warpdrive.staging.transferz.com/partners/bookings/312840');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Accept: application/json',
        'X-API-Key: YOUR_STAGING_API_KEY',
    ],
]);

$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);

echo $status, PHP_EOL, $response, PHP_EOL;
```

**Response (200):**

```json
{
  "id": 312840,
  "code": "TZ7K4QM",
  "journeys": [{ "id": 488213, "code": "TZ7K4QM-1", "status": "PENDING" }]
}
```

> **To be confirmed by Transferz:** The test cards for payment links on staging are still to be confirmed by Transferz.
> Paying on invoice works on staging without extra data.

## Errors

| Problem                                                                                                                            | Cause                                            | What to do                                                                                       |
| ---------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------ | ------------------------------------------------------------------------------------------------ |
| `400` with [PAYMENT_ON_INVOICE_NOT_ALLOWED](https://developers.test.transferz.com/reference/errors/payment-on-invoice-not-allowed) | Invoice payment is not enabled for your account. | Use another method, or ask your partner success manager to enable it.                            |
| `400` with [STRIPE_PAYMENT_FAILED](https://developers.test.transferz.com/reference/errors/stripe-payment-failed)                   | The payment intent could not be used.            | Check the intent in your Stripe dashboard (amount, currency, status) and retry with a valid one. |
| `400` with `BLANK_VALUE` and `field` `paymentIntent`                                                                               | The payment intent is empty.                     | Send the intent id.                                                                              |
| `403` with `INSUFFICIENT_PERMISSIONS`                                                                                              | The booking belongs to another partner.          | Check the booking id and the API key.                                                            |
| Journeys stay `NOT_PAID` after a payment link                                                                                      | The booker has not paid, or the link expired.    | Generate a new link and send it to the booker.                                                   |

## Next steps

- [Follow a journey](https://developers.test.transferz.com/guides/partners/follow-a-journey) now that it is paid.
- [Cancel a journey or a booking](https://developers.test.transferz.com/guides/partners/cancel-a-journey-or-booking) if the traveller no
  longer needs it.

## Related

### Endpoints

- [POST Pay by invoice](https://developers.test.transferz.com/reference/partners/pay-booking-by-invoice) (`POST /bookings/{id}/pay-by-invoice`)
- [POST Generate payment link](https://developers.test.transferz.com/reference/partners/generate-booking-payment-link) (`POST /bookings/{id}/generate-payment-link`)
- [POST Pay by Stripe Connect](https://developers.test.transferz.com/reference/partners/pay-booking-by-stripe-connect) (`POST /bookings/{id}/pay-by-stripe-connect`)
- [GET Get booking by id](https://developers.test.transferz.com/reference/partners/get-booking) (`GET /bookings/{id}`)

### Walk-through steps

- [Confirm the booking](https://developers.test.transferz.com/walkthrough/partner/confirm-the-booking)
