SonaCORE

Referência / Quadra Command API

Obligations

5 operações em Quadra Command API 0.2.0.

GET/v1/obligations

List Obligations

List obligations with optional filters and cursor-based pagination.

Filters: state, resolution_outcome, rail_family, created_from, created_to, effective_from, effective_to (business time), match_key.client_reference, match_key.rail_ref.

Parâmetros

NomeTipoDetalhe
statestring, opcionalquery
resolution_outcomestring, opcionalquery
railstring, opcionalquery
created_fromstring, opcionalquery
created_tostring, opcionalquery
effective_fromstring, opcionalquery
effective_tostring, opcionalquery
match_key.client_referencestring, opcionalquery
match_key.rail_refstring, opcionalquery
limitintegerquery
cursorstring, opcionalquery

Respostas

StatusCorpoDetalhe
200ObligationListResponseResposta bem-sucedida
422HTTPValidationErrorErro de validação
POST/v1/obligations

Create a Transfer Obligation

Create a transfer obligation between two Quadra accounts.

For INTERNAL / atomic transfers, the Hydra L2 transaction is submitted and the obligation is returned in state PENDING. Hydra confirms or rejects transactions asynchronously, so the caller must poll GET /v1/obligations/{id} to determine the final resolution.

Requires an Idempotency-Key header.

Parâmetros

NomeTipoDetalhe
Idempotency-Keystringheaderobrigatório

Corpo da requisição

CreateObligationRequest — 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/obligations/{obligation_id}

Get an Obligation

Retrieve an obligation by its obligation ID.

Accepts both logical obligation IDs (``obl_*``) and legacy UTXO-based IDs (``txhash_index``).

State lifecycle: - OPEN — the obligation was created and the Hydra tx submitted, awaiting confirmation. - RESOLVED — the head-indexer confirmed or rejected the tx. Check resolution_outcome for SETTLED, FAILED, or CANCELED.

Parâmetros

NomeTipoDetalhe
obligation_idstringpathobrigatório

Respostas

StatusCorpoDetalhe
200ObligationResponseResposta bem-sucedida
422HTTPValidationErrorErro de validação
PATCH/v1/obligations/{obligation_id}/match-keys

Update match keys on an Obligation

Add or update match_keys on an existing obligation.

Only `rail_ref` and `client_reference` are accepted keys. New values are merged with existing match_keys (overriding on conflict).

Parâmetros

NomeTipoDetalhe
obligation_idstringpathobrigatório

Corpo da requisição

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

Respostas

StatusCorpoDetalhe
200Resposta 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/obligations/{obligation_id}/timeline

Get Obligation Timeline

Retrieve the full lifecycle timeline of an obligation.

Reconstructs events from all UTXOs (including spent ones) associated with the given obligation ID. Returns a chronologically-ordered list of state transition events.

Parâmetros

NomeTipoDetalhe
obligation_idstringpathobrigatório

Respostas

StatusCorpoDetalhe
200ObligationTimelineResponseResposta 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.

AmountField

CampoTipoDetalhe
currencystringobrigatórioISO 4217 currency code (e.g., 'BRL')
valueintegerobrigatórioAmount in centavos (e.g., 2500 = R$25.00)

CreateObligationRequest

CampoTipoDetalhe
amountAmountFieldobrigatório
creditorDebtorCreditorobrigatório
debtorDebtorCreditorobrigatório
expected_settlementExpectedSettlement, opcionalExpected settlement window
match_keysobject, opcionalKeys for matching evidence to this obligation
metadataobject, opcionalFree-form metadata
railRailFamilyobrigatório

DebtorCreditor

CampoTipoDetalhe
account_idstring, opcionalQuadra account ID (e.g., 'acc_...')
external_idstring, opcionalExternal entity identifier (for kind='external')
kindstringobrigatórioEntity kind: 'account' or 'external'

ExpectedSettlement

CampoTipoDetalhe
windowstringobrigatórioExpected settlement window (e.g., 'T+1', 'T+2')

HTTPValidationError

CampoTipoDetalhe
detailarray de ValidationError

ObligationException

CampoTipoDetalhe
descriptionstringobrigatórioHuman-readable description of the exception
evidence_amountAmountDetail, opcionalAmount from the evidence that triggered this exception
matched_obligation_idstring, opcionalID of the matched obligation (for AMOUNT_MISMATCH)
obligation_amountAmountDetail, opcionalAmount of the matched obligation (for AMOUNT_MISMATCH)
trace_numberstring, opcionalTrace number from the evidence
typestringobrigatórioException type, e.g. AMOUNT_MISMATCH, UNMATCHED_SETTLEMENT

ObligationListItem

CampoTipoDetalhe
adapter_refstring, opcional
amountinteger, opcional
created_atstring, opcional
creditor_account_idstring, opcional
currencystring, opcional
debtor_account_idstring, opcional
dispatch_attemptsinteger, opcional
dispatch_errorstring, opcional
dispatch_statusstring, opcional
dispatched_atstring, opcional
effective_atstring, opcional
obligation_idstringobrigatório
pending_dispatchboolean, opcional
railstring, opcional
resolution_outcomestring, opcional
stateObligationStateobrigatório

ObligationListResponse

CampoTipoDetalhe
itemsarray de ObligationListItemobrigatório
next_cursorstring, opcional

ObligationResponse

CampoTipoDetalhe
adapter_refstring, opcional
amountinteger, opcional
created_atstring, opcional
creditor_account_idstring, opcional
currencystring, opcional
debtor_account_idstring, opcional
dispatch_attemptsinteger, opcional
dispatch_errorstring, opcional
dispatch_statusstring, opcional
dispatched_atstring, opcional
effective_atstring, opcional
evidence_idstring, opcional
exceptionObligationException, opcional
expected_settlementobject, opcional
external_idstring, opcional
indexed_atstring, opcional
match_keysobject, opcional
metadataobject, opcional
obligation_idstringobrigatório
pending_dispatchboolean, opcional
railstring, opcional
resolution_outcomestring, opcional
resolution_reasonstring, opcional
resolved_atstring, opcional
rolestring, opcional
stateObligationStateobrigatório
state_historyarray de object, opcional
typestring, opcional
utxo_idstring, opcional

ObligationState

Um de: OPEN, FINAL, PENDING, EXCEPTION

ObligationTimelineResponse

CampoTipoDetalhe
obligation_idstringobrigatório
timelinearray de TimelineEventobrigatório

RailFamily

Um de: QUADRA, ACH, MOCK, PIX

TimelineEvent

CampoTipoDetalhe
eventstringobrigatório
journalTimelineJournalRef, opcional
transaction_idstring, opcional
updated_atstringobrigatório

UpdateMatchKeysRequest

CampoTipoDetalhe
match_keysobjectobrigatórioArbitrary key-value pairs for matching evidence to this obligation (all values must be strings)

ValidationError

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