Link a refund to the charge it reverses
Pairs two transactions on the same bank account that cancel each
other out — typically a card charge and a later full or partial
refund of it. Unlike pair, which
settles a document or expense, this settles one transaction against
ANOTHER transaction.
Callable from either side: pass the other transaction’s id as
counterpart_id and the two are sorted into the charge (larger
absolute amount) and the refund automatically. The refund is marked
paired to the charge; once refunds cover the full charge amount the
charge is marked paired back too.
A charge that is only partly refunded keeps its own remaining budget
(unallocated_amount, visible via GET) open for pairing to a document
or expense — a 58.45 charge partly offset by a 9.74 refund still has
48.71 left to settle an expense. Prefer this endpoint over pair for a
refund that reverses a specific charge: it nets the two transactions
against each other and restores the charge’s budget, rather than
landing the refund on a document/expense as an allocation of its own
(which pair will also do, if that is what was actually meant).
Requires manage:transactions on BOTH transactions, not update —
this writes two rows, not one field, so a write:transactions key
cannot reach it.
Authentication
JWT issued via POST /api/v1/auth/sign_in. Used by mobile and SPA clients. Revoked tokens are rejected.
Lucanto API key. Two prefixes:
lct_pat_<random><checksum>— personal access token (owner: User)lct_live_<random><checksum>— workspace token, live data
Issue keys at /settings/api_keys (personal) or
/:workspace_id/settings/api_keys (workspace). Plaintext token is
shown once and never again.
Path parameters
Transaction ID — either side of the pair (the charge or the refund). Either the numeric id or the public_id (txn_…).
Headers
Client-supplied unique key (recommended: UUID v4) for safe
retries. Within 24 hours, repeating the same key with the same
request (method, path, query, body) replays the original
response instead of re-executing the action — once the action
has run, a 5xx included; a request stopped before it ran is not
stored. Reusing
a key with a different request returns
422 idempotency_key_conflict (IETF draft §2.7).
Request
Response
Paired. Returns the updated transaction (this side of the pair).
Stable public identifier of this record. Never changes once assigned.
Its prefix names the entity: doc_ document (invoice, proforma, credit
note, quote, sales order), exp_ expense, cnt_ contact, prj_
project, ba_ bank account or cash register, txn_ transaction,
lon_ loan, bst_ bank statement. Accepted in place of the numeric
id in this resource’s path parameters and in request fields that
reference it (customer_id, bank_account_id, …).
Signed amount as a precision-preserving decimal string. Positive = credit (money in), negative = debit (money out).
Derived from the sign of amount. Zero is treated as credit.
Matching / classification status. unmatched, matched,
manually_matched, no_match_found, or an auto-classified bucket
(bank_fee, tax_fee, loan_principal, salary,
internal_transfer, atm_withdrawal, …).
true when imported from the bank via PSD2 sync; false for manually recorded transactions.
ID of the owning bank account / cash register.
ISO-4217 currency code (uppercased).
Free-text description / narrative for the movement.
Ready-to-render label for the other side of the movement: the
counterparty name (payer on money in, payee on money out), falling
back to the bank’s trading-party identification and then to its
additional info. Prefer this over creditor_name/debtor_name for
display — on a card payment both of those are empty and the merchant
is only in the trading-party identification.
Best effort, not a guaranteed name: the last fallback is the bank’s
free-text narrative, so a row the bank named nobody on can render as
e.g. GP NÁKUP POS. Null only when the bank sent none of the three.
SK/CZ payment matching symbol (variabilný symbol).
SK/CZ constant symbol (konštantný symbol).
SK/CZ specific symbol (špecifický symbol).
End-to-end / structured payment reference.
Name of the credited party (payee).
Name of the debited party (payer).
Value date (when funds are effective).
Payment date — primary date for manually recorded (cash) transactions.
Finer-grained auto-classification bucket, when classified.
Additional detail for the classification (e.g. a specific fee/tax label).
true when the row was imported from an uploaded bank statement
(PDF/CSV): bank data, but without a bank transaction id. Such rows
may be corrected when the statement was misread; rows the bank
delivered itself are locked.
A property of the row: whether it is the kind of transaction a
correction (lucanto_correct_transaction) applies to. Identical to
statement_imported today. The caller’s role still applies —
correcting needs transactions:manage.
Correction history, oldest first — present on GET /transactions/{id} and lucanto_get_transaction only; the list
and the pairing responses (pair, unpair, pair_with_transaction)
omit it. Each entry records who corrected the row, when, why,
through which surface and what changed.
Payment method (e.g. cash, transfer, card), when known.
What this transaction settles, when it is paired. matching_status
tells you a transaction is matched but not to what — this says which
record, so you can tell whether a row is load-bearing for a
document’s payment state before acting on it. Null when unpaired.
Slim embed of the owning payment account (routing/identity fields only — no balances).
