Vic.ai Invoices API

These routes give you read-only access to two types of invoices: - Invoices which have not yet been posted to the ERP system (restricted access). - Invoices which have been posted to the ERP system.

OpenAPI Specification

vicai-invoices-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  version: v10.40.4
  contact: {}
  title: Vic.ai Accounts Invoices API
  description: "## Introduction\n\nThe Vic.ai API provides a seamless connection between your Enterprise Resource\nPlanning (ERP) system and the Vic.ai product suite.\n\nThe API is designed to offer three main areas of functionality:\n\n- **Syncing master data:** This refers to the data in your ERP that Vic.ai\n  interacts with. You are required to supply and update this data in Vic.ai, and\n  you also have the option to verify the copy of the masterdata in Vic.ai.\n\n- **Syncing training data:** We need historical data to train your AI model. To\n  that end, the API provides endpoints to sync historical invoices into Vic.ai\n  and to confirm their presence.\n\n- **Subscribing to and receiving webhooks:** Webhooks enable users or automated\n  tasks to interact with your ERP through various actions in the Vic.ai product\n  suite, such as posting an invoice, payment or purchase order or requesting\n  synchronization. You will receive a notification via a webhook when these\n  actions occur.\n\n\nFor US-based integrations, please use the following base API URL:\n\n```\nhttps://api.us.vic.ai\n```\n\nFor integrations based in Norway, use the following base API URL:\n\n```\nhttps://api.no.vic.ai\n```\n\nAll paths mentioned in this documentation should use one of these URLs as the\nbase.\n\nExample:\n\n```bash\ncurl https://api.us.vic.ai/v0/healthCheck \\\n    -H \"Content-Type: application/json\" \\\n    -H \"Authorization: Bearer YOUR_ACCESS_TOKEN\"\n```\n\n## Getting Started\n\nTo begin interacting with the Vic.ai API, you will need the following\ncredentials:\n\n* A Vic.ai client ID\n* A Vic.ai client secret.\n\nThese can be provided to you securely by a Vic.ai representative\n[upon request](https://www.vic.ai/book-a-demo).\n\n**Please note:** These credentials are essentially the keys to your ERP\nintegration. If they fall into the wrong hands, unauthorized parties could\nimpersonate you, gain access to sensitive data, and potentially perform\nmalicious actions. Therefore, it's crucial to keep these credentials safe at all\ntimes to protect your application's integrity and your clients' data.\n\n### Limitations\n\nThe Vic.ai API has the following limitations:\n\n**Rate Limiting:** The API is rate-limited to 500 requests per 10-second time\nframe. If you exceed this limit, you will receive a `429 Too Many Requests`\nresponse. The limit is per Oauth client ID. If you continue to receive `429`s,\nplease contact support with a request id from the response headers.\n"
servers:
- url: https://api.no.stage.vic.ai
  description: staging server, NO
- url: https://api.us.vic.ai
  description: production server, US
- url: https://api.no.vic.ai
  description: production server, NO
security:
- BearerAuth: []
tags:
- name: Invoices
  description: 'These routes give you read-only access to two types of invoices:

    - Invoices which have not yet been posted to the ERP system (restricted access).

    - Invoices which have been posted to the ERP system.

    '
paths:
  /v0/invoices:
    get:
      description: 'Use this request to query the invoice data that are stored in Vic.ai.

        '
      summary: List all invoices
      operationId: listInvoices
      tags:
      - Invoices
      parameters:
      - $ref: '#/components/parameters/PagingLimit'
      - $ref: '#/components/parameters/PagingCursor'
      - $ref: '#/components/parameters/UseSystemDefaultExternal'
      - $ref: '#/components/parameters/SinceFilter'
      - $ref: '#/components/parameters/SortOrder'
      - $ref: '#/components/parameters/InvoiceStateFilter'
      - $ref: '#/components/parameters/InvoiceMarkedAsFilter'
      - $ref: '#/components/parameters/InvoiceBillStatusFilter'
      responses:
        '200':
          $ref: '#/components/responses/InvoicesResponse'
        '429':
          $ref: '#/components/responses/TooManyRequestsResponse'
        4XX:
          $ref: '#/components/responses/ErrorResponse'
    post:
      summary: Create an invoice.
      description: 'When creating an invoice, there are three steps to follow:


        1. Create the invoice with a POST to `/invoices`

        2. Upload the document with a POST to `/invoice/{id}/document`

        3. Process the document with a POST to `/invoice/{id}/process`


        You can make the id the internal id (from vic.ai) or the external id (from your system).


        > #### Note

        > The maximum file size allowed to upload is 100MB.

        '
      operationId: createInvoice
      tags:
      - Invoices
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateInvoice'
      responses:
        '201':
          $ref: '#/components/responses/InvoiceCreatedResponse'
        '403':
          $ref: '#/components/responses/ForbiddenResponse'
        '404':
          $ref: '#/components/responses/ResourceNotFoundResponse'
        '422':
          $ref: '#/components/responses/UnprocessableEntityResponse'
  /v0/invoices/{id}:
    get:
      description: 'Use this request to get data for a single invoice that is stored in

        Vic.ai

        '
      summary: Info for a specific invoice
      operationId: getInvoice
      tags:
      - Invoices
      parameters:
      - $ref: '#/components/parameters/PathId'
      - $ref: '#/components/parameters/UseSystemDefaultExternal'
      responses:
        '200':
          $ref: '#/components/responses/InvoiceResponse'
        '429':
          $ref: '#/components/responses/TooManyRequestsResponse'
        4XX:
          $ref: '#/components/responses/ErrorResponse'
    patch:
      description: "Use this request to indicate that an invoice has been posted or\ntransferred to the ERP system, in the case where you have not activated\na subscription, or you have responded to the subscription with a\n202-asynchronous response.\nNote that this operation can either be a confirmation, or a rejection,\ndepending on the shape of the payload.\nPossible payloads:\n- InvoiceConfirm: used to confirm that the invoice data have been\n  successfully posted to the ERP, possibly including a postingError.\n  - Use of this postingError means that the invoice data are posted, but\n    some secondary content needs amendation in the ERP that cannot be\n    performed from the vic user interface (for example: a problem\n    uploading the posted document).\n- InvoiceReject: used to communicate that the invoice data have NOT been\n  successfully posted to the ERP, due to invalid data. This should NOT\n  be used to communicate an error in posting due to a general failure\n  such as a network issue or an availability issue with the ERP, in\n  those or similar cases, a retry should be performed without notifying the vic system.\nCurrently unsupported:\n- InvoiceClearError: the error set in an `InvoiceConfirm` operation\n  should be cleared because the postingError has been resolved in the\n  ERP. This cannot be used to clear an error due to `InvoiceReject`.\nNote that `:id` *must* be internalId for this route.\n"
      summary: Asynchronous reply to invoice post or invoice transfer
      operationId: ackInvoice
      tags:
      - Invoices
      parameters:
      - name: id
        in: path
        required: true
        description: 'The `internalId` of the invoice which should be confirmed.

          '
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
              - $ref: '#/components/schemas/InvoiceConfirm'
              - $ref: '#/components/schemas/InvoiceReject'
      responses:
        '201':
          $ref: '#/components/responses/InvoiceResponse'
        '429':
          $ref: '#/components/responses/TooManyRequestsResponse'
        4XX:
          $ref: '#/components/responses/ErrorResponse'
    delete:
      description: 'Use this request to delete data for a single invoice that is stored in

        Vic.ai


        An invoice that is currently in an approval flow, or that has already

        been posted, transferred, or submitted, cannot be deleted and is

        rejected with `422 Unprocessable Entity`. Resolve the approval or

        transmission first, then retry the deletion.

        '
      summary: Deletes an invoice
      operationId: deleteInvoice
      tags:
      - Invoices
      parameters:
      - $ref: '#/components/parameters/PathId'
      - $ref: '#/components/parameters/UseSystemDefaultExternal'
      - $ref: '#/components/parameters/Comment'
      responses:
        '204':
          $ref: '#/components/responses/InvoiceDeletedResponse'
        '422':
          $ref: '#/components/responses/UnprocessableEntityResponse'
        '429':
          $ref: '#/components/responses/TooManyRequestsResponse'
        4XX:
          $ref: '#/components/responses/ErrorResponse'
  /v0/invoices/{id}/process:
    post:
      summary: Start the invoice processing.
      description: 'Tells Vic that the invoice is ready to start being processed. Once this

        is called, it may not be called again.

        '
      operationId: startProcessingInvoice
      tags:
      - Invoices
      parameters:
      - $ref: '#/components/parameters/UseSystemDefaultExternal'
      - name: id
        in: path
        required: true
        description: The Invoice internal id or external id.
        schema:
          type: string
      responses:
        '202':
          $ref: '#/components/responses/InvoiceResponse'
        '403':
          $ref: '#/components/responses/ForbiddenResponse'
        '404':
          $ref: '#/components/responses/ResourceNotFoundResponse'
        '422':
          $ref: '#/components/responses/UnprocessableEntityResponse'
  /v0/invoices/{id}/document:
    get:
      description: 'Use this request to get the document associated with a single invoice

        that is stored in Vic.ai

        '
      summary: Document for a specific invoice
      operationId: getInvoiceDocument
      tags:
      - Invoices
      parameters:
      - $ref: '#/components/parameters/UseSystemDefaultExternal'
      - name: id
        in: path
        required: true
        description: The Invoice internal id or external id.
        schema:
          type: string
      responses:
        '200':
          $ref: '#/components/responses/InvoiceDocumentResponse'
        '429':
          $ref: '#/components/responses/TooManyRequestsResponse'
        4XX:
          $ref: '#/components/responses/ErrorResponse'
    post:
      summary: Upload document invoice
      description: "This attaches a document to the invoice for processing. An external id\nmust be specified for an invoice prior to calling this.\n* Once an invoice has been processed, you may not attach a new document.\n* Once a document has been attached to an invoice, it may not be\n  changed.\n**NOTE:** The maximum file size allowed is 100MB.\n"
      operationId: uploadDocumentInvoice
      tags:
      - Invoices
      parameters:
      - $ref: '#/components/parameters/UseSystemDefaultExternal'
      - name: id
        in: path
        required: true
        description: The Invoice internal id or external id.
        schema:
          type: string
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
              - document
              properties:
                document:
                  type: string
                  format: binary
      responses:
        '200':
          $ref: '#/components/responses/InvoiceResponse'
        '403':
          $ref: '#/components/responses/ForbiddenResponse'
        '404':
          $ref: '#/components/responses/ResourceNotFoundResponse'
        '422':
          $ref: '#/components/responses/UnprocessableEntityResponse'
  /v0/invoices/{id}/supporting-attachments:
    get:
      description: 'List the supporting attachments that have been uploaded to an invoice.


        Supporting attachments are auxiliary files (contracts, packing slips,

        correspondence, etc.) that accompany an invoice but are not the invoice

        document itself. For the primary invoice document see

        `GET /v0/invoices/{id}/document`.

        '
      summary: List supporting attachments for an invoice
      operationId: listInvoiceSupportingAttachments
      tags:
      - Invoices
      parameters:
      - $ref: '#/components/parameters/UseSystemDefaultExternal'
      - name: id
        in: path
        required: true
        description: The Invoice internal id or external id.
        schema:
          type: string
      responses:
        '200':
          $ref: '#/components/responses/InvoiceSupportingAttachmentsResponse'
        '403':
          $ref: '#/components/responses/ForbiddenResponse'
        '404':
          $ref: '#/components/responses/ResourceNotFoundResponse'
        '429':
          $ref: '#/components/responses/TooManyRequestsResponse'
        4XX:
          $ref: '#/components/responses/ErrorResponse'
    post:
      description: 'Upload a supporting attachment to an invoice.


        Supporting attachments are auxiliary files (contracts, packing slips,

        correspondence, etc.) that accompany an invoice but are not the invoice

        document itself. For uploading the primary invoice document see

        `POST /v0/invoices/{id}/document`.


        The request must be sent as `multipart/form-data` with the file in a

        form field named **`file`** (note: this differs from the invoice

        document endpoint, which uses the field name `document`).


        **Supported content types** are the same as for invoice documents; see

        the [Attachments](#tag/Attachments) section for the full list.


        **Maximum file size:** 100 MB.


        **Validation failures** all return `422 Unprocessable Entity`: missing

        or blank `file`, unsupported MIME type, oversized file, and uploads

        that the server cannot read.


        **Immutability:** uploads are rejected with `422` when the invoice is

        in an immutable state (for example already posted or transmitted to

        the ERP).

        '
      summary: Upload a supporting attachment
      operationId: uploadInvoiceSupportingAttachment
      tags:
      - Invoices
      parameters:
      - $ref: '#/components/parameters/UseSystemDefaultExternal'
      - name: id
        in: path
        required: true
        description: The Invoice internal id or external id.
        schema:
          type: string
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
              - file
              properties:
                file:
                  type: string
                  format: binary
                  description: The supporting attachment file to upload.
      responses:
        '201':
          $ref: '#/components/responses/InvoiceSupportingAttachmentResponse'
        '403':
          $ref: '#/components/responses/ForbiddenResponse'
        '404':
          $ref: '#/components/responses/ResourceNotFoundResponse'
        '422':
          $ref: '#/components/responses/UnprocessableEntityResponse'
  /v0/invoices/{id}/supporting-attachments/{attachment_id}:
    delete:
      description: 'Soft-delete a supporting attachment from an invoice. The attachment is

        retained internally for audit purposes but is no longer returned by

        `GET /v0/invoices/{id}/supporting-attachments` and its download URL is

        invalidated.


        The request succeeds with `204 No Content`. If `attachment_id` does

        not belong to the given invoice the endpoint responds with

        `404 Not Found`.


        **Immutability:** deletions are rejected with `422` when the invoice

        is in an immutable state (for example already posted or transmitted

        to the ERP).

        '
      summary: Delete a supporting attachment
      operationId: deleteInvoiceSupportingAttachment
      tags:
      - Invoices
      parameters:
      - $ref: '#/components/parameters/UseSystemDefaultExternal'
      - name: id
        in: path
        required: true
        description: The Invoice internal id or external id.
        schema:
          type: string
      - name: attachment_id
        in: path
        required: true
        description: The id of the supporting attachment (returned by the list endpoint).
        schema:
          type: string
          format: uuid
      responses:
        '204':
          description: The supporting attachment was soft-deleted successfully.
        '403':
          $ref: '#/components/responses/ForbiddenResponse'
        '404':
          $ref: '#/components/responses/ResourceNotFoundResponse'
        '422':
          $ref: '#/components/responses/UnprocessableEntityResponse'
  /v2/companies/{company_id}/invoices:
    get:
      description: 'Lists a company''s invoices. By default returns posted invoices ordered

        by the time Vic.ai last changed them, oldest change first — pass

        `updated_after` (with `system`) to walk a change feed incrementally.

        Use `status`, `marked_as`, and `bill_status` to narrow the results.

        '
      summary: List invoices
      operationId: listInvoicesV2
      tags:
      - Invoices
      parameters:
      - name: company_id
        in: path
        required: true
        description: The ID of the company in Vic.ai.
        schema:
          type: string
          format: uuid
      - name: updated_after
        in: query
        description: 'Only return invoices changed strictly after this timestamp. Applies

          to whichever timestamp `system` selects.

          '
        schema:
          type: string
          format: date-time
      - name: system
        in: query
        description: 'Which timestamp `updated_after` filters on and the page is ordered

          by. `internal` (default) uses the time Vic.ai last changed the

          invoice; `external` uses the upstream system''s last-updated time.

          '
        schema:
          type: string
          enum:
          - internal
          - external
          default: internal
      - name: sort_order
        in: query
        description: Direction the page is ordered by the selected timestamp.
        schema:
          type: string
          enum:
          - asc
          - desc
          default: asc
      - name: status
        in: query
        description: Filter by workflow status.
        schema:
          type: string
          enum:
          - all
          - posted
          - not_ready
          - in_approvals
          - ready_for_post
          - ready_for_transfer
          - transferred
          default: posted
      - name: marked_as
        in: query
        description: Filter by manual payment marking.
        schema:
          type: string
          enum:
          - all
          - paid
          - unpaid
          - deleted
          default: all
      - name: bill_status
        in: query
        description: Filter by bill payment status.
        schema:
          type: string
          enum:
          - all
          - error
          - paid
          - partially_paid
          - pending
          - processing
          - rejected
          - scheduled
          - unpaid
          - voided
          default: all
      - $ref: '#/components/parameters/PaginationV2'
      responses:
        '200':
          description: A page of invoices.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListInvoicesResponseV2'
        '403':
          $ref: '#/components/responses/ErrorResponseV2'
        '422':
          $ref: '#/components/responses/ErrorResponseV2'
        4XX:
          $ref: '#/components/responses/ErrorResponseV2'
  /v2/invoices/{id}:
    get:
      description: 'Get a single invoice by its Vic.ai ID.

        '
      summary: Get an invoice
      operationId: getInvoiceV2
      tags:
      - Invoices
      parameters:
      - name: id
        in: path
        required: true
        description: The ID of the invoice in Vic.ai.
        schema:
          type: string
          format: uuid
      responses:
        '200':
          $ref: '#/components/responses/BillResponseV2'
        '404':
          $ref: '#/components/responses/ResourceNotFoundResponse'
        4XX:
          $ref: '#/components/responses/ErrorResponseV2'
    delete:
      description: 'Delete a single invoice by its Vic.ai ID.


        An invoice that is currently in an approval flow, or that has already

        been posted, transferred, or submitted, cannot be deleted and is

        rejected with `422 Unprocessable Entity`. Resolve the approval or

        transmission first, then retry the deletion.

        '
      summary: Delete an invoice
      operationId: deleteInvoiceV2
      tags:
      - Invoices
      parameters:
      - name: id
        in: path
        required: true
        description: The ID of the invoice in Vic.ai.
        schema:
          type: string
          format: uuid
      - $ref: '#/components/parameters/Comment'
      responses:
        '204':
          description: The invoice has been deleted.
        '403':
          $ref: '#/components/responses/ErrorResponseV2'
        '404':
          $ref: '#/components/responses/ResourceNotFoundResponse'
        '422':
          $ref: '#/components/responses/ErrorResponseV2'
        4XX:
          $ref: '#/components/responses/ErrorResponseV2'
  /v2/invoices/{id}/document:
    get:
      description: 'Get the PDF document for a specific invoice.


        This endpoint returns the invoice document if it has been generated.

        If the document is not yet available (pdf_path is not set), the endpoint

        will return a 202 (Accepted) status and enqueue a background job to generate

        the document. The client should retry the request after a short delay.


        The document generation typically completes within a few seconds, but may

        take longer for complex invoices or during high system load.

        '
      summary: Get invoice document
      operationId: getInvoiceDocumentV2
      tags:
      - Invoices
      parameters:
      - name: id
        in: path
        required: true
        description: The ID of the invoice in Vic.ai.
        schema:
          type: string
          format: uuid
      responses:
        '200':
          $ref: '#/components/responses/InvoiceDocumentResponse'
        '202':
          $ref: '#/components/responses/InvoiceDocumentProcessingResponse'
        '403':
          $ref: '#/components/responses/ForbiddenResponse'
        '404':
          $ref: '#/components/responses/ResourceNotFoundResponse'
        '500':
          description: 'Failed to download the document from storage. This is an internal

            error that should be reported to support.

            '
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        message:
                          type: string
                          example: Failed to download document, please try again later or contact support
        4XX:
          $ref: '#/components/responses/ErrorResponseV2'
  /v0/invoices/{id}/confirm:
    post:
      description: 'Used to confirm that the invoice data have been successfully posted to

        the ERP, possibly including a `postingError`.

        Use of this `postingError` means that the invoice data are posted, but

        some secondary content needs amendation in the ERP that cannot be

        performed from the vic user interface (for example: a problem

        uploading the posted document).

        Note: `id` *must* be the `internalId` of the invoice.


        **Submit flow timeout:** When an invoice is submitted via the

        `invoice_submitted` webhook, if Vic is unable to deliver the webhook

        to any subscriber endpoint (all delivery attempts fail), the invoice

        will automatically transition to "submit failed" within approximately

        15 minutes. If the webhook was successfully delivered, the subscriber

        may take as long as needed to confirm or reject the invoice — there is

        no timeout on the confirmation itself.

        '
      summary: Asynchronous reply to invoice post or invoice transfer
      operationId: confirmInvoice
      tags:
      - Invoices
      parameters:
      - name: id
        in: path
        required: true
        description: 'The `internalId` of the invoice which should be confirmed.

          '
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InvoiceConfirm'
      responses:
        '200':
          $ref: '#/components/responses/InvoiceConfirmedResponse'
        '403':
          $ref: '#/components/responses/ForbiddenResponse'
        '404':
          $ref: '#/components/responses/ResourceNotFoundResponse'
        '422':
          $ref: '#/components/responses/UnprocessableEntityResponse'
  /v0/invoices/{id}/reject:
    post:
      description: 'Used to communicate that the invoice data have **NOT** been

        successfully posted to the ERP, due to invalid data. This should **NOT**

        be used to communicate an error in posting due to a general failure

        such as a network issue or an availability issue with the ERP, in

        those or similar cases, a retry should be performed without notifying the vic system.

        Note: `id` *must* be the `internalId` of the invoice.

        '
      summary: Asynchronous reply to invoice post
      operationId: rejectInvoice
      tags:
      - Invoices
      parameters:
      - name: id
        in: path
        required: true
        description: 'The `internalId` of the invoice which should be confirmed.

          '
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InvoiceReject'
      responses:
        '200':
          $ref: '#/components/responses/InvoiceRejectedResponse'
        '403':
          $ref: '#/components/responses/ForbiddenResponse'
        '404':
          $ref: '#/components/responses/ResourceNotFoundResponse'
        '422':
          $ref: '#/components/responses/UnprocessableEntityResponse'
  /v0/invoices/{id}/lineItems:
    get:
      description: 'List all of the line items for the invoice.

        NOTE: They are ungrouped so that you may inspect and modify them as

        necessary.

        '
      summary: List all line items for a specific invoice
      operationId: getInvoicelineItems
      tags:
      - Invoices
      parameters:
      - $ref: '#/components/parameters/UseSystemDefaultExternal'
      - name: id
        in: path
        required: true
        description: The Invoice internal id or external id.
        schema:
          type: string
      responses:
        '200':
          $ref: '#/components/responses/InvoiceLineItemsResponse'
        '429':
          $ref: '#/components/responses/TooManyRequestsResponse'
        4XX:
          $ref: '#/components/responses/ErrorResponse'
  /v0/invoiceItems/{id}:
    put:
      summary: Update a specific invoice line item
      description: 'Updates an individual invoice line item. This allows you to modify

        the properties of a specific line item within an invoice, including

        amounts, tax information, cost accounts, and dimensions.

        '
      operationId: updateInvoiceItem
      tags:
      - Invoices
      parameters:
      - $ref: '#/components/parameters/PathId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateInvoiceLineItem'
      responses:
        '200':
          $ref: '#/components/responses/InvoiceLineItemResponse'
        '403':
          $ref: '#/components/responses/ForbiddenResponse'
        '404':
          $ref: '#/components/responses/ResourceNotFoundResponse'
        '422':
          $ref: '#/components/responses/UnprocessableEntityResponse'
        '429':
          $ref: '#/components/responses/TooManyRequestsResponse'
        4XX:
          $ref: '#/components/responses/ErrorResponse'
  /v0/invoices/{id}/external:
    put:
      summary: Update invoice external fields
      description: 'Updates an invoices external fields.


        The following fields are only available to customers with invoice

        external payment fields enabled:


        - `externalPaymentAmount`

        - `externalPaymentCurrencyId`

        - `externalPaymentDate`

        - `externalPaymentNumber`

        - `externalPaymentSource`

        - `externalPaymentStatus`

        - `externalPaymentTotalPaid`

        - `externalPaymentType`


        When setting the `externalPaymentStatus` to `voided` you may use the `externalPaymentDate` to represent when it was voided.

        '
      operationId: updateInvoiceExternal
      tags:
      - Invoices
      parameters:
      - $ref: '#/components/parameters/UseSystemDefaultExternal'
      - name: id
        in: path
        required: true
        description: The Invoice internal id or external id.
        schema:
          type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateInvoiceExternalInput'
      responses:
        '202':
          $ref: '#/components/responses/InvoiceResponse'
        '403':
          $ref: '#/components/responses/ForbiddenResponse'
        '404':
          $ref: '#/components/responses/ResourceNotFoundResponse'
        '422':
          $ref: '#/components/responses/UnprocessableEntityResponse'
  /v2/companies/{company_id}/invoices/submit:
    parameters:
    - $ref: '#/components/parameters/CompanyId'
    post:
      description: 'Marks one or more invoices as submitted for downstream approval workflows

        (e.g. NetSuite approval queue) before they are locked as posted. Records

        the `submit, started` transmission state via the same pipeline that

        native integrations use, and enqueues the `invoice_submitted` webhook

        for each invoice.


        If any invoice is ineligible (already posted, transferred, or submitted,

        missing required fields, soft-deleted vendor, etc.) or authorization

        fails, the entire batch is aborted with no partial state written.


        After submission, callers confirm approval with

        `POST /v0/invoices/{id}/confirm` (or the V2 equivalent) when the invoice

        is approved in the external system, or `POST /v0/invoices/{id}/reject`

        when it is rejected.

        '
      summary: Bulk submit invoices for approval
      operationId: bulkSubmitInvoicesV2
      tags:
      - Invoices
      x-badges:
      - name: V2
        position: after
        color: blue
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubmitInvoicesInputV2'
      responses:
        '202':
          $ref: '#/components/responses/InvoicesBulkSubmittedResponseV2'
        '403':
          $ref: '#/components/responses/ForbiddenResponse'
        '404':
          $ref: '#/components/responses/ResourceNotFoundResponse'
        '422':
          $ref: '#/components/responses/UnprocessableEntityResponse'
        4XX:
          $ref: '#/components/responses/ErrorResponseV2'
components:
  schemas:
    BillOfLadingNumberV2:
      description: The bill of lading number.
      type: object
      required:
      - bol_number
      properties:
        bol_number:
          type: string
          description: Bill of Lading number.
          minLength: 1
          maxLength: 255
          example: BOL-123456
    VendorLookupByOrgNumber:
      type: object
      required:
      - orgNumber
      properties:
        orgNumber:
          type: string
          maxLength: 255
          description: The org number of the vendor to aid in the predictions.
     

# --- truncated at 32 KB (127 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/vicai/refs/heads/main/openapi/vicai-invoices-api-openapi.yml