API reference

Allocations

Payments applied to invoices and bills, and undoing one.

Guides: Keep track of vendors and customers

Apply a payment to an invoice or bill

POST/v1/allocations· Idempotent

client.allocations.create()

Settle part or all of a debit item with a credit item of the same ledger and party: a payment applied to an invoice on AR, to a bill on AP. Refused with over_allocated past what either has left, and allocation_refused for items that cannot be joined.

Request body

AllocationCreate

Response

201AllocationOut

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

Undo an allocation

POST/v1/allocations/{allocation_id}/reverse· Idempotent

client.allocations.reverse()

Undo an allocation with another for minus its amount. Both items have what it took back. An allocation a reversal entry made is undone by reversing that entry's reversal instead.

Parameters

NameTypeDescription
allocation_idPath · Requiredstring

An id that starts with alloc_.

Response

201AllocationOut

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

Objects

The objects these operations take and return.

AllocationCreate

NameTypeDescription
amountRequirednumber | string

At most what both items have left.

credit_item_idRequiredstring

A payment on AR, a bill on AP.

debit_item_idRequiredstring

An invoice on AR, a payment on AP.

effective_onRequiredstring (date)

The day it takes effect: on or after both items' days.

AllocationOut

NameTypeDescription
amountRequiredstring

Positive; minus the allocation it undoes when reverses_id is set.

created_byRequiredstring or null

An id that starts with usr_.

credit_item_idRequiredstring

An id that starts with oi_.

debit_item_idRequiredstring

An id that starts with oi_.

effective_onRequiredstring (date)
idRequiredstring

An id that starts with alloc_.

recorded_atRequiredstring (date-time)
reverses_idRequiredstring or null

An id that starts with alloc_.

settlement_entry_idRequiredstring or null

An id that starts with je_.