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.
- GET
/v1/fx_ratesList FX rates - POST
/v1/fx_ratesSet an FX rate - GET
/v1/fx_rates/{rate_id}Get an FX rate - PATCH
/v1/fx_rates/{rate_id}Correct an FX rate - DELETE
/v1/fx_rates/{rate_id}Delete an FX rate
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
| Name | Type | Description |
|---|---|---|
currencyQuery | string or null | Only this currency's rates. |
limitQuery | integer | Page size, 1–200. |
cursorQuery | string or null | The |
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 "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
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 -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
| Name | Type | Description |
|---|---|---|
rate_idPath · Required | string | An id that starts with |
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 "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
| Name | Type | Description |
|---|---|---|
rate_idPath · Required | string | An id that starts with |
Request body
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 -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
| Name | Type | Description |
|---|---|---|
rate_idPath · Required | string | An id that starts with |
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 -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
| Name | Type | Description |
|---|---|---|
dataRequired | array of RateOut | |
has_moreRequired | boolean | |
next_cursorRequired | string or null |
RateCreate
| Name | Type | Description |
|---|---|---|
currencyRequired | string | The foreign currency, ISO 4217: |
rateRequired | number | string | One unit of the currency, in the books' currency. |
rate_dateRequired | string (date) | The day the rate is for. It holds until a later one is set. |
source | string or null | Where the rate came from: |
RateOut
| Name | Type | Description |
|---|---|---|
created_atRequired | string (date-time) | |
currencyRequired | string | |
idRequired | string | An id that starts with |
rateRequired | string | |
rate_dateRequired | string (date) | |
row_versionRequired | integer | |
sourceRequired | string | |
updated_atRequired | string (date-time) |
RateChange
| Name | Type | Description |
|---|---|---|
rateRequired | number | string | The corrected rate. Lines already posted keep the one they were booked at. |
source | string or null |