Schemas
Draft contract · no live API. Generated from OpenAPI 3.1.1, version 1.0.0-draft.
Download the exact YAML. SHA-256: edb36682e0c124e1a67cfc6213ed93dcfa2494e84c63f79181ae7ed12f9851e7.
All schema constraints below are copied from the pinned contract. Local $ref values refer to entries on this page.
Company
Section titled “Company”Explicit safe company projection. LK/SG pilot only. Country is authoritative company configuration, never inferred from locale; no bank/contact/person fields. Other country providers remain outside this pilot.
{ "type": "object", "additionalProperties": false, "required": [ "id", "code", "legalName", "country", "baseCurrency", "timeZone" ], "properties": { "id": { "type": "string", "format": "uuid" }, "code": { "type": "string", "minLength": 1, "maxLength": 20, "pattern": "^[A-Z0-9][A-Z0-9-]{1,19}$" }, "legalName": { "type": "string", "minLength": 1, "maxLength": 200 }, "country": { "type": "string", "enum": [ "LK", "SG" ] }, "baseCurrency": { "type": "string", "enum": [ "LKR", "SGD" ] }, "timeZone": { "type": "string", "minLength": 1, "maxLength": 64 } }, "description": "Explicit safe company projection. LK/SG pilot only. Country is authoritative company configuration, never inferred from locale; no bank/contact/person fields. Other country providers remain outside this pilot."}LedgerAccount
Section titled “LedgerAccount”Safe ordinary chart definitions only; omit private and party/control accounts and any revealing names/roles on the admitted base. draftEligible is current advisory eligibility, rechecked at write; no balances.
{ "type": "object", "additionalProperties": false, "required": [ "id", "companyId", "code", "name", "type", "status", "isGroup", "draftEligible" ], "properties": { "id": { "type": "string", "format": "uuid" }, "companyId": { "type": "string", "format": "uuid" }, "code": { "type": "string", "minLength": 1, "maxLength": 32 }, "name": { "type": "string", "minLength": 1, "maxLength": 200 }, "type": { "type": "string", "enum": [ "ASSET", "LIABILITY", "EQUITY", "INCOME", "EXPENSE" ] }, "status": { "type": "string", "enum": [ "ACTIVE", "INACTIVE" ] }, "isGroup": { "type": "boolean" }, "draftEligible": { "type": "boolean" } }, "description": "Safe ordinary chart definitions only; omit private and party/control accounts and any revealing names/roles on the admitted base. draftEligible is current advisory eligibility, rechecked at write; no balances."}LedgerPeriod
Section titled “LedgerPeriod”Dates are inclusive. Projection carries no totals. Period 13 may be listed but cannot be used by this draft POST.
{ "type": "object", "additionalProperties": false, "required": [ "id", "companyId", "fiscalYearId", "periodNumber", "startDate", "endDate", "state" ], "properties": { "id": { "type": "string", "format": "uuid" }, "companyId": { "type": "string", "format": "uuid" }, "fiscalYearId": { "type": "string", "format": "uuid" }, "periodNumber": { "type": "integer", "minimum": 1, "maximum": 13 }, "startDate": { "type": "string", "format": "date", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" }, "endDate": { "type": "string", "format": "date", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" }, "state": { "type": "string", "enum": [ "OPEN", "SOFT_CLOSED", "CLOSED" ] } }, "description": "Dates are inclusive. Projection carries no totals. Period 13 may be listed but cannot be used by this draft POST."}{ "type": "object", "additionalProperties": false, "required": [ "amount", "currency" ], "properties": { "amount": { "type": "string", "pattern": "^(0|[1-9][0-9]{0,14})\\.[0-9]{2}$", "not": { "const": "0.00" }, "maxLength": 18, "description": "Positive amount, fixed scale 2 for this LKR/SGD-only pilot, range 0.01–999999999999999.99. No sign, exponent, commas, leading zeros or rounding. Precision violations reject; zero rejects. This does not define the scale of future currencies." }, "currency": { "type": "string", "enum": [ "LKR", "SGD" ], "description": "Must equal the selected company base currency for every line; no FX conversion." } }}JournalDraftLine
Section titled “JournalDraftLine”Ordinary active non-group draft-eligible account in the path company. No party, dimensions, counterparty or private/control-account authority.
{ "type": "object", "additionalProperties": false, "required": [ "accountId", "side", "money" ], "properties": { "accountId": { "type": "string", "format": "uuid" }, "side": { "type": "string", "enum": [ "DEBIT", "CREDIT" ] }, "money": { "$ref": "#/components/schemas/Money" }, "description": { "type": "string", "minLength": 1, "maxLength": 500 } }, "description": "Ordinary active non-group draft-eligible account in the path company. No party, dimensions, counterparty or private/control-account authority."}JournalDraftRequest
Section titled “JournalDraftRequest”Proposed narrow complete ordinary MANUAL draft. Exact decimal debit and credit totals must balance; each side total must not exceed 999999999999999.99. postingDate must identify an ordinary OPEN company period; period 13, auto-reversal, opening/import and source authority fields are not accepted. Store via existing user draft service; creation is not posting or validation of a later submission. Body max 1 MiB, UTF-8 JSON with duplicate keys rejected.
{ "type": "object", "additionalProperties": false, "required": [ "postingDate", "narration", "lines" ], "properties": { "postingDate": { "type": "string", "format": "date", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" }, "narration": { "type": "string", "minLength": 1, "maxLength": 500 }, "lines": { "type": "array", "minItems": 2, "maxItems": 200, "items": { "$ref": "#/components/schemas/JournalDraftLine" } } }, "description": "Proposed narrow complete ordinary MANUAL draft. Exact decimal debit and credit totals must balance; each side total must not exceed 999999999999999.99. postingDate must identify an ordinary OPEN company period; period 13, auto-reversal, opening/import and source authority fields are not accepted. Store via existing user draft service; creation is not posting or validation of a later submission. Body max 1 MiB, UTF-8 JSON with duplicate keys rejected."}JournalDraftCreated
Section titled “JournalDraftCreated”{ "type": "object", "additionalProperties": false, "required": [ "id", "companyId", "version", "status" ], "properties": { "id": { "type": "string", "format": "uuid" }, "companyId": { "type": "string", "format": "uuid" }, "version": { "type": "integer", "minimum": 1 }, "status": { "type": "string", "const": "DRAFT" } }}FieldError
Section titled “FieldError”JSON Pointer and safe stable code only. Never echo submitted values, SQL or inaccessible identifiers.
{ "type": "object", "additionalProperties": false, "required": [ "pointer", "code" ], "properties": { "pointer": { "type": "string", "minLength": 1, "maxLength": 200, "pattern": "^(/[^\\s]*)?$" }, "code": { "type": "string", "minLength": 1, "maxLength": 64, "pattern": "^[A-Z][A-Z0-9_]*$" } }, "description": "JSON Pointer and safe stable code only. Never echo submitted values, SQL or inaccessible identifiers."}Problem
Section titled “Problem”application/problem+json. status equals HTTP status. Safe opaque instance, no private values or existence clues. Type is stable urn:ginum:problem:
{ "type": "object", "additionalProperties": false, "required": [ "type", "title", "status", "code", "requestId", "retryable" ], "properties": { "type": { "type": "string", "format": "uri" }, "title": { "type": "string", "minLength": 1, "maxLength": 160 }, "status": { "type": "integer", "minimum": 400, "maximum": 599 }, "detail": { "type": "string", "minLength": 1, "maxLength": 500 }, "instance": { "type": "string", "format": "uri-reference", "maxLength": 200 }, "code": { "type": "string", "minLength": 1, "maxLength": 64, "pattern": "^[A-Z][A-Z0-9_]*$" }, "requestId": { "type": "string", "format": "uuid" }, "retryable": { "type": "boolean" }, "errors": { "type": "array", "maxItems": 20, "items": { "$ref": "#/components/schemas/FieldError" } } }, "description": "application/problem+json. status equals HTTP status. Safe opaque instance, no private values or existence clues. Type is stable urn:ginum:problem:<name>."}CompaniesPage
Section titled “CompaniesPage”Keyset page; nextCursor null means complete. Signed opaque cursor binds tenant/company, principal and authorization version, filters, stable sort and snapshot. Recheck live authority on every page; no total count. Snapshot TTL 15 minutes; 409 CURSOR_EXPIRED requires restart, never a broader query.
{ "type": "object", "additionalProperties": false, "required": [ "items", "nextCursor", "asOf" ], "properties": { "items": { "type": "array", "maxItems": 200, "items": { "$ref": "#/components/schemas/Company" } }, "nextCursor": { "type": [ "string", "null" ], "minLength": 1, "maxLength": 2048 }, "asOf": { "type": "string", "format": "date-time", "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?Z$" } }, "description": "Keyset page; nextCursor null means complete. Signed opaque cursor binds tenant/company, principal and authorization version, filters, stable sort and snapshot. Recheck live authority on every page; no total count. Snapshot TTL 15 minutes; 409 CURSOR_EXPIRED requires restart, never a broader query."}AccountsPage
Section titled “AccountsPage”Keyset page; nextCursor null means complete. Signed opaque cursor binds tenant/company, principal and authorization version, filters, stable sort and snapshot. Recheck live authority on every page; no total count. Snapshot TTL 15 minutes; 409 CURSOR_EXPIRED requires restart, never a broader query.
{ "type": "object", "additionalProperties": false, "required": [ "items", "nextCursor", "asOf" ], "properties": { "items": { "type": "array", "maxItems": 200, "items": { "$ref": "#/components/schemas/LedgerAccount" } }, "nextCursor": { "type": [ "string", "null" ], "minLength": 1, "maxLength": 2048 }, "asOf": { "type": "string", "format": "date-time", "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?Z$" } }, "description": "Keyset page; nextCursor null means complete. Signed opaque cursor binds tenant/company, principal and authorization version, filters, stable sort and snapshot. Recheck live authority on every page; no total count. Snapshot TTL 15 minutes; 409 CURSOR_EXPIRED requires restart, never a broader query."}PeriodsPage
Section titled “PeriodsPage”Keyset page; nextCursor null means complete. Signed opaque cursor binds tenant/company, principal and authorization version, filters, stable sort and snapshot. Recheck live authority on every page; no total count. Snapshot TTL 15 minutes; 409 CURSOR_EXPIRED requires restart, never a broader query.
{ "type": "object", "additionalProperties": false, "required": [ "items", "nextCursor", "asOf" ], "properties": { "items": { "type": "array", "maxItems": 200, "items": { "$ref": "#/components/schemas/LedgerPeriod" } }, "nextCursor": { "type": [ "string", "null" ], "minLength": 1, "maxLength": 2048 }, "asOf": { "type": "string", "format": "date-time", "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?Z$" } }, "description": "Keyset page; nextCursor null means complete. Signed opaque cursor binds tenant/company, principal and authorization version, filters, stable sort and snapshot. Recheck live authority on every page; no total count. Snapshot TTL 15 minutes; 409 CURSOR_EXPIRED requires restart, never a broader query."}
