Skip to content
Navigation

Get a person's balances in the back office

GET
https://api.nicer.travel/backoffice/people/{userId}/balances

Returns a person's ledger balances, as an advisor (what they earn) and as a traveler (their rewards): one row per agency, kind and currency they hold an account in, with what is available, pending and owed back; an overdrawn bucket reads zero and its shortfall is owed back, as everywhere else in Nicer. The person's orders are read with GET /backoffice/orders, by advisorUserId or payerUserId. The agency is named by the x-nicer-company header and nothing else. Nicer staff who name no agency read the person's accounts in every agency's ledger; with an agency named, staff and its admins read that agency's ledger only: the person's accounts there, and nothing of other agencies. An agency admin may name only an agency they administer, and may leave the header out when they administer one. An empty list means the person holds no account in the ledgers read. Errors: 400 ERROR_COMPANY_REQUIRED for an admin of several agencies who names none; 403 ERROR_DO_NOT_HAVE_PERMISSION for a caller who is neither Nicer staff nor an admin of the agency named.

Authorization

  • bearerAuth
    HTTP Bearer (JWT)
    required

    Authorization: Bearer <token>

Path parameters

  • userId
    string
    required

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
  • balances
    array of
    object
    required

    One row per agency, kind and currency the person holds an account in, ordered by agency, then kind, then currency; empty when they hold none.

    • availableMinor
      integer
      required

      What the account may pay out now, in minor units; zero when the bucket is overdrawn.

      maximum: 9007199254740991 · minimum: 0
    • beneficiaryKind
      ADVISOR
      or
      TRAVELER
      required

      The account's kind: ADVISOR for what the person earns as an advisor, TRAVELER for their traveler rewards.

    • companyName
      string
      required

      The agency whose ledger holds the account.

      minLength: 1
    • currency
      string
      required

      The account's currency.

      pattern: ^[A-Z]{3}$
    • pendingMinor
      integer
      required

      What the account has earned but may not pay out yet, in minor units; zero when the bucket is overdrawn.

      maximum: 9007199254740991 · minimum: 0
    • receivableMinor
      integer
      required

      What the person owes back on the account, in minor units, an overdrawn bucket's shortfall included.

      maximum: 9007199254740991 · minimum: 0

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