Supersede what was said about this line, correcting or reversing what it booked
const url = 'https://example.com/v1/entities/example/lines/example/reexplain';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"kind":"example","reason":"example","legs":[{"account":"example","commodity":"example","amount":"-12.00","memo":"example","tax_code":"example"}],"parts":[{"posting_id":"example","amount":"-12.00"}],"narration":"example","dt":"example","memo":"example","tax_code":"example","code":"","comment":"","id":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/v1/entities/example/lines/example/reexplain \ --header 'Content-Type: application/json' \ --data '{ "kind": "example", "reason": "example", "legs": [ { "account": "example", "commodity": "example", "amount": "-12.00", "memo": "example", "tax_code": "example" } ], "parts": [ { "posting_id": "example", "amount": "-12.00" } ], "narration": "example", "dt": "example", "memo": "example", "tax_code": "example", "code": "", "comment": "", "id": "example" }'Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The entity this path is relative to
The entity this path is relative to
Request Bodyrequired
Section titled “Request Bodyrequired”Supersede what was said about this line before.
The previous explanation is kept and the new one names it. If the previous one booked an entry, the books
are put right through the ordinary correction path in the same transaction: kind: booked with new legs
corrects it, and kind: linked/ignored reverses it. A closed period refuses.
object
Booked | linked | ignored
Why the previous reading was wrong; recorded verbatim
One contra leg of a booking: what the line was for.
The cash leg is not supplied and cannot be: it is the statement line itself, on the line’s own account for the line’s own amount. These legs are the other side, and must sum to the negative of the line.
object
Account path (preferred) or stable account id
Signed decimal amount in whole commodity units, as a string; never a JSON number. Converted by the commodity’s declared precision, so more decimal places than the currency has is refused rather than rounded.
One part of a split: an existing posting, and how much of the line it is.
A posting is named by id: it has no path, and naming its account would not say which leg. The amount is in the line’s own commodity, the only commodity a part can be in.
object
Signed decimal amount in whole commodity units, as a string; never a JSON number. Converted by the commodity’s declared precision, so more decimal places than the currency has is refused rather than rounded.
Responses
Section titled “Responses”Successful Response
object
What has become of one statement line.
status is derived from the live explanation, never stored, so there is exactly one answer.
unexplained_micros is the remainder, reported in every state including a fully explained line, where it
is "0". history is every explanation ever written for this line, oldest first.
object
Signed integer micro-units (millionths) as a base-10 string; never a JSON number.
Unexplained | partly_explained | booked | linked | ignored | superseded_input
Signed integer micro-units (millionths) as a base-10 string; never a JSON number.
Signed integer micro-units (millionths) as a base-10 string; never a JSON number.
One thing somebody said about a line. The chain of these is the line’s history.
object
Booked | linked | ignored
object
Signed integer micro-units (millionths) as a base-10 string; never a JSON number.
Signed integer micro-units (millionths) as a base-10 string; never a JSON number.
One thing somebody said about a line. The chain of these is the line’s history.
object
Booked | linked | ignored
object
Signed integer micro-units (millionths) as a base-10 string; never a JSON number.
Signed integer micro-units (millionths) as a base-10 string; never a JSON number.
The entries this line is booked or linked to, oldest first
An entry a statement line is explained by, with the mirror that already reverses it, if any.
object
object
Signed integer micro-units (millionths) as a base-10 string; never a JSON number.
object
object
Example
{ "line": { "amount_micros": "-12000000", "allocated_micros": "-12000000", "unexplained_micros": "-12000000", "explanation": { "allocations": [ { "amount_micros": "-12000000" } ], "allocated_micros": "-12000000" }, "history": [ { "allocations": [ { "amount_micros": "-12000000" } ], "allocated_micros": "-12000000" } ], "entries": [ { "postings": [ { "amount_micros": "-12000000" } ] } ] }}Bad Request
object
Example generated
{ "error": { "code": "example", "message": "example", "retryable": true, "details": [ {} ], "request_id": "example", "next_action": {} }}Unauthorized
object
Example generated
{ "error": { "code": "example", "message": "example", "retryable": true, "details": [ {} ], "request_id": "example", "next_action": {} }}Forbidden
object
Example generated
{ "error": { "code": "example", "message": "example", "retryable": true, "details": [ {} ], "request_id": "example", "next_action": {} }}Not Found
object
Example generated
{ "error": { "code": "example", "message": "example", "retryable": true, "details": [ {} ], "request_id": "example", "next_action": {} }}Conflict
object
Example generated
{ "error": { "code": "example", "message": "example", "retryable": true, "details": [ {} ], "request_id": "example", "next_action": {} }}Precondition Failed
object
Example generated
{ "error": { "code": "example", "message": "example", "retryable": true, "details": [ {} ], "request_id": "example", "next_action": {} }}Unprocessable Content
object
Example generated
{ "error": { "code": "example", "message": "example", "retryable": true, "details": [ {} ], "request_id": "example", "next_action": {} }}Internal Server Error
object
Example generated
{ "error": { "code": "example", "message": "example", "retryable": true, "details": [ {} ], "request_id": "example", "next_action": {} }}Service Unavailable
object
Example generated
{ "error": { "code": "example", "message": "example", "retryable": true, "details": [ {} ], "request_id": "example", "next_action": {} }}