SonaCORE

Referência / Quadra Core API

Products

5 operações em Quadra Core API 0.5.0.

GET/v1/accounts/{account_id}/product-instances

List an account's product instances

⛔ The boundary here is **account ownership**, not the tenant filter.

This partition is keyed by an account the caller named, and its rows would pass a tenant filter for every account inside the caller's own tenant. So it gates on ``require_visible_account``, which reads through the guarded ``get_account`` and 404s identically for "not yours" and "never existed" — the laas-64 rule for every ``account_id`` branch.

Parâmetros

NomeTipoDetalhe
account_idstringpathobrigatório
product_idstring, opcionalquery Filter to one product
open_onlybooleanquery
limitintegerquery
cursorstring, opcionalquery

Respostas

StatusCorpoDetalhe
200ProductInstanceListResponseResposta bem-sucedida
422HTTPValidationErrorErro de validação
GET/v1/products

List the products bound to the caller's tenant

A tenant's own catalog.

⟲ *LaaS-77:* ``quadra-escrow`` now appears, for the tenants that have bound it — SafeSwap is catalog product #1 and these routes genuinely drive it. What a product is listed *by* is its binding row, so the rule is unchanged and ``quadra-squad`` is still absent: it has no row, and listing it would advertise a surface these routes cannot drive (laas-91 is where it gets one).

Parâmetros

NomeTipoDetalhe
lifecyclestring, opcionalquery Filter by lifecycle state
limitintegerquery
cursorstring, opcionalquery

Respostas

StatusCorpoDetalhe
200ProductListResponseResposta bem-sucedida
422HTTPValidationErrorErro de validação
GET/v1/products/{product_id}

Get one bound product

Parâmetros

NomeTipoDetalhe
product_idstringpathobrigatório

Respostas

StatusCorpoDetalhe
200ProductSummaryResposta bem-sucedida
422HTTPValidationErrorErro de validação
GET/v1/products/{product_id}/instances

List a product's instances

Parâmetros

NomeTipoDetalhe
product_idstringpathobrigatório
statestring, opcionalquery Filter by product_state
open_onlybooleanquery Exclude closed instances
limitintegerquery
cursorstring, opcionalquery

Respostas

StatusCorpoDetalhe
200ProductInstanceListResponseResposta bem-sucedida
422HTTPValidationErrorErro de validação
GET/v1/products/{product_id}/instances/{instance_id}

Get one product instance and its on-chain timeline

The instance index row plus every product UTxO it has ever had.

⛔ **The timeline is NOT filtered to this product**, and that is a correction rather than an omission. A close writes its release output as a **custody** row — the value has left the product — so filtering on ``product_id`` drops the terminal transition and a closed instance's history stops at whatever state preceded it. The devlocal run is what showed it: three transitions, two rows.

The boundary is elsewhere and is not weakened by that. The index row is tenant-guarded at the accessor and its ``product_id`` must match the path, so a caller reaches this line only for an instance of a product already shown to be theirs; every row GSI4 returns belongs to that instance by key; and each row is still put through the same tenant predicate, which permits an un-attributed row exactly as ``tenant_owned`` does (the obligation-first window writes one before head-indexer stamps it).

⟲ *LaaS-77:* an instance created through a product's **own** bespoke routes has no index row — that row is written by the write path — so the summary is projected from the obligation rows when it is absent. One product, one set of instances, whichever surface created them.

Parâmetros

NomeTipoDetalhe
product_idstringpathobrigatório
instance_idstringpathobrigatório

Respostas

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

HTTPValidationError

CampoTipoDetalhe
detailarray de ValidationError

ProductInstanceDetailResponse

CampoTipoDetalhe
instanceProductInstanceSummaryobrigatório
timelinearray de ProductInstanceTransitionPadrão []

ProductInstanceListResponse

CampoTipoDetalhe
itemsarray de ProductInstanceSummaryobrigatório
next_cursorstring, opcional

ProductInstanceSummary

CampoTipoDetalhe
account_idstringobrigatório
amountProductAmountobrigatório
closedbooleanobrigatório
created_at_utcstring, opcional
instance_idstringobrigatório
latest_actionstring, opcional
product_idstringobrigatório
statestringobrigatório
updated_at_utcstring, opcional

ProductInstanceTransition

One step of an instance's on-chain lifecycle, off GSI4. ⚠️ Both live and spent rows appear: ``mark_obligation_spent`` preserves the GSI4 keys precisely so the full timeline stays walkable after the UTxO is consumed. ``spent`` is how a reader tells the current row from its history.

CampoTipoDetalhe
actionstring, opcional
awaiting_indexbooleanPadrão false
created_atstring, opcional
datumobjectPadrão {}
obligation_idstring, opcional
product_statestring, opcional
spentbooleanPadrão false
statestring, opcional
transaction_idstringobrigatório

ProductListResponse

CampoTipoDetalhe
itemsarray de ProductSummaryobrigatório
next_cursorstring, opcional

ProductSummary

One bound product, as its owning tenant sees it.

CampoTipoDetalhe
actionsobjectPadrão {}
addressstringobrigatório
artifact_hashstring, opcional
ir_versionintegerobrigatório
lifecyclestringobrigatório
product_idstringobrigatório
release_targetsarray de stringPadrão []
script_hashstringobrigatório
tenantstringobrigatório
updated_atstring, opcional
versionintegerobrigatório

ValidationError

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