Materialize Driver Values
Operation ID: materializeDriverValues
Group: Value Accounting › Business Drivers › Driver Values
Open in the interactive reference
POST /value-accounting/driver-values/materialize
Retry-safe: A write that accepts Idempotency-Key: repeating a request with the same key replays the stored answer instead of executing twice.
Fill in an As-of driver's system-carried rows for a span of accounting periods, so each holds the value in force; returns how many rows were created. WRITES derived rows only — no recorded value, no audit history. Every write already carries an As-of value forward to today, so call this only before reading periods no write has reached yet with searchDriverValues (POST value-accounting/driver-values/search). It fills gaps only: it never overwrites a row, never invents a period before a combination's first value, and never fills the periods of an ended stretch. IDEMPOTENT: a second identical call creates 0. Concurrent writers are tolerated — a period another call or write stored first is kept and not counted, so overlapping calls may each report fewer rows than the span needed, and the call re-reads the stored rows once to carry the value now in force into the later periods; only a second collision within one call leaves that combination's later periods for a repeat call. A cumulative driver, or one with no values in this entity and book, gets 0 — not an error.
Fills in an As-of driver's system-carried rows for a span of accounting periods, so each period holds the value in force there, and returns how many rows it created.
WHEN: every write already carries an As-of value forward to today, so a read of past and current periods normally needs nothing (only a write that collided twice with concurrent writers can leave a combination's later periods empty; this call fills them). Call this before reading periods no write has reached yet — a later period once time has moved on — with searchDriverValues (POST value-accounting/driver-values/search).
It writes DERIVED rows only — no recorded value, no audit history — and only fills GAPS: it never overwrites a row, never invents a period before a combination's first value, and never fills the periods of an ended stretch. It is IDEMPOTENT: a second identical call creates 0. Concurrent writers are tolerated: a period another call or write stored first is kept and not counted — so overlapping calls may each report fewer rows than the span needed — and the call then re-reads the stored rows once and carries the value now in force into the later periods. Only a second such collision within one call leaves that combination's later periods empty; a repeat call fills them. A cumulative driver's values do not carry, so it gets 0, and so does a driver with no values in this entity and book. A system driver is not refused: the rows are derived, not statements.
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. |
Request body
Required, application/json: materializeDriverValuesInput.
| Field | Type | Required | Description |
|---|---|---|---|
driverId |
string | yes | Id (a UUID) of the business driver whose carried rows to fill in. Matched case-insensitively. Example: "0f1e4b9a-6a71-4a2c-8a0d-2f9c5d3b7e10". |
entityId |
string | yes | Id (a UUID) of the legal entity of the recording context. Matched case-insensitively. Example: "6d2c8f31-b4a7-4e19-9f2b-77c0a1d4e5b2". |
bookId |
string | yes | Id (a UUID) of the accounting book of the recording context. Matched case-insensitively. Example: "c3a91e07-52d4-4f6b-8e1a-9b0d2c7f4a63". |
accountingPeriodIds |
array<string> | yes | Ids (UUIDs) of the accounting periods to fill — the latest of them bounds the span, and the gap periods before it are filled too. Locked periods are filled as well: the rows are derived data. An empty array creates nothing. Matched case-insensitively. Example: ["7d446073-dfc2-4258-947c-a34aa0ea4c2b"]. |
{
"driverId": "0f1e4b9a-6a71-4a2c-8a0d-2f9c5d3b7e10",
"entityId": "6d2c8f31-b4a7-4e19-9f2b-77c0a1d4e5b2",
"bookId": "c3a91e07-52d4-4f6b-8e1a-9b0d2c7f4a63",
"accountingPeriodIds": [
"7d446073-dfc2-4258-947c-a34aa0ea4c2b"
]
}
Response
200 Success
Under data (materializeDriverValuesOutput):
| Field | Type | Required | Description |
|---|---|---|---|
createdCount |
number | yes | How many carried rows THIS call created; a row a concurrent writer stored first is not counted. 0 means everything already existed (or a concurrent writer filled it), the driver is cumulative, or the periods lie outside every combination's live stretch — none of which is an error. After overlapping calls, repeat the call to be sure the span is complete: it creates 0 when nothing is missing. |
{
"data": {
"createdCount": 0
},
"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 |
|---|---|
DRIVER_NOT_FOUND |
400 |
ENTITY_NOT_FOUND |
400 |
BOOK_NOT_FOUND |
400 |
PERIOD_NOT_FOUND |
400 |
PERIOD_CALENDAR_MISMATCH |
400 |
IDEMPOTENCY_KEY_CONFLICT |
409 |
IDEMPOTENCY_PAYLOAD_MISMATCH |
422 |
Statuses
400— Invalid request or business failure. Codes: DRIVER_NOT_FOUND, ENTITY_NOT_FOUND, BOOK_NOT_FOUND, PERIOD_NOT_FOUND, PERIOD_CALENDAR_MISMATCH401— 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