Skip to main content

Validate Cost Entry Allocation Import

POST 

/api/cost-entries/:costEntry/allocations/import/validate

Validates mapped import rows against the cost entry and returns a per-row preview — no changes are made. Each row resolves its target (SKU / name, case-insensitive) and reports errors (row is skipped on import) and warnings (e.g. the entry already has an allocation to that target on that date). A blank allocation date defaults to the cost entry's cost date.

Required scope: purchase-orders:write

Grant this scope to your token under Settings → Developer → Personal Access Tokens.

summary.exceeds_available is true — and errors explains it — when the valid rows add up to more than summary.available_amount (the entry amount minus existing allocations minus a pending amortization schedule's reserved periods). Such a file cannot be imported.

Body: rows (required, 1–5000) — each with allocation_type, allocation_target, allocation_amount, and optional allocation_date, allocation_period_start, allocation_period_end.

Authentication: Requires Bearer token (scope purchase-orders:write).

Request​

Responses​

OK

Response Headers
    Content-Type