API reference

Dimension values

The values a dimension takes, such as Engineering under Department.

Guides: Read your chart of accounts

List a dimension's values

GET/v1/dimensions/{dimension_id}/values

client.dimensionValues.list()

A dimension's values, by code.

Parameters

NameTypeDescription
dimension_idPath · Requiredstring

An id that starts with dim_.

limitQueryinteger

Page size, 1–200.

Default 50
cursorQuerystring or null

The next_cursor of the previous page.

Response

200DimensionValuePage

Errors

400
The request was malformed or a parameter is invalid.
401
No valid credential was sent.
403
The credential or the member's role does not allow this.
404
No such resource in this ledger.
409
A conflicting request, e.g. one with the same Idempotency-Key still running.
422
A well-formed request a business rule refused.
429
Too many requests; retry after the Retry-After header.
500
Something failed on our side; the request_id identifies it.

Example

curl
curl "https://api.ledgerit.ai/v1/dimensions/{dimension_id}/values" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN"

Add a value to a dimension

POST/v1/dimensions/{dimension_id}/values· Idempotent

client.dimensionValues.create()

Add a value to a dimension.

Refused with dimension_conflict when the dimension already has one with the same code, and dimension_invalid when the parent is not of it.

Parameters

NameTypeDescription
dimension_idPath · Requiredstring

An id that starts with dim_.

Request body

NewDimensionValue

Response

201DimensionValueOut

Errors

400
The request was malformed or a parameter is invalid.
401
No valid credential was sent.
403
The credential or the member's role does not allow this.
404
No such resource in this ledger.
409
A conflicting request, e.g. one with the same Idempotency-Key still running.
422
A well-formed request a business rule refused.
429
Too many requests; retry after the Retry-After header.
500
Something failed on our side; the request_id identifies it.

Example

curl
curl -X POST "https://api.ledgerit.ai/v1/dimensions/{dimension_id}/values" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"code":"…","name":"…"}'

Get a dimension value

GET/v1/dimensions/{dimension_id}/values/{value_id}

client.dimensionValues.get()

One value of a dimension.

Parameters

NameTypeDescription
dimension_idPath · Requiredstring

An id that starts with dim_.

value_idPath · Requiredstring

An id that starts with dimv_.

Response

200DimensionValueOut

Errors

400
The request was malformed or a parameter is invalid.
401
No valid credential was sent.
403
The credential or the member's role does not allow this.
404
No such resource in this ledger.
409
A conflicting request, e.g. one with the same Idempotency-Key still running.
422
A well-formed request a business rule refused.
429
Too many requests; retry after the Retry-After header.
500
Something failed on our side; the request_id identifies it.

Example

curl
curl "https://api.ledgerit.ai/v1/dimensions/{dimension_id}/values/{value_id}" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN"

Rename a dimension value or move it under another

PATCH/v1/dimensions/{dimension_id}/values/{value_id}· Idempotent

client.dimensionValues.update()

Rename a value or move it under another. Its code never changes.

Refused with dimension_invalid when the new parent is not of the same dimension, or is the value itself or one under it.

Parameters

NameTypeDescription
dimension_idPath · Requiredstring

An id that starts with dim_.

value_idPath · Requiredstring

An id that starts with dimv_.

Request body

DimensionValueChanges

Response

200DimensionValueOut

Errors

400
The request was malformed or a parameter is invalid.
401
No valid credential was sent.
403
The credential or the member's role does not allow this.
404
No such resource in this ledger.
409
A conflicting request, e.g. one with the same Idempotency-Key still running.
422
A well-formed request a business rule refused.
429
Too many requests; retry after the Retry-After header.
500
Something failed on our side; the request_id identifies it.

Example

curl
curl -X PATCH "https://api.ledgerit.ai/v1/dimensions/{dimension_id}/values/{value_id}" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'

Delete a dimension value no posted line carries

DELETE/v1/dimensions/{dimension_id}/values/{value_id}

client.dimensionValues.delete()

Remove a value. Values under it move to the top.

Refused with dimension_in_use once a posted line carries it.

Parameters

NameTypeDescription
dimension_idPath · Requiredstring

An id that starts with dim_.

value_idPath · Requiredstring

An id that starts with dimv_.

Response

204No content

Errors

400
The request was malformed or a parameter is invalid.
401
No valid credential was sent.
403
The credential or the member's role does not allow this.
404
No such resource in this ledger.
409
A conflicting request, e.g. one with the same Idempotency-Key still running.
422
A well-formed request a business rule refused.
429
Too many requests; retry after the Retry-After header.
500
Something failed on our side; the request_id identifies it.

Example

curl
curl -X DELETE "https://api.ledgerit.ai/v1/dimensions/{dimension_id}/values/{value_id}" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN"

Objects

The objects these operations take and return.

DimensionValuePage

NameTypeDescription
dataRequiredarray of DimensionValueOut
has_moreRequiredboolean
next_cursorRequiredstring or null

NewDimensionValue

NameTypeDescription
codeRequiredstring
nameRequiredstring
parent_idstring or null

An id that starts with dimv_.

DimensionValueOut

NameTypeDescription
codeRequiredstring

Unique within the dimension, e.g. ENG. Never changes.

created_atRequiredstring (date-time)
dimension_idRequiredstring

An id that starts with dim_.

idRequiredstring

An id that starts with dimv_.

nameRequiredstring

What a person reads, e.g. Engineering.

parent_idRequiredstring or null

An id that starts with dimv_.

DimensionValueChanges

Only the fields sent change; parent_id: null moves it to the top.

NameTypeDescription
namestring
parent_idstring or null

An id that starts with dimv_.