Commit Landed Cost

POST /inventory/landed-costs/{id}/commit

Group: Inventory › Landed Costs · Operation ID: commitLandedCost

Commits the landed cost, capitalizing the charges onto the received stock.

Commits a draft landed cost: the charges are capitalized onto the received stock and the inventory is worth more, in one call.

This is the only workflow verb this resource has. The landed cost is a draft until you commit it and committed afterwards. There is no separate validate endpoint, because the commit runs the platform's dry run first and reports what it would have refused. After this the landed cost can be neither edited nor deleted.

It posts by raising inventory revaluations. The charges are grouped by expense account and costing element type, and one revaluation is raised and committed per group. Their ids come back in revaluationIds and are also visible per allocation line on the read. Two things follow: several charges can produce several revaluations from one commit, and a rejection naming an account is that revaluation's, not the landed cost's, so check the entity's account determination rule.

warnings is non-fatal. The commit succeeded regardless of what is listed there.

Open in the interactive reference

Parameters

Name In Type Required Description
Api-Version header "v1" yes The API version this request targets, named by its public identifier. Required on every request; omitting it, or naming a version this company does not have, is answered with 400. This document describes version v1.
Idempotency-Key header string no An opaque caller-chosen string (1-255 characters) that makes this request safe to retry. Repeating the same key with an identical request body replays the original response instead of re-executing - but only once that original request succeeded; a failed attempt re-executes on retry. Repeating the key with a different body is answered with 422. A key still in flight is answered with 409 - as is a key whose original request was interrupted before it finished, for a few minutes afterwards, until that attempt is presumed dead. A completed response stays replayable for 24 hours. The key is scoped to the caller, not to the action: reusing it for a different action is answered with 409 or 422 rather than treated independently. On read actions this header is ignored. On write actions that cannot offer the guarantee it is answered with 400 IDEMPOTENCY_NOT_SUPPORTED rather than silently ignored.
id path string yes The unique identifier for the landed cost to commit.

Response

200 Success

Under data (commitLandedCostOutput):

Field Type Required Description
id string yes The unique identifier for the landed cost.
documentStatus string yes The status of the landed cost after the commit. It is read back from the document, so a commit that ends in an unexpected status says so.
totalChargeAmount string (decimal) no The total of the charges capitalized, in the landed cost's currency.
revaluationIds array of string yes The inventory revaluations this commit raised, one per expense account and costing element type. They are the documents that moved the value. See id on GET inventory/inventory-revaluations/:id.
warnings array of string yes Non-fatal advisories from the commit. An empty array on a clean run. The commit succeeded regardless of what is listed here.

Response headers

Errors

Code Status
NOT_FOUND 400
WRONG_STATUS 400
VALIDATION_FAILED 400
POSTING_REJECTED 400
IDEMPOTENCY_KEY_CONFLICT 409
IDEMPOTENCY_PAYLOAD_MISMATCH 422

Statuses