API reference

FX rates

What one unit of a foreign currency is in your books' currency, day by day. Correcting one never changes a line already posted.

Guides: Foreign currency and revaluation

List FX rates

GET/v1/fx_rates

client.fxRates.list()

The rates these books convert at, the newest set first.

Parameters

NameTypeDescription
currencyQuerystring or null

Only this currency's rates.

limitQueryinteger

Page size, 1–200.

Default 50
cursorQuerystring or null

The next_cursor of the previous page.

Response

200RatePage

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/fx_rates" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN"

Set an FX rate

POST/v1/fx_rates· Idempotent

client.fxRates.create()

Set a currency's rate on a day. Refused with conflict when that day already has one: change it instead.

Request body

RateCreate

Response

201RateOut

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/fx_rates" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"currency":"…","rate":0,"rate_date":"2026-09-30"}'

Get an FX rate

GET/v1/fx_rates/{rate_id}

client.fxRates.get()

One rate.

Parameters

NameTypeDescription
rate_idPath · Requiredstring

An id that starts with fx_.

Response

200RateOut

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/fx_rates/{rate_id}" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN"

Correct an FX rate

PATCH/v1/fx_rates/{rate_id}· Idempotent

client.fxRates.update()

Correct a rate. Every line already posted keeps the rate it was booked at; the next posting and revaluation use this one.

Parameters

NameTypeDescription
rate_idPath · Requiredstring

An id that starts with fx_.

Request body

RateChange

Response

200RateOut

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/fx_rates/{rate_id}" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"rate":0}'

Delete an FX rate

DELETE/v1/fx_rates/{rate_id}· Idempotent

client.fxRates.delete()

Delete a rate. Lines booked at it keep it.

Parameters

NameTypeDescription
rate_idPath · Requiredstring

An id that starts with fx_.

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/fx_rates/{rate_id}" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)"

Objects

The objects these operations take and return.

RatePage

NameTypeDescription
dataRequiredarray of RateOut
has_moreRequiredboolean
next_cursorRequiredstring or null

RateCreate

NameTypeDescription
currencyRequiredstring

The foreign currency, ISO 4217: EUR.

rateRequirednumber | string

One unit of the currency, in the books' currency.

rate_dateRequiredstring (date)

The day the rate is for. It holds until a later one is set.

sourcestring or null

Where the rate came from: ECB, manual.

RateOut

NameTypeDescription
created_atRequiredstring (date-time)
currencyRequiredstring
idRequiredstring

An id that starts with fx_.

rateRequiredstring
rate_dateRequiredstring (date)
row_versionRequiredinteger
sourceRequiredstring
updated_atRequiredstring (date-time)

RateChange

NameTypeDescription
rateRequirednumber | string

The corrected rate. Lines already posted keep the one they were booked at.

sourcestring or null