---
title: "Get customer retention in the back office"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.nicer.travel/llms.txt
> Use this file to discover all available pages before exploring further.

# Get customer retention in the back office

Path: Nicer API › backoffice

`GET /backoffice/retention`

URL: `https://api.nicer.travel/backoffice/retention`

Returns who comes back, over every date: the customers by the UTC month of their first BOOKED order, with how many of them booked again, and the 200 customers with the most BOOKED orders (then the highest lifetime value), one row per agency, customer and currency. A customer is a payer email at one agency with at least one BOOKED order: the same person at two agencies is two customers. The payer email is personal data. The agency is named by the x-nicer-company header and nothing else: with one named, that agency's customers; with none, every agency's. Nicer staff only. Errors: 403 ERROR_DO_NOT_HAVE_PERMISSION for a caller who is not Nicer staff.

## Authentication

- `bearerAuth`, http bearer, header `Authorization`, format `JWT`

## Header parameters

- `x-nicer-company` (`backoffice.retention.list.header.x-nicer-company`; string, optional) — Company context for an agency admin who belongs to several companies. Optional when the caller belongs to one.

## Code samples

### JavaScript SDK

```javascript
import { createClient } from "@nicertravel/sdk";

const nicer = createClient({
  baseUrl: "https://api.nicer.travel",
  token: process.env.NICER_TOKEN,
});

await nicer.backoffice.retention.list();
```

### Nicer CLI

```bash
nicer backoffice retention list
```

### cURL

```bash
curl --request GET \
  --url https://api.nicer.travel/backoffice/retention \
  --header 'Authorization: Bearer <token>'
```

### TypeScript

```typescript
const url = 'https://api.nicer.travel/backoffice/retention';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.nicer.travel/backoffice/retention"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
```

## Responses

### 200

OK

#### Example

```json
{
  "cohorts": [
    {
      "customers": 9007199254740991,
      "month": "2026-11",
      "returningCustomers": 9007199254740991
    }
  ],
  "customers": [
    {
      "bookings": 1,
      "companyName": "string",
      "currency": "string",
      "firstBookingAt": "2019-08-24T14:15:22Z",
      "lastBookingAt": "2019-08-24T14:15:22Z",
      "lifetimeMinor": -9007199254740991,
      "payerEmail": "string"
    }
  ]
}
```

- `cohorts` (`backoffice.retention.list.response.200.cohorts`; array of object, required) — Customers by the month of their first BOOKED order, the oldest month first. One row per month.
  - `customers` (`backoffice.retention.list.response.200.cohorts.customers`; integer, required) — How many customers made their first BOOKED order in the month.
    - maximum: `9007199254740991` · minimum: `0`
  - `month` (`backoffice.retention.list.response.200.cohorts.month`; string, required) — The UTC month the customers' first BOOKED order was created in: the cohort.
    - pattern: `^\d{4}-(?:0[1-9]|1[0-2])$`
  - `returningCustomers` (`backoffice.retention.list.response.200.cohorts.returningCustomers`; integer, required) — How many of them have more than one BOOKED order.
    - maximum: `9007199254740991` · minimum: `0`
- `customers` (`backoffice.retention.list.response.200.customers`; array of object, required) — The most loyal customers: the most BOOKED orders first, then the highest lifetime value. One row per agency, customer and currency; at most 200.
  - `bookings` (`backoffice.retention.list.response.200.customers.bookings`; integer, required) — How many BOOKED orders the customer has in this currency.
    - maximum: `9007199254740991` · minimum: `1`
  - `companyName` (`backoffice.retention.list.response.200.customers.companyName`; string, required) — The agency the customer booked with.
    - minLength: `1`
  - `currency` (`backoffice.retention.list.response.200.customers.currency`; any of, required) — The orders' currency; null for the orders that carry no amount.
    - any of the following: `CurrencyCode`, `null`
  - `firstBookingAt` (`backoffice.retention.list.response.200.customers.firstBookingAt`; string, required) — When the customer's first BOOKED order in this currency was created.
    - format: `date-time` · pattern: `^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$`
  - `lastBookingAt` (`backoffice.retention.list.response.200.customers.lastBookingAt`; string, required) — When their latest BOOKED order in this currency was created.
    - format: `date-time` · pattern: `^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$`
  - `lifetimeMinor` (`backoffice.retention.list.response.200.customers.lifetimeMinor`; any of, required) — The BOOKED orders' totals added up, in minor units; null when none carries an amount.
    - any of the following: `integer`, `null`
  - `payerEmail` (`backoffice.retention.list.response.200.customers.payerEmail`; string, required) — The customer: the payer's email, lower-cased. Personal data.
    - minLength: `1`

### 400

Request failed. `errorCode` is stable; `errorMessage` is for humans.

#### Example

```json
{
  "errorCode": "string",
  "errorMessage": "string"
}
```

- `errorCode` (`backoffice.retention.list.response.400.errorCode`; string, required)
- `errorMessage` (`backoffice.retention.list.response.400.errorMessage`; string, required)

### 401

Request failed. `errorCode` is stable; `errorMessage` is for humans.

#### Example

```json
{
  "errorCode": "string",
  "errorMessage": "string"
}
```

- `errorCode` (`backoffice.retention.list.response.401.errorCode`; string, required)
- `errorMessage` (`backoffice.retention.list.response.401.errorMessage`; string, required)

### 403

Request failed. `errorCode` is stable; `errorMessage` is for humans.

#### Example

```json
{
  "errorCode": "string",
  "errorMessage": "string"
}
```

- `errorCode` (`backoffice.retention.list.response.403.errorCode`; string, required)
- `errorMessage` (`backoffice.retention.list.response.403.errorMessage`; string, required)


Source: https://docs.nicer.travel/api/backoffice/backoffice.retention.list/index.md
