Purchase Orders

🧪 [Preview] Query purchase orders. Returns full purchase order models with explicit control over filters, sorting, pagination and field selection.

🧪 Preview — early access! This endpoint is fully functional, but its shape may still change while we finalize it.

Primary endpoint for fetching purchase orders: single lookups, filtered lists, and paginated UI queries. Pagination is capped at offset (Take * Page) of 10,000 — past that, use POST /api/PurchaseOrders/Query/Scroll.

All filter fields are documented on the request schema below.

Default values are omitted

To keep responses small, a field is left out when it holds its default value: false, 0, null, the empty date 0001-01-01T00:00:00, the empty id 00000000-0000-0000-0000-000000000000, or an enum's first value. A missing field means that value, not "unknown". "" and [] are real values and are always returned.

A field marked nullable in the schema has null as its default, so it is left out only when it is null — a nullable boolean holding false, or a nullable number holding 0, is still returned.

Examples

1. Specific purchase orders by ID.

{
  "purchaseOrderIds": ["PO-123", "PO-456"]
}

2. Filtered list with a tight payload (recommended). Order lines are usually the bulk of the document — exclude them when you only need header data.

{
  "take": 50,
  "page": 1,
  "statuses": ["Sent"],
  "storeIds": ["store-1"],
  "sort": [{ "field": "created", "direction": "desc" }],
  "fields": { "exclude": ["purchaseOrderForm.lineItems"] }
}

3. Only the fields you need. The document id is always returned.

{
  "supplierId": "SUPPLIER-1",
  "fields": { "include": ["purchaseOrderNumber", "status", "total"] }
}
post/api/PurchaseOrders/Query

Request

  • Base URL: https://api.omnium.no (the document declares no server; this is the origin it was published from)
  • URL: https://api.omnium.no/api/PurchaseOrders/Query
  • Auth: API key in header Authorization

Request body

takeinteger nullable

Number of items per page. Default applied when null: 10. Allowed range: 1–1000.

pageinteger nullable

Page number (1-indexed). Default applied when null: 1. Max offset (Take * Page) is 10,000. For larger datasets — bulk exports, system syncs — use the scroll endpoint instead.

searchTextstring nullable

Free-text search across purchase order fields (order number, supplier, reference number, etc.). Also matches the purchase order document ID exactly. Max 300 characters.

purchaseOrderIdsstring[] nullable

Filter by purchase order document IDs (exact match).

orderNumberstring nullable

Filter by purchase order number.

statusesstring[] nullable

Filter by purchase order statuses.

storeIdsstring[] nullable

Filter by store IDs.

supplierIdstring nullable

Filter by supplier ID.

supplierWarehouseCodestring nullable

Filter by supplier warehouse code (warehouse used for sending internal transfers).

emailstring nullable

Filter by supplier email address.

orderTypestring nullable

Filter by purchase order type (InternalTransfer or PurchaseOrder).

skuIdsstring[] nullable

Filter by SKU IDs on the order lines. Returns purchase orders containing at least one order line with a matching SKU.

externalIdsstring[] nullable

Filter by external IDs.

tagsstring[] nullable

Filter by tags. Returns purchase orders carrying at least one of the tags.

excludedTagsstring[] nullable

Exclude purchase orders carrying any of these tags.

deliveryIdsstring[] nullable

Filter by delivery IDs assigned to the order lines.

projectIdstring nullable

Filter by project ID.

errorKeysstring[] nullable

Filter by entity error keys. Returns purchase orders that have at least one error with a matching key.

hasDeliveryboolean nullable

Filter by whether the purchase order has at least one order line with a delivery assigned. True returns only purchase orders with a delivery on one or more lines; false returns only purchase orders with no deliveries on any line; null (default) returns both.

createdFromstring date-time nullable

Minimum creation date.

createdTostring date-time nullable

Maximum creation date.

modifiedFromstring date-time nullable

Minimum modified date. Use with Omnium.Public.PurchaseOrders.Query.OmniumPurchaseOrderQueryRequestBase.ModifiedTo for delta queries.

modifiedTostring date-time nullable

Maximum modified date.

requestedDeliveryDateFromstring date-time nullable

Minimum requested delivery date.

requestedDeliveryDateTostring date-time nullable

Maximum requested delivery date.

Response

Query successful

totalHitsinteger

Total number of items matching the query (not just this page)

Changes

No recorded changes to this operation across all 1 revision of this API.