Skip to content
Navigation

Run a statement action

POST
https://api.nicer.travel/commerce/statements/{statementId}/actions

One action on a statement. ADD_ADJUSTMENT and REMOVE_ADJUSTMENT (a credit or debit, unit amount times quantity, with a description) and RECOMPUTE (picks again the earnings its period covers) while it is OPEN or PENDING_APPROVAL; CLOSE moves an OPEN statement to approval; REOPEN takes it back; APPROVE releases its earnings and makes it payable — a negative total, or one under the payee's minimum payout, is carried to the next statement; VOID cancels an unapproved statement and frees its earnings. MARK_PAID records that an approved statement was paid outside Nicer (a check, a wire, another system) in one step: the day, optionally how and a reference; it becomes PAID with its payout and journal (409 COMMISSION_STATEMENT_ALREADY_PAID once a payout run holds it). ADD_ATTACHMENT (any status but VOID) answers a presigned upload for a document such as the payment's receipt. ADD_NOTE (Markdown, as on an item) at any time. An approved statement accepts no other change (409 COMMISSION_STATEMENT_FINAL). The payee may add notes; agency admins and finance staff run the rest. Returns the statement and, for ADD_ATTACHMENT, its upload link.

Authorization

  • bearerAuth
    HTTP Bearer (JWT)
    required

    Authorization: Bearer <token>

Path parameters

  • statementId
    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
    • description
      string
      required
      maxLength: 500 · minLength: 1
    • kind
      CREDIT
      or
      DEBIT
      required
    • quantity
      integer
      required
      maximum: 10000 · minimum: 1
    • type
      string
      required
    • unitAmountMinor
      integer
      required
      maximum: 100000000 · minimum: 1
  • object
    • adjustmentId
      string
      required
      maxLength: 255 · minLength: 1
    • type
      string
      required
  • object
    • bodyMarkdown
      string
      required
      maxLength: 10000 · minLength: 1
    • type
      string
      required
  • object
    • type
      string
      required
  • object
    • type
      string
      required
  • object
    • type
      string
      required
  • object
    • reason
      string
      required
      maxLength: 500 · minLength: 1
    • type
      string
      required
  • object
    • type
      string
      required
  • object
    • paidOn
      string
      required
      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])))$
    • type
      string
      required
    • method
      optional
      CHECK
      or
      MANUAL
    • reference
      optional
      string
      maxLength: 100 · minLength: 1
  • object
    • contentType
      string
      ·
      one of 8 values
      required
      Allowed values: application/pdf, image/jpeg, image/png, message/rfc822, text/csv, text/plain, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.openxmlformats-officedocument.wordprocessingml.document
    • fileName
      string
      required
      maxLength: 255 · minLength: 1
    • sha256
      string
      required
      pattern: ^[0-9a-f]{64}$
    • sizeBytes
      integer
      required
      maximum: 26214400 · minimum: 1
    • type
      string
      required
    • label
      optional
      string
      maxLength: 200 · minLength: 1

Returns

200

OK

JSON
  • statement
    object
    required
    • adjustmentsMinor
      integer
      required
      maximum: 9007199254740991 · minimum: -9007199254740991
    • approvedAt
      required

      Any of the following:

      • string
      • null
    • approvedByUserId
      required

      Any of the following:

      • string
      • null
    • closedAt
      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))$
    • currency
      string
      required
      pattern: ^[A-Z]{3}$
    • cycleOn
      string
      required
      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])))$
    • earningsMinor
      integer
      required
      maximum: 9007199254740991 · minimum: -9007199254740991
    • lineCount
      integer
      required
      maximum: 9007199254740991 · minimum: 0
    • number
      string
      required
      minLength: 1
    • paidAt
      required

      Any of the following:

      • string
      • null
    • payeeId
      string
      required
      minLength: 1
    • payeeKind
      ADVISOR
      or
      COMPANY
      required
    • periodEnd
      string
      required
      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])))$
    • periodStart
      string
      required
      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])))$
    • statementId
      string
      required
      minLength: 1
    • status
      OPEN
      or
      PENDING_APPROVAL
      or
      APPROVED
      or
      PAID
      or
      VOID
      required
    • totalMinor
      integer
      required
      maximum: 9007199254740991 · minimum: -9007199254740991
    • 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))$
    • version
      integer
      required
      maximum: 9007199254740991
    • voidReason
      required

      Any of the following:

      • string
      • null
    • adjustments
      array of
      object
      required
      • adjustmentId
        string
        required
        minLength: 1
      • amountMinor
        integer
        required
        maximum: 9007199254740991 · minimum: -9007199254740991
      • carriedFromStatementId
        required

        Any of the following:

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

        Any of the following:

        • string
        • null
      • description
        string
        required
        maxLength: 500 · minLength: 1
      • kind
        CREDIT
        or
        DEBIT
        required
      • quantity
        integer
        required
        maximum: 9007199254740991
      • unitAmountMinor
        integer
        required
        maximum: 9007199254740991
    • allowedActions
      array of
      string
      ·
      one of 10 values
      required
      Allowed values: ADD_ADJUSTMENT, REMOVE_ADJUSTMENT, ADD_NOTE, CLOSE, APPROVE, REOPEN, VOID, RECOMPUTE, MARK_PAID, ADD_ATTACHMENT
    • attachments
      array of
      object
      required
      • attachmentId
        string
        required
        minLength: 1
      • contentType
        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
        string
        required
        format: uri
      • fileName
        string
        required
        minLength: 1
      • label
        required

        Any of the following:

        • string
        • null
      • sizeBytes
        integer
        required
        maximum: 9007199254740991
      • uploadedByUserId
        string
        required
        minLength: 1
    • lines
      array of
      object
      required
      • amountMinor
        integer
        required
        maximum: 9007199254740991 · minimum: -9007199254740991
      • bucket
        PENDING
        or
        AVAILABLE
        required
      • clientName
        required

        Any of the following:

        • string
        • null
      • commissionItemId
        required

        Any of the following:

        • string
        • null
      • confirmationNumber
        required

        Any of the following:

        • string
        • null
      • earningId
        string
        required
        minLength: 1
      • earningKind
        string
        required
        minLength: 1
      • entryType
        EARNING
        or
        REVERSAL
        or
        CLAWBACK
        required
      • orderId
        required

        Any of the following:

        • string
        • null
      • payableOn
        string
        required
        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])))$
      • supplierName
        required

        Any of the following:

        • string
        • null
      • travelEnd
        required

        Any of the following:

        • string
        • null
    • nextCursor
      required

      Any of the following:

      • string
      • null
    • notes
      array of
      object
      required
      • authorUserId
        string
        required
        minLength: 1
      • bodyMarkdown
        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))$
      • noteId
        string
        required
        minLength: 1
    • payout
      required

      Any of the following:

      • Payout
        • amountMinor
          integer
          required
          maximum: 9007199254740991
        • attempts
          integer
          required
          maximum: 9007199254740991 · minimum: 0
        • 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))$
        • currency
          string
          required
          pattern: ^[A-Z]{3}$
        • failureReason
          required

          Any of the following:

          • string
          • null
        • method
          STRIPE_CONNECT
          or
          CHECK
          or
          MANUAL
          required
        • paidAt
          required

          Any of the following:

          • string
          • null
        • payeeId
          string
          required
          minLength: 1
        • payeeKind
          ADVISOR
          or
          COMPANY
          required
        • payoutId
          string
          required
          minLength: 1
        • payoutRunId
          string
          required
          minLength: 1
        • processorReference
          required

          Any of the following:

          • string
          • null
        • statementId
          string
          required
          minLength: 1
        • statementNumber
          string
          required
          minLength: 1
        • status
          PENDING
          or
          PAID
          or
          FAILED
          or
          CANCELLED
          required
        • 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))$
      • null
    • pdfUrl
      required

      Any of the following:

      • string
      • null
  • upload
    required

    Any of the following:

    • UploadLink
      • expiresAt
        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))$
      • headers
        map of
        string
        required
      • method
        string
        required
      • url
        string
        required
        format: uri
    • 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