Skip to navigation

Settle a document or expense with this transaction

View as Markdown

Links the transaction to what it pays for and updates that record’s payment status — the same operation as manual pairing in the app.

type is a whitelisted key, never a class name. Money in: invoice, proforma, tax_document, settlement_invoice, collective_invoice, internal_income, rent_income, debit_note. Money out: credit_note, advance_credit_note, expense, payroll (an expense a payroll run generated — same model as expense, just pre-filtered). Other: insurance, loan, recurring_expense (a template, not itself pairable — pairable_id is the template’s id and the server settles the expense for the transaction’s period, creating it from the template if it does not exist yet).

Omit amount to let the policy allocate the sensible default (what is still outstanding, capped by the transaction). Pass it to settle part of a record, in the transaction’s currency.

A transaction can only settle a record in its own currency, or the “card abroad” currency it recorded a DCC rate for — anything else is refused with incompatible_currency, unless document_amount is given. document_amount is the manual cross-currency escape hatch: the amount, in the record’s own currency, that this payment discharges. When present, the full transaction amount is allocated (the bank side is fact) and document_amount is stored as the settled amount — the rate is derived from the two figures, never asked for. When the transaction reports the original amount in the record’s currency (a bank conversion), document_amount must equal that original; a document_amount above it requires charges (the gap is never assumed to be fees — without charges the pairing is refused with charges_required). In one currency, a document_amount sent with charges must equal amount plus charges. Both amount and document_amount accept a decimal comma or thousands grouping (e.g. "1 234,56"), not only a plain dot-decimal string.

Requires manage:transactions and update rights on the target record — pairing writes that record’s payment status, so a transactions scope alone is not a way in.

Authentication

AuthorizationBearer

JWT issued via POST /api/v1/auth/sign_in. Used by mobile and SPA clients. Revoked tokens are rejected.

OR
AuthorizationBearer

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

workspace_idlongRequired>=1
Workspace ID. The numeric ID shown in your URLs.
idlong or stringRequired

Transaction ID. Either the numeric id or the public_id (txn_…).

Headers

Idempotency-KeystringOptional<=255 characters

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

This endpoint expects an object.
typestringRequired
Pairable type key.
pairable_idlong or stringRequired

The record’s numeric id or its public_id (doc_…, exp_…, lon_…), matching type.

amountstring or doubleOptional

Optional partial allocation, in the transaction’s currency. A JSON number is accepted, but only the string form can carry a decimal comma or thousands grouping ("1 234,56").

document_amountstring or doubleOptional

Optional. The amount this payment settles, in the record’s own currency — required to pair a transaction and a record whose currencies otherwise differ (must be greater than zero). A JSON number is accepted; the string form is preferred for the same reason as amount.

chargesstring or doubleOptional

Optional. Bank charges deducted from this payment before it arrived (e.g. SWIFT correspondent fees), in the record’s own currency. Only for money received for an invoice or proforma. The record is settled at the gross (document_amount, or what arrived plus charges); the transaction keeps its booked amount. Must be greater than zero and smaller than the gross. Required when a bank-converted payment is given a document_amount above the bank’s original amount.

Response

Paired. Returns the updated transaction.
idlong
public_idstringRead-onlyformat: "^[a-z]+_[0-7][0-9a-hjkmnp-tv-z]{25}$"

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, …).

amountstringformat: "decimal"

Signed amount as a precision-preserving decimal string. Positive = credit (money in), negative = debit (money out).

directionenum

Derived from the sign of amount. Zero is treated as credit.

Allowed values:
matching_statusstring

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, …).

synced_from_bankboolean

true when imported from the bank via PSD2 sync; false for manually recorded transactions.

bank_account_idlong

ID of the owning bank account / cash register.

created_atdatetime
updated_atdatetime
currencystring or nullOptional

ISO-4217 currency code (uppercased).

descriptionstring or nullOptional

Free-text description / narrative for the movement.

display_namestring or nullOptional

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.

variable_symbolstring or nullOptional

SK/CZ payment matching symbol (variabilný symbol).

constant_symbolstring or nullOptional

SK/CZ constant symbol (konštantný symbol).

specific_symbolstring or nullOptional

SK/CZ specific symbol (špecifický symbol).

payment_referencestring or nullOptional

End-to-end / structured payment reference.

remittance_infostring or nullOptional
Unstructured remittance information from the bank.
creditor_namestring or nullOptional

Name of the credited party (payee).

creditor_ibanstring or nullOptional
IBAN of the credited party.
debtor_namestring or nullOptional

Name of the debited party (payer).

debtor_ibanstring or nullOptional
IBAN of the debited party.
booking_datedate or nullOptional
Date the bank booked the transaction.
value_datedate or nullOptional

Value date (when funds are effective).

paid_ondate or nullOptional

Payment date — primary date for manually recorded (cash) transactions.

classification_subtypestring or nullOptional

Finer-grained auto-classification bucket, when classified.

classification_detailstring or nullOptional

Additional detail for the classification (e.g. a specific fee/tax label).

statement_importedbooleanOptional

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.

correctablebooleanOptional

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.

correctionslist of objectsOptional

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_methodstring or nullOptional

Payment method (e.g. cash, transfer, card), when known.

pairableobject or nullOptional

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.

bank_accountobject or nullOptional

Slim embed of the owning payment account (routing/identity fields only — no balances).

Errors

401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error
422
Unprocessable Entity Error
429
Too Many Requests Error