Validate Cost Entry Source Line Import
POST/api/cost-entries/:costEntry/source-lines/import/validate
Turns mapped rows of a vendor detail file into source lines and previews them, without writing anything. Each row comes back with its resolved charge type, matched product and per-row errors; lines is the normalised payload to send to Record Cost Entry Source Lines; dry_run reports what recording them would do to allocations (only when no row has errors).
purchase-orders:writeGrant this scope to your token under Settings → Developer → Personal Access Tokens.
Body: rows (required, 1–20,000) — objects keyed by external_reference, description, charge_type (product, fee, unknown, rounding, adjustment, credit, other, or the enum value), charge_group, quantity, unit, rate, amount (required; accepts $, thousands separators and (1.23) negatives), period_start, period_end, basis, basis_note, basis_as_of. A row with a reference and no charge type is a product charge. Optional default_basis, default_basis_note, default_basis_as_of apply to rows without a basis; optional allocation_mode (as for recording) shapes the dry run.
Authentication: Requires Bearer token (scope purchase-orders:write).
Request
Responses
- 200
- 401
- 403
- 404
- 422
- 429
OK
Response Headers
Unauthenticated — the bearer token is missing, revoked, expired, or malformed. Never retry automatically; fix the credential. See the Errors guide.
Forbidden — the token lacks a required scope, the endpoint is not available to API tokens, or the user behind the token lacks the permission. A human must adjust the token scopes or user permissions; do not retry.
Not found — no record with the given identifier (or the route does not exist). Verify the ID before retrying.
Unprocessable Entity
Response Headers
Rate limited — platform limit is 1,000 requests/min; individual tokens may carry lower limits. Honor the Retry-After header before retrying. See the Rate Limits guide.