Delete Value Center
Operation ID: deleteValueCenter
Group: Value Accounting › Value Centers
Open in the interactive reference
DELETE /value-accounting/value-centers/{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 center with its mappings, SKIP it when it has live children, or DEACTIVATE it when it is still in use — and report which happened. WRITES. A value center with a direct child reading 'active' or 'planned' is left untouched (outcome 'skipped'): move, end or delete the children first. One in use — allocation lines are tagged to it, business drivers reference it, it is related to other master data, or another value center's mapping names it as its record — is kept and end-dated to today (or to its own startDate, when that is later) with every mapping still open (a mapping that would only start after that day is deleted) ('deactivated'), and the other value centers' mappings naming it that are still open end on the same day; one that already ended keeps its own end date and is reported 'deactivated' again, and its mappings still open end on that same day, so reactivating re-opens them with it. Any other is hard-deleted with its mappings and its place in the tree — DESTRUCTIVE, no undo — and its remaining children move up to its parent ('deleted'). All three are a success with HTTP 200: read outcome and reason. Re-open a deactivated value center with reactivateValueCenters (POST value-accounting/value-centers/reactivate). It cannot be re-opened while another value center holds an open one-to-one link to the record it stood for (ONE_TO_ONE_EXISTS): end that link first. An unknown id is rejected with NOT_FOUND and nothing is written. For several value centers in one call use bulkDeleteValueCenters (POST value-accounting/value-centers/bulk-delete).
Deletes one value center with its mappings — or leaves it in place when it has live children, or DEACTIVATES it when it is still in use — and reports which of the three happened.
A value center with a direct child that reads 'active' or 'planned' is SKIPPED: nothing is written, because deleting or retiring it would strand a live part of the tree. Deal with the children first — move them with updateValueCenter (PATCH value-accounting/value-centers/:id) (parentId), end them, or delete them — then delete again. A child ended today still reads 'active' and still blocks.
Otherwise a value center that IS in use is kept: it and every one of its mappings still open are end-dated to today (or to its own startDate, when that is later), which retires it once that day has passed — a mapping that would only start after that day is deleted instead and listed in deletedMappingIds — while every posting made against it keeps resolving; it stays in the tree. A value center that already ended keeps its own end date and is reported deactivated again; its mappings still open end on that same day, so reactivating re-opens them with it. In use means any of: allocation lines are tagged to it, it is referenced by business drivers, or it is related to other master data through the associations resource.
Otherwise it is hard-deleted with its mappings and its place in the tree; there is no undo. Its children — only ended ones can be left by then — move up to its own parent (to the root when it had none); they are never deleted with it.
All three outcomes are a success (HTTP 200); read outcome, and reason for why a value center was kept. A deactivated value center can be re-opened with reactivateValueCenters (POST value-accounting/value-centers/reactivate). It cannot be re-opened while another value center holds an open one-to-one link to the record it stood for (ONE_TO_ONE_EXISTS): end that link first. An unknown id fails with NOT_FOUND and nothing is written.
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 center to delete; bound from the :id path segment. An id that matches no value center 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
Under data (deleteValueCenterOutput):
| Field | Type | Required | Description |
|---|---|---|---|
outcome |
string | yes | What happened: 'deleted' — it was not in use and had no live child, so it is gone with its mappings and its id no longer resolves; any ended children moved up to its parent. 'deactivated' — it is in use, so it and every mapping still open were end-dated to today, or to its own startDate when that is later (a mapping that had already ended keeps its date, so reactivating re-opens exactly these; one that would only start after that day was deleted — deletedMappingIds) and its id still resolves (the end date is inclusive, so it reads status 'active' for the rest of that day and 'inactive' from the next); one that already ended keeps its own end date and is reported 'deactivated' again, and its mappings still open end on that same day, so reactivating re-opens them with it. 'skipped' — it has a direct child reading 'active' or 'planned', so nothing was written. One of: "deleted", "deactivated", "skipped". |
reason |
string | no | Why the value center was kept, as a sentence. For 'skipped', how many active or planned children blocked it. For 'deactivated' the first that applies: allocation lines are tagged to it ('used in financial transactions'), business drivers reference it, it is part of master-data relationships (clear them with removeRelationship (POST value-accounting/associations/remove), then delete again; the sentence names the application-API action for the same removal), or other value centers' mappings name it as their record (remove those mappings with updateValueCenter (PATCH value-accounting/value-centers/:id) deleteMappings on their value centers, then delete again). Absent for 'deleted'. |
deletedMappingIds |
array<string> | no | Present only on 'deactivated' when the deactivation DELETED mappings: ids (UUIDs) of the mappings — the value center's own and other value centers' mappings naming it as their record — that would only have started after the day it ends on (today, its own start when it has not started yet, or the end it already had). Such a mapping is never in effect inside the value center's life, so it is deleted rather than ended before its own start; none is left canceled. These ids no longer resolve. The reason sentence only counts them (it names no id); this field is the contract. |
{
"data": {
"outcome": "deleted",
"reason": "<reason>",
"deletedMappingIds": [
"<deletedMappingIds>"
]
},
"diagnostics": [
{
"code": "<code>",
"message": "<message>",
"severity": "error",
"path": [
"<path>"
],
"details": "<details>"
}
]
}
Response headers
Idempotency-Replayed— Present andtrueonly when this response replays a previously stored one for the same Idempotency-Key, rather than reflecting a live execution. Absent on a live response - never sent asfalse.
Errors
| Code | Status |
|---|---|
NOT_FOUND |
400 |
IDEMPOTENCY_KEY_CONFLICT |
409 |
IDEMPOTENCY_PAYLOAD_MISMATCH |
422 |
Statuses
400— Invalid request or business failure. Codes: NOT_FOUND401— The request carries no valid access token.403— Not authorized404— Not found409— The Idempotency-Key is still being processed by another request.422— The Idempotency-Key was already used with a different request payload.429— Too many requests from this client address. The response has no body and noRetry-Afterheader.500— Internal server error