Skip to content

Financial

Port: REST :3060 · gRPC :5060

Manages the full financial lifecycle: accounts group wallets, wallets hold balances, invoices represent obligations, and transactions record atomic monetary movements. All transactions are saga-linked.

Collections

CollectionPathPurpose
Accounts/financial/accountsGroups one or more wallets
Currencies/financial/currenciesFiat, virtual, and chain currency definitions
Invoices/financial/invoicesBilling documents with payees, line items, and optional recurrence
Transactions/financial/transactionsAtomic monetary movement records
Wallets/financial/walletsBalance-holding wallet tied to one account and currency

financial/accounts

Groups one or more wallets and defines ownership semantics.

Required Create Fields

FieldRequiredTypeDescription
typeAccountTypeCHECKING, SAVINGS, FIXED_DEPOSIT, MONEY_MARKET, JOINT, STUDENT, BUSINESS
ownershipAccountOwnershipCOMMON, PERSONAL, GOVERNMENT

Optional Fields

FieldTypeDescription
membersMongoId[]User IDs with access

financial/currencies

Fiat, virtual, and blockchain-related currency metadata.

Required Create Fields

FieldRequiredTypeDescription
symbolstringDisplay symbol
typeCurrencyTypeREAL, VIRTUAL
precisioninteger ≥ 0Decimal precision

Optional Fields

FieldTypeDescription
codestringShort code
namestringDisplay name
countriesstring[]ISO 3166-1 Alpha-3 codes
tokenstringToken identifier
networkstringBlockchain network
contractstringContract address
categoryCurrencyCategoryCOIN, TOKEN
libCurrencyLibIntegration library
nodesstring[]RPC node URLs
subunitsCurrencyUnit[]Nested unit definitions

financial/invoices

Represents a financial obligation with payees, optional payers, line items, and optional recurrence.

Required Create Fields

FieldRequiredTypeDescription
amountnumber ≥ 0Total invoice amount
payeesPay[]Non-empty recipient array

Optional Fields

FieldTypeDescription
typeInvoiceTypeTRANSACTION, REPEATABLE, REPLICATION, SUBSCRIPTION
titlestringInvoice title
payersPay[]Payment source wallets
currencyMongoIdfinancial/currencies
itemsInvoiceItem[]Line items
discountnumberDiscount amount
expires_atdateExpiration time
subscriptioncron stringRecurrence rule (for SUBSCRIPTION type)

Special Operation

OperationHTTPPurpose
paymentGET /financial/invoices/:id/paymentConvert invoice into a transaction flow

Invoice payment is a special operation, not a generic update. It requires the payment:financial:invoices scope.

Population

PathCollection
currencyfinancial/currencies
payees.walletfinancial/wallets
payers.walletfinancial/wallets

financial/transactions

Atomic monetary movement. Every transaction is linked to a saga.

create (raw CRUD) vs init (platform REST) are different operations. Use init for normal payment flows.

POST /financial/transactions/init
FieldRequiredTypeDescription
reasonTransactionReasonSYNC, DEPOSIT, TRANSFER, WITHDRAW, PAYMENT
amountnumber ≥ 0Amount
sagaMongoIdAttach to an existing saga
payersPay[]Source wallets
payeesPay[]Destination wallets
invoiceMongoIdLinked invoice

Platform manages state, failed_at, verified_at, canceled_at — never set these manually during init.

Special Operations

OperationHTTPPurpose
abortGET /financial/transactions/:id/abortAbort a pending/in-flight transaction
verifyGET /financial/transactions/:id/verifyVerify a transaction

Population

PathCollection
sagaessential/sagas
invoicefinancial/invoices
payees.wallet / payers.walletfinancial/wallets

financial/wallets

Digital wallet tied to one account and one currency.

Required Create Fields

FieldRequiredTypeDescription
accountMongoIdfinancial/accounts
currencyMongoIdfinancial/currencies
amountnumberPrimary balance

Optional Fields

FieldTypeDescription
blockednumberReserved / frozen balance
internalnumberInternal ledger balance
externalnumberExternal ledger balance
addressstringWallet address
privatestringPrivate key — write-only, never returned

Population

PathCollection
accountfinancial/accounts
currencyfinancial/currencies

Pay — Shared Nested Object

Used in both invoices and transactions for wallet payment entries.

FieldRequiredTypeDescription
typePayTypeAMOUNT, BLOCKED, INTERNAL, EXTERNAL
walletMongoIdTarget wallet
amountnumberFixed amount
fractionnumberProportional fraction (0–1)

Use either amount or fraction for a given entry — not both.