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

# List supplier invoices

> Paginated supplier invoices of the workspace, newest first (without items).



## OpenAPI

````yaml /openapi.yaml get /supplier_invoices
openapi: 3.0.1
info:
  title: GetSpecs REST API
  description: REST API documentation for GetSpecs.
  version: 1.0.0
servers:
  - url: /v1
  - url: https://demo-api.getspecs.io/v1
security: []
paths:
  /supplier_invoices:
    get:
      tags:
        - SupplierInvoice
      summary: List supplier invoices
      description: >-
        Paginated supplier invoices of the workspace, newest first (without
        items).
      operationId: supplier_invoices#index
      parameters:
        - name: status[]
          in: query
          required: false
          schema:
            type: array
            items:
              type: string
              enum:
                - draft
                - matched
                - on_hold
                - approved
                - cancelled
        - name: supplier_company_name[]
          in: query
          required: false
          schema:
            type: array
            items:
              type: string
        - name: supplier
          in: query
          required: false
          schema:
            type: string
        - name: search
          in: query
          required: false
          description: Substring of the invoice number
          schema:
            type: string
        - name: purchase_order_ids[]
          in: query
          required: false
          schema:
            type: array
            items:
              type: integer
          description: Invoices billing any of these purchase orders
        - name: project_ids[]
          in: query
          required: false
          schema:
            type: array
            items:
              type: integer
          description: >-
            Invoices with an item (PO line or extra charge) of any of these
            projects
        - name: supplier_ids[]
          in: query
          required: false
          schema:
            type: array
            items:
              type: integer
          description: Invoices of any of these suppliers (contacts company ids)
        - name: supplier_invoice_items[package_ids][]
          in: query
          required: false
          schema:
            type: array
            items:
              type: integer
          description: >-
            Invoices with an item matching every given supplier_invoice_items
            list on the same item (its own package / section / category; a PO
            line has a copy of its PO item's)
        - name: supplier_invoice_items[package_section_ids][]
          in: query
          required: false
          schema:
            type: array
            items:
              type: integer
          description: >-
            Invoices with an item matching every given supplier_invoice_items
            list on the same item (its own package / section / category; a PO
            line has a copy of its PO item's)
        - name: supplier_invoice_items[category_ids][]
          in: query
          required: false
          schema:
            type: array
            items:
              type: integer
          description: >-
            Invoices with an item matching every given supplier_invoice_items
            list on the same item (its own package / section / category; a PO
            line has a copy of its PO item's)
        - name: overdue
          in: query
          required: false
          description: >-
            true: due before today, not cancelled and not fully paid; false:
            every other invoice
          schema:
            type: boolean
        - name: due_from
          in: query
          required: false
          description: Due on or after this date
          schema:
            type: string
            format: date
        - name: due_to
          in: query
          required: false
          description: Due on or before this date
          schema:
            type: string
            format: date
        - name: page
          in: query
          required: false
          schema:
            type: integer
        - name: per_page
          in: query
          required: false
          schema:
            type: integer
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/supplier_invoice'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
      security:
        - apiKey: []
          workspaceId: []
components:
  schemas:
    supplier_invoice:
      type: object
      properties:
        id:
          type: integer
        project_ids:
          type: array
          description: >-
            The projects of the invoice's items (PO item lines and extra
            charges), ascending. An invoice belongs to the workspace and may
            bill several projects.
          items:
            type: integer
        invoice_number:
          type: string
          description: >-
            The supplier's own invoice number, unique per workspace and
            supplier. Generated numbers continue the workspace's `INV-0001`
            series.
        invoice_date:
          type: string
          format: date
        due_date:
          type: string
          format: date
          nullable: true
          description: >-
            When the invoice should be paid. Computed as invoice_date + due_days
            of a payment line (see payment_terms_basis) unless typed in by hand
            (due_date_overridden); null without terms.
        due_date_overridden:
          type: boolean
          description: The due date was typed in by hand and is no longer computed.
        payment_terms_basis:
          type: object
          nullable: true
          description: >-
            The payment line the computed due date came from; null when typed in
            by hand or without terms.
          properties:
            source:
              type: string
              enum:
                - purchase_order
                - supplier
                - workspace_default
              description: >-
                `purchase_order`: a line of the order of the first PO-linked
                invoice line (the line this invoice starts billing, after the
                order's earlier invoices); `supplier` / `workspace_default`: the
                company's own terms or the workspace defaults (the first
                invoice-triggered one, else the first).
            purchase_order_id:
              type: integer
            payment_term_id:
              type: integer
              nullable: true
            label:
              type: string
            trigger:
              type: string
              enum:
                - order
                - delivery
                - invoice
            due_days:
              type: integer
        overdue:
          type: boolean
          description: Not fully paid and due before today; never for a cancelled invoice.
        currency:
          type: string
          nullable: true
          example: PLN
        net_amount:
          type: string
          description: Σ item quantity × unit price (extra charges included), 2 decimals.
        paid_amount:
          type: string
          description: Σ payments, 2 decimals.
        outstanding_amount:
          type: string
          description: net_amount − paid_amount.
        payment_status:
          type: string
          enum:
            - unpaid
            - partially_paid
            - paid
        purchase_orders:
          type: array
          description: >-
            The purchase orders this invoice bills, with this invoice's amounts
            per PO (summed over the PO's projects).
          items:
            type: object
            properties:
              id:
                type: integer
              label:
                type: string
              project_ids:
                type: array
                description: The projects this invoice bills the PO on, ascending.
                items:
                  type: integer
              items_amount:
                type: string
                description: Σ of the invoice items billing this PO.
              invoiced_amount:
                type: string
                description: >-
                  This PO's share of the invoice net amount — its items amount
                  plus a proportional share of the unlinked extra charges of the
                  same project.
              paid_amount:
                type: string
                description: Σ of this invoice's payment allocations to this PO.
        status:
          type: string
          enum:
            - draft
            - matched
            - on_hold
            - approved
            - cancelled
        matched_at:
          type: string
          format: date-time
          nullable: true
        exceptions_accepted_at:
          type: string
          format: date-time
          nullable: true
        exceptions_accepted_by_id:
          type: integer
          nullable: true
        exceptions_acceptance_note:
          type: string
          nullable: true
        position:
          type: integer
        supplier_id:
          type: integer
          description: >-
            The supplier, a Contacts company of the workspace (may no longer
            exist).
        supplier_company_name:
          type: string
          description: >-
            The company's name when the invoice got its supplier (copied from
            the PO, or picked); never changes afterwards.
        supplier_contact_name:
          type: string
          nullable: true
        supplier_contact_email:
          type: string
          nullable: true
        supplier_contact_phone:
          type: string
          nullable: true
        supplier_address:
          type: string
          nullable: true
        created_by_id:
          type: integer
          nullable: true
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        items:
          type: array
          description: Not on the list endpoint. Ordered by position descending.
          items:
            $ref: '#/components/schemas/supplier_invoice_item'
        attachments:
          type: array
          description: Not on the list endpoint. Newest first.
          items:
            $ref: '#/components/schemas/attachment'
        payments:
          type: array
          description: Not on the list endpoint. Newest payment first.
          items:
            $ref: '#/components/schemas/supplier_invoice_payment'
      required:
        - id
        - project_ids
        - invoice_number
        - invoice_date
        - currency
        - net_amount
        - paid_amount
        - outstanding_amount
        - payment_status
        - status
        - supplier_id
        - supplier_company_name
    error:
      type: object
      properties:
        error:
          type: string
        errors:
          type: array
          items:
            type: object
            properties:
              field:
                type: string
                nullable: true
              code:
                type: string
                nullable: true
              message:
                type: string
            required:
              - message
    supplier_invoice_item:
      type: object
      properties:
        id:
          type: integer
        supplier_invoice_id:
          type: integer
        project_id:
          type: integer
          description: A PO item line's PO item project; an extra charge's own project.
        purchase_order_item:
          type: object
          nullable: true
          description: >-
            The billed PO item; null for an extra charge (freight, packaging,
            ...), which is never matched. Carries the PO item's current budget
            dimensions; the line's own are a snapshot taken when it was saved,
            so they differ once the PO item is moved (section, category,
            baseline row) after billing.
          properties:
            id:
              type: integer
            purchase_order_id:
              type: integer
            label:
              type: string
            description:
              type: string
              nullable: true
            package_section_id:
              type: integer
            category_id:
              type: integer
              nullable: true
            package_baseline_item_id:
              type: integer
              nullable: true
        charge_purchase_order:
          type: object
          nullable: true
          description: >-
            Extra charges only — the PO the charge belongs to; null for PO item
            lines and unlinked charges.
          properties:
            id:
              type: integer
            label:
              type: string
        package_id:
          type: integer
          description: >-
            Budget dimensions — a PO item line's copied from its PO item, an
            extra charge's own.
        package_section_id:
          type: integer
        category_id:
          type: integer
          nullable: true
        category:
          type: string
          nullable: true
          description: The category text (named like a manual PO item's).
        package_baseline_item_id:
          type: integer
          nullable: true
        description:
          type: string
          nullable: true
        quantity:
          type: string
          example: '400.00'
        unit_price:
          type: string
          example: '10.00'
        amount:
          type: string
          description: quantity × unit price, 2 decimals.
        position:
          type: integer
        matches:
          type: array
          items:
            type: object
            properties:
              id:
                type: integer
              goods_receipt_item_id:
                type: integer
                nullable: true
              inspection_id:
                type: integer
                nullable: true
              matched_quantity:
                type: string
              result:
                type: string
                enum:
                  - matched
                  - exception
              exception_reason:
                type: string
                nullable: true
                enum:
                  - price_variance
                  - quantity_exceeds_order
                  - quantity_not_received
                  - quantity_rejected
                  - quantity_not_inspected
                  - null
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
        - id
        - project_id
        - quantity
        - unit_price
        - amount
        - package_id
        - package_section_id
        - matches
    attachment:
      type: object
      description: >-
        A file attached to a procurement document (purchase order, supplier
        invoice, goods receipt or inspection), a project or a baseline row.
      properties:
        id:
          type: integer
        filename:
          type: string
          description: The name the file was uploaded with.
        content_type:
          type: string
          example: application/pdf
        byte_size:
          type: integer
        url:
          type: string
          description: >-
            Download URL. On private storage a signed URL that serves the file
            inline under its filename.
        created_by_id:
          type: integer
          nullable: true
        created_at:
          type: string
          format: date-time
        deleted_at:
          type: string
          format: date-time
          nullable: true
          description: >-
            When it was removed from its document. Documents list only files
            that are not removed; a purchase order revision lists the files it
            had, removed ones included (their `url` still works).
      required:
        - id
        - filename
        - content_type
        - byte_size
        - url
        - created_at
    supplier_invoice_payment:
      type: object
      properties:
        id:
          type: integer
        amount:
          type: string
          example: '2500.00'
        paid_on:
          type: string
          format: date
        reference:
          type: string
          nullable: true
          description: Bank / transfer reference.
        notes:
          type: string
          nullable: true
        allocations:
          type: array
          description: >-
            How the payment is split across the invoice's purchase orders (adds
            up to `amount`). One entry per PO, whichever projects the invoice
            bills it on.
          items:
            type: object
            properties:
              purchase_order:
                type: object
                properties:
                  id:
                    type: integer
                  label:
                    type: string
              amount:
                type: string
        created_by_id:
          type: integer
          nullable: true
        created_at:
          type: string
          format: date-time
      required:
        - id
        - amount
        - paid_on
  securitySchemes:
    apiKey:
      type: apiKey
      name: authorization
      in: header
    workspaceId:
      type: apiKey
      name: X-Workspace-ID
      in: header

````

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