Loki Docs
Tools › Transactions › Resolve which account paid

Resolve which account paid

resolve_payment_accountReads
What it does
Reads only. Changes nothing.
Permission
Transactions, read transactions:read

What your assistant is told

Call this BEFORE logging a receipt or a card payment: pass what the receipt shows — cardLast4 (the last 4 digits it prints) and/or cardLabel (the card's name, as Apple Pay or the user said it, e.g. "ING Debit"), or paidCash: true. NEVER send a full card number; only four digits are accepted and anything longer is refused. outcome is one of: "matched" — account is the one to log into (either a card the user already told us about, or they have only one account); "ambiguous" — those digits are on several accounts (two banks can both end 4821), so ASK which; "unknown" — nothing remembered matches, so ASK which account, choosing from accountsWithoutCards (use list_accounts if none fit), then offer remember_card so the next receipt from that card goes straight in; "cash" — account is their cash account, or null, in which case offer to create_account with the alias "Cash". suggestedAccount is a card NAME that merely resembles an account ("ING Debit" and an account called ING): OFFER it ("is this your ING account?") and never use it without the user saying yes — a resemblance is not a link. Never fall back to a default account: a wrong account is worse than a question, because reconciliation then looks for the line in the wrong statement. Read-only.

Parameters

  • cardLast4text, optionalThe last 4 digits the receipt prints, any masking ("4821", "XXXX-4821"). Exactly 4 digits — never a full card number.
  • cardLabeltext, optionalThe card's name as the wallet shows it, e.g. "ING Debit".
  • paidCashtrue or false, optionaltrue when the user says they paid cash. It wins over any digits you also pass.