Skip to content
Navigation

Run an action on an import of bookings

POST
https://api.nicer.travel/commerce/commission-imports/{importId}/actions

APPLY_MAPPING re-reads the rows with a new mapping (status PARSING, then READY); MAP_ADVISORS (admins and staff) replaces the emails-to-members map and re-reads the rows; SAVE_PRESET keeps the mapping for the company's next files; COMMIT creates one booking made elsewhere with its commission item per valid row, as a resumable job (status COMMITTING, then COMMITTED; duplicates are skipped and counted; a commit that failed stays COMMITTING and resumes when COMMIT is asked again); DISCARD drops a file that was not committed. Each action is audited.

Authorization

  • bearerAuth
    HTTP Bearer (JWT)
    required

    Authorization: Bearer <token>

Path parameters

  • importId
    string
    required

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
    • mapping
      object
      required
      • columns
        map of
        string
        required
      • defaults
        map of
        string
        required
      • dateFormat
        ISO
        or
        US
        or
        EU
        required
      • decimalSeparator
        .
        or
        ,
        required
      • headerRow
        integer
        required
        maximum: 50 · minimum: 1
      • sheet
        required

        Any of the following:

        • string
        • null
    • type
      string
      required
  • object
    • advisors
      array of
      object
      required
      • email
        string
        required
        maxLength: 254 · pattern: ^[^\s@A-Z]+@[^\s@A-Z]+$
      • userId
        string
        required
        maxLength: 255 · minLength: 1
    • type
      string
      required
  • object
    • name
      string
      required
      maxLength: 100 · minLength: 1
    • type
      string
      required
  • object
    • type
      string
      required
  • object
    • type
      string
      required

Returns

200

OK

JSON
  • committedAt
    required

    Any of the following:

    • string
    • null
  • 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))$
  • createdByUserId
    string
    required
    minLength: 1
  • errorCode
    required

    Any of the following:

    • string
    • null
  • fileName
    string
    required
    minLength: 1
  • format
    CSV
    or
    TSV
    or
    TXT
    or
    XLSX
    required
  • headers
    array of
    string
    required
  • jobId
    required

    Any of the following:

    • string
    • null
  • presetId
    required

    Any of the following:

    • string
    • null
  • sizeBytes
    integer
    required
    maximum: 9007199254740991
  • source
    FILE_IMPORT
    required
  • status
    string
    ·
    one of 9 values
    required
    Allowed values: AWAITING_UPLOAD, UPLOADED, PARSING, READY, COMMITTING, COMMITTED, UNDONE, DISCARDED, FAILED
  • updatedAt
    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))$
  • advisorUserId
    required

    Any of the following:

    • string
    • null
  • advisors
    array of
    object
    required
    • email
      string
      required
      maxLength: 254 · pattern: ^[^\s@A-Z]+@[^\s@A-Z]+$
    • userId
      string
      required
      maxLength: 255 · minLength: 1
  • counts
    object
    required
    • committed
      integer
      required
      maximum: 9007199254740991 · minimum: 0
    • duplicate
      integer
      required
      maximum: 9007199254740991 · minimum: 0
    • invalid
      integer
      required
      maximum: 9007199254740991 · minimum: 0
    • rows
      integer
      required
      maximum: 9007199254740991 · minimum: 0
    • valid
      integer
      required
      maximum: 9007199254740991 · minimum: 0
  • importId
    string
    required
    minLength: 1
  • kind
    BOOKINGS
    required
  • mapping
    required

    Any of the following:

    • BookingImportMapping
      • columns
        map of
        string
        required
      • defaults
        map of
        string
        required
      • dateFormat
        ISO
        or
        US
        or
        EU
        required
      • decimalSeparator
        .
        or
        ,
        required
      • headerRow
        integer
        required
        maximum: 50 · minimum: 1
      • sheet
        required

        Any of the following:

        • string
        • null
    • null

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