GL Entries
4 operações em Quadra Core API 0.5.0.
/v1/gl/entriesList journal-entry legs by account or GL node
Auditor leg feed over the DR/CR read model (RFC-025).
Requires exactly one of ``account_id`` or ``gl_node_id``. The two modes paginate on different indexes — their cursors are index-specific and must never cross (laas-04 lore).
Raises: 400: INVALID_QUERY (neither/both of account_id and gl_node_id) or Invalid cursor
Parâmetros
| Nome | Tipo | Detalhe |
|---|---|---|
| account_id | string, opcional | query Leg feed for one account (GSI1 mode) |
| gl_node_id | string, opcional | query Leg feed for one COA node (GSI2 mode) |
| effective_from | string, opcional | query Inclusive lower bound on effective_at (ISO 8601) |
| effective_to | string, opcional | query Inclusive upper bound on effective_at (ISO 8601) |
| layer | string, opcional | query Filter legs by layer |
| limit | integer | query |
| cursor | string, opcional | query |
Respostas
| Status | Corpo | Detalhe |
|---|---|---|
| 200 | GLEntryLegListResponse | Resposta bem-sucedida |
| 422 | HTTPValidationError | Erro de validação |
/v1/gl/entries/{tx_hash}Entry-set drill-down for one confirmed transaction
Full entry set (header + legs) for one confirmed Hydra transaction.
A refused transaction (projection EXCEPTION marker, no SET header) returns 200 with ``exception`` populated and no legs — auditors must see refusals; only a completely unknown tx_hash is a 404.
Raises: 404: NOT_FOUND (no entry set and no refusal marker for tx_hash)
Parâmetros
| Nome | Tipo | Detalhe |
|---|---|---|
| tx_hash | string | pathobrigatório |
Respostas
| Status | Corpo | Detalhe |
|---|---|---|
| 200 | GLEntrySetResponse | Resposta bem-sucedida |
| 422 | HTTPValidationError | Erro de validação |
/v1/gl/mapping-rulesCurrent transaction-type→node mapping ruleset
The CURRENT mapping ruleset. Version 0 with no rules means no operator ruleset has been appended yet — the built-in per-account-type defaults apply (RFC-025). Rule changes are prospective-only; entries stamp the ruleset_version they were projected under.
Respostas
| Status | Corpo | Detalhe |
|---|---|---|
| 200 | GLMappingRulesetResponse | Resposta bem-sucedida |
/v1/gl/trial-balanceTrial balance over an accounting-day range
Per-node DR/CR/net over the rollup counters (a Query per node — no scans) plus the graph-wide zero-sum flag. CUSTODY sums to zero by UTxO conservation; MEMO by the gl_squad_obligations counter-legs (RFC-025).
Raises: 400: INVALID_QUERY (from > to)
Parâmetros
| Nome | Tipo | Detalhe |
|---|---|---|
| from | string | queryobrigatório Inclusive start accounting day (América/São_Paulo) |
| to | string | queryobrigatório Inclusive end accounting day (América/São_Paulo) |
| layer | string | query CUSTODY (default) or MEMO |
Respostas
| Status | Corpo | Detalhe |
|---|---|---|
| 200 | GLTrialBalanceResponse | 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.
GLEntryLeg
One DR/CR leg of a projected entry set — a per-account net flow per asset.
| Campo | Tipo | Detalhe |
|---|---|---|
| account_id | string | obrigatórioAccount the value moved in/out of |
| accounting_day | string, opcional | América/São_Paulo (−03:00) accounting day |
| amount_cents | integer | obrigatórioAbsolute leg amount in minor units |
| asset | string | obrigatórioQBRL or VQBRL#<policy_hash> |
| direction | "DR" | "CR" | obrigatórioDR = value in, CR = value out |
| effective_at | string | obrigatórioEntry-set effective timestamp (ISO 8601) |
| event_kind | string, opcional | Entry-set classification (TRANSFER_INTERNAL, DEPOSIT, ...) |
| gl_node_id | string | obrigatórioCOA node the leg is classified to |
| layer | "CUSTODY" | "MEMO" | obrigatórioCUSTODY (QBRL) or MEMO (per-squad vQBRL) |
| leg | integer | obrigatórioLeg ordinal within the set (ordered over sorted account_id) |
| obligation_id | string, opcional | Backing obligation (obl_*) where one exists |
| tx_hash | string | obrigatórioConfirmed Hydra transaction hash (entry-set id; cross-refs the journal) |
GLEntryLegListResponse
Cursor-paginated leg feed (by account or by GL node).
| Campo | Tipo | Detalhe |
|---|---|---|
| items | array de GLEntryLeg | obrigatórioLeg rows, effective-time ordered |
| next_cursor | string, opcional | Opaque cursor; null when no more pages |
GLEntrySetException
Refusal marker for a transaction whose entry set could not be projected.
| Campo | Tipo | Detalhe |
|---|---|---|
| confirmed_at | string, opcional | When the refusal was recorded |
| detail | object, opcional | Refusal specifics (imbalances, offending UTxOs) |
| reason | string | obrigatórioWhy the set was refused (UNBALANCED, UNATTRIBUTABLE, ...) |
GLEntrySetResponse
Entry-set drill-down: header + legs (or the refusal marker).
| Campo | Tipo | Detalhe |
|---|---|---|
| accounting_day | string, opcional | América/São_Paulo (−03:00) accounting day |
| balanced | boolean, opcional | DR=CR held per (asset, layer) — always true for written sets |
| confirmed_at | string, opcional | Snapshot confirmation timestamp |
| correlation | object, opcional | sqd_id / swp_instance_id / evidence_id where applicable |
| effective_at | string, opcional | Entry-set effective timestamp (ISO 8601) |
| event_kind | string, opcional | Null when the set was refused (exception present) |
| exception | GLEntrySetException, opcional | Present iff the set was refused |
| layer_totals | object | Per-'<asset>|<layer>' DR/CR totals |
| legs | array de GLEntryLeg | Ordinal-ordered legs |
| obligation_ids | array de string | Backing obligations (obl_*) |
| ruleset_version | integer, opcional | Mapping-ruleset version stamped at projection |
| tx_hash | string | obrigatórioConfirmed Hydra transaction hash |
GLMappingRule
One ordered mapping rule: match → COA node.
| Campo | Tipo | Detalhe |
|---|---|---|
| gl_node_id | string | obrigatórioTarget COA node for matching legs |
| match | GLMappingRuleMatch | obrigatórioConditions (missing key = wildcard) |
GLMappingRulesetResponse
The CURRENT transaction-type→node mapping ruleset (versioned, prospective-only).
| Campo | Tipo | Detalhe |
|---|---|---|
| created_at | string, opcional | When this version was appended |
| created_by | string, opcional | Operator client id that appended it |
| rules | array de GLMappingRule | Ordered, first-match-wins |
| version | integer | obrigatório0 = no operator ruleset yet (built-in per-type defaults apply) |
GLTrialBalanceNode
One COA node's aggregate over the queried period/layer.
| Campo | Tipo | Detalhe |
|---|---|---|
| cr_cents | integer | obrigatórioSum of CR over the period |
| dr_cents | integer | obrigatórioSum of DR over the period |
| entry_count | integer | obrigatórioEntry sets that touched this node in the period |
| gl_node_id | string | obrigatórioCOA node id (GL account row) |
| name | string, opcional | Human-readable node name |
| net_cents | integer | obrigatóriodr−cr for DR-normal nodes, cr−dr for CR-normal (D2 rendering) |
| normal_balance | string, opcional | Normal balance side (DR|CR) |
| parent_account_id | string, opcional | Parent GL node (sub-GL accounts) |
| type | string, opcional | Node type (ASSET, LIABILITY, TRANSIT, REVENUE, EXCEPTION) |
GLTrialBalanceResponse
Trial balance over an accounting-day range (rollup-Query-backed, no scans).
| Campo | Tipo | Detalhe |
|---|---|---|
| cr_total_cents | integer | obrigatórioGraph-wide CR total for the layer/period |
| dr_total_cents | integer | obrigatórioGraph-wide DR total for the layer/period |
| from | string | obrigatórioInclusive start accounting day (yyyy-mm-dd) |
| layer | string | obrigatórioCUSTODY (default) or MEMO |
| nodes | array de GLTrialBalanceNode | obrigatórioPer-node aggregates |
| to | string | obrigatórioInclusive end accounting day (yyyy-mm-dd) |
| zero_sum | boolean | obrigatóriodr_total == cr_total (the graph-wide invariant, raw dr/cr) |
HTTPValidationError
| Campo | Tipo | Detalhe |
|---|---|---|
| detail | array de ValidationError |
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 |