SonaCORE

Referência / Quadra Core API

Accounts

7 operações em Quadra Core API 0.5.0.

GET/v1/accounts

Search Accounts

Parâmetros

NomeTipoDetalhe
querystring, opcionalquery
typestring, opcionalquery
statusstring, opcionalquery
currencystring, opcionalquery
owner_party_idstring, opcionalquery
is_frozenboolean, opcionalquery
limitintegerquery
cursorstring, opcionalquery

Respostas

StatusCorpoDetalhe
200AccountSearchResponseOutResposta bem-sucedida
422HTTPValidationErrorErro de validação
POST/v1/accounts

Create an Account

Create a new account.

Creates a ledger container owned by a party, used to anchor intents/obligations and (later) postings. Generates Cardano keys and stores them with envelope encryption.

Returns: 201 Created with full Account object

Raises: 404: owner_party_id doesn't exist 422: Invalid type or currency 500: Internal error during account creation

Parâmetros

NomeTipoDetalhe
Idempotency-Keystringheaderobrigatório

Corpo da requisição

AccountCreateRequest — obrigatório. Os campos estão listados em Esquemas, abaixo.

Respostas

StatusCorpoDetalhe
201AccountResponseResposta bem-sucedida
422HTTPValidationErrorErro de validação
GET/v1/accounts/{account_id}

Get an Account

Get an account by ID.

Returns: Account object if found

Raises: 404: Account not found

Parâmetros

NomeTipoDetalhe
account_idstringpathobrigatório

Respostas

StatusCorpoDetalhe
200AccountWithPaymentMethodsResponseResposta bem-sucedida
422HTTPValidationErrorErro de validação
GET/v1/accounts/{account_id}/balance

Get Account Balance

Get the balance of an account by summing its UTXOs.

Returns aggregated balance per currency with optional obligation details. Under ``as_of``/``as_of_seq`` the balance is reconstructed by journal replay (RFC-009 §7.1): the response echoes the resolved cut in ``as_of``, adds a ``reconstruction`` block, and returns ``committed_to_products/squads`` as [] (live-only composition). EXTERNAL accounts keep the live short-circuit shape (their custody set is empty at every cut).

Parâmetros

NomeTipoDetalhe
account_idstringpathobrigatório
assetstring, opcionalquery Filter by currency symbol (e.g. BRL)
includestring, opcionalquery Comma-separated includes (e.g. obligations; positions with as_of)
obligations_statestring, opcionalquery Filter obligations by state
as_ofstring, opcionalquery Point-in-time cut: ISO-8601 instant (commit-time basis, LaaS-03)
as_of_seqinteger, opcionalquery Point-in-time cut: journal sequence number (mutually exclusive with as_of)

Respostas

StatusCorpoDetalhe
200AccountBalanceResponseResposta bem-sucedida
422HTTPValidationErrorErro de validação
POST/v1/accounts/{account_id}/payment-methods

Bind a Payment Method

Bind a payment method to an account.

Accepts a typed payload with rail, scheme, and coordinates. Currently supports ACH; extensible to PIX, WIRE, SEPA.

Parâmetros

NomeTipoDetalhe
account_idstringpathobrigatório
Idempotency-Keystringheaderobrigatório

Corpo da requisição

PaymentMethodRequest — obrigatório. Os campos estão listados em Esquemas, abaixo.

Respostas

StatusCorpoDetalhe
201Resposta bem-sucedidaO contrato não declara um modelo para esta resposta, então a forma dela não está documentada aqui. Um roteiro de demonstração mostra a forma que ela realmente devolve.
422HTTPValidationErrorErro de validação
GET/v1/accounts/{account_id}/statement

Formal account statement for a date range

A synchronous, effective-dated statement built from the journal-entry read model (LaaS-20): custody-layer net legs, one line per confirmed transaction.

Periods are América/São_Paulo accounting days over *effective* time (fixed −03:00); DR→CREDIT, CR→DEBIT (DR = value in). Opening = cumulative net from the opening epoch to ``from``; closing = opening + period net. The ``reconciliation`` block cross-checks closing against the live balance and is emitted only when ``to`` is today or later. MEMO-layer (squad vQBRL) accounting entries are excluded — this is a custody-layer statement.

``format=pdf`` is rejected (400): PDF rendering is BFF/mobile presentation territory, not Core.

Raises: 404: unknown or hidden FAUCET account (before any other validation) 400: from > to, ranges over 366 days, or unsupported format

Parâmetros

NomeTipoDetalhe
account_idstringpathobrigatório
fromstringqueryobrigatório Inclusive start accounting day (yyyy-mm-dd, América/São_Paulo)
tostringqueryobrigatório Inclusive end accounting day (yyyy-mm-dd, América/São_Paulo)
formatstringquery Response format: json (default) or csv

Respostas

StatusCorpoDetalhe
200StatementResponseResposta bem-sucedida
422HTTPValidationErrorErro de validação
GET/v1/accounts/{account_id}/transactions

List Account Transactions

List an account's transactions, newest first.

Returns a reverse-chronological, cursor-paginated feed of the economic events that touched the account — deposits and transfers (obligations), SafeSwap escrow movements, and squad operations that move value into or out of this account's base balance (funding a squad, receiving a squad spend, settling a squad share) — each projected from this account's perspective as a CREDIT or DEBIT. Squad-internal bookkeeping (accounting shares) is not a base-balance movement and does not appear here.

When ``effective_from``/``effective_to`` are given, the feed is ordered and filtered by business time (``effective_at``) instead of recording time — a distinct query mode with its own cursors; cursors from one mode are rejected in the other.

Parâmetros

NomeTipoDetalhe
account_idstringpathobrigatório
limitintegerquery
cursorstring, opcionalquery
effective_fromstring, opcionalquery Inclusive lower bound on effective_at (ISO 8601)
effective_tostring, opcionalquery Inclusive upper bound on effective_at (ISO 8601)

Respostas

StatusCorpoDetalhe
200TransactionListResponseResposta bem-sucedida
422HTTPValidationErrorErro de validação

Esquemas

Os modelos que as operações acima aceitam e devolvem. Campos opcionais estão marcados como tal; um campo tipado como outro modelo está documentado sob o nome dele.

AccountBalanceResponse

Top-level response for GET /v1/accounts/{account_id}/balance.

CampoTipoDetalhe
account_idstringobrigatórioQuadra account identifier
as_ofstringobrigatórioISO 8601 timestamp of the balance snapshot
assetsarray de AssetEntryobrigatórioAsset balances
banking_coordinatesBankingCoordinates, opcionalBanking coordinates from ACH payment methods
committed_to_productsarray de CommittedProductSummaryOpen product-instance commitments where this account is the locker
committed_to_squadsarray de CommittedSquadSummaryThe account's position in each OPEN squad it belongs to (RFC-018, SQ-16)
consistencyBalanceConsistencyobrigatórioConsistency metadata
display_namestring, opcionalOwner party display name
positionsarray de ReconstructedPosition, opcionalReconstructed position set (only under as_of with include=positions)
reconstructionReconstruction, opcionalPresent only under as_of/as_of_seq: commit-time reconstruction provenance
typestringobrigatórioAccount type (CUSTOMER, ASSET, TRANSIT, REVENUE, EXCEPTION)
unitstringUnit of balance amountsPadrão "cents"

AccountCreateRequest

Request body for creating a new account.

CampoTipoDetalhe
currencystringobrigatórioISO 4217 currency code (e.g., BRL)
metadataobject, opcionalOptional free-form metadata (max 8KB)
owner_party_idstringobrigatórioParty ID that owns this account
typeAccountTypeobrigatórioAccount type: CUSTOMER, ASSET, TRANSIT, REVENUE, or EXCEPTION

AccountResponse

Response model for account operations.

CampoTipoDetalhe
addressstring, opcionalCardano address for this account
created_atstringobrigatórioISO 8601 timestamp of creation
created_bystringobrigatórioAPI client that created this account
currencystringobrigatórioISO 4217 currency code
idstringobrigatórioUnique account identifier (acc_...)
is_frozenbooleanobrigatórioWhether the account is frozen for operations
metadataobject, opcionalFree-form metadata
owner_party_idstringobrigatórioParty ID that owns this account
statusAccountStatusobrigatórioAccount lifecycle status
typeAccountTypeobrigatórioAccount type
updated_atstringobrigatórioISO 8601 timestamp of last update

AccountSearchItemOut

Single account item in search results.

CampoTipoDetalhe
addressstring, opcionalCardano address for this account
currencystring, opcionalISO 4217 currency code
idstringobrigatórioUnique account identifier (acc_...)
is_frozenboolean, opcionalWhether the account is frozen for operations
owner_party_idstring, opcionalParty ID that owns this account
statusstring, opcionalAccount lifecycle status
typestring, opcionalAccount type

AccountSearchResponseOut

Paginated list of accounts.

CampoTipoDetalhe
dataarray de AccountSearchItemOutobrigatório
next_cursorstring, opcional

AccountStatus

Account lifecycle status.

Um de: ACTIVE, CLOSED

AccountType

Account type enum - controls what operations are allowed.

Um de: ASSET, TRANSIT, REVENUE, EXCEPTION, CUSTOMER, EXTERNAL, GUEST, SQUAD

AccountWithPaymentMethodsResponse

Account response including external payment methods.

CampoTipoDetalhe
addressstring, opcionalCardano address for this account
created_atstringobrigatórioISO 8601 timestamp of creation
created_bystringobrigatórioAPI client that created this account
currencystringobrigatórioISO 4217 currency code
external_payment_methodsarray de PaymentMethodResponse, opcionalList of external payment methods bound to this account
idstringobrigatórioUnique account identifier (acc_...)
is_frozenbooleanobrigatórioWhether the account is frozen for operations
metadataobject, opcionalFree-form metadata
owner_party_idstringobrigatórioParty ID that owns this account
promoted_to_account_idstring, opcionalIf this GUEST/EXTERNAL account was promoted to a CUSTOMER account, the new account_id (RFC-021 §3.4 / LaaS-17); queries follow the pointer to reconcile history
statusAccountStatusobrigatórioAccount lifecycle status
typeAccountTypeobrigatórioAccount type
updated_atstringobrigatórioISO 8601 timestamp of last update

AssetEntry

A single asset in the balance response.

CampoTipoDetalhe
balancesAssetBalancesobrigatórioBalance breakdown
obligationsarray de ObligationSummary, opcionalObligation details (when include=obligations)
symbolstringobrigatórioCurrency symbol (e.g. BRL)

BalanceConsistency

Consistency metadata for the balance snapshot.

CampoTipoDetalhe
ledger_versionintegerobrigatórioLedger version number
snapshot_idstringobrigatórioHash-based snapshot identifier

BankingCoordinates

Banking coordinates extracted from ACH payment methods.

CampoTipoDetalhe
account_numberstringobrigatórioBank account number
routing_numberstringobrigatórioABA routing number

Capabilities

Transaction capabilities for a payment method.

CampoTipoDetalhe
originate_debitbooleanobrigatórioCan originate debit pulls
receive_creditbooleanobrigatórioCan receive credit transfers
supports_returnsbooleanobrigatórioWhether returns are supported

CommittedProductSummary

Per-product roll-up of an account's open commitments.

CampoTipoDetalhe
instancesarray de CommittedInstanceSummaryOpen instances contributing to the total
product_idstringobrigatórioProduct identifier (e.g. quadra-escrow)
total_committed_valueintegerobrigatórioSum of amount.value across open instances for this account

CommittedSquadSummary

The account's position in one OPEN squad it is a member of (RFC-018, SQ-16).

CampoTipoDetalhe
funded_in_centsintegerobrigatórioQBRL the account currently holds in the squad's funded pool
has_open_debtsbooleanobrigatórioTrue iff your_owed_cents > 0 (something to settle)
namestring, opcionalSquad display name
rolestring, opcionalThe account's role in the squad (OWNER|SPENDER)
sqd_idstringobrigatórioSquad identifier
statestringobrigatórioSquad state (OPEN)
your_net_centsintegerobrigatórioSigned net: positive = owed to you; negative = you owe
your_owed_centsintegerobrigatórioSum of the account's open debt shares (what it must pay)
your_owed_to_centsintegerobrigatórioSum of open shares where the account is the creditor

Directionality

Which directions the payment method supports.

CampoTipoDetalhe
inboundbooleanobrigatórioCan receive funds
outboundbooleanobrigatórioCan send funds

HTTPValidationError

CampoTipoDetalhe
detailarray de ValidationError

PaymentMethodMode

How the payment method was provisioned.

Um de: EXTERNAL_ALLOCATION, CUSTOMER_LINKED, PROVIDER_MANAGED, VIRTUAL_ADDRESS

PaymentMethodRequest

Request body for binding a payment method to an account.

CampoTipoDetalhe
capabilitiesCapabilitiesobrigatórioTransaction capabilities
coordinatesUSACHCoordinates ou BRMockCoordinates ou BRPixKeyCoordinatesobrigatórioRail-specific coordinates
directionalityDirectionalityobrigatórioSupported fund directions
metadataobject, opcionalOptional free-form metadata (max 8KB)
modePaymentMethodModeobrigatórioHow the payment method was provisioned
providerProviderInfoobrigatórioProvider information
railRailobrigatórioPayment rail (ACH, PIX, WIRE, etc.)
schemeSchemeobrigatórioPayment scheme within the rail
statusPaymentMethodStatusobrigatórioInitial status
verificationVerificationobrigatórioVerification state

PaymentMethodResponse

Response for a payment method with masked coordinates.

CampoTipoDetalhe
account_idstringobrigatórioAccount this payment method is bound to
capabilitiesCapabilitiesobrigatórioTransaction capabilities
coordinatesUSACHCoordinatesResponse ou BRMockCoordinatesResponse ou BRPixKeyCoordinatesResponseobrigatórioMasked coordinates
created_atstringobrigatórioISO 8601 creation timestamp
directionalityDirectionalityobrigatórioSupported fund directions
metadataobject, opcionalFree-form metadata
modePaymentMethodModeobrigatórioProvisioning mode
payment_method_idstringobrigatórioUnique payment method identifier
providerProviderInfoobrigatórioProvider information
railRailobrigatórioPayment rail
schemeSchemeobrigatórioPayment scheme
statusPaymentMethodStatusobrigatórioPayment method status
updated_atstringobrigatórioISO 8601 last update timestamp
verificationVerificationobrigatórioVerification state

PaymentMethodStatus

Payment method lifecycle status.

Um de: ACTIVE, PENDING_VERIFICATION, SUSPENDED, CLOSED

ProviderInfo

Provider information for externally allocated payment methods.

CampoTipoDetalhe
provider_idstringobrigatórioUnique identifier for the provider
typeProviderTypeobrigatórioProvider type: SPONSOR_BANK or BAAS_PROVIDER

Rail

Payment rail.

Um de: ACH, PIX, EFT_CA, WIRE, SEPA, MOCK

ReconstructedPosition

One position of the reconstructed set (balance ``include=positions`` under as_of).

CampoTipoDetalhe
assetstring, opcional
position_idstringobrigatório
statestring, opcional
valueintegerobrigatório

Reconstruction

Provenance block for an as-of balance reconstruction (D1: commit-time basis).

CampoTipoDetalhe
as_of_seqintegerobrigatório
basisstringPadrão "commit_time"
entries_replayedintegerobrigatório
journal_head_seqintegerobrigatório

Scheme

Payment scheme within a rail.

Um de: US_ACH, BR_PIX_KEY, BR_BANK_ACCOUNT, CA_TRANSIT, BR_MOCK

StatementLine

One netted line per confirmed transaction (custody layer, this account).

CampoTipoDetalhe
accounting_daystringobrigatórioAmérica/São_Paulo (−03:00) accounting day the tx applies to
amount_centsintegerobrigatórioAbsolute net amount for this tx in minor units
assetstringobrigatórioCustody asset (QBRL)
correlationStatementCorrelationsqd_id / swp_id / evidence_id where applicable
direction"CREDIT" | "DEBIT"obrigatórioCREDIT = money in (DR), DEBIT = money out (CR)
effective_atstringobrigatórioBusiness-time instant the tx applies to (ISO 8601)
event_kindstring, opcionalEntry-set classification (TRANSFER_INTERNAL, DEPOSIT, SQUAD_SETTLE, ...)
obligation_idsarray de stringBacking obligations (obl_*)
tx_idstringobrigatórioConfirmed Hydra transaction hash (groups feed legs; sum-per-tx_id)

StatementPeriod

The requested statement window, echoed back with its accounting timezone.

CampoTipoDetalhe
fromstringobrigatórioInclusive start accounting day (yyyy-mm-dd, América/São_Paulo)
timezonestringAccounting-day timezone (fixed −03:00, no DST)Padrão "America/Sao_Paulo"
tostringobrigatórioInclusive end accounting day (yyyy-mm-dd, América/São_Paulo)

StatementReconciliation

Live-balance cross-check; emitted only for a period ending today or later.

CampoTipoDetalhe
live_balance_centsintegerobrigatórioCurrent available balance (sum of unspent custody UTxOs)
matchesbooleanobrigatórioclosing_balance_cents == live_balance_cents (RFC-025 §8 guarantee)

StatementResponse

A formal account statement for a date range (json; csv = one row per line).

CampoTipoDetalhe
account_idstringobrigatórioAccount the statement is for
closing_balance_centsintegerobrigatórioopening_balance_cents + period net
feesnão declarado, opcionalReserved (null): no fee primitive exists in Core yet
holdsnão declarado, opcionalReserved (null): hold balances are not surfaced in the statement yet
linesarray de StatementLineobrigatórioPer-tx netted lines, chronological (effective time)
opening_balance_centsintegerobrigatórioCumulative net from the opening epoch up to (excluding) 'from'
periodStatementPeriodobrigatórioThe requested window + accounting timezone
reconciliationStatementReconciliation, opcionalPresent only when 'to' ≥ today (São Paulo)
totalsStatementTotalsobrigatórioPeriod aggregates

StatementTotals

Period aggregates over the statement lines.

CampoTipoDetalhe
credits_centsintegerobrigatórioSum of CREDIT line amounts
debits_centsintegerobrigatórioSum of DEBIT line amounts
line_countintegerobrigatórioNumber of statement lines
net_centsintegerobrigatóriocredits_cents − debits_cents

TransactionItem

A single entry in an account's transaction feed.

CampoTipoDetalhe
amountintegerobrigatórioAmount in minor units (cents)
counterparty_account_idstring, opcionalThe other account in the event, if any
counterparty_display_namestring, opcionalOwner party display name of the counterparty (best-effort)
created_atstringobrigatórioISO 8601 event timestamp
currencystringobrigatórioISO 4217 currency code
directionTransactionDirectionobrigatórioCREDIT (value in) or DEBIT (value out) for this account
effective_atstringobrigatórioISO 8601 business-time instant this entry applies to (effective dating). Equals created_at unless the rail or an operator asserted a different business date (e.g. a backdated devolução).
idstringobrigatórioReference id of the underlying event (obl_* or swp_*)
railstring, opcionalPayment rail family (QUADRA, ACH, ...) for obligation events
ref_kindstringobrigatórioKind of underlying event: 'obligation' or 'safeswap'
statusTransactionStatusobrigatórioCurrent settlement status
tx_idstring, opcionalOn-chain transaction id that produced this entry. Entries sharing one tx_id are legs of a single transaction (e.g. several squad debts settled in one settle tx) — group by it to render them as one transaction.
typestringobrigatórioEvent type: DEPOSIT, TRANSFER, SAFESWAP_LOCKED, SAFESWAP_RELEASED, SAFESWAP_REFUNDED

TransactionListResponse

Paginated, reverse-chronological transaction feed for an account.

CampoTipoDetalhe
itemsarray de TransactionItemobrigatórioActivity entries, newest first
next_cursorstring, opcionalCursor for the next page; null when no more pages
unitstringUnit of transaction amountsPadrão "cents"

ValidationError

CampoTipoDetalhe
ctxobject
inputnão declarado
locarray de string ou integerobrigatório
msgstringobrigatório
typestringobrigatório

Verification

Verification state for a payment method.

CampoTipoDetalhe
statusVerificationStatusobrigatórioCurrent verification status