Browse the extensions reference

Update Journal Entry

post/extensions/roboledger/{graph_id}/operations/update-journal-entry

Part of RoboLedger: Ledger & Events.

Update a draft journal entry, or re-tag any entry's flows or management dimensions. If line_items is provided, existing line items are replaced atomically, the new set must balance, and a line on a retired (is_active=false) account is refused. line_flows sets the cash flow row of the named lines in place, on a posted entry too, closed month included, since a flow moves no balance; the lines on the other side of the entry that were in step with it follow. line_dimensions sets the department, class, location or project members the named lines carry, in place, on a posted entry and a closed month too, since a dimension moves no balance either. Posted entries accept nothing else and are corrected via create-event-block(event_type='journal_entry_reversed').

Idempotency: supply an Idempotency-Key header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.

Authentication

Authenticate in any one of these ways — not all of them:

  • API key in the X-API-Key header.
  • Bearer token in the Authorization header.

Path parameters

NameTypeDescription
graph_idrequiredstringGraph Id

Constraints: matches ^(kg[a-f0-9]{16,}(?:_[a-zA-Z0-9]{1,20})?|sec(?:_[a-zA-Z0-9]{1,20})?|library)$

Header parameters

NameTypeDescription
Idempotency-KeyoptionalstringIdempotency-Key

Request body

Required, application/json.

FieldTypeDescription
entry_idrequiredstring

The draft entry to update.

posting_dateoptionalstring (date)

New posting date.

memooptionalstring

New entry-level memo.

typeoptionalstring

New entry type. closing should normally only be set by close-period.

One of: standard, adjusting, closing, reversing

line_itemsoptionalJournalEntryLineItemInput[]

Replacement line items. Whole-list replacement (not patch). The new set must still balance (total_debit == total_credit). Omit to leave existing lines untouched.

JournalEntryLineItemInput fields
FieldTypeDescription
element_idrequiredstring

Element ULID identifying the account to post to.

debit_amountoptionalinteger

Debit amount in cents. Must be 0 if credit_amount > 0.

Default: 0

credit_amountoptionalinteger

Credit amount in cents. Must be 0 if debit_amount > 0.

Default: 0

descriptionoptionalstring

Per-line memo (overrides the entry-level memo on this line).

flow_qnameoptionalstring

The cash flow row this line's cash belongs to, an rs-gaap flow qname (flowCandidates(entityId) lists the rows this company's statement offers). Only for a loan drawn or repaid, capital put in or taken out, an asset bought or sold; omitted, the account's default flow applies. A flow set on one side of the entry tags the untagged lines on the other: the cash flow statement reads the cash line and the roll-forwards read the account line. On the group's consolidation entity, which moves no cash, every tagged line counts on its own, cash-effect signed (a credit is an inflow), so an elimination offsets the flow a member's line produced, and a tag does not spread to the other side. Refused when it is not a row of the entity's cash flow statement.

dimension_idsoptionalstring[]

The management dimension members this line carries (department, class, location, project), by id from dimensions; at most one per axis. An untagged line is read as the axis's Unallocated.

metadataoptionalobject

Optional per-line metadata stamped on LineItem.metadata_. Used to carry source-system fields the standard columns don't cover — e.g. an external flow-tag code that drives rollforward attribution (transaction_description_code), an external memo, or a cost-center hint. Pass-through is non-validating; the renderer / filter engine reads keys it knows about and ignores the rest. None is normalized to {} at persist time.

line_flowsoptionalJournalEntryLineFlow[]

Re-tag lines in place: each named line takes its flow_qname (null clears it), and when every line on that side of the entry then carries one flow, the lines on the other side not named here follow when they were in step with it — untagged, or carrying the flow the named lines carried before — so the cash line and the account line agree; a line tagged differently on purpose keeps its tag. Allowed on a posted entry, closed month included, and the only change one accepts; recorded on the entry as flow_retags, with what each changed line carried before. Not combinable with line_items, which replaces the lines (set flow_qname on them).

Constraints: at least 1 item

JournalEntryLineFlow fields
FieldTypeDescription
line_idrequiredstring

The line to re-tag, by id.

flow_qnameoptionalstring

The rs-gaap flow qname the line takes; null clears it, back to the account's default flow.

line_dimensionsoptionalJournalEntryLineDimensions[]

Re-tag lines' management dimensions in place: each named line carries exactly the members given (empty clears them). A dimension moves no balance, so this is allowed on a posted entry, closed month included; recorded on the entry as dimension_retags, with what each line carried before. Not combinable with line_items (set dimension_ids on the new lines).

Constraints: at least 1 item

JournalEntryLineDimensions fields
FieldTypeDescription
line_idrequiredstring

The line to re-tag, by id.

dimension_idsrequiredstring[]

The members the line carries from now on, replacing what it carried; empty clears them. At most one per axis.

Example request

curl · example 1 of 2
curl -X POST "https://api.robosystems.ai/extensions/roboledger/{graph_id}/operations/update-journal-entry" \
  -H "X-API-Key: $ROBOSYSTEMS_API_KEY" \
  -H "Idempotency-Key: <Idempotency-Key>" \
  -H "Content-Type: application/json" \
  -d '{
  "entry_id": "ent_01HVF8T0M2YTAY3BBNRH0V0",
  "memo": "Corrected vendor reference"
}'
curl · example 2 of 2
curl -X POST "https://api.robosystems.ai/extensions/roboledger/{graph_id}/operations/update-journal-entry" \
  -H "X-API-Key: $ROBOSYSTEMS_API_KEY" \
  -H "Idempotency-Key: <Idempotency-Key>" \
  -H "Content-Type: application/json" \
  -d '{
  "entry_id": "ent_01HVF8T0M2YTAY3BBNRH0V0",
  "line_items": [
    {
      "debit_amount": 12500,
      "element_id": "elem_coa_office_supplies"
    },
    {
      "credit_amount": 12500,
      "element_id": "elem_coa_accounts_payable"
    }
  ]
}'

Responses

200 Successful Response

FieldTypeDescription
operationrequiredstring

Kebab-case operation name

operationIdrequiredstring

op_-prefixed ULID for audit and SSE correlation

statusrequiredstring

Operation lifecycle state

One of: completed, pending, failed

resultoptionalJournalEntryResponse

Command-specific result payload

JournalEntryResponse fields
FieldTypeDescription
idrequiredstring
transaction_idoptionalstring
typerequiredstring
statusrequiredstring
posting_daterequiredstring (date)
memooptionalstring
provenanceoptionalstring
reversal_ofoptionalstring
posted_atoptionalstring (date-time)
line_itemsrequiredJournalEntryLineItemResponse[]

One line in a journal entry response.

JournalEntryLineItemResponse fields
FieldTypeDescription
idrequiredstring
element_idrequiredstring
debit_amountrequiredinteger
credit_amountrequiredinteger
descriptionoptionalstring
line_orderrequiredinteger
flow_qnameoptionalstring

The cash flow row this line carries, when tagged; null means the account's default flow.

dimension_idsoptionalstring[]

The management dimension members the line carries, by id.

total_debitrequiredinteger
total_creditrequiredinteger
adjustment_kindoptionalstring
adjusts_entity_idoptionalstring
atrequiredstring

ISO-8601 UTC timestamp

createdByoptionalstring

User ID that initiated the operation

idempotentReplayoptionalboolean

True when this envelope came from the idempotency cache — the underlying command did not execute again. False on fresh executions.

Default: false

StatusMeaning
400Invalid request
401Authentication required
403Access denied
404Resource not found
409Idempotency-Key conflict — key reused with different body
422Validation error
429Rate limit exceeded
500Internal server error