> ## Documentation Index
> Fetch the complete documentation index at: https://docs.panoqore.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Entries

> Balanced postings, pending entries and reversals.

An entry is one financial event: two or more postings, written atomically. Entries are never edited.

## 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.
* `kind` is required. It is your label, such as `TRANSFER`, `PAYOUT` or `TRANSFER_IN`, and you can filter on it.

## Post

```bash theme={null}
curl -X POST "$PANOQORE_URL/v1/entries" \
  -H "Authorization: Bearer $PANOQORE_API_KEY" \
  -H "Idempotency-Key: transfer-77" \
  -H "Content-Type: application/json" \
  -d '{
    "kind": "TRANSFER",
    "externalRef": "transfer-77",
    "postings": [
      {"accountId": "'"$WALLET_A"'", "side": "DEBIT",  "amount": "500", "currency": "NGN"},
      {"accountId": "'"$WALLET_B"'", "side": "CREDIT", "amount": "500", "currency": "NGN"}
    ]
  }'
```

`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.

```bash theme={null}
curl -X POST "$PANOQORE_URL/v1/entries/$ENTRY/post" \
  -H "Authorization: Bearer $PANOQORE_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" -d '{}'
```

| Call | Result |
| - | - |
| `POST /v1/entries/{id}/post` | Status becomes `POSTED`. |
| `POST /v1/entries/{id}/void` | Status becomes `VOIDED`, and the money is back. |

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 gains `reversedById`.

```bash theme={null}
curl -X POST "$PANOQORE_URL/v1/entries/$ENTRY/reverse" \
  -H "Authorization: Bearer $PANOQORE_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"reason":"Returned by the bank"}'
```

The new entry has `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](https://docs.panoqore.com/concepts/approvals.md).

## 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 optional `ifMatchVersion`, the `version` you read from the balance. If the account has moved since, the entry gets `VERSION_CONFLICT` and nothing posts.

```json theme={null}
{ "accountId": "acc_...", "side": "DEBIT", "amount": "100", "currency": "NGN", "ifMatchVersion": "9" }
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.