API reference
Allocations
Payments applied to invoices and bills, and undoing one.
- POST
/v1/allocationsApply a payment to an invoice or bill - POST
/v1/allocations/{allocation_id}/reverseUndo an allocation
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
Response
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/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
| Name | Type | Description |
|---|---|---|
allocation_idPath · Required | string | An id that starts with |
Response
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/allocations/{allocation_id}/reverse" \
-H "Authorization: Bearer $LEDGERIT_TOKEN" \
-H "Idempotency-Key: $(uuidgen)"Objects
The objects these operations take and return.
AllocationCreate
| Name | Type | Description |
|---|---|---|
amountRequired | number | string | At most what both items have left. |
credit_item_idRequired | string | A payment on AR, a bill on AP. |
debit_item_idRequired | string | An invoice on AR, a payment on AP. |
effective_onRequired | string (date) | The day it takes effect: on or after both items' days. |
AllocationOut
| Name | Type | Description |
|---|---|---|
amountRequired | string | Positive; minus the allocation it undoes when |
created_byRequired | string or null | An id that starts with |
credit_item_idRequired | string | An id that starts with |
debit_item_idRequired | string | An id that starts with |
effective_onRequired | string (date) | |
idRequired | string | An id that starts with |
recorded_atRequired | string (date-time) | |
reverses_idRequired | string or null | An id that starts with |
settlement_entry_idRequired | string or null | An id that starts with |