---
title: "List Invoices"
method: GET
path: "/v2/ap-portals/invoices"
tags: ["ap-portals"]
---

# List Invoices

`GET /v2/ap-portals/invoices`

## Request

- Base URL: `https://api.stuut.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.stuut.ai/v2/ap-portals/invoices`
- Auth: HTTP bearer

List swept invoices

Paginated invoice rows mirrored from the latest sweeps, newest ``invoice_date`` first
(rows with no date sort last). Each row's ``invoice_id`` is the matched internal AR
invoice (the Pass-1 matcher), or null when unmatched.

## Query parameters

- `page` integer: Page number, 0 indexed.
- `limit` integer: Number of records per page.
- `ap_portal_account_id` string, nullable: Restrict to invoices swept from one login.
- `search` string, nullable: Case-insensitive substring match on portal invoice number, PO reference, buyer/customer name, or portal document (payload) id.

## Response `200`

Successful Response

- PaginatedResponseAPPortalInvoiceListItem
  - `data` APPortalInvoiceListItem[], required: The list of records.
    - `id` string, required
    - `invoice_number` string, nullable, required
    - `canonical_status` 'not_submitted' | 'submitting' | 'submitted' | 'approved' | 'scheduled' | 'paid' | 'rejected' | 'disputed' | 'on_hold' | 'cancelled' | 'unknown', required: Canonical, MECE invoice status normalized across portals — the dashboard's at-a-glance state. Derived from the raw portal status (preferred) with the coarse ``SubmissionState`` as fallback (see stuut.core.ap_portal.normalize). Portal facts only: submit pre-flight results live on the separate ``submit_gate`` axis.
    - `state` 'submitted' | 'approved' | 'rejected' | 'pending', required: Coarse, normalized invoice lifecycle from a sweep/submit.
    - `invoice_status` string, nullable, required
    - `routing_status` string, nullable, required
    - `customer` string, nullable, required: Portal buyer identifier.
    - `reference` string, nullable, required
    - `amount` string, nullable, required
    - `currency` string, nullable, required
    - `invoice_date` string, date, nullable, required
    - `po_reference` string, nullable, required
    - `reject_reason` 'po_mismatch' | 'missing_required_field' | 'invalid_tax' | 'duplicate_invoice' | 'unknown_customer' | 'invalid_date' | 'transmission_failed' | 'not_stated' | 'other' | 'po_line_mismatch' | 'receipt_pending' | 'disallowed_charge' | 'invoice_data_error' | 'prerequisite_document' | 'wrong_channel' | 'po_closed', required: Closed reject taxonomy — remediation routes by code, not string-match. Buckets group rejections by what fixes them: missing fields/attachments into ``MISSING_REQUIRED_FIELD``; tax errors and missing tax docs into ``INVALID_TAX``.
    - `reject_reason_text` string, nullable, required
    - `submit_gate` 'ok' | 'needs_review' | 'blocked', required: Submit pre-flight gate for one invoice — can we submit it right now? Computed from the field-mapping + PO/order checks (see ``stuut.core.ap_portal.preview``) and persisted so the dashboard can flag "needs a fix before submit" without re-running a preview. A separate axis from ``APPortalInvoiceStatus`` (what the portal reports about the invoice).
    - `submit_gate_reason` string, nullable, required
    - `payload_id` string, nullable, required
    - `provider` 'kehe' | 'taulia' | 'coupa' | 'ariba' | 'meijer' | 'kroger' | 'walgreens' | 'albertsons' | 'target' | 'heb' | 'heb_sidm' | 'c_and_s' | 'walmart' | 'walmart_highradius' | 'cvs' | 'cvs_sap' | 'cvs_image_silo' | 'kroger_supplier_connect' | 'kroger_claimtrax' | 'kroger_verigon' | 'servicetitan' | 'sandbox' | 'generic', required: Supported AP Portal providers.
    - `ap_portal_account_id` string, required
    - `invoice_id` string, nullable, required
    - `synced_at` string, date-time, required
  - `current_page` integer, required: The current page.
  - `total_records` integer, nullable, required: Total number of records.
  - `next_page` integer, nullable, required: The next page number, if one exists.

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/stuut/apis/stuut-api.md) - [All operations](https://skmtc.dev/stuut/apis/stuut-api/llms.txt) - [OpenAPI document](https://skmtc.dev/stuut/apis/stuut-api/revisions/ff0ad16a55ff?raw)
