Delete Value Allocation

Operation ID: deleteValueAllocation

Group: Value Accounting › Value Allocations

Open in the interactive reference

DELETE /value-accounting/value-allocations/{id}

Retry-safe: A write that accepts Idempotency-Key: repeating a request with the same key replays the stored answer instead of executing twice.

Delete one value allocation with all of its lines. WRITES and is DESTRUCTIVE — rows are hard-deleted, there is no undo and nothing is ever deactivated instead. Returns an empty body on success. GUARDED: an allocation a document still holds — a journal entry line or any other document line or record that stores an allocation id, drafts included — is refused with IN_USE naming the holding node types in referencedBy, and nothing is deleted (re-tag the financial document to change its attribution); so is one owning the split parent of a line under another allocation (IN_USE with splitChildIds). The document check reads under the caller's row-level security: a caller whose access covers only some rows of a node type that can hold an allocation is refused with ROW_ACCESS_RESTRICTED instead, since the check cannot be evaluated for them. CASCADING: the allocation's own lines are deleted with it. An unknown id is rejected with NOT_FOUND and nothing is written. For several allocations in one transaction use bulkDeleteValueAllocations (POST value-accounting/value-allocations/bulk-delete).

Deletes one value allocation together with all of its lines and returns an empty body. DESTRUCTIVE: rows are hard-deleted and there is no undo.

GUARDED: an allocation that a document still holds — a journal entry line, or a document line that has not posted or never posts (purchase order or request line, sales order product, time record, fixed asset, inventory line, a draft vendor bill's line, …; 25 node types store an allocation id) — is refused with IN_USE naming the holding node types in referencedBy, and nothing is deleted. It is that document's live link into value accounting: deleting it would drop a posted line's attribution from every value-accounting report while the ledger keeps the amount, or leave an unposted document to post without it. To change a document's attribution, re-tag the financial document instead. An allocation owning the line another allocation's line was split from is refused the same way, naming the child lines in splitChildIds: the cascade would leave them pointing at nothing. The document check reads under the caller's row-level security, so a caller whose access covers only some rows of a node type that can hold an allocation is refused with ROW_ACCESS_RESTRICTED naming those node types, and nothing is deleted: the check cannot be evaluated for them.

CASCADING: a successful delete removes the allocation's own lines with it, a line split from another line of the same allocation included, so no orphan line is left behind.

Unlike the deletes of value objects and value centers, nothing is ever deactivated instead: an allocation has no lifecycle to retire into, so the answer is deleted or refused, and a refusal is a typed diagnostic rather than an outcome in the body. An unknown id fails with NOT_FOUND. To delete several allocations in one transaction, use bulkDeleteValueAllocations (POST value-accounting/value-allocations/bulk-delete).

Parameters

Name In Type Required Description
Api-Version header string · 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 Id (a UUID) of the value allocation to delete; bound from the :id path segment. Obtain it from the valueAllocations data-set (GET value-accounting/value-allocations) or the search. An id that matches no allocation is rejected with NOT_FOUND rather than treated as an already-completed delete. Ids are matched case-insensitively and returned in canonical lowercase.

Response

200 Success

{
  "data": {},
  "diagnostics": [
    {
      "code": "<code>",
      "message": "<message>",
      "severity": "error",
      "path": [
        "<path>"
      ],
      "details": "<details>"
    }
  ]
}

Response headers

Errors

Code Status
NOT_FOUND 400
IN_USE 400
ROW_ACCESS_RESTRICTED 400
IDEMPOTENCY_KEY_CONFLICT 409
IDEMPOTENCY_PAYLOAD_MISMATCH 422

Statuses