Skip to main content
Version: v1.0.0(int)

E128: Bulk-import purchase orders

POST /api/purchase-orders/bulk-import

Creates many POs at once from an uploaded CSV or Excel file. Triggered from the Data page, POs import. The whole import succeeds or fails atomically; partial imports are deliberately not supported.

Authentication

Standard tenant route. Requires Authorization: Bearer <firebase-id-token> and X-Org-Id: <org-id>. Access: Admin.

Request

{
"rows": [
{ "vendorRef": "ACME", "targetType": "materials", "shipToRef": "WH-1", "orderDate": "2026-05-18", "items": [ ... ] }
]
}

Rows reference vendors / locations / materials by their org-scoped human refs (codes / names), not uuids. The L3 workflow resolves references row-by-row.

Response — 200 OK

{
"data": [
{ "index": 0, "status": "ok", "id": "uuid", "poNumber": "PO-2026-0042" },
{ "index": 1, "status": "error", "code": "validation_failed", "message": "vendorRef 'XYZ' not found" }
]
}

No partial-failure rollback — each row commits independently per the L4 overview.

Errors

HTTPcodeCondition
422validation_failedTop-level shape is malformed (not an object with rows: []).

Workflow

Calls W128 Bulk-import purchase orders.