The rules
- At least two postings.
- Debits equal credits in each currency.
- An account appears at most once on each side.
- Every amount is above zero, and each posting’s currency matches its account.
kindis required. It is your label, such asTRANSFER,PAYOUTorTRANSFER_IN, and you can filter on it.
Post
effectiveAt backdates an entry, as long as its business date is in an open period. metadata is any JSON object of your own, returned with the entry. Keep personal data out of it.
Pending
Set"pending": true and the entry reserves the money without settling it. Then finish it.
Doing either to an entry that is not pending gets
ENTRY_NOT_PENDING.
Reverse
A reversal is a new entry with every leg on the opposite side. The original stays as it was, and gainsreversedById.
kind: REVERSAL, reversesId pointing back, and the original’s externalRef. reason becomes its description. An entry can be reversed once. A key reverses at once; a person’s reversal goes to approval.
Linked batches
POST /v1/entries:batch takes entries, and either all of them commit or none do. If the second entry is refused, the first is not posted.
Guarding against a race
Each posting takes an optionalifMatchVersion, the version you read from the balance. If the account has moved since, the entry gets VERSION_CONFLICT and nothing posts.