Products
5 operações em Quadra Core API 0.5.0.
/v1/accounts/{account_id}/product-instancesList 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
| Nome | Tipo | Detalhe |
|---|---|---|
| account_id | string | pathobrigatório |
| product_id | string, opcional | query Filter to one product |
| open_only | boolean | query |
| limit | integer | query |
| cursor | string, opcional | query |
Respostas
| Status | Corpo | Detalhe |
|---|---|---|
| 200 | ProductInstanceListResponse | Resposta bem-sucedida |
| 422 | HTTPValidationError | Erro de validação |
/v1/productsList 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
| Nome | Tipo | Detalhe |
|---|---|---|
| lifecycle | string, opcional | query Filter by lifecycle state |
| limit | integer | query |
| cursor | string, opcional | query |
Respostas
| Status | Corpo | Detalhe |
|---|---|---|
| 200 | ProductListResponse | Resposta bem-sucedida |
| 422 | HTTPValidationError | Erro de validação |
/v1/products/{product_id}Get one bound product
Parâmetros
| Nome | Tipo | Detalhe |
|---|---|---|
| product_id | string | pathobrigatório |
Respostas
| Status | Corpo | Detalhe |
|---|---|---|
| 200 | ProductSummary | Resposta bem-sucedida |
| 422 | HTTPValidationError | Erro de validação |
/v1/products/{product_id}/instancesList a product's instances
Parâmetros
| Nome | Tipo | Detalhe |
|---|---|---|
| product_id | string | pathobrigatório |
| state | string, opcional | query Filter by product_state |
| open_only | boolean | query Exclude closed instances |
| limit | integer | query |
| cursor | string, opcional | query |
Respostas
| Status | Corpo | Detalhe |
|---|---|---|
| 200 | ProductInstanceListResponse | Resposta bem-sucedida |
| 422 | HTTPValidationError | Erro de validação |
/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
| Nome | Tipo | Detalhe |
|---|---|---|
| product_id | string | pathobrigatório |
| instance_id | string | pathobrigatório |
Respostas
| Status | Corpo | Detalhe |
|---|---|---|
| 200 | ProductInstanceDetailResponse | Resposta bem-sucedida |
| 422 | HTTPValidationError | Erro 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
| Campo | Tipo | Detalhe |
|---|---|---|
| detail | array de ValidationError |
ProductInstanceDetailResponse
| Campo | Tipo | Detalhe |
|---|---|---|
| instance | ProductInstanceSummary | obrigatório |
| timeline | array de ProductInstanceTransition | Padrão [] |
ProductInstanceListResponse
| Campo | Tipo | Detalhe |
|---|---|---|
| items | array de ProductInstanceSummary | obrigatório |
| next_cursor | string, opcional |
ProductInstanceSummary
| Campo | Tipo | Detalhe |
|---|---|---|
| account_id | string | obrigatório |
| amount | ProductAmount | obrigatório |
| closed | boolean | obrigatório |
| created_at_utc | string, opcional | |
| instance_id | string | obrigatório |
| latest_action | string, opcional | |
| product_id | string | obrigatório |
| state | string | obrigatório |
| updated_at_utc | string, 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.
| Campo | Tipo | Detalhe |
|---|---|---|
| action | string, opcional | |
| awaiting_index | boolean | Padrão false |
| created_at | string, opcional | |
| datum | object | Padrão {} |
| obligation_id | string, opcional | |
| product_state | string, opcional | |
| spent | boolean | Padrão false |
| state | string, opcional | |
| transaction_id | string | obrigatório |
ProductListResponse
| Campo | Tipo | Detalhe |
|---|---|---|
| items | array de ProductSummary | obrigatório |
| next_cursor | string, opcional |
ProductSummary
One bound product, as its owning tenant sees it.
| Campo | Tipo | Detalhe |
|---|---|---|
| actions | object | Padrão {} |
| address | string | obrigatório |
| artifact_hash | string, opcional | |
| ir_version | integer | obrigatório |
| lifecycle | string | obrigatório |
| product_id | string | obrigatório |
| release_targets | array de string | Padrão [] |
| script_hash | string | obrigatório |
| tenant | string | obrigatório |
| updated_at | string, opcional | |
| version | integer | obrigatório |
ValidationError
| Campo | Tipo | Detalhe |
|---|---|---|
| ctx | object | |
| input | não declarado | |
| loc | array de string ou integer | obrigatório |
| msg | string | obrigatório |
| type | string | obrigatório |