Skip to content
Navigation

Get customer retention in the back office

GET
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.

Authorization

  • bearerAuth
    HTTP Bearer (JWT)
    required

    Authorization: Bearer <token>

Header parameters

  • x-nicer-company
    optional
    string

    Company context for an agency admin who belongs to several companies. Optional when the caller belongs to one.

Returns

200

OK

JSON
  • cohorts
    array of
    object
    required

    Customers by the month of their first BOOKED order, the oldest month first. One row per month.

    • customers
      integer
      required

      How many customers made their first BOOKED order in the month.

      maximum: 9007199254740991 · minimum: 0
    • 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
      integer
      required

      How many of them have more than one BOOKED order.

      maximum: 9007199254740991 · minimum: 0
  • 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
      integer
      required

      How many BOOKED orders the customer has in this currency.

      maximum: 9007199254740991 · minimum: 1
    • companyName
      string
      required

      The agency the customer booked with.

      minLength: 1
    • currency
      required

      The orders' currency; null for the orders that carry no amount.

      Any of the following:

      • CurrencyCode
      • null
    • 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
      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
      required

      The BOOKED orders' totals added up, in minor units; null when none carries an amount.

      Any of the following:

      • integer
      • null
    • 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.
JSON
  • errorCode
    string
    required
  • errorMessage
    string
    required

401

Request failed. errorCode is stable; errorMessage is for humans.
JSON
  • errorCode
    string
    required
  • errorMessage
    string
    required

403

Request failed. errorCode is stable; errorMessage is for humans.
JSON
  • errorCode
    string
    required
  • errorMessage
    string
    required

Type to search…

↑↓ navigate↵ selectEsc close