Revalue FIFO Layer
POST/api/cogs-revaluation/:id/revalue
Revalues a single FIFO layer to a new unit cost, creating an InventoryRevaluation record.
inventory:writeGrant this scope to your token under Settings → Developer → Personal Access Tokens.
Authentication: Requires Bearer token.
Fields (CreateInventoryRevaluationData):
- cogs_source (required, CogsSourceEnum): the source for the new cost (e.g., purchase_order)
- new_unit_cost (required, float): the new per-unit cost
- reason (optional, InventoryRevaluationReasonEnum): reason for revaluation
- reason_notes (optional, string): free-text notes
- effective_at (optional, date-only YYYY-MM-DD or ISO 8601 datetime): date the cost change takes effect; drives the point-in-time valuation overlay and the GL revaluation period. Defaults to now(). If it falls inside a locked accounting period it is moved forward to the first open day.
- posted_at (optional, date-only YYYY-MM-DD or ISO 8601 datetime): GL posting timestamp. Defaults to now().
- old_unit_cost (optional, float): explicit prior per-unit cost; defaults to the layer's current average cost.
- old_total_cost (optional, float): explicit prior total cost for the layer.
- new_total_cost (optional, float): explicit new total cost for the layer.
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.