Skip to content
Navigation

Export a commission list

POST
https://api.nicer.travel/commerce/commission-exports

Queues an export of a commission list (items, payments, remittances, statements, suppliers, payees, payouts, commission invoices or earnings) as CSV, XLSX or PDF, with a preset or ad-hoc columns, or AGENCY: everything of the company in one ZIP archive, <company> commission <YYYY-MM-DD>.zip, with a CSV file of each list holding all of its columns (AGENCY takes nothing but its subject); and answers it QUEUED. A Rust worker pages through the rows and streams them to the file; GET the export until it is READY to receive a link that works for 15 minutes. The file is kept 7 days. Advisors export their own bookings and statements; agency admins and finance staff anything of the company (payees never with a legal name). Columns must belong to the subject (400), CSV holds 2,000,000 rows (so does each file of an archive), XLSX 1,048,575, PDF 10,000 and an archive 4 GiB (the export fails COMMISSION_EXPORT_TOO_LARGE past them). A company may have 3 exports queued or running, an archive counting as one (429 COMMISSION_RATE_LIMITED). The request and its filter are audited.

Authorization

  • bearerAuth
    HTTP Bearer (JWT)
    required

    Authorization: Bearer <token>

Header parameters

  • Idempotency-Key
    string
    required

    Unique key (8–255 chars) per request; replays return the original result.

  • x-nicer-company
    string
    required

    Company context. Authentication and tenant membership are validated by the API.

Request body JSON required

One of the following:

  • object
    • subject
      string
      required
    • columns
      optional
      array of
      string
      pattern: ^[A-Z][A-Z0-9_]{0,63}$
    • fileName
      optional
      string
      maxLength: 100 · minLength: 1 · pattern: ^[^/\\:*?"<>|\p{Cc}]+$
    • filter
      optional
      object
      • advisorUserId
        optional
        string
        maxLength: 4096 · minLength: 1
      • agingBucket
        optional
        string
        minLength: 1
      • category
        optional
        string
        minLength: 1
      • dateField
        optional
        TRAVEL_END
        or
        TRAVEL_START
        or
        BOOKED
        or
        DUE
      • from
        optional
        string
        format: date · 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])))$
      • identifierId
        optional
        string
        maxLength: 4096 · minLength: 1
      • kind
        optional
        string
        minLength: 1
      • needsReview
        optional
        true
        or
        false
      • q
        optional
        string
        maxLength: 100 · minLength: 2
      • source
        optional
        string
        minLength: 1
      • status
        optional
        string
        minLength: 1
      • supplierId
        optional
        string
        minLength: 1
      • tag
        optional
        string
        maxLength: 64 · minLength: 1
      • to
        optional
        string
        format: date · 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])))$
      • view
        optional
        BOOKINGS
        or
        RECEIVABLES
    • format
      optional
      CSV
      or
      XLSX
      or
      PDF
    • groupBy
      optional

      Any of the following:

      • ExportColumn
      • null
    • presetId
      optional
      string
      maxLength: 255 · minLength: 1
    • totalsOnly
      optional
      boolean
  • object
    • subject
      string
      required
    • columns
      optional
      array of
      string
      pattern: ^[A-Z][A-Z0-9_]{0,63}$
    • fileName
      optional
      string
      maxLength: 100 · minLength: 1 · pattern: ^[^/\\:*?"<>|\p{Cc}]+$
    • filter
      optional
      object
      • channel
        optional
        string
        minLength: 1
      • from
        optional
        string
        format: date · 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])))$
      • remittanceId
        optional
        string
        maxLength: 255 · minLength: 1
      • to
        optional
        string
        format: date · 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])))$
    • format
      optional
      CSV
      or
      XLSX
      or
      PDF
    • groupBy
      optional

      Any of the following:

      • ExportColumn
      • null
    • presetId
      optional
      string
      maxLength: 255 · minLength: 1
    • totalsOnly
      optional
      boolean
  • object
    • subject
      string
      required
    • columns
      optional
      array of
      string
      pattern: ^[A-Z][A-Z0-9_]{0,63}$
    • fileName
      optional
      string
      maxLength: 100 · minLength: 1 · pattern: ^[^/\\:*?"<>|\p{Cc}]+$
    • filter
      optional
      object
      • batchId
        optional
        string
        maxLength: 255 · minLength: 1
      • channel
        optional
        string
        minLength: 1
      • from
        optional
        string
        format: date · 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])))$
      • q
        optional
        string
        maxLength: 100 · minLength: 2
      • state
        optional
        string
        minLength: 1
      • to
        optional
        string
        format: date · 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])))$
      • unallocated
        optional
        true
        or
        false
    • format
      optional
      CSV
      or
      XLSX
      or
      PDF
    • groupBy
      optional

      Any of the following:

      • ExportColumn
      • null
    • presetId
      optional
      string
      maxLength: 255 · minLength: 1
    • totalsOnly
      optional
      boolean
  • object
    • subject
      string
      required
    • columns
      optional
      array of
      string
      pattern: ^[A-Z][A-Z0-9_]{0,63}$
    • fileName
      optional
      string
      maxLength: 100 · minLength: 1 · pattern: ^[^/\\:*?"<>|\p{Cc}]+$
    • filter
      optional
      object
      • currency
        optional
        string
        pattern: ^[A-Z]{3}$
      • from
        optional
        string
        format: date · 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])))$
      • payeeId
        optional
        string
        maxLength: 255 · minLength: 1
      • payeeKind
        optional
        ADVISOR
        or
        COMPANY
      • status
        optional
        string
        minLength: 1
      • to
        optional
        string
        format: date · 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])))$
    • format
      optional
      CSV
      or
      XLSX
      or
      PDF
    • groupBy
      optional

      Any of the following:

      • ExportColumn
      • null
    • presetId
      optional
      string
      maxLength: 255 · minLength: 1
    • totalsOnly
      optional
      boolean
  • object
    • subject
      string
      required
    • columns
      optional
      array of
      string
      pattern: ^[A-Z][A-Z0-9_]{0,63}$
    • fileName
      optional
      string
      maxLength: 100 · minLength: 1 · pattern: ^[^/\\:*?"<>|\p{Cc}]+$
    • filter
      optional
      object
      • kind
        optional
        string
        minLength: 1
      • q
        optional
        string
        maxLength: 100 · minLength: 2
    • format
      optional
      CSV
      or
      XLSX
      or
      PDF
    • groupBy
      optional

      Any of the following:

      • ExportColumn
      • null
    • presetId
      optional
      string
      maxLength: 255 · minLength: 1
    • totalsOnly
      optional
      boolean
  • object
    • subject
      string
      required
    • columns
      optional
      array of
      string
      pattern: ^[A-Z][A-Z0-9_]{0,63}$
    • fileName
      optional
      string
      maxLength: 100 · minLength: 1 · pattern: ^[^/\\:*?"<>|\p{Cc}]+$
    • filter
      optional
      object
    • format
      optional
      CSV
      or
      XLSX
      or
      PDF
    • groupBy
      optional

      Any of the following:

      • ExportColumn
      • null
    • presetId
      optional
      string
      maxLength: 255 · minLength: 1
    • totalsOnly
      optional
      boolean
  • object
    • subject
      string
      required
    • columns
      optional
      array of
      string
      pattern: ^[A-Z][A-Z0-9_]{0,63}$
    • fileName
      optional
      string
      maxLength: 100 · minLength: 1 · pattern: ^[^/\\:*?"<>|\p{Cc}]+$
    • filter
      optional
      object
    • format
      optional
      CSV
      or
      XLSX
      or
      PDF
    • groupBy
      optional

      Any of the following:

      • ExportColumn
      • null
    • presetId
      optional
      string
      maxLength: 255 · minLength: 1
    • totalsOnly
      optional
      boolean
  • object
    • subject
      string
      required
    • columns
      optional
      array of
      string
      pattern: ^[A-Z][A-Z0-9_]{0,63}$
    • fileName
      optional
      string
      maxLength: 100 · minLength: 1 · pattern: ^[^/\\:*?"<>|\p{Cc}]+$
    • filter
      optional
      object
    • format
      optional
      CSV
      or
      XLSX
      or
      PDF
    • groupBy
      optional

      Any of the following:

      • ExportColumn
      • null
    • presetId
      optional
      string
      maxLength: 255 · minLength: 1
    • totalsOnly
      optional
      boolean
  • object
    • subject
      string
      required
    • columns
      optional
      array of
      string
      pattern: ^[A-Z][A-Z0-9_]{0,63}$
    • fileName
      optional
      string
      maxLength: 100 · minLength: 1 · pattern: ^[^/\\:*?"<>|\p{Cc}]+$
    • filter
      optional
      object
    • format
      optional
      CSV
      or
      XLSX
      or
      PDF
    • groupBy
      optional

      Any of the following:

      • ExportColumn
      • null
    • presetId
      optional
      string
      maxLength: 255 · minLength: 1
    • totalsOnly
      optional
      boolean
  • object
    • subject
      string
      required

Returns

200

OK

JSON
  • columns
    array of
    string
    required
    pattern: ^[A-Z][A-Z0-9_]{0,63}$
  • companyName
    string
    required
    minLength: 1
  • createdAt
    string
    required
    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))$
  • downloadUrl
    required

    Any of the following:

    • string
    • null
  • errorCode
    required

    Any of the following:

    • string
      COMMISSION_EXPORT_TOO_LARGE
      or
      COMMISSION_EXPORT_TIMED_OUT
      or
      COMMISSION_EXPORT_FAILED
    • null
  • expiresAt
    required

    Any of the following:

    • string
    • null
  • exportId
    string
    required
    minLength: 1
  • fileName
    string
    required
    minLength: 1
  • finishedAt
    required

    Any of the following:

    • string
    • null
  • filter
    map of
    unknown
    required
  • format
    CSV
    or
    XLSX
    or
    PDF
    required
  • groupBy
    required

    Any of the following:

    • ExportColumn
    • null
  • presetId
    required

    Any of the following:

    • string
    • null
  • requestedByUserId
    string
    required
    minLength: 1
  • rowCount
    required

    Any of the following:

    • integer
    • null
  • sizeBytes
    required

    Any of the following:

    • integer
    • null
  • startedAt
    required

    Any of the following:

    • string
    • null
  • status
    QUEUED
    or
    RUNNING
    or
    READY
    or
    FAILED
    or
    EXPIRED
    required
  • subject
    string
    ·
    one of 10 values
    required
    Allowed values: COMMISSION_ITEMS, PAYMENTS, REMITTANCES, STATEMENTS, SUPPLIERS, PAYEES, PAYOUTS, COMMISSION_INVOICES, EARNINGS, AGENCY
  • totalsOnly
    boolean
    required

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