---
title: "List Orders"
method: GET
path: "/v2/ap-portals/orders"
tags: ["ap-portals"]
---

# List Orders

`GET /v2/ap-portals/orders`

## 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/orders`
- Auth: HTTP bearer

List swept purchase orders

Paginated purchase-order rows mirrored from the latest sweeps, newest ``order_date``
first (rows with no date sort last). Headroom (PO running low) is derived client-side
from ``amount_total`` minus ``amount_invoiced_total`` when detail-swept, else ``amount``
minus ``amount_invoiced``.

## Query parameters

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

## Response `200`

Successful Response

- PaginatedResponseAPPortalOrderListItem
  - `data` APPortalOrderListItem[], required: The list of records.
    - `id` string, required
    - `order_number` string, required
    - `state` 'open' | 'on_hold' | 'changed' | 'invoiced' | 'closed' | 'cancelled' | 'not_found' | 'unknown', required: Normalized purchase-order lifecycle from a sweep. Invoice creation is a separate fact (``can_create_invoice``), not answered by these labels: OPEN (active), ON_HOLD (buyer reviewing), CHANGED (superseded — re-fetch the new PO), INVOICED (fully billed), CLOSED / CANCELLED (terminal), NOT_FOUND (referenced but not located in the portal), UNKNOWN (unrecognized provider status). The "PO running low" headroom signal is derived from amounts, not from a status.
    - `order_status` string, nullable, required
    - `confirmation_required` boolean, nullable, required
    - `can_create_invoice` boolean, nullable, required
    - `invoice_creation_blocked_reason` string, nullable, required
    - `invoice_creation_checked_at` string, date-time, nullable, required
    - `can_submit_invoice` boolean, required
    - `customer` string, nullable, required: Portal buyer identifier.
    - `amount` string, nullable, required
    - `currency` string, nullable, required
    - `amount_invoiced` string, nullable, required
    - `amount_total` string, decimal, nullable, required
    - `amount_invoiced_total` string, decimal, nullable, required
    - `order_date` string, date, 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
    - `synced_at` string, date-time, required
    - `display_status` 'open' | 'awaiting_confirmation' | 'on_hold' | 'changed' | 'invoiced' | 'closed' | 'cancelled' | 'not_found' | 'unknown', 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)
