> ## Documentation Index
> Fetch the complete documentation index at: https://equatetravel.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Push an invoice

> Ingest a single invoice document into the workspace's pipelines.



## OpenAPI

````yaml openapi.json POST /api/v1/invoices
openapi: 3.1.0
info:
  title: equate API
  version: 1.0.0
  description: >-
    The public equate Agent API. Send a supplier invoice (as text, a
    base64-encoded file, or a URL) to a published agent and receive structured,
    travel-aware extraction — optionally matched against your booking data.
    Authenticated with a workspace API key.
  contact:
    name: equate support
    email: support@equatetravel.ai
servers:
  - url: https://equatetravel.ai
    description: >-
      Production. Replace with your equate workspace domain if you use a custom
      one.
  - url: http://localhost:3000
    description: Local development
security:
  - apiKey: []
tags:
  - name: Agents
    description: >-
      Invoke a published agent to read a document, say what it is, match it to a
      booking and set off its actions.
  - name: Invoices
    description: >-
      Push invoice documents into the workspace's pipelines, and fetch the
      documents held for an invoice.
paths:
  /api/v1/invoices:
    post:
      tags:
        - Invoices
      summary: Push an invoice
      description: >-
        Push a single invoice document into the workspace. The file is ingested
        exactly like a manual upload or an email attachment — it becomes a job
        and flows through your pipelines. Supply the file via exactly one of
        `fileBase64` or `fileUrl`. Without an explicit `sourceId`, the document
        lands on the workspace's built-in REST API source.
      operationId: pushInvoice
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PushInvoiceRequest'
            examples:
              url:
                summary: File URL
                value:
                  fileUrl: https://example.com/invoices/OC-44821.pdf
                  fileName: OC-44821.pdf
                  reference: order-9921
              base64:
                summary: Base64 file
                value:
                  fileBase64: JVBERi0xLjQKJ...
                  fileType: application/pdf
                  fileName: OC-44821.pdf
      responses:
        '202':
          description: >-
            The invoice was ingested and a job created. `processed` indicates
            whether a pipeline picked it up immediately (as-they-arrive
            handling) or it awaits a scheduled/manual run.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PushInvoiceResponse'
        '400':
          description: >-
            The request body failed validation, the `sourceId` was not found in
            the workspace, or the `fileUrl` could not be fetched
            (`FETCH_FAILED`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '401':
          description: Missing, malformed, unknown or revoked API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '413':
          description: >-
            The file exceeds the size limit (~10.5 MB decoded for base64; 50 MB
            absolute).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '415':
          description: >-
            Unsupported file type — PDF, plain text, CSV and Excel are accepted
            (`UNSUPPORTED_MEDIA_TYPE`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '502':
          description: >-
            Ingestion failed (`INGEST_FAILED`) — often the plan's document
            limit.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
components:
  schemas:
    PushInvoiceRequest:
      type: object
      description: >-
        A single invoice push. Supply the file via exactly one of `fileBase64`
        or `fileUrl`.
      anyOf:
        - required:
            - fileBase64
        - required:
            - fileUrl
      properties:
        fileBase64:
          type: string
          description: >-
            A base64-encoded file (PDF, plain text, CSV or Excel). Decoded size
            must stay under ~10.5 MB.
        fileUrl:
          type: string
          format: uri
          maxLength: 2048
          description: >-
            A publicly reachable http(s) URL the server fetches the document
            from.
        fileName:
          type: string
          maxLength: 500
          description: Optional filename, shown in the work queue. Generated when omitted.
        fileType:
          type: string
          maxLength: 120
          description: >-
            Optional MIME type, e.g. `application/pdf`. Defaults to the URL's
            content type, or `application/pdf` for base64.
        reference:
          type: string
          maxLength: 200
          description: Your own correlation id, echoed back unchanged in the response.
        sourceId:
          type: string
          format: uuid
          description: >-
            Optional target source (must belong to the workspace). Defaults to
            the built-in REST API source.
    PushInvoiceResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            jobId:
              type: string
              description: Id of the created job — track it in the dashboard's work queue.
            sourceFileId:
              type: string
              description: Id of the stored source file.
            processed:
              type: boolean
              description: Whether a pipeline picked the document up immediately.
            pipelineId:
              type:
                - string
                - 'null'
              description: The pipeline that picked it up, when `processed` is true.
            reference:
              type:
                - string
                - 'null'
              description: The `reference` you supplied, if any.
            deduped:
              type: boolean
              description: >-
                True when this exact file (byte-identical content already in the
                workspace) had been ingested before: `jobId` and `sourceFileId`
                reference the ORIGINAL ingest, no new job was created and
                nothing extra was billed.
    ApiError:
      type: object
      description: Every error response uses this envelope.
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - UNAUTHORIZED
                - VALIDATION_ERROR
                - SUBSCRIPTION_REQUIRED
                - FEATURE_NOT_AVAILABLE
                - NOT_FOUND
                - AGENT_DISABLED
                - NOT_PUBLISHED
                - PAYLOAD_TOO_LARGE
                - UNSUPPORTED_MEDIA_TYPE
                - FETCH_FAILED
                - INGEST_FAILED
                - RATE_LIMITED
                - RUN_FAILED
                - INTERNAL_ERROR
              description: A stable, machine-readable error code.
            message:
              type: string
              description: A human-readable explanation.
            details:
              type: object
              additionalProperties: true
              description: >-
                Present for `VALIDATION_ERROR`: a flattened list of field
                issues.
          required:
            - code
            - message
        runId:
          type:
            - string
            - 'null'
          description: 'Present on `RUN_FAILED`: the id of the recorded (failed) run.'
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: >-
        A workspace API key, sent as `Authorization: Bearer ip_live_…`. Create
        and revoke keys in the equate dashboard under Settings → API keys
        (workspace admins only). The full key is shown once at creation — store
        it securely.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.