{"openapi":"3.1.0","info":{"title":"Economico core API","version":"1.0.0","description":"REST and MCP share one business API and OAuth resource. Every request names its business; connection and token grants constrain its principal. Request resource=https://economi.co/mcp during authorization; scopes remain mcp. This is a public reference, not an authorization grant. Use /v1/openapi.json with your token and business header for permitted operations."},"servers":[{"url":"https://economi.co"}],"security":[{"bearerAuth":[]}],"paths":{"/v1/platform/purchases":{"post":{"operationId":"platform.purchase","description":"Discover and accept an exact Solo extra-events or Startup agreement, prepare its invoice, recover status and open invoices, or explicitly pay a saved card with action=pay and method=card. MPP and x402 payment use the separate paymentUrl. The authenticated business is the target. A full-access agent acting for its current owner can accept; wallet policy governs payment. Status may finish paid activation. On prepare, fundingAccountId may name an existing USD funding account; without it wallet activation can finish while customer payment bookkeeping waits. Payment credentials are never purchase arguments. Responses include a paymentUrl and browserFallback when available.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"action":{"type":"string","enum":["offer","accept","prepare","status","pay"]},"plan":{"type":"string","enum":["team","events"]},"interval":{"type":"string","enum":["month","year"]},"offerId":{"type":"string","minLength":1,"maxLength":256},"invoiceId":{"type":"string","minLength":1,"maxLength":256},"fundingAccountId":{"type":"string","minLength":1,"maxLength":256},"invoiceCursor":{"type":"string","minLength":1,"maxLength":256},"offerCid":{"type":"string","minLength":1,"maxLength":256},"capacity":{"type":"string","minLength":1,"maxLength":200},"authorized":{"type":"boolean"},"method":{"type":"string","enum":["card","mpp","x402"]}},"required":["action"],"additionalProperties":false}}}},"responses":{"200":{"description":"Canonical result; missing read objects are null. Money is in decimal integer strings.","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid envelope, query or domain input; also `missing_rates`, a foreign-currency command whose exchange rates the shared store could not supply (`details.missing_rates: [{ base, quote, date }]`, plus `details.refusal: { code, message }` when the command also refused), answered by stating an evidenced `exchangeRate`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token. Follow the WWW-Authenticate resource_metadata URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"}}}},"402":{"description":"plan_required: the command needs a platform plan this business is not on (members beyond the owner and shared views need Startup), or the command would record more events than Solo's monthly allowance has left. The allowance refusal writes nothing (a retry may keep its idempotency key) and carries `details: { reason, included, used, requested, from, through }` (counts as decimal strings; `from`/`through` the current events period as UTC instants). `reason` `solo_limit`: Solo's allowance; tell the founder the limit and that it resets at `through`, then retry after `through`, or once they upgrade to Startup or accept paid extra events. `reason` `plan_cancelled`: Startup was cancelled, or Solo's extra events were turned off; the extra events so far were billed then, and until the plan ends at `endsAt` the business has only `allowed` events in each billing period (its included events, or up to the end of a started block the cancellation billed), with no further extra events; after that it is on Solo (`after` `solo`, for Startup); retry after `through` (the next period's included events) or after `endsAt`. Tell the founder; they can keep Startup (or the extra events) from the billing page once the extra events billed then are paid (for monthly Startup whose cancellation billed extra events, keeping it takes a new Startup agreement from the end; a first-year YC price cannot carry over, so that plan ends as scheduled), or choose it again once it has ended. Any new paid plan (Startup, extra events, a switch or that new agreement) starts only once every invoice from Economico is paid; until then the billing page says so. `reason` `usage_settled`: Startup or Solo's extra events were kept after a cancel; this period's usage was settled then, so retry after `through`. With `details.closesAt`, the business is set to close then (its owner approved closing it): tell the founder, and do not wait for `endsAt` or suggest keeping or upgrading the plan; the owner can stop the closing at /account/cancel until then. Reads, exports and payment setup stay available, and so does upgrading unless the business is set to close (`closesAt`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Membership revoked, business unavailable for writes, or command credential requirements not met (browser-only commands refuse all OAuth tokens). `demo_business`: the business is a demo (`demo: true` on the business read: fictional, its owner's alone) and the command would reach someone else, send a message (support included, for now), publish it, take a plan or make it look like a real company, or the demo has recorded the 2,000 events it may record; tell the user, who can create their own business to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown route or missing required resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not supported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Allow":{"schema":{"type":"string"}}}},"408":{"description":"Request body transfer timed out (code `upload_timeout`): it took over 30 s, or paused over 5 s between chunks; retry the same request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Domain or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Length required (code `length_required`): a JSON body larger than 256 KiB must send Content-Length.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Payload too large (code `payload_too_large`): the request body exceeds the admitted byte limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"JSON body required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Address rate budget exhausted. Wait for Retry-After seconds before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","pattern":"^[0-9]+$"}}}},"500":{"description":"Internal failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Busy (code `busy`): the business is still receiving other document uploads or serving other large documents, and did not start this request. Retry the same request after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string"}}}}},"parameters":[{"name":"X-Economico-Business","in":"header","required":true,"description":"Explicit business slug for this request; must be approved by the connection and token.","schema":{"type":"string"}}]}},"/v1/platform/purchases/{offerId}/payment":{"post":{"operationId":"platform.pay","description":"Pay the prepared invoice with an offered MPP or x402 method. Keep OAuth Authorization: Bearer; send MPP's complete Payment credential in the separate Payment header, or an x402 credential in PAYMENT-SIGNATURE. Omit the request body. Retry pending outcomes through purchase status before trying another method. A 402 is a wallet challenge, not payment consent or proof of settlement.","parameters":[{"name":"X-Economico-Business","in":"header","required":true,"description":"Explicit business slug for this request; must be approved by the connection and token.","schema":{"type":"string"}},{"name":"offerId","in":"path","required":true,"schema":{"type":"string"}},{"name":"method","in":"query","required":true,"schema":{"type":"string","enum":["mpp","x402"]}},{"name":"invoiceId","in":"query","required":false,"description":"The ordinary renewal or extra-event invoice to pay, when supplied by the purchase response.","schema":{"type":"string"}},{"name":"Payment","in":"header","required":false,"description":"MPP Payment credential; independent of the OAuth Authorization header.","schema":{"type":"string"}},{"name":"PAYMENT-SIGNATURE","in":"header","required":false,"description":"x402 payment signature; independent of the OAuth Authorization header.","schema":{"type":"string"}}],"responses":{"200":{"description":"Canonical result; missing read objects are null. Money is in decimal integer strings.","content":{"application/json":{"schema":{}}}},"202":{"description":"Payment outcome is pending; recover status before collecting again.","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid envelope, query or domain input; also `missing_rates`, a foreign-currency command whose exchange rates the shared store could not supply (`details.missing_rates: [{ base, quote, date }]`, plus `details.refusal: { code, message }` when the command also refused), answered by stating an evidenced `exchangeRate`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token. Follow the WWW-Authenticate resource_metadata URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"}}}},"402":{"description":"MPP or x402 payment challenge.","content":{"application/json":{"schema":{}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"}},"PAYMENT-REQUIRED":{"schema":{"type":"string"}}}},"403":{"description":"Membership revoked, business unavailable for writes, or command credential requirements not met (browser-only commands refuse all OAuth tokens). `demo_business`: the business is a demo (`demo: true` on the business read: fictional, its owner's alone) and the command would reach someone else, send a message (support included, for now), publish it, take a plan or make it look like a real company, or the demo has recorded the 2,000 events it may record; tell the user, who can create their own business to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown route or missing required resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not supported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Allow":{"schema":{"type":"string"}}}},"408":{"description":"Request body transfer timed out (code `upload_timeout`): it took over 30 s, or paused over 5 s between chunks; retry the same request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Domain or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Length required (code `length_required`): a JSON body larger than 256 KiB must send Content-Length.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Payload too large (code `payload_too_large`): the request body exceeds the admitted byte limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"JSON body required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Address rate budget exhausted. Wait for Retry-After seconds before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","pattern":"^[0-9]+$"}}}},"500":{"description":"Internal failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Busy (code `busy`): the business is still receiving other document uploads or serving other large documents, and did not start this request. Retry the same request after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string"}}}}}}},"/v1/commands":{"post":{"operationId":"commands.execute","description":"Execute a public command. Retry with the same idempotency_key to retrieve the accepted receipt. Only active businesses may write.","requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"accounts.archive"},"input":{"type":"object","properties":{"financialAccountId":{"type":"string","minLength":1}},"required":["financialAccountId"],"additionalProperties":false},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"accounts.register"},"input":{"type":"object","properties":{"financialAccountId":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"currency":{"type":"string","minLength":1},"glAccountCode":{"enum":[1110,1310,2190]},"kind":{"enum":["checking","savings","card","wallet","other"]},"isDefault":{"type":"boolean"},"ownerPartyId":{"type":"string","minLength":1},"providerPartyId":{"type":"string","minLength":1},"providerContractId":{"type":"string","minLength":1},"last4":{"type":"string","pattern":"^[0-9]{4}$"},"network":{"type":"string","minLength":1},"brandColor":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}$","description":"The issuer's brand color as #RRGGBB, drawn as the account's card or plate."},"logoDocumentId":{"type":"string","minLength":1,"description":"The issuer's logo: the documentId of an image document (documents.receive kind image, PNG/JPEG/WebP)."}},"required":["financialAccountId","name","currency"],"additionalProperties":false},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"accounts.restore"},"input":{"type":"object","properties":{"financialAccountId":{"type":"string","minLength":1}},"required":["financialAccountId"],"additionalProperties":false},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"accounts.update"},"input":{"type":"object","properties":{"financialAccountId":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"kind":{"enum":["checking","savings","card","wallet","other"]},"isDefault":{"type":"boolean"},"providerPartyId":{"type":"string","minLength":1},"providerContractId":{"type":"string","minLength":1},"last4":{"type":"string","pattern":"^[0-9]{4}$"},"network":{"type":"string","minLength":1},"brandColor":{"anyOf":[{"type":"string","pattern":"^#[0-9A-Fa-f]{6}$","description":"The issuer's brand color as #RRGGBB, drawn as the account's card or plate."},{"type":"null"}]},"logoDocumentId":{"anyOf":[{"type":"string","minLength":1,"description":"The issuer's logo: the documentId of an image document (documents.receive kind image, PNG/JPEG/WebP)."},{"type":"null"}]}},"required":["financialAccountId"],"additionalProperties":false},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"activities.archive"},"input":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","minLength":1},"expectedDocumentId":{"type":"string","minLength":1}},"required":["id","expectedDocumentId"]},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"source_document_id":{"description":"A registered document of kind activity, template that caused this command.","type":"string","minLength":1}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"activities.create"},"input":{"type":"object","additionalProperties":false,"properties":{"definition":{"type":"object","additionalProperties":false,"properties":{"model":{"const":"priced-rights-v1"},"name":{"type":"string","minLength":1},"description":{"type":"string","minLength":1},"externalReferences":{"type":"object","maxProperties":100,"additionalProperties":{"type":"string","minLength":1}},"terms":{"type":"object","maxProperties":100,"additionalProperties":{"type":"object","additionalProperties":false,"properties":{"type":{"enum":["integer","text","date","instant"]},"unit":{"type":"string","minLength":1},"default":{"type":"string","minLength":1}},"required":["type"]}},"facts":{"type":"object","maxProperties":100,"additionalProperties":{"anyOf":[{"type":"object","additionalProperties":false,"properties":{"type":{"enum":["integer","text","date","instant"]},"unit":{"type":"string","minLength":1}},"required":["type"]},{"type":"object","additionalProperties":false,"properties":{"type":{"enum":["claim","occurrence"]}},"required":["type"]}]}},"ledgers":{"type":"object","maxProperties":100,"additionalProperties":{"type":"object","additionalProperties":false,"properties":{"classification":{"enum":["gaap","contractual","operational","ownership","planning"]},"unitKind":{"enum":["currency","share","usage","credit","right","token","other"]},"unitCode":{"type":"string","minLength":1},"decimals":{"type":"integer","minimum":0,"maximum":18},"accountTemplate":{"enum":["gaap_startup","contract_flow","capacity","meter","entitlement","issued_instrument"]}},"required":["classification","unitKind","unitCode","decimals","accountTemplate"]}},"price":{"anyOf":[{"type":"object","additionalProperties":false,"properties":{"treatment":{"const":"priced"},"calculation":{"anyOf":[{"type":"object","additionalProperties":false,"properties":{"type":{"const":"fixed"},"amount":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"}},"required":["type","amount"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"capacity_excess"},"consumptionFact":{"type":"string","minLength":1},"rate":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"unitsPerPrice":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"}},"required":["type","consumptionFact","rate","unitsPerPrice"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"rate"},"quantity":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"rate":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"unitsPerPrice":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"}},"required":["type","quantity","rate","unitsPerPrice"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"tiered"},"quantity":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"mode":{"enum":["volume","graduated"]},"tiers":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"upTo":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"rate":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"unitsPerPrice":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"flat":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"wholeUnits":{"type":"boolean"},"startedUnits":{"type":"boolean"}},"required":["rate"]},"minItems":1,"maxItems":100}},"required":["type","quantity","mode","tiers"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"sum"},"components":{"type":"array","items":{"anyOf":[{"type":"object","additionalProperties":false,"properties":{"type":{"const":"fixed"},"amount":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"}},"required":["type","amount"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"rate"},"quantity":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"rate":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"unitsPerPrice":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"}},"required":["type","quantity","rate","unitsPerPrice"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"tiered"},"quantity":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"mode":{"enum":["volume","graduated"]},"tiers":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"upTo":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"rate":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"unitsPerPrice":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"flat":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"wholeUnits":{"type":"boolean"},"startedUnits":{"type":"boolean"}},"required":["rate"]},"minItems":1,"maxItems":100}},"required":["type","quantity","mode","tiers"]}]},"minItems":2,"maxItems":20}},"required":["type","components"]}]},"currencyTerm":{"type":"string","minLength":1}},"required":["treatment","calculation","currencyTerm"]},{"type":"object","additionalProperties":false,"properties":{"treatment":{"enum":["included","free","promotional"]},"evidence":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}},"required":["kind","ref"]},"minItems":1,"maxItems":20}},"required":["treatment","evidence"]},{"type":"object","additionalProperties":false,"properties":{"treatment":{"const":"unknown"},"evidence":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}},"required":["kind","ref"]},"minItems":1,"maxItems":20},"knownAmountTerm":{"type":"string","minLength":1}},"required":["treatment","evidence"]}]},"recurringValue":{"type":"object","additionalProperties":false,"properties":{"interval":{"enum":["monthly","yearly"]},"startTerm":{"type":"string","minLength":1},"endTerm":{"type":"string","minLength":1}},"required":["interval","startTerm"]},"economics":{"type":"object","additionalProperties":false,"properties":{"kind":{"enum":["service","capacity","ownership","financing","distribution"]},"direction":{"enum":["provide","receive"]},"billing":{"type":"object","additionalProperties":false,"properties":{"timing":{"enum":["advance","arrears","upfront"]},"schedule":{"type":"object","additionalProperties":false,"properties":{"startTerm":{"type":"string","minLength":1},"anchorTerm":{"type":"string","minLength":1},"endTerm":{"type":"string","minLength":1},"everyMonths":{"type":"integer","minimum":1,"maximum":120},"everyDays":{"type":"integer","minimum":1,"maximum":366},"timing":{"enum":["start","end"]},"offsetDays":{"type":"integer","minimum":-365,"maximum":365},"serviceEvidence":{"const":"elapsed_time"}},"required":["startTerm","timing","offsetDays"],"oneOf":[{"required":["everyMonths"]},{"required":["everyDays"]}]},"on":{"enum":["accept","cancel","terminate"]},"automatic":{"type":"boolean"},"dueDays":{"type":"integer","minimum":0,"maximum":365},"factsDueDays":{"type":"integer","minimum":1,"maximum":90},"factsFrom":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"}},"required":["timing"]},"recognition":{"type":"object","additionalProperties":false,"properties":{"timing":{"enum":["delivery","usage","ratable"]},"allocation":{"enum":["equal_periods"]},"schedule":{"type":"object","additionalProperties":false,"properties":{"startTerm":{"type":"string","minLength":1},"anchorTerm":{"type":"string","minLength":1},"endTerm":{"type":"string","minLength":1},"everyMonths":{"type":"integer","minimum":1,"maximum":120},"everyDays":{"type":"integer","minimum":1,"maximum":366},"timing":{"enum":["start","end"]},"offsetDays":{"type":"integer","minimum":-365,"maximum":365},"serviceEvidence":{"const":"elapsed_time"}},"required":["startTerm","timing","offsetDays"],"oneOf":[{"required":["everyMonths"]},{"required":["everyDays"]}]},"on":{"enum":["accept","cancel","terminate"]}},"required":["timing"]},"consideration":{"anyOf":[{"type":"object","additionalProperties":false,"properties":{"type":{"const":"money"},"amount":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"currencyTerm":{"type":"string","minLength":1},"recognition":{"enum":["unconditional_obligation","condition_satisfied"]}},"required":["type","amount","currencyTerm","recognition"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"units"},"quantity":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"ledger":{"type":"string","minLength":1}},"required":["type","quantity","ledger"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"claim"},"claimFact":{"type":"string","minLength":1},"amount":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"currencyTerm":{"type":"string","minLength":1}},"required":["type","claimFact","amount","currencyTerm"]}]},"classification":{"type":"object","additionalProperties":false,"properties":{"monetaryLedger":{"type":"string","minLength":1},"capitalAccount":{"enum":[3100,3110,3120]},"revenueCategory":{"enum":["services","subscription","consulting","usage","grant"]},"expenseAccount":{"type":"integer"},"expenseFunction":{"enum":["cost_of_revenue","research_and_development","sales_and_marketing","general_and_administrative","other"]},"product":{"type":"string","minLength":1},"taxCode":{"type":"string","minLength":1},"taxTreatment":{"enum":["inclusive","exclusive"]}},"required":["monetaryLedger"]}},"required":["kind","direction"]}},"required":["model","name","price","economics"]}},"required":["definition"]},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"source_document_id":{"description":"A registered document of kind activity, template, contract, source_document that caused this command.","type":"string","minLength":1}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"activities.replace"},"input":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","minLength":1},"expectedDocumentId":{"type":"string","minLength":1},"definition":{"type":"object","additionalProperties":false,"properties":{"model":{"const":"priced-rights-v1"},"name":{"type":"string","minLength":1},"description":{"type":"string","minLength":1},"externalReferences":{"type":"object","maxProperties":100,"additionalProperties":{"type":"string","minLength":1}},"terms":{"type":"object","maxProperties":100,"additionalProperties":{"type":"object","additionalProperties":false,"properties":{"type":{"enum":["integer","text","date","instant"]},"unit":{"type":"string","minLength":1},"default":{"type":"string","minLength":1}},"required":["type"]}},"facts":{"type":"object","maxProperties":100,"additionalProperties":{"anyOf":[{"type":"object","additionalProperties":false,"properties":{"type":{"enum":["integer","text","date","instant"]},"unit":{"type":"string","minLength":1}},"required":["type"]},{"type":"object","additionalProperties":false,"properties":{"type":{"enum":["claim","occurrence"]}},"required":["type"]}]}},"ledgers":{"type":"object","maxProperties":100,"additionalProperties":{"type":"object","additionalProperties":false,"properties":{"classification":{"enum":["gaap","contractual","operational","ownership","planning"]},"unitKind":{"enum":["currency","share","usage","credit","right","token","other"]},"unitCode":{"type":"string","minLength":1},"decimals":{"type":"integer","minimum":0,"maximum":18},"accountTemplate":{"enum":["gaap_startup","contract_flow","capacity","meter","entitlement","issued_instrument"]}},"required":["classification","unitKind","unitCode","decimals","accountTemplate"]}},"price":{"anyOf":[{"type":"object","additionalProperties":false,"properties":{"treatment":{"const":"priced"},"calculation":{"anyOf":[{"type":"object","additionalProperties":false,"properties":{"type":{"const":"fixed"},"amount":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"}},"required":["type","amount"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"capacity_excess"},"consumptionFact":{"type":"string","minLength":1},"rate":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"unitsPerPrice":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"}},"required":["type","consumptionFact","rate","unitsPerPrice"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"rate"},"quantity":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"rate":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"unitsPerPrice":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"}},"required":["type","quantity","rate","unitsPerPrice"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"tiered"},"quantity":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"mode":{"enum":["volume","graduated"]},"tiers":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"upTo":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"rate":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"unitsPerPrice":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"flat":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"wholeUnits":{"type":"boolean"},"startedUnits":{"type":"boolean"}},"required":["rate"]},"minItems":1,"maxItems":100}},"required":["type","quantity","mode","tiers"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"sum"},"components":{"type":"array","items":{"anyOf":[{"type":"object","additionalProperties":false,"properties":{"type":{"const":"fixed"},"amount":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"}},"required":["type","amount"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"rate"},"quantity":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"rate":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"unitsPerPrice":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"}},"required":["type","quantity","rate","unitsPerPrice"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"tiered"},"quantity":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"mode":{"enum":["volume","graduated"]},"tiers":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"upTo":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"rate":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"unitsPerPrice":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"flat":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"wholeUnits":{"type":"boolean"},"startedUnits":{"type":"boolean"}},"required":["rate"]},"minItems":1,"maxItems":100}},"required":["type","quantity","mode","tiers"]}]},"minItems":2,"maxItems":20}},"required":["type","components"]}]},"currencyTerm":{"type":"string","minLength":1}},"required":["treatment","calculation","currencyTerm"]},{"type":"object","additionalProperties":false,"properties":{"treatment":{"enum":["included","free","promotional"]},"evidence":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}},"required":["kind","ref"]},"minItems":1,"maxItems":20}},"required":["treatment","evidence"]},{"type":"object","additionalProperties":false,"properties":{"treatment":{"const":"unknown"},"evidence":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}},"required":["kind","ref"]},"minItems":1,"maxItems":20},"knownAmountTerm":{"type":"string","minLength":1}},"required":["treatment","evidence"]}]},"recurringValue":{"type":"object","additionalProperties":false,"properties":{"interval":{"enum":["monthly","yearly"]},"startTerm":{"type":"string","minLength":1},"endTerm":{"type":"string","minLength":1}},"required":["interval","startTerm"]},"economics":{"type":"object","additionalProperties":false,"properties":{"kind":{"enum":["service","capacity","ownership","financing","distribution"]},"direction":{"enum":["provide","receive"]},"billing":{"type":"object","additionalProperties":false,"properties":{"timing":{"enum":["advance","arrears","upfront"]},"schedule":{"type":"object","additionalProperties":false,"properties":{"startTerm":{"type":"string","minLength":1},"anchorTerm":{"type":"string","minLength":1},"endTerm":{"type":"string","minLength":1},"everyMonths":{"type":"integer","minimum":1,"maximum":120},"everyDays":{"type":"integer","minimum":1,"maximum":366},"timing":{"enum":["start","end"]},"offsetDays":{"type":"integer","minimum":-365,"maximum":365},"serviceEvidence":{"const":"elapsed_time"}},"required":["startTerm","timing","offsetDays"],"oneOf":[{"required":["everyMonths"]},{"required":["everyDays"]}]},"on":{"enum":["accept","cancel","terminate"]},"automatic":{"type":"boolean"},"dueDays":{"type":"integer","minimum":0,"maximum":365},"factsDueDays":{"type":"integer","minimum":1,"maximum":90},"factsFrom":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"}},"required":["timing"]},"recognition":{"type":"object","additionalProperties":false,"properties":{"timing":{"enum":["delivery","usage","ratable"]},"allocation":{"enum":["equal_periods"]},"schedule":{"type":"object","additionalProperties":false,"properties":{"startTerm":{"type":"string","minLength":1},"anchorTerm":{"type":"string","minLength":1},"endTerm":{"type":"string","minLength":1},"everyMonths":{"type":"integer","minimum":1,"maximum":120},"everyDays":{"type":"integer","minimum":1,"maximum":366},"timing":{"enum":["start","end"]},"offsetDays":{"type":"integer","minimum":-365,"maximum":365},"serviceEvidence":{"const":"elapsed_time"}},"required":["startTerm","timing","offsetDays"],"oneOf":[{"required":["everyMonths"]},{"required":["everyDays"]}]},"on":{"enum":["accept","cancel","terminate"]}},"required":["timing"]},"consideration":{"anyOf":[{"type":"object","additionalProperties":false,"properties":{"type":{"const":"money"},"amount":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"currencyTerm":{"type":"string","minLength":1},"recognition":{"enum":["unconditional_obligation","condition_satisfied"]}},"required":["type","amount","currencyTerm","recognition"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"units"},"quantity":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"ledger":{"type":"string","minLength":1}},"required":["type","quantity","ledger"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"claim"},"claimFact":{"type":"string","minLength":1},"amount":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"currencyTerm":{"type":"string","minLength":1}},"required":["type","claimFact","amount","currencyTerm"]}]},"classification":{"type":"object","additionalProperties":false,"properties":{"monetaryLedger":{"type":"string","minLength":1},"capitalAccount":{"enum":[3100,3110,3120]},"revenueCategory":{"enum":["services","subscription","consulting","usage","grant"]},"expenseAccount":{"type":"integer"},"expenseFunction":{"enum":["cost_of_revenue","research_and_development","sales_and_marketing","general_and_administrative","other"]},"product":{"type":"string","minLength":1},"taxCode":{"type":"string","minLength":1},"taxTreatment":{"enum":["inclusive","exclusive"]}},"required":["monetaryLedger"]}},"required":["kind","direction"]}},"required":["model","name","price","economics"]}},"required":["id","expectedDocumentId","definition"]},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"source_document_id":{"description":"A registered document of kind activity, template, contract, source_document that caused this command.","type":"string","minLength":1}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"business.change_fiscal_year"},"input":{"type":"object","additionalProperties":false,"required":["yearEnd","reason"],"properties":{"yearEnd":{"type":"string","pattern":"^(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$","description":"Fiscal year end as MM-DD, e.g. 12-31, 03-31, 06-30. 02-29 is refused; use 02-28."},"reason":{"type":"string","minLength":1,"maxLength":2000}}},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"source_document_id":{"description":"A registered document of kind source_document that caused this command.","type":"string","minLength":1}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"business.change_functional_currency"},"input":{"type":"object","required":["fromCurrency","toCurrency","reason"],"properties":{"fromCurrency":{"type":"string","pattern":"^[A-Z]{3}$"},"toCurrency":{"type":"string","pattern":"^[A-Z]{3}$"},"reason":{"type":"string","minLength":1,"maxLength":2000}},"additionalProperties":false},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"source_document_id":{"description":"A registered document of kind source_document that caused this command.","type":"string","minLength":1}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"business.change_legal_form"},"input":{"type":"object","required":["reason"],"properties":{"jurisdiction":{"enum":["US","US-AL","US-AK","US-AZ","US-AR","US-CA","US-CO","US-CT","US-DE","US-DC","US-FL","US-GA","US-HI","US-ID","US-IL","US-IN","US-IA","US-KS","US-KY","US-LA","US-ME","US-MD","US-MA","US-MI","US-MN","US-MS","US-MO","US-MT","US-NE","US-NV","US-NH","US-NJ","US-NM","US-NY","US-NC","US-ND","US-OH","US-OK","US-OR","US-PA","US-RI","US-SC","US-SD","US-TN","US-TX","US-UT","US-VT","US-VA","US-WA","US-WV","US-WI","US-WY","SG","CA","CA-AB","CA-BC","CA-MB","CA-NB","CA-NL","CA-NS","CA-NT","CA-NU","CA-ON","CA-PE","CA-QC","CA-SK","CA-YT","GB","GB-EAW","GB-SCT","GB-NIR","CH","AT","BE","BG","HR","CY","CZ","DK","EE","FI","FR","DE","GR","HU","IE","IT","LV","LT","LU","MT","NL","PL","PT","RO","SK","SI","ES","SE"],"description":"Country of incorporation (ISO 3166-1), or the ISO 3166-2 subdivision holding the register: US-DE, SG, CA (federal) or CA-ON, GB-EAW/GB-SCT/GB-NIR, CH."},"legalEntityType":{"enum":["unknown","llc","c_corp","s_corp","sole_proprietorship","partnership","nonprofit","unincorporated","other","private_limited_company","corporation","stock_corporation","project"]},"reason":{"type":"string","pattern":".*\\S.*","maxLength":2000}},"anyOf":[{"type":"object","properties":{"jurisdiction":{"enum":["US","US-AL","US-AK","US-AZ","US-AR","US-CA","US-CO","US-CT","US-DE","US-DC","US-FL","US-GA","US-HI","US-ID","US-IL","US-IN","US-IA","US-KS","US-KY","US-LA","US-ME","US-MD","US-MA","US-MI","US-MN","US-MS","US-MO","US-MT","US-NE","US-NV","US-NH","US-NJ","US-NM","US-NY","US-NC","US-ND","US-OH","US-OK","US-OR","US-PA","US-RI","US-SC","US-SD","US-TN","US-TX","US-UT","US-VT","US-VA","US-WA","US-WV","US-WI","US-WY","SG","CA","CA-AB","CA-BC","CA-MB","CA-NB","CA-NL","CA-NS","CA-NT","CA-NU","CA-ON","CA-PE","CA-QC","CA-SK","CA-YT","GB","GB-EAW","GB-SCT","GB-NIR","CH","AT","BE","BG","HR","CY","CZ","DK","EE","FI","FR","DE","GR","HU","IE","IT","LV","LT","LU","MT","NL","PL","PT","RO","SK","SI","ES","SE"],"description":"Country of incorporation (ISO 3166-1), or the ISO 3166-2 subdivision holding the register: US-DE, SG, CA (federal) or CA-ON, GB-EAW/GB-SCT/GB-NIR, CH."}},"required":["jurisdiction"]},{"type":"object","properties":{"legalEntityType":{"enum":["unknown","llc","c_corp","s_corp","sole_proprietorship","partnership","nonprofit","unincorporated","other","private_limited_company","corporation","stock_corporation","project"]}},"required":["legalEntityType"]}],"additionalProperties":false},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"source_document_id":{"description":"A registered document of kind source_document that caused this command.","type":"string","minLength":1}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"business.change_legal_name"},"input":{"type":"object","required":["name","reason"],"properties":{"name":{"type":"string","pattern":"^[^\\r\\n]*\\S[^\\r\\n]*$","maxLength":500},"reason":{"type":"string","pattern":".*\\S.*","maxLength":2000}},"additionalProperties":false},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"source_document_id":{"description":"A registered document of kind source_document that caused this command.","type":"string","minLength":1}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"business.deregister_sales_tax"},"input":{"type":"object","required":["regime","effectiveUntil","reason"],"properties":{"regime":{"enum":["sg_gst","ca_gst_hst","ca_qst","ca_pst_bc","ca_pst_sk","ca_rst_mb","gb_vat"],"description":"sg_gst (Singapore GST); ca_gst_hst (Canadian GST/HST), ca_qst (Quebec QST), ca_pst_bc, ca_pst_sk, ca_rst_mb (provincial sales taxes, kept apart from GST/HST); gb_vat (UK VAT). It must be a regime of the country the business is incorporated in. There is no US regime: record US state sales tax as custom codes with tax_codes.create."},"effectiveUntil":{"type":"string","format":"date","description":"First day the business is no longer registered; after the registration began and no later than today."},"reason":{"type":"string","minLength":1,"maxLength":1000}},"additionalProperties":false},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"source_document_id":{"description":"A registered document of kind source_document that caused this command.","type":"string","minLength":1}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"business.elect_accounting_framework"},"input":{"type":"object","required":["framework","reason"],"properties":{"framework":{"enum":["us_gaap","sg_frs","sg_sfrs_small_entities","sg_sfrs_i","ca_aspe","ca_ifrs","uk_frs_102","uk_frs_102_section_1a","uk_frs_105","ch_co"],"description":"US us_gaap; SG sg_frs, sg_sfrs_small_entities, sg_sfrs_i; CA ca_aspe, ca_ifrs; GB uk_frs_102, uk_frs_102_section_1a, uk_frs_105; CH ch_co. Must belong to the business's country. Swiss GAAP FER is not supported."},"edition":{"type":"string","minLength":1,"maxLength":256},"sizeRegime":{"enum":["small","micro"],"description":"Optional; implied by the framework (small: sg_sfrs_small_entities, uk_frs_102_section_1a; micro: uk_frs_105)."},"sizeEligibility":{"type":"object","required":["basis","periodEnd"],"properties":{"basis":{"type":"string","minLength":1,"maxLength":2000,"description":"What the founder's size conclusion rests on, e.g. 'Companies Act 2006 s384A conditions met in FY2025 and FY2026'. Recorded, never computed."},"periodEnd":{"type":"string","format":"date","description":"Period end the conclusion covers."}}},"reason":{"type":"string","minLength":1,"maxLength":2000}},"additionalProperties":false},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"source_document_id":{"description":"A registered document of kind source_document that caused this command.","type":"string","minLength":1}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"business.incorporate"},"input":{"type":"object","required":["legalEntityType","reason"],"properties":{"name":{"type":"string","minLength":1,"maxLength":500,"pattern":"^[^\\r\\n]*\\S[^\\r\\n]*$","description":"The company's legal name. Omitted, the project's public name becomes it; a public name that differed from the project's legal name is kept."},"legalEntityType":{"enum":["llc","c_corp","s_corp","private_limited_company","corporation","stock_corporation"],"description":"The incorporated form; it must exist in the jurisdiction."},"jurisdiction":{"enum":["US","US-AL","US-AK","US-AZ","US-AR","US-CA","US-CO","US-CT","US-DE","US-DC","US-FL","US-GA","US-HI","US-ID","US-IL","US-IN","US-IA","US-KS","US-KY","US-LA","US-ME","US-MD","US-MA","US-MI","US-MN","US-MS","US-MO","US-MT","US-NE","US-NV","US-NH","US-NJ","US-NM","US-NY","US-NC","US-ND","US-OH","US-OK","US-OR","US-PA","US-RI","US-SC","US-SD","US-TN","US-TX","US-UT","US-VT","US-VA","US-WA","US-WV","US-WI","US-WY","SG","CA","CA-AB","CA-BC","CA-MB","CA-NB","CA-NL","CA-NS","CA-NT","CA-NU","CA-ON","CA-PE","CA-QC","CA-SK","CA-YT","GB","GB-EAW","GB-SCT","GB-NIR","CH","AT","BE","BG","HR","CY","CZ","DK","EE","FI","FR","DE","GR","HU","IE","IT","LV","LT","LU","MT","NL","PL","PT","RO","SK","SI","ES","SE"],"description":"Where the company is incorporated. Omitted, the project's jurisdiction. In another country, the facts that held only in the project's country are cleared."},"ownerPartyId":{"type":"string","minLength":1,"description":"The founder who receives the shares: the one party holding the project's capital. Needed only when no party holds it; naming anyone else is refused, and so is a project whose capital more than one party holds (move it to the founder first)."},"parValue":{"type":"string","pattern":"^(0|[1-9][0-9]*)$","maxLength":38,"description":"Minor units of the contributed net assets booked to share capital at par (3100); the rest is paid-in capital (3110), negative for a project that owes more than it owns. The net assets must cover a nonzero par value. Default 0."},"reason":{"type":"string","pattern":".*\\S.*","maxLength":2000}},"additionalProperties":false},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"source_document_id":{"description":"A registered document of kind source_document that caused this command.","type":"string","minLength":1}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"business.record_formation_date"},"input":{"type":"object","additionalProperties":false,"required":["date","reason"],"properties":{"date":{"type":"string","format":"date"},"reason":{"type":"string","minLength":1,"maxLength":2000}}},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"source_document_id":{"description":"A registered document of kind source_document that caused this command.","type":"string","minLength":1}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"business.register_sales_tax"},"input":{"type":"object","required":["regime","registrationNumber","effectiveFrom","reason"],"properties":{"regime":{"enum":["sg_gst","ca_gst_hst","ca_qst","ca_pst_bc","ca_pst_sk","ca_rst_mb","gb_vat"],"description":"sg_gst (Singapore GST); ca_gst_hst (Canadian GST/HST), ca_qst (Quebec QST), ca_pst_bc, ca_pst_sk, ca_rst_mb (provincial sales taxes, kept apart from GST/HST); gb_vat (UK VAT). It must be a regime of the country the business is incorporated in. There is no US regime: record US state sales tax as custom codes with tax_codes.create."},"registrationNumber":{"type":"string","minLength":1,"description":"As issued: a Singapore UEN or IRAS GST number (201912345K, M2-1234567-K); a Canadian BN with its RT account (123456789RT0001); a QST number (1234567890TQ0001); PST-1234-5678 (BC); a UK VAT number (GB123456789). Spaces are ignored."},"province":{"type":"string","pattern":"^CA-[A-Z]{2}$","description":"Required for ca_gst_hst: the province the registrant operates from, e.g. CA-ON. Not accepted for other regimes."},"effectiveFrom":{"type":"string","format":"date","description":"The effective date of registration the authority confirmed."},"reason":{"type":"string","minLength":1,"maxLength":1000}},"additionalProperties":false},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"source_document_id":{"description":"A registered document of kind source_document that caused this command.","type":"string","minLength":1}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"business.set_registration"},"input":{"type":"object","required":["kind","number","reason"],"properties":{"kind":{"enum":["us_ein","sg_uen","ca_bn","gb_company_number"]},"number":{"type":"string","minLength":1,"maxLength":32},"reason":{"type":"string","pattern":".*\\S.*","maxLength":2000}},"additionalProperties":false},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"source_document_id":{"description":"A registered document of kind source_document that caused this command.","type":"string","minLength":1}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"business.update"},"input":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":500,"pattern":"^[^\\r\\n]*\\S[^\\r\\n]*$","description":"The public name the workspace and shared pages show. The legal name changes with business.change_legal_name."},"description":{"type":"string","maxLength":280,"pattern":"^[^\\r\\n]*$"},"address":{"type":"object","properties":{"line1":{"type":"string","maxLength":200,"pattern":"^[^\\r\\n]+$"},"line2":{"type":"string","maxLength":200,"pattern":"^[^\\r\\n]*$"},"city":{"type":"string","maxLength":200,"pattern":"^[^\\r\\n]+$"},"region":{"type":"string","maxLength":200,"pattern":"^[^\\r\\n]*$"},"postalCode":{"type":"string","maxLength":40,"pattern":"^[^\\r\\n]*$"},"country":{"type":"string","pattern":"^[A-Z]{2}$"}},"required":["line1","city","country"],"additionalProperties":false},"url":{"type":"string","pattern":"^https?://[^\\s/]+","maxLength":2048},"ycVerificationUrl":{"type":"string","pattern":"^https://(?:www\\.)?ycombinator\\.com/verify/[A-Za-z0-9]+/?$"}},"anyOf":[{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":500,"pattern":"^[^\\r\\n]*\\S[^\\r\\n]*$","description":"The public name the workspace and shared pages show. The legal name changes with business.change_legal_name."}},"required":["name"]},{"type":"object","properties":{"description":{"type":"string","maxLength":280,"pattern":"^[^\\r\\n]*$"}},"required":["description"]},{"type":"object","properties":{"address":{"type":"object","properties":{"line1":{"type":"string","maxLength":200,"pattern":"^[^\\r\\n]+$"},"line2":{"type":"string","maxLength":200,"pattern":"^[^\\r\\n]*$"},"city":{"type":"string","maxLength":200,"pattern":"^[^\\r\\n]+$"},"region":{"type":"string","maxLength":200,"pattern":"^[^\\r\\n]*$"},"postalCode":{"type":"string","maxLength":40,"pattern":"^[^\\r\\n]*$"},"country":{"type":"string","pattern":"^[A-Z]{2}$"}},"required":["line1","city","country"],"additionalProperties":false}},"required":["address"]},{"type":"object","properties":{"url":{"type":"string","pattern":"^https?://[^\\s/]+","maxLength":2048}},"required":["url"]},{"type":"object","properties":{"ycVerificationUrl":{"type":"string","pattern":"^https://(?:www\\.)?ycombinator\\.com/verify/[A-Za-z0-9]+/?$"}},"required":["ycVerificationUrl"]}],"additionalProperties":false},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"categories.create"},"input":{"type":"object","properties":{"categoryId":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"description":{"type":"string"}},"required":["categoryId","name","code"],"additionalProperties":false},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"connections.accept"},"input":{"type":"object","additionalProperties":false,"properties":{"connectionId":{"type":"string","minLength":1},"partyId":{"type":"string","minLength":1}},"required":["connectionId","partyId"]},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"connections.decline"},"input":{"type":"object","additionalProperties":false,"properties":{"connectionId":{"type":"string","minLength":1}},"required":["connectionId"]},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"connections.end"},"input":{"type":"object","additionalProperties":false,"properties":{"connectionId":{"type":"string","minLength":1}},"required":["connectionId"]},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"connections.request"},"input":{"type":"object","additionalProperties":false,"properties":{"to":{"type":"string","minLength":3,"maxLength":63,"description":"The other business's exact slug."},"partyId":{"type":"string","minLength":1},"note":{"type":"string","maxLength":500}},"required":["to","partyId"]},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"contracts.accept"},"input":{"type":"object","additionalProperties":false,"required":["contractId","expectedDocumentId","expectedStatus","effectiveAt","sourceFactId","evidence"],"properties":{"contractId":{"type":"string","minLength":1},"expectedDocumentId":{"type":"string","minLength":1},"expectedStatus":{"enum":["draft","offer","active","rejected","terminated","expired"]},"effectiveAt":{"type":"string","minLength":1},"sourceFactId":{"type":"string","minLength":1},"facts":{"type":"object","maxProperties":100},"exchangeRate":{"type":"object","additionalProperties":false,"required":["base","quote","date","numerator","denominator","evidence"],"description":"An evidenced exchange rate (1 base = numerator/denominator quote), e.g. from a bank statement. It overrides the shared rate store for this command; omit it to use the store.","properties":{"base":{"type":"string","pattern":"^[A-Z]{3}$"},"quote":{"type":"string","pattern":"^[A-Z]{3}$"},"date":{"type":"string","format":"date"},"numerator":{"type":"string","pattern":"^[1-9][0-9]*$"},"denominator":{"type":"string","pattern":"^[1-9][0-9]*$"},"evidence":{"type":"array","minItems":1,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string"}}}}}},"evidence":{"type":"object","additionalProperties":false,"required":["acceptance"],"properties":{"acceptance":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}},"economic":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}},"service":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}}}}}},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"source_document_id":{"description":"A registered document of kind contract, source_document that caused this command.","type":"string","minLength":1}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"contracts.amend"},"input":{"type":"object","additionalProperties":false,"required":["contractId","expectedDocumentId","effectiveAt","terms","acceptanceEvidence"],"properties":{"contractId":{"type":"string","minLength":1},"expectedDocumentId":{"type":"string","minLength":1},"effectiveAt":{"type":"string","minLength":1,"format":"date-time"},"terms":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"string","minLength":1}}},"sourceDocumentIds":{"type":"array","items":{"type":"string","minLength":1},"maxItems":100},"acceptanceEvidence":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}}}},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"source_document_id":{"description":"A registered document of kind contract, source_document that caused this command.","type":"string","minLength":1}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"contracts.cancel"},"input":{"type":"object","additionalProperties":false,"required":["contractId","expectedDocumentId","expectedStatus","effectiveAt","sourceFactId","evidence"],"properties":{"contractId":{"type":"string","minLength":1},"expectedDocumentId":{"type":"string","minLength":1},"expectedStatus":{"enum":["draft","offer","active","rejected","terminated","expired"]},"effectiveAt":{"type":"string","minLength":1},"sourceFactId":{"type":"string","minLength":1},"facts":{"type":"object","maxProperties":100},"exchangeRate":{"type":"object","additionalProperties":false,"required":["base","quote","date","numerator","denominator","evidence"],"description":"An evidenced exchange rate (1 base = numerator/denominator quote), e.g. from a bank statement. It overrides the shared rate store for this command; omit it to use the store.","properties":{"base":{"type":"string","pattern":"^[A-Z]{3}$"},"quote":{"type":"string","pattern":"^[A-Z]{3}$"},"date":{"type":"string","format":"date"},"numerator":{"type":"string","pattern":"^[1-9][0-9]*$"},"denominator":{"type":"string","pattern":"^[1-9][0-9]*$"},"evidence":{"type":"array","minItems":1,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string"}}}}}},"evidence":{"type":"object","additionalProperties":false,"required":["acceptance"],"properties":{"acceptance":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}},"economic":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}},"service":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}}}}}},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"source_document_id":{"description":"A registered document of kind contract, source_document that caused this command.","type":"string","minLength":1}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"contracts.create"},"input":{"type":"object","additionalProperties":false,"properties":{"templateDocumentId":{"type":"string","minLength":1},"definition":{"type":"object","additionalProperties":false,"properties":{"model":{"const":"priced-rights-v1"},"name":{"type":"string","minLength":1},"plan":{"enum":["on_sale","off_sale"]},"parties":{"type":"array","items":{"type":"string","minLength":1},"minItems":1,"maxItems":100},"ledgers":{"type":"object","maxProperties":100,"additionalProperties":{"type":"object","additionalProperties":false,"properties":{"classification":{"enum":["gaap","contractual","operational","ownership","planning"]},"unitKind":{"enum":["currency","share","usage","credit","right","token","other"]},"unitCode":{"type":"string","minLength":1},"decimals":{"type":"integer","minimum":0,"maximum":18},"accountTemplate":{"enum":["gaap_startup","contract_flow","capacity","meter","entitlement","issued_instrument"]}},"required":["classification","unitKind","unitCode","decimals","accountTemplate"]}},"activities":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"key":{"type":"string","minLength":1},"activityDocumentId":{"type":"string","minLength":1},"partyRole":{"type":"string","minLength":1},"ledgers":{"type":"object","maxProperties":100,"additionalProperties":{"type":"string","minLength":1}},"terms":{"type":"object","maxProperties":100,"additionalProperties":{"type":"string","minLength":1}}},"required":["key","activityDocumentId","partyRole"]},"minItems":1,"maxItems":100},"consequences":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"key":{"type":"string","minLength":1},"sourceRights":{"type":"array","items":{"type":"string","minLength":1},"minItems":1,"maxItems":100},"rule":{"anyOf":[{"type":"object","additionalProperties":false,"properties":{"type":{"const":"grant_capacity"},"capacityLedger":{"type":"string","minLength":1},"quantity":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"expiresAtTerm":{"type":"string","minLength":1}},"required":["type","capacityLedger","quantity","expiresAtTerm"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"consume_capacity"},"capacityLedger":{"type":"string","minLength":1},"quantity":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"grantOccurrenceFact":{"type":"string","minLength":1},"overageRight":{"type":"string","minLength":1}},"required":["type","capacityLedger","quantity","grantOccurrenceFact"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"expire_capacity"},"capacityLedger":{"type":"string","minLength":1},"valueLedger":{"type":"string","minLength":1}},"required":["type","capacityLedger"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"minimum"},"eligibleRights":{"type":"array","items":{"type":"string","minLength":1},"minItems":1,"maxItems":100},"minimum":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"currencyTerm":{"type":"string","minLength":1},"completeThroughFact":{"type":"string","minLength":1}},"required":["type","eligibleRights","minimum","currencyTerm","completeThroughFact"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"refund_unearned"},"monetaryLedger":{"type":"string","minLength":1},"amount":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"taxClaimFact":{"type":"string","minLength":1}},"required":["type","monetaryLedger","amount"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"profit_allocation"},"result":{"enum":["profit","loss"]},"monetaryLedger":{"type":"string","minLength":1},"ownershipLedger":{"type":"string","minLength":1},"amount":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"completeThroughFact":{"type":"string","minLength":1}},"required":["type","monetaryLedger","ownershipLedger","amount","completeThroughFact"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"profit_allocation"},"result":{"enum":["profit","loss"]},"monetaryLedger":{"type":"string","minLength":1},"ownershipBasis":{"const":"agreement"},"amount":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"completeThroughFact":{"type":"string","minLength":1}},"required":["type","monetaryLedger","ownershipBasis","amount","completeThroughFact"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"close_draws"},"monetaryLedger":{"type":"string","minLength":1},"completeThroughFact":{"type":"string","minLength":1}},"required":["type","monetaryLedger","completeThroughFact"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"authorize_units"},"unitsLedger":{"type":"string","minLength":1},"quantity":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"}},"required":["type","unitsLedger","quantity"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"issue_units"},"capitalAllocation":{"type":"object","additionalProperties":false,"properties":{"shareCapital":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"sharePremium":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"}},"required":["shareCapital","sharePremium"]},"unitsLedger":{"type":"string","minLength":1},"quantity":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"consideration":{"anyOf":[{"type":"object","additionalProperties":false,"properties":{"type":{"const":"money"},"amount":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"currencyTerm":{"type":"string","minLength":1},"recognition":{"enum":["unconditional_obligation","condition_satisfied"]}},"required":["type","amount","currencyTerm","recognition"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"units"},"quantity":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"ledger":{"type":"string","minLength":1}},"required":["type","quantity","ledger"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"claim"},"claimFact":{"type":"string","minLength":1},"amount":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"currencyTerm":{"type":"string","minLength":1}},"required":["type","claimFact","amount","currencyTerm"]}]},"restricted":{"type":"boolean"}},"required":["type","unitsLedger","quantity","consideration","restricted"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"capital_contribution"},"consideration":{"anyOf":[{"type":"object","additionalProperties":false,"properties":{"type":{"const":"money"},"amount":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"currencyTerm":{"type":"string","minLength":1},"recognition":{"enum":["unconditional_obligation","condition_satisfied"]}},"required":["type","amount","currencyTerm","recognition"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"units"},"quantity":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"ledger":{"type":"string","minLength":1}},"required":["type","quantity","ledger"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"claim"},"claimFact":{"type":"string","minLength":1},"amount":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"currencyTerm":{"type":"string","minLength":1}},"required":["type","claimFact","amount","currencyTerm"]}]}},"required":["type","consideration"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"financing_commitment"},"consideration":{"anyOf":[{"type":"object","additionalProperties":false,"properties":{"type":{"const":"money"},"amount":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"currencyTerm":{"type":"string","minLength":1},"recognition":{"enum":["unconditional_obligation","condition_satisfied"]}},"required":["type","amount","currencyTerm","recognition"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"units"},"quantity":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"ledger":{"type":"string","minLength":1}},"required":["type","quantity","ledger"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"claim"},"claimFact":{"type":"string","minLength":1},"amount":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"currencyTerm":{"type":"string","minLength":1}},"required":["type","claimFact","amount","currencyTerm"]}]},"liability":{"const":"owner_advance"}},"required":["type","consideration"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"capital_distribution"},"amount":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"}},"required":["type","amount"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"owner_draw"},"amount":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"}},"required":["type","amount"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"vest_units"},"unitsLedger":{"type":"string","minLength":1},"quantity":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"grantOccurrenceFact":{"type":"string","minLength":1}},"required":["type","unitsLedger","quantity","grantOccurrenceFact"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"vest_units"},"unitsLedger":{"type":"string","minLength":1},"quantity":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"grantConsequence":{"type":"string","minLength":1}},"required":["type","unitsLedger","quantity","grantConsequence"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"convert_claim"},"claimFact":{"type":"string","minLength":1},"amount":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"currencyTerm":{"type":"string","minLength":1},"monetaryLedger":{"type":"string","minLength":1},"equityAccount":{"enum":[3100,3110,3120]},"units":{"type":"object","additionalProperties":false,"properties":{"ledger":{"type":"string","minLength":1},"quantity":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"restricted":{"type":"boolean"}},"required":["ledger","quantity","restricted"]}},"required":["type","claimFact","amount","currencyTerm","monetaryLedger","equityAccount"]}]},"trigger":{"anyOf":[{"type":"object","additionalProperties":false,"properties":{"type":{"const":"transition"},"action":{"enum":["accept","cancel","terminate"]}},"required":["type","action"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"exercise"},"activityKey":{"type":"string","minLength":1}},"required":["type","activityKey"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"period_close"},"schedule":{"type":"object","additionalProperties":false,"properties":{"startTerm":{"type":"string","minLength":1},"anchorTerm":{"type":"string","minLength":1},"endTerm":{"type":"string","minLength":1},"everyMonths":{"type":"integer","minimum":1,"maximum":120},"timing":{"enum":["start","end"]},"offsetDays":{"type":"integer","minimum":-365,"maximum":365},"serviceEvidence":{"const":"elapsed_time"}},"required":["startTerm","everyMonths","timing","offsetDays"]}},"required":["type","schedule"]}]},"evidence":{"type":"array","items":{"enum":["acceptance","economic","service"]},"minItems":1,"maxItems":100}},"required":["key","sourceRights","trigger","rule","evidence"]},"minItems":0,"maxItems":100}},"required":["model","name","parties","activities"]},"parties":{"type":"object","additionalProperties":{"type":"string","minLength":1},"maxProperties":100},"terms":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"string","minLength":1},"maxProperties":100},"maxProperties":100},"ledgerBindings":{"type":"object","additionalProperties":{"type":"string","minLength":1},"maxProperties":100,"description":"Ledger alias → existing ledger id. Every GAAP alias needs one. A business starts with its selected functional-currency ledger (USD only when omitted at initialization); binding a GAAP alias to another currency's canonical id (led_ + the zero-padded ISO 4217 numeric code, e.g. led_00000000000000000000000978 for EUR) opens that ledger with this contract, even while it is a draft."},"sourceDocumentIds":{"type":"array","items":{"type":"string","minLength":1},"maxItems":100}},"required":["parties"]},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"source_document_id":{"description":"A registered document of kind contract, template, source_document that caused this command.","type":"string","minLength":1}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"contracts.discard"},"input":{"type":"object","additionalProperties":false,"properties":{"contractId":{"type":"string","minLength":1},"expectedDocumentId":{"type":"string","minLength":1}},"required":["contractId","expectedDocumentId"]},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"contracts.offer"},"input":{"type":"object","additionalProperties":false,"required":["contractId","expectedDocumentId","expectedStatus","effectiveAt","sourceFactId","evidence"],"properties":{"contractId":{"type":"string","minLength":1},"expectedDocumentId":{"type":"string","minLength":1},"expectedStatus":{"enum":["draft","offer","active","rejected","terminated","expired"]},"effectiveAt":{"type":"string","minLength":1},"sourceFactId":{"type":"string","minLength":1},"facts":{"type":"object","maxProperties":100},"evidence":{"type":"object","additionalProperties":false,"required":["acceptance"],"properties":{"acceptance":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}},"economic":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}},"service":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}}}}}},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"source_document_id":{"description":"A registered document of kind contract, source_document that caused this command.","type":"string","minLength":1}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"contracts.record"},"input":{"type":"object","additionalProperties":false,"properties":{"contractId":{"type":"string","minLength":1},"activityKey":{"type":"string","minLength":1},"occurrenceKey":{"type":"string","minLength":1},"sourceFactId":{"type":"string","minLength":1},"effectiveAt":{"type":"string","minLength":1,"format":"date-time"},"dueDate":{"type":"string","minLength":1,"format":"date","description":"Evidenced due date for a priced-right billing claim only; omit when unknown."},"facts":{"type":"object","maxProperties":100,"additionalProperties":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":false,"required":["occurrenceId"],"properties":{"occurrenceId":{"type":"string","minLength":1}}},{"type":"object","additionalProperties":false,"required":["claimId","component"],"properties":{"claimId":{"type":"string","minLength":1},"component":{"type":"object","additionalProperties":false,"required":["originLedgerId","accountCode"],"properties":{"originLedgerId":{"type":"string","minLength":1},"accountCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}}}}]}},"evidence":{"type":"object","additionalProperties":false,"properties":{"payment":{"type":"array","maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}},"service":{"type":"array","maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}},"acceptance":{"type":"array","maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}},"billing":{"type":"array","maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}},"economic":{"type":"array","maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}}}},"correctsOccurrenceId":{"type":"string","minLength":1},"exchangeRate":{"type":"object","additionalProperties":false,"required":["base","quote","date","numerator","denominator","evidence"],"description":"An evidenced exchange rate (1 base = numerator/denominator quote), e.g. from a bank statement. It overrides the shared rate store for this command; omit it to use the store.","properties":{"base":{"type":"string","pattern":"^[A-Z]{3}$"},"quote":{"type":"string","pattern":"^[A-Z]{3}$"},"date":{"type":"string","format":"date"},"numerator":{"type":"string","pattern":"^[1-9][0-9]*$"},"denominator":{"type":"string","pattern":"^[1-9][0-9]*$"},"evidence":{"type":"array","minItems":1,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string"}}}}}},"paymentMethodId":{"type":"string","minLength":1},"phase":{"enum":["billing","delivery","usage","recognition","exercise","period_close"]},"serviceShare":{"type":"object","additionalProperties":false,"required":["index","count","billingOccurrenceId"],"properties":{"billingOccurrenceId":{"type":"string","minLength":1},"index":{"type":"integer","minimum":1,"maximum":12},"count":{"type":"integer","minimum":1,"maximum":12}}},"consequenceKey":{"type":"string","minLength":1},"obligationKey":{"type":"string","minLength":1},"period":{"type":"object","additionalProperties":false,"required":["from","through"],"properties":{"from":{"type":"string","minLength":1,"format":"date-time"},"through":{"type":"string","minLength":1,"format":"date-time"}}}},"required":["contractId","activityKey","occurrenceKey","sourceFactId","effectiveAt"]},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"source_document_id":{"description":"A registered document of kind source_document, activity_statement, contract that caused this command.","type":"string","minLength":1}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"contracts.reverse_economics"},"input":{"type":"object","additionalProperties":false,"required":["contractId","activityKey","occurrenceId","effectiveAt","sourceFactId","evidence"],"properties":{"contractId":{"type":"string","minLength":1},"activityKey":{"type":"string","minLength":1},"occurrenceId":{"type":"string","minLength":1},"sourceFactId":{"type":"string","minLength":1},"effectiveAt":{"type":"string","format":"date-time"},"evidence":{"type":"array","minItems":1,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}},"refundSettled":{"const":true}}},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"source_document_id":{"description":"A registered document of kind source_document that caused this command.","type":"string","minLength":1}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"contracts.terminate"},"input":{"type":"object","additionalProperties":false,"required":["contractId","expectedDocumentId","expectedStatus","effectiveAt","sourceFactId","evidence"],"properties":{"contractId":{"type":"string","minLength":1},"expectedDocumentId":{"type":"string","minLength":1},"expectedStatus":{"enum":["draft","offer","active","rejected","terminated","expired"]},"effectiveAt":{"type":"string","minLength":1},"sourceFactId":{"type":"string","minLength":1},"facts":{"type":"object","maxProperties":100},"exchangeRate":{"type":"object","additionalProperties":false,"required":["base","quote","date","numerator","denominator","evidence"],"description":"An evidenced exchange rate (1 base = numerator/denominator quote), e.g. from a bank statement. It overrides the shared rate store for this command; omit it to use the store.","properties":{"base":{"type":"string","pattern":"^[A-Z]{3}$"},"quote":{"type":"string","pattern":"^[A-Z]{3}$"},"date":{"type":"string","format":"date"},"numerator":{"type":"string","pattern":"^[1-9][0-9]*$"},"denominator":{"type":"string","pattern":"^[1-9][0-9]*$"},"evidence":{"type":"array","minItems":1,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string"}}}}}},"evidence":{"type":"object","additionalProperties":false,"required":["acceptance"],"properties":{"acceptance":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}},"economic":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}},"service":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}}}}}},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"source_document_id":{"description":"A registered document of kind contract, source_document that caused this command.","type":"string","minLength":1}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"documents.receive"},"input":{"type":"object","properties":{"kind":{"enum":["source_document","activity","template","contract","activity_statement","contract_lifecycle_statement","image"]},"contentBase64":{"type":"string","minLength":1,"maxLength":13981016,"pattern":"^[A-Za-z0-9+/]+={0,2}$","description":"The exact artifact bytes encoded as base64: at most 10485760 bytes for a source_document, 262144 bytes for the structured kinds."},"externalId":{"type":"string","minLength":1,"maxLength":200},"title":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[^\\r\\n]*\\S[^\\r\\n]*$","description":"What the document is called, in the founder's words. Omit to take it from the content."}},"required":["kind","contentBase64"],"additionalProperties":false},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"documents.relate"},"input":{"type":"object","properties":{"fromDocumentId":{"type":"string","minLength":1},"toDocumentId":{"type":"string","minLength":1},"relation":{"enum":["supersedes","based_on","amends","incorporates","responds_to"]}},"required":["fromDocumentId","toDocumentId","relation"],"additionalProperties":false},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"ingestions.agreement_proposal"},"input":{"type":"object","additionalProperties":false,"required":["ingestionId","agreementText","partyBindings"],"properties":{"ingestionId":{"type":"string"},"agreementText":{"type":"string"},"templateDocumentId":{"type":"string"},"partyBindings":{"type":"object","maxProperties":100,"additionalProperties":{"type":"string"}},"ledgerBindings":{"type":"object","maxProperties":100,"additionalProperties":{"type":"string"}}}},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"ingestions.amendment_proposal"},"input":{"type":"object","additionalProperties":false,"required":["ingestionId","amendmentText","contractId","expectedDocumentId"],"properties":{"ingestionId":{"type":"string"},"amendmentText":{"type":"string"},"contractId":{"type":"string"},"expectedDocumentId":{"type":"string"},"acceptanceEvidence":{"type":"array","minItems":0,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}}}},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"ingestions.attach_original"},"input":{"type":"object","additionalProperties":false,"properties":{"ingestionId":{"type":"string","minLength":1},"file":{"type":"object","description":"Retains exact source bytes. Text/Markdown/JSON bypasses PDF/OCR. Candidate PDF/image extraction retains source-bound text before classification; supported PDFs are limited to 50 pages, with explicit unsupported/limit failures. Optional attachments do not verify supplied transcriptions.","additionalProperties":false,"properties":{"filename":{"type":"string","minLength":1,"maxLength":200},"contentType":{"enum":["application/pdf","text/plain","text/markdown","text/csv","application/json","image/png","image/jpeg","image/webp"]},"size":{"type":"integer","minimum":1,"maximum":10485760,"description":"Exact byte length. Images are limited to 256 KiB; other files to 10 MiB."}},"required":["filename","contentType","size"]}},"required":["ingestionId","file"]},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"ingestions.credit_proposal"},"input":{"type":"object","additionalProperties":false,"required":["ingestionId","creditText","expenseTargets"],"properties":{"ingestionId":{"type":"string"},"creditText":{"type":"string"},"expenseTargets":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"properties":{"contractId":{"type":"string","minLength":1,"maxLength":128},"activityKey":{"type":"string","minLength":1,"maxLength":128}},"required":["contractId","activityKey"]}}}},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"ingestions.invoice_candidates"},"input":{"type":"object","additionalProperties":false,"properties":{"ingestionId":{"type":"string"},"invoiceText":{"type":"string","maxLength":65536}},"required":["ingestionId","invoiceText"]},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"ingestions.receipt_proposal"},"input":{"type":"object","additionalProperties":false,"required":["ingestionId","receiptText","expenseTargets","financialAccountId"],"properties":{"ingestionId":{"type":"string"},"receiptText":{"type":"string"},"expenseTargets":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"properties":{"contractId":{"type":"string","minLength":1,"maxLength":128},"activityKey":{"type":"string","minLength":1,"maxLength":128}},"required":["contractId","activityKey"]}},"financialAccountId":{"type":"string"}}},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"ingestions.reissue_upload"},"input":{"type":"object","additionalProperties":false,"properties":{"ingestionId":{"type":"string","minLength":1},"role":{"enum":["primary","original"]}},"required":["ingestionId","role"]},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"ingestions.resolve"},"input":{"type":"object","additionalProperties":false,"properties":{"ingestionId":{"type":"string"},"expectedProposalRevision":{"type":"integer","minimum":1,"maximum":7},"expenseTargets":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"properties":{"contractId":{"type":"string","minLength":1,"maxLength":128},"activityKey":{"type":"string","minLength":1,"maxLength":128}},"required":["contractId","activityKey"]}},"invoiceText":{"type":"string","maxLength":65536},"invoiceChoices":{"type":"object","additionalProperties":false,"properties":{"headers":{"type":"object","additionalProperties":false,"properties":{"vendor":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"},"buyer":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"},"externalId":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"},"date":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"},"currency":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"},"total":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"}},"required":["vendor","buyer","externalId","date","currency","total"]},"service":{"enum":["delivered","not_delivered","unclear"]},"rows":{"type":"array","maxItems":64,"items":{"type":"object","additionalProperties":false,"properties":{"role":{"enum":["charge","tax","summary","other","unclear"]},"amount":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"}},"required":["role","amount"]}}},"required":["headers","service","rows"]}},"required":["ingestionId","expectedProposalRevision","expenseTargets"]},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"ingestions.start"},"input":{"type":"object","additionalProperties":false,"properties":{"source":{"anyOf":[{"type":"object","additionalProperties":false,"properties":{"type":{"const":"text"},"format":{"enum":["text","markdown"]},"text":{"type":"string","minLength":1,"maxLength":65536,"description":"Retention limit is 64 KiB of UTF-8; current classification requires the whole serialized request (text, instructions and business context) to fit within 48 KiB, otherwise polling reports classifier_input_too_large."}},"required":["type","format","text"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"document"},"documentId":{"type":"string","minLength":1}},"required":["type","documentId"]},{"type":"object","description":"Retains exact source bytes. Text/Markdown/JSON bypasses PDF/OCR. Candidate PDF/image extraction retains source-bound text before classification; supported PDFs are limited to 50 pages, with explicit unsupported/limit failures. Optional attachments do not verify supplied transcriptions.","additionalProperties":false,"properties":{"filename":{"type":"string","minLength":1,"maxLength":200},"contentType":{"enum":["application/pdf","text/plain","text/markdown","text/csv","application/json","image/png","image/jpeg","image/webp"]},"size":{"type":"integer","minimum":1,"maximum":10485760,"description":"Exact byte length. Images are limited to 256 KiB; other files to 10 MiB."},"type":{"const":"file"}},"required":["filename","contentType","size","type"]}]},"mode":{"enum":["propose","auto_record"],"default":"propose"},"recordingPolicy":{"type":"object","additionalProperties":false,"properties":{"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"maxAmountMinor":{"type":"string","pattern":"^[1-9][0-9]{0,18}$"},"maxDailyTotalMinor":{"type":"string","pattern":"^[1-9][0-9]{0,18}$","description":"Upper bound, in currency minor units, on the total this business records automatically per UTC day across all auto_record ingestions; a proposal that would exceed it needs review (daily_total_exceeded)."},"minimumConfidencePercent":{"type":"integer","minimum":60,"maximum":100},"fundingAccounts":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["financialAccountId","currency","last4","kind","glAccountCode"],"properties":{"financialAccountId":{"type":"string","minLength":1,"maxLength":128},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"last4":{"type":"string","pattern":"^[0-9]{4}$"},"kind":{"enum":["checking","savings","card","wallet","other"]},"glAccountCode":{"enum":[1110,1310,2190,2135]},"ownerPartyId":{"type":"string","minLength":1},"providerPartyId":{"type":"string","minLength":1}}}},"targets":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"properties":{"contractId":{"type":"string","minLength":1,"maxLength":128},"activityKey":{"type":"string","minLength":1,"maxLength":128},"cid":{"type":"string","minLength":1,"maxLength":128}},"required":["contractId","activityKey","cid"]}}},"required":["currency","maxAmountMinor","maxDailyTotalMinor","minimumConfidencePercent","targets"]},"expenseTargets":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"properties":{"contractId":{"type":"string","minLength":1,"maxLength":128},"activityKey":{"type":"string","minLength":1,"maxLength":128}},"required":["contractId","activityKey"]},"description":"Optional bounded hints for structured vendor-invoice proposals against existing activities. Requires whole-domain document, subject, party and ledger reads, plus activity_effects report access. Automatic execution requires a separate explicit frozen recordingPolicy."},"original":{"type":"object","description":"Retains exact source bytes. Text/Markdown/JSON bypasses PDF/OCR. Candidate PDF/image extraction retains source-bound text before classification; supported PDFs are limited to 50 pages, with explicit unsupported/limit failures. Optional attachments do not verify supplied transcriptions.","additionalProperties":false,"properties":{"filename":{"type":"string","minLength":1,"maxLength":200},"contentType":{"enum":["application/pdf","text/plain","text/markdown","text/csv","application/json","image/png","image/jpeg","image/webp"]},"size":{"type":"integer","minimum":1,"maximum":10485760,"description":"Exact byte length. Images are limited to 256 KiB; other files to 10 MiB."}},"required":["filename","contentType","size"]},"relationship":{"enum":["transcription","summary","related_original"],"description":"Caller-declared relationship between primary text and an optional original; retained as unverified."}},"required":["source"]},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"ingestions.statement_matches"},"input":{"type":"object","additionalProperties":false,"properties":{"ingestionId":{"type":"string"},"statementText":{"type":"string"}},"required":["ingestionId","statementText"]},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"journal.post"},"input":{"type":"object","required":["description","currency","lines"],"properties":{"description":{"type":"string","maxLength":1024},"currency":{"type":"string","examples":["USD"]},"externalRef":{"type":"string","maxLength":200},"lines":{"type":"array","minItems":2,"maxItems":100,"items":{"type":"object","required":["accountCode","direction","amount"],"properties":{"accountCode":{"type":"integer"},"direction":{"enum":["debit","credit"]},"amount":{"type":"string","pattern":"^(0|[1-9][0-9]*)$"},"subKey":{"type":"object","properties":{"kind":{"enum":[0,1,2,3,4,5,6]},"symbol":{"type":"string"},"partyId":{"type":"string"},"sku":{"type":"string"},"financialAccountId":{"type":"string"},"taxCodeId":{"type":"string"},"expenseFunction":{"enum":["cost_of_revenue","research_and_development","sales_and_marketing","general_and_administrative","other"]}}},"asset":{"type":"string"},"assetAmount":{"type":"string"},"externalId":{"type":"string","maxLength":200}}}}},"additionalProperties":false},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"source_document_id":{"description":"A registered document of kind source_document that caused this command.","type":"string","minLength":1}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"journal.void"},"input":{"type":"object","required":["eventId"],"properties":{"eventId":{"type":"integer","minimum":1},"reason":{"type":"string","maxLength":200}},"additionalProperties":false},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"members.grant"},"input":{"type":"object","properties":{"principalId":{"type":"string","minLength":1,"maxLength":128,"description":"A principal id the platform knows, obtained from the person's sign-in; never invented."},"role":{"enum":["owner","member"]},"preset":{"type":"object","properties":{"name":{},"version":{"const":1}},"required":["name","version"]},"permissions":{"type":"array","items":{"type":"object"},"description":"Explicit permission statements, required for members."}},"required":["principalId"],"additionalProperties":false},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"members.revoke"},"input":{"type":"object","properties":{"principalId":{"type":"string","minLength":1,"maxLength":128}},"required":["principalId"],"additionalProperties":false},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"messages.send"},"input":{"type":"object","additionalProperties":false,"properties":{"to":{"type":"string","minLength":1,"description":"The recipient's party id in these books; it must be a party this business holds a platform-bound agreement with. Omit it to write to Economico."},"topic":{"enum":["support","feature_suggestion","general"],"description":"support: something is broken, unclear or you are stuck. feature_suggestion: a capability Economico does not have yet. general: anything else."},"inReplyTo":{"type":"string","minLength":1,"description":"The id of a message this business received. The reply goes to its sender; topic and subject default from it."},"about":{"type":"array","maxItems":10,"items":{"type":"string","minLength":1},"description":"Document ids in these books the message is about, such as an invoice you received."},"subject":{"type":"string","minLength":1,"maxLength":200},"body":{"type":"string","minLength":1,"maxLength":5000},"context":{"type":"object","maxProperties":20,"propertyNames":{"minLength":1,"maxLength":64},"additionalProperties":{"type":"string","maxLength":500},"description":"Optional structured detail about what you were doing, such as the tool or workflow you attempted."}},"required":["body"]},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"opportunities.link"},"input":{"type":"object","additionalProperties":false,"properties":{"opportunityId":{"type":"string","minLength":1},"expectedRevision":{"type":"integer","minimum":1},"contractId":{"type":"string","minLength":1},"contractDocumentId":{"type":"string","minLength":1},"activityKey":{"type":"string","minLength":1},"occurrenceKey":{"type":"string","minLength":1}},"required":["opportunityId","expectedRevision","contractId","contractDocumentId"]},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"opportunities.lose"},"input":{"type":"object","additionalProperties":false,"properties":{"opportunityId":{"type":"string","minLength":1},"expectedRevision":{"type":"integer","minimum":1},"reason":{"type":"string","minLength":1}},"required":["opportunityId","expectedRevision","reason"]},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"opportunities.open"},"input":{"type":"object","additionalProperties":false,"properties":{"opportunityKey":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"partyId":{"type":"string","minLength":1},"cohort":{"enum":["customer","vendor","financing"]},"kind":{"enum":["new","renewal","expansion"]},"currency":{"type":"string","minLength":1},"expectedValue":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"weightBps":{"type":"integer","minimum":0,"maximum":10000},"expectedCloseOn":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"stage":{"enum":["open","qualified","proposed"]},"predecessorContractId":{"type":"string","minLength":1}},"required":["opportunityKey","name","partyId","cohort","kind","currency"]},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"opportunities.stage"},"input":{"type":"object","additionalProperties":false,"properties":{"opportunityId":{"type":"string","minLength":1},"expectedRevision":{"type":"integer","minimum":1},"stage":{"enum":["open","qualified","proposed"]},"weightBps":{"type":"integer","minimum":0,"maximum":10000},"expectedValue":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"expectedCloseOn":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]}},"required":["opportunityId","expectedRevision","stage"]},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"parties.add_contact"},"input":{"type":"object","properties":{"contactId":{"type":"string","minLength":1},"partyId":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"email":{"type":"string","format":"email","maxLength":254},"role":{"type":"string"}},"required":["contactId","partyId","name","email"],"additionalProperties":false},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"parties.archive"},"input":{"type":"object","properties":{"partyId":{"type":"string","minLength":1}},"required":["partyId"],"additionalProperties":false},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"parties.create"},"input":{"type":"object","properties":{"partyId":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"legalName":{"type":"string","minLength":1,"maxLength":500,"pattern":"^[^\\r\\n]*\\S[^\\r\\n]*$","description":"The registered name, when it differs from the name the party is known by (Y Combinator's fund, say)."},"url":{"type":"string"},"iri":{"type":"string","minLength":1},"categories":{"type":"array","items":{"enum":["customer","vendor","founder","investor","provider","employee"]}},"relatedParty":{"type":"boolean"}},"required":["partyId","name"],"additionalProperties":false},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"parties.remove_contact"},"input":{"type":"object","properties":{"partyId":{"type":"string","minLength":1},"contactId":{"type":"string","minLength":1}},"required":["partyId","contactId"],"additionalProperties":false},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"parties.set_address"},"input":{"type":"object","properties":{"partyId":{"type":"string","minLength":1},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1},"line2":{"type":"string","minLength":1},"city":{"type":"string","minLength":1},"region":{"type":"string","minLength":1},"postalCode":{"type":"string","minLength":1},"country":{"type":"string","minLength":1}},"anyOf":[{"type":"object","properties":{"line1":{"type":"string","minLength":1}},"required":["line1"]},{"type":"object","properties":{"line2":{"type":"string","minLength":1}},"required":["line2"]},{"type":"object","properties":{"city":{"type":"string","minLength":1}},"required":["city"]},{"type":"object","properties":{"region":{"type":"string","minLength":1}},"required":["region"]},{"type":"object","properties":{"postalCode":{"type":"string","minLength":1}},"required":["postalCode"]},{"type":"object","properties":{"country":{"type":"string","minLength":1}},"required":["country"]}],"additionalProperties":false}},"required":["partyId","address"],"additionalProperties":false},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"parties.update"},"input":{"type":"object","properties":{"partyId":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"legalName":{"type":"string","minLength":1,"maxLength":500,"pattern":"^[^\\r\\n]*\\S[^\\r\\n]*$","description":"The registered name, when it differs from the name the party is known by (Y Combinator's fund, say)."},"url":{"type":"string"},"iri":{"type":"string","minLength":1},"categories":{"type":"array","items":{"enum":["customer","vendor","founder","investor","provider","employee"]}},"relatedParty":{"type":"boolean"}},"required":["partyId"],"anyOf":[{"type":"object","properties":{"relatedParty":{"type":"boolean"}},"required":["relatedParty"]},{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},{"type":"object","properties":{"legalName":{"type":"string"}},"required":["legalName"]},{"type":"object","properties":{"url":{"type":"string"}},"required":["url"]},{"type":"object","properties":{"categories":{"type":"array"}},"required":["categories"]}],"additionalProperties":false},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"payment_endpoints.register"},"input":{"type":"object","additionalProperties":false,"properties":{"paymentEndpointId":{"type":"string","minLength":1},"financialAccountId":{"type":"string","minLength":1},"partyId":{"type":"string","minLength":1},"uri":{"type":"string"},"label":{"type":"string"},"active":{"type":"boolean"},"methods":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"properties":{"direction":{"enum":["in","out"]},"rail":{"enum":["ach","ach_same_day","fedwire","rtp","sepa","sepa_instant","swift","onchain","internal","card"]},"asset":{"type":"string","minLength":1},"enabled":{"type":"boolean"},"etaSeconds":{"type":"integer","minimum":0},"minAmountMinor":{"type":"string","pattern":"^(0|[1-9][0-9]*)$"},"maxAmountMinor":{"type":"string","pattern":"^(0|[1-9][0-9]*)$"}},"required":["direction","rail","asset"]}}},"required":["paymentEndpointId","methods"]},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"payment_endpoints.update"},"input":{"type":"object","additionalProperties":false,"properties":{"paymentEndpointId":{"type":"string","minLength":1},"label":{"type":"string"},"active":{"type":"boolean"}},"required":["paymentEndpointId"]},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"payments.allocate"},"input":{"type":"object","additionalProperties":false,"required":["paymentId","sourceFactId","effectiveAt","evidence","allocations"],"properties":{"exchangeRate":{"type":"object","additionalProperties":false,"required":["base","quote","date","numerator","denominator","evidence"],"description":"An evidenced exchange rate (1 base = numerator/denominator quote), e.g. from a bank statement. It overrides the shared rate store for this command; omit it to use the store.","properties":{"base":{"type":"string","pattern":"^[A-Z]{3}$"},"quote":{"type":"string","pattern":"^[A-Z]{3}$"},"date":{"type":"string","format":"date"},"numerator":{"type":"string","pattern":"^[1-9][0-9]*$"},"denominator":{"type":"string","pattern":"^[1-9][0-9]*$"},"evidence":{"type":"array","minItems":1,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string"}}}}}},"paymentId":{"type":"string","minLength":1},"sourceFactId":{"type":"string","minLength":1},"effectiveAt":{"type":"string","format":"date-time"},"evidence":{"type":"array","minItems":1,"items":{"type":"object","properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}},"required":["kind","ref"],"additionalProperties":false}},"allocations":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","additionalProperties":false,"required":["claimId","component","amount"],"properties":{"claimId":{"type":"string","minLength":1},"amount":{"type":"string","pattern":"^[1-9][0-9]*$"},"cashAmount":{"type":"string","pattern":"^[1-9][0-9]*$"},"component":{"type":"object","additionalProperties":false,"required":["originLedgerId","accountCode"],"properties":{"originLedgerId":{"type":"string","minLength":1},"accountCode":{"type":"integer"}}}}}}}},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"payments.process"},"input":{"type":"object","additionalProperties":false,"required":["payment","rail","netAmount","evidence"],"properties":{"payment":{"type":"object","additionalProperties":false,"required":["financialAccountId","direction","amount","currency","partyId","effectiveAt","sourceFactId","evidence","allocations"],"properties":{"exchangeRate":{"type":"object","additionalProperties":false,"required":["base","quote","date","numerator","denominator","evidence"],"description":"An evidenced exchange rate (1 base = numerator/denominator quote), e.g. from a bank statement. It overrides the shared rate store for this command; omit it to use the store.","properties":{"base":{"type":"string","pattern":"^[A-Z]{3}$"},"quote":{"type":"string","pattern":"^[A-Z]{3}$"},"date":{"type":"string","format":"date"},"numerator":{"type":"string","pattern":"^[1-9][0-9]*$"},"denominator":{"type":"string","pattern":"^[1-9][0-9]*$"},"evidence":{"type":"array","minItems":1,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string"}}}}}},"refundsFundingClaim":{"type":"object","additionalProperties":false,"properties":{"claimId":{"type":"string","minLength":1},"component":{"type":"object","additionalProperties":false,"required":["originLedgerId","accountCode"],"properties":{"originLedgerId":{"type":"string","minLength":1},"accountCode":{"type":"integer"}}}},"required":["claimId","component"]},"financialAccountId":{"type":"string","minLength":1},"direction":{"enum":["in","out"]},"amount":{"type":"string","pattern":"^[1-9][0-9]*$"},"currency":{"type":"string","minLength":1},"partyId":{"type":"string","minLength":1},"effectiveAt":{"type":"string","format":"date-time"},"sourceFactId":{"type":"string","minLength":1},"evidence":{"type":"array","minItems":1,"items":{"type":"object","properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}},"required":["kind","ref"],"additionalProperties":false}},"allocations":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","additionalProperties":false,"required":["claimId","component","amount"],"properties":{"claimId":{"type":"string","minLength":1},"amount":{"type":"string","pattern":"^[1-9][0-9]*$"},"cashAmount":{"type":"string","pattern":"^[1-9][0-9]*$"},"component":{"type":"object","additionalProperties":false,"required":["originLedgerId","accountCode"],"properties":{"originLedgerId":{"type":"string","minLength":1},"accountCode":{"type":"integer"}}}}}}}},"rail":{"enum":["ach","ach_same_day","fedwire","rtp","sepa","sepa_instant","swift","onchain","internal","card"]},"netAmount":{"type":"string","pattern":"^(0|-?[1-9][0-9]*)$"},"feeFacts":{"type":"object","maxProperties":20,"additionalProperties":{"type":"string","pattern":"^(0|[1-9][0-9]*)$"}},"evidence":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","required":["kind","ref"],"additionalProperties":false,"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}}}},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"payments.record"},"input":{"type":"object","additionalProperties":false,"required":["financialAccountId","direction","amount","currency","partyId","effectiveAt","sourceFactId","evidence","allocations"],"properties":{"exchangeRate":{"type":"object","additionalProperties":false,"required":["base","quote","date","numerator","denominator","evidence"],"description":"An evidenced exchange rate (1 base = numerator/denominator quote), e.g. from a bank statement. It overrides the shared rate store for this command; omit it to use the store.","properties":{"base":{"type":"string","pattern":"^[A-Z]{3}$"},"quote":{"type":"string","pattern":"^[A-Z]{3}$"},"date":{"type":"string","format":"date"},"numerator":{"type":"string","pattern":"^[1-9][0-9]*$"},"denominator":{"type":"string","pattern":"^[1-9][0-9]*$"},"evidence":{"type":"array","minItems":1,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string"}}}}}},"refundsFundingClaim":{"type":"object","additionalProperties":false,"properties":{"claimId":{"type":"string","minLength":1},"component":{"type":"object","additionalProperties":false,"required":["originLedgerId","accountCode"],"properties":{"originLedgerId":{"type":"string","minLength":1},"accountCode":{"type":"integer"}}}},"required":["claimId","component"]},"financialAccountId":{"type":"string","minLength":1},"direction":{"enum":["in","out"]},"amount":{"type":"string","pattern":"^[1-9][0-9]*$"},"currency":{"type":"string","minLength":1},"partyId":{"type":"string","minLength":1},"effectiveAt":{"type":"string","format":"date-time"},"sourceFactId":{"type":"string","minLength":1},"evidence":{"type":"array","minItems":1,"items":{"type":"object","properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}},"required":["kind","ref"],"additionalProperties":false}},"allocations":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","additionalProperties":false,"required":["claimId","component","amount"],"properties":{"claimId":{"type":"string","minLength":1},"amount":{"type":"string","pattern":"^[1-9][0-9]*$"},"cashAmount":{"type":"string","pattern":"^[1-9][0-9]*$"},"component":{"type":"object","additionalProperties":false,"required":["originLedgerId","accountCode"],"properties":{"originLedgerId":{"type":"string","minLength":1},"accountCode":{"type":"integer"}}}}}}}},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"payments.reverse"},"input":{"type":"object","additionalProperties":false,"required":["paymentId","sourceFactId","effectiveAt","evidence"],"properties":{"paymentId":{"type":"string","minLength":1},"sourceFactId":{"type":"string","minLength":1},"effectiveAt":{"type":"string","format":"date-time"},"evidence":{"type":"array","minItems":1,"items":{"type":"object","properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}},"required":["kind","ref"],"additionalProperties":false}}}},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"payments.transfer"},"input":{"type":"object","additionalProperties":false,"required":["fromAccountId","toAccountId","amount","currency","effectiveAt","sourceFactId","evidence"],"properties":{"fromAccountId":{"type":"string","minLength":1},"toAccountId":{"type":"string","minLength":1},"amount":{"type":"string","pattern":"^[1-9][0-9]*$"},"currency":{"type":"string","minLength":1},"receivedAmount":{"type":"string","pattern":"^[1-9][0-9]*$"},"receivedCurrency":{"type":"string","minLength":1},"effectiveAt":{"type":"string","format":"date-time"},"sourceFactId":{"type":"string","minLength":1},"evidence":{"type":"array","minItems":1,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}}}},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"payments.unallocate"},"input":{"type":"object","additionalProperties":false,"required":["allocationId","sourceFactId","effectiveAt","evidence","allocations"],"properties":{"allocationId":{"type":"string","minLength":1},"sourceFactId":{"type":"string","minLength":1},"effectiveAt":{"type":"string","format":"date-time"},"evidence":{"type":"array","minItems":1,"items":{"type":"object","properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}},"required":["kind","ref"],"additionalProperties":false}},"allocations":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","additionalProperties":false,"required":["claimId","component","amount"],"properties":{"claimId":{"type":"string","minLength":1},"amount":{"type":"string","pattern":"^[1-9][0-9]*$"},"cashAmount":{"type":"string","pattern":"^[1-9][0-9]*$"},"component":{"type":"object","additionalProperties":false,"required":["originLedgerId","accountCode"],"properties":{"originLedgerId":{"type":"string","minLength":1},"accountCode":{"type":"integer"}}}}}}}},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"presentation_rate.record"},"input":{"type":"object","required":["packageId","baseCurrency","quoteCurrency","numerator","denominator","observedAt","source"],"properties":{"packageId":{"type":"string"},"baseCurrency":{"type":"string"},"quoteCurrency":{"type":"string"},"numerator":{"type":"string","pattern":"^[1-9][0-9]*$","maxLength":38},"denominator":{"type":"string","pattern":"^[1-9][0-9]*$","maxLength":38},"observedAt":{"type":"string"},"source":{"const":"manual_evidenced"},"approvedRate":{"type":"object","description":"Copy the complete rate returned by fx_rate that the human reviewed. Required with lookupDate; provenance changes require review again.","required":["base","quote","requestedDate","date","numerator","denominator","source","settled"],"properties":{"base":{"type":"string"},"quote":{"type":"string"},"requestedDate":{"type":"string"},"date":{"type":"string"},"numerator":{"type":"string"},"denominator":{"type":"string"},"source":{"const":"frankfurter"},"provider":{"type":"string"},"settled":{"type":"boolean"}}},"lookupDate":{"type":"string","description":"Optional shared-store requested day (YYYY-MM-DD). First review fx_rate; the approved numerator, denominator and observation day must match. A human approval source_document remains required."}},"additionalProperties":false},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"source_document_id":{"description":"A registered document of kind source_document that caused this command.","type":"string","minLength":1}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"receipts.record"},"input":{"type":"object","additionalProperties":false,"required":["billing","payment"],"properties":{"processing":{"type":"object","additionalProperties":false,"required":["rail","netAmount","evidence"],"properties":{"rail":{"enum":["ach","ach_same_day","fedwire","rtp","sepa","sepa_instant","swift","onchain","internal","card"]},"netAmount":{"type":"string","pattern":"^(0|-?[1-9][0-9]*)$"},"feeFacts":{"type":"object","maxProperties":20,"additionalProperties":{"type":"string","pattern":"^(0|[1-9][0-9]*)$"}},"evidence":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}}}},"billing":{"type":"object","additionalProperties":false,"required":["contractId","activityKey","occurrenceKey","sourceFactId","effectiveAt","phase"],"anyOf":[{"type":"object","properties":{"obligationKey":{"type":"string","minLength":1}},"required":["obligationKey"]},{"type":"object","properties":{"period":{"type":"object","properties":{"from":{"type":"string","minLength":1},"through":{"type":"string","minLength":1}},"required":["from","through"]}},"required":["period"]}],"properties":{"contractId":{"type":"string","minLength":1},"activityKey":{"type":"string","minLength":1},"occurrenceKey":{"type":"string","minLength":1},"obligationKey":{"type":"string","minLength":1},"sourceFactId":{"type":"string","minLength":1},"effectiveAt":{"type":"string","format":"date-time"},"phase":{"const":"billing"},"dueDate":{"type":"string","format":"date"},"exchangeRate":{"type":"object","additionalProperties":false,"required":["base","quote","date","numerator","denominator","evidence"],"description":"An evidenced exchange rate (1 base = numerator/denominator quote), e.g. from a bank statement. It overrides the shared rate store for this command; omit it to use the store.","properties":{"base":{"type":"string","pattern":"^[A-Z]{3}$"},"quote":{"type":"string","pattern":"^[A-Z]{3}$"},"date":{"type":"string","format":"date"},"numerator":{"type":"string","pattern":"^[1-9][0-9]*$"},"denominator":{"type":"string","pattern":"^[1-9][0-9]*$"},"evidence":{"type":"array","minItems":1,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string"}}}}}},"period":{"type":"object","additionalProperties":false,"required":["from","through"],"properties":{"from":{"type":"string","format":"date-time"},"through":{"type":"string","format":"date-time"}}},"facts":{"type":"object","maxProperties":100,"additionalProperties":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":false,"required":["occurrenceId"],"properties":{"occurrenceId":{"type":"string","minLength":1}}},{"type":"object","additionalProperties":false,"required":["claimId","component"],"properties":{"claimId":{"type":"string","minLength":1},"component":{"type":"object","additionalProperties":false,"required":["originLedgerId","accountCode"],"properties":{"originLedgerId":{"type":"string","minLength":1},"accountCode":{"type":"integer"}}}}}]}},"evidence":{"type":"object","additionalProperties":false,"properties":{"billing":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}},"service":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}},"acceptance":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}},"economic":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}}}}}},"payment":{"type":"object","additionalProperties":false,"required":["financialAccountId","direction","amount","currency","partyId","effectiveAt","sourceFactId","evidence"],"properties":{"financialAccountId":{"type":"string","minLength":1},"direction":{"enum":["in","out"]},"amount":{"type":"string","pattern":"^[1-9][0-9]*$"},"currency":{"type":"string","minLength":1},"partyId":{"type":"string","minLength":1},"effectiveAt":{"type":"string","format":"date-time"},"sourceFactId":{"type":"string","minLength":1},"evidence":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}}}}}},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"source_document_id":{"description":"A registered document of kind source_document that caused this command.","type":"string","minLength":1}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"reporting_adjustment.post"},"input":{"type":"object","required":["packageId","requirement","description","currency","lines"],"properties":{"packageId":{"type":"string"},"requirement":{"type":"string"},"description":{"type":"string","maxLength":1024},"currency":{"type":"string"},"lines":{"type":"array","minItems":2,"maxItems":100,"items":{"type":"object","required":["accountCode","direction","amount"],"properties":{"accountCode":{"type":"integer"},"direction":{"enum":["debit","credit"]},"amount":{"type":"string","pattern":"^(0|[1-9][0-9]*)$"},"subKey":{"type":"object","properties":{"kind":{"enum":[0,1,2,3,4,5,6]},"symbol":{"type":"string"},"partyId":{"type":"string"},"sku":{"type":"string"},"financialAccountId":{"type":"string"},"taxCodeId":{"type":"string"},"expenseFunction":{"enum":["cost_of_revenue","research_and_development","sales_and_marketing","general_and_administrative","other"]}}},"asset":{"type":"string"},"assetAmount":{"type":"string"},"externalId":{"type":"string","maxLength":200}}}}},"additionalProperties":false},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"source_document_id":{"description":"A registered document of kind source_document that caused this command.","type":"string","minLength":1}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"reporting_adjustment.void"},"input":{"type":"object","required":["eventId"],"properties":{"eventId":{"type":"integer","minimum":1},"reason":{"type":"string","maxLength":200}},"additionalProperties":false},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"reporting_profile.select"},"input":{"type":"object","required":["packageId","jurisdiction","legalEntityScope","framework","frameworkEdition","policyElections"],"properties":{"packageId":{"type":"string"},"jurisdiction":{"type":"string"},"legalEntityScope":{"type":"string"},"framework":{"type":"string"},"frameworkEdition":{"type":"string"},"policyElections":{"type":"array","maxItems":32,"items":{"type":"string"}},"overrides":{"type":"array","maxItems":100,"items":{"type":"object","required":["ruleId","destination"],"properties":{"ruleId":{"type":"string"},"destination":{"type":"object","required":["code","label","reportLineIds"],"properties":{"code":{"type":"string"},"label":{"type":"string"},"reportLineIds":{"type":"array","minItems":1,"maxItems":32,"items":{"type":"string"}}}}}}}},"additionalProperties":false},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"source_document_id":{"description":"A registered document of kind source_document that caused this command.","type":"string","minLength":1}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"shared_views.create"},"input":{"type":"object","properties":{"description":{"type":"string","minLength":1,"maxLength":200},"reports":{"type":"array","items":{"enum":["activity_balances","activity_claims","pipeline","activity_effects","balances","balance_sheet","capital_accounts","income_statement","income_statement_periods","recognition","amortization","aging","unit_economics","cap_table"]},"uniqueItems":true},"documents":{"type":"array","items":{"type":"string","minLength":1},"uniqueItems":true},"contracts":{"type":"array","items":{"type":"string","minLength":1},"uniqueItems":true},"currency":{"type":"string","minLength":3,"maxLength":16},"expiresAt":{"type":"string","format":"date-time"}},"required":["description"],"additionalProperties":false},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"shared_views.revoke"},"input":{"type":"object","properties":{"viewId":{"type":"string","minLength":1}},"required":["viewId"],"additionalProperties":false},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"subscription.cancel_request"},"input":{"type":"object","properties":{"reason":{"type":"string","maxLength":500}},"additionalProperties":false},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"subscription.revoke_cancellation"},"input":{"type":"object","properties":{"cancellationId":{"type":"string","minLength":1}},"required":["cancellationId"],"additionalProperties":false},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"tax_codes.create"},"input":{"type":"object","properties":{"taxCodeId":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"role":{"enum":["output","input","reverse_charge","imported_services","non_recoverable"],"default":"output","description":"How the code posts: output credits 2160; input debits recoverable 1170; reverse_charge and imported_services debit 1170 and credit 2165; non_recoverable tax is added to the expense."},"ratePpm":{"type":"integer","minimum":0,"maximum":1000000,"description":"Rate in parts per million: 50000 means 5%, 99750 means 9.975%."},"effectiveFrom":{"type":"string","format":"date","description":"First day the rate applies; omit for no lower bound."},"effectiveUntil":{"type":"string","format":"date","description":"First day the rate no longer applies (exclusive); omit for open-ended."}},"required":["taxCodeId","code","name","ratePpm"],"additionalProperties":false},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"tax_codes.update"},"input":{"type":"object","properties":{"taxCodeId":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"ratePpm":{"type":"integer","minimum":0,"maximum":1000000,"description":"Rate in parts per million: 50000 means 5%, 99750 means 9.975%."},"effectiveUntil":{"type":"string","format":"date","description":"First day the rate no longer applies (exclusive); omit for open-ended."},"active":{"type":"boolean"}},"required":["taxCodeId"],"additionalProperties":false},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"templates.archive"},"input":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","minLength":1},"expectedDocumentId":{"type":"string","minLength":1}},"required":["id","expectedDocumentId"]},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"source_document_id":{"description":"A registered document of kind activity, template that caused this command.","type":"string","minLength":1}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"templates.create"},"input":{"type":"object","additionalProperties":false,"properties":{"definition":{"type":"object","additionalProperties":false,"properties":{"model":{"const":"priced-rights-v1"},"name":{"type":"string","minLength":1},"plan":{"enum":["on_sale","off_sale"]},"parties":{"type":"array","items":{"type":"string","minLength":1},"minItems":1,"maxItems":100},"ledgers":{"type":"object","maxProperties":100,"additionalProperties":{"type":"object","additionalProperties":false,"properties":{"classification":{"enum":["gaap","contractual","operational","ownership","planning"]},"unitKind":{"enum":["currency","share","usage","credit","right","token","other"]},"unitCode":{"type":"string","minLength":1},"decimals":{"type":"integer","minimum":0,"maximum":18},"accountTemplate":{"enum":["gaap_startup","contract_flow","capacity","meter","entitlement","issued_instrument"]}},"required":["classification","unitKind","unitCode","decimals","accountTemplate"]}},"activities":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"key":{"type":"string","minLength":1},"activityDocumentId":{"type":"string","minLength":1},"partyRole":{"type":"string","minLength":1},"ledgers":{"type":"object","maxProperties":100,"additionalProperties":{"type":"string","minLength":1}},"terms":{"type":"object","maxProperties":100,"additionalProperties":{"type":"string","minLength":1}}},"required":["key","activityDocumentId","partyRole"]},"minItems":1,"maxItems":100},"consequences":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"key":{"type":"string","minLength":1},"sourceRights":{"type":"array","items":{"type":"string","minLength":1},"minItems":1,"maxItems":100},"rule":{"anyOf":[{"type":"object","additionalProperties":false,"properties":{"type":{"const":"grant_capacity"},"capacityLedger":{"type":"string","minLength":1},"quantity":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"expiresAtTerm":{"type":"string","minLength":1}},"required":["type","capacityLedger","quantity","expiresAtTerm"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"consume_capacity"},"capacityLedger":{"type":"string","minLength":1},"quantity":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"grantOccurrenceFact":{"type":"string","minLength":1},"overageRight":{"type":"string","minLength":1}},"required":["type","capacityLedger","quantity","grantOccurrenceFact"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"expire_capacity"},"capacityLedger":{"type":"string","minLength":1},"valueLedger":{"type":"string","minLength":1}},"required":["type","capacityLedger"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"minimum"},"eligibleRights":{"type":"array","items":{"type":"string","minLength":1},"minItems":1,"maxItems":100},"minimum":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"currencyTerm":{"type":"string","minLength":1},"completeThroughFact":{"type":"string","minLength":1}},"required":["type","eligibleRights","minimum","currencyTerm","completeThroughFact"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"refund_unearned"},"monetaryLedger":{"type":"string","minLength":1},"amount":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"taxClaimFact":{"type":"string","minLength":1}},"required":["type","monetaryLedger","amount"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"profit_allocation"},"result":{"enum":["profit","loss"]},"monetaryLedger":{"type":"string","minLength":1},"ownershipLedger":{"type":"string","minLength":1},"amount":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"completeThroughFact":{"type":"string","minLength":1}},"required":["type","monetaryLedger","ownershipLedger","amount","completeThroughFact"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"profit_allocation"},"result":{"enum":["profit","loss"]},"monetaryLedger":{"type":"string","minLength":1},"ownershipBasis":{"const":"agreement"},"amount":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"completeThroughFact":{"type":"string","minLength":1}},"required":["type","monetaryLedger","ownershipBasis","amount","completeThroughFact"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"close_draws"},"monetaryLedger":{"type":"string","minLength":1},"completeThroughFact":{"type":"string","minLength":1}},"required":["type","monetaryLedger","completeThroughFact"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"authorize_units"},"unitsLedger":{"type":"string","minLength":1},"quantity":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"}},"required":["type","unitsLedger","quantity"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"issue_units"},"capitalAllocation":{"type":"object","additionalProperties":false,"properties":{"shareCapital":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"sharePremium":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"}},"required":["shareCapital","sharePremium"]},"unitsLedger":{"type":"string","minLength":1},"quantity":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"consideration":{"anyOf":[{"type":"object","additionalProperties":false,"properties":{"type":{"const":"money"},"amount":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"currencyTerm":{"type":"string","minLength":1},"recognition":{"enum":["unconditional_obligation","condition_satisfied"]}},"required":["type","amount","currencyTerm","recognition"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"units"},"quantity":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"ledger":{"type":"string","minLength":1}},"required":["type","quantity","ledger"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"claim"},"claimFact":{"type":"string","minLength":1},"amount":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"currencyTerm":{"type":"string","minLength":1}},"required":["type","claimFact","amount","currencyTerm"]}]},"restricted":{"type":"boolean"}},"required":["type","unitsLedger","quantity","consideration","restricted"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"capital_contribution"},"consideration":{"anyOf":[{"type":"object","additionalProperties":false,"properties":{"type":{"const":"money"},"amount":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"currencyTerm":{"type":"string","minLength":1},"recognition":{"enum":["unconditional_obligation","condition_satisfied"]}},"required":["type","amount","currencyTerm","recognition"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"units"},"quantity":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"ledger":{"type":"string","minLength":1}},"required":["type","quantity","ledger"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"claim"},"claimFact":{"type":"string","minLength":1},"amount":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"currencyTerm":{"type":"string","minLength":1}},"required":["type","claimFact","amount","currencyTerm"]}]}},"required":["type","consideration"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"financing_commitment"},"consideration":{"anyOf":[{"type":"object","additionalProperties":false,"properties":{"type":{"const":"money"},"amount":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"currencyTerm":{"type":"string","minLength":1},"recognition":{"enum":["unconditional_obligation","condition_satisfied"]}},"required":["type","amount","currencyTerm","recognition"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"units"},"quantity":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"ledger":{"type":"string","minLength":1}},"required":["type","quantity","ledger"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"claim"},"claimFact":{"type":"string","minLength":1},"amount":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"currencyTerm":{"type":"string","minLength":1}},"required":["type","claimFact","amount","currencyTerm"]}]},"liability":{"const":"owner_advance"}},"required":["type","consideration"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"capital_distribution"},"amount":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"}},"required":["type","amount"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"owner_draw"},"amount":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"}},"required":["type","amount"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"vest_units"},"unitsLedger":{"type":"string","minLength":1},"quantity":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"grantOccurrenceFact":{"type":"string","minLength":1}},"required":["type","unitsLedger","quantity","grantOccurrenceFact"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"vest_units"},"unitsLedger":{"type":"string","minLength":1},"quantity":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"grantConsequence":{"type":"string","minLength":1}},"required":["type","unitsLedger","quantity","grantConsequence"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"convert_claim"},"claimFact":{"type":"string","minLength":1},"amount":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"currencyTerm":{"type":"string","minLength":1},"monetaryLedger":{"type":"string","minLength":1},"equityAccount":{"enum":[3100,3110,3120]},"units":{"type":"object","additionalProperties":false,"properties":{"ledger":{"type":"string","minLength":1},"quantity":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"restricted":{"type":"boolean"}},"required":["ledger","quantity","restricted"]}},"required":["type","claimFact","amount","currencyTerm","monetaryLedger","equityAccount"]}]},"trigger":{"anyOf":[{"type":"object","additionalProperties":false,"properties":{"type":{"const":"transition"},"action":{"enum":["accept","cancel","terminate"]}},"required":["type","action"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"exercise"},"activityKey":{"type":"string","minLength":1}},"required":["type","activityKey"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"period_close"},"schedule":{"type":"object","additionalProperties":false,"properties":{"startTerm":{"type":"string","minLength":1},"anchorTerm":{"type":"string","minLength":1},"endTerm":{"type":"string","minLength":1},"everyMonths":{"type":"integer","minimum":1,"maximum":120},"timing":{"enum":["start","end"]},"offsetDays":{"type":"integer","minimum":-365,"maximum":365},"serviceEvidence":{"const":"elapsed_time"}},"required":["startTerm","everyMonths","timing","offsetDays"]}},"required":["type","schedule"]}]},"evidence":{"type":"array","items":{"enum":["acceptance","economic","service"]},"minItems":1,"maxItems":100}},"required":["key","sourceRights","trigger","rule","evidence"]},"minItems":0,"maxItems":100}},"required":["model","name","parties","activities"]}},"required":["definition"]},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"source_document_id":{"description":"A registered document of kind activity, template, contract, source_document that caused this command.","type":"string","minLength":1}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false},{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"const":"templates.replace"},"input":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","minLength":1},"expectedDocumentId":{"type":"string","minLength":1},"definition":{"type":"object","additionalProperties":false,"properties":{"model":{"const":"priced-rights-v1"},"name":{"type":"string","minLength":1},"plan":{"enum":["on_sale","off_sale"]},"parties":{"type":"array","items":{"type":"string","minLength":1},"minItems":1,"maxItems":100},"ledgers":{"type":"object","maxProperties":100,"additionalProperties":{"type":"object","additionalProperties":false,"properties":{"classification":{"enum":["gaap","contractual","operational","ownership","planning"]},"unitKind":{"enum":["currency","share","usage","credit","right","token","other"]},"unitCode":{"type":"string","minLength":1},"decimals":{"type":"integer","minimum":0,"maximum":18},"accountTemplate":{"enum":["gaap_startup","contract_flow","capacity","meter","entitlement","issued_instrument"]}},"required":["classification","unitKind","unitCode","decimals","accountTemplate"]}},"activities":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"key":{"type":"string","minLength":1},"activityDocumentId":{"type":"string","minLength":1},"partyRole":{"type":"string","minLength":1},"ledgers":{"type":"object","maxProperties":100,"additionalProperties":{"type":"string","minLength":1}},"terms":{"type":"object","maxProperties":100,"additionalProperties":{"type":"string","minLength":1}}},"required":["key","activityDocumentId","partyRole"]},"minItems":1,"maxItems":100},"consequences":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"key":{"type":"string","minLength":1},"sourceRights":{"type":"array","items":{"type":"string","minLength":1},"minItems":1,"maxItems":100},"rule":{"anyOf":[{"type":"object","additionalProperties":false,"properties":{"type":{"const":"grant_capacity"},"capacityLedger":{"type":"string","minLength":1},"quantity":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"expiresAtTerm":{"type":"string","minLength":1}},"required":["type","capacityLedger","quantity","expiresAtTerm"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"consume_capacity"},"capacityLedger":{"type":"string","minLength":1},"quantity":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"grantOccurrenceFact":{"type":"string","minLength":1},"overageRight":{"type":"string","minLength":1}},"required":["type","capacityLedger","quantity","grantOccurrenceFact"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"expire_capacity"},"capacityLedger":{"type":"string","minLength":1},"valueLedger":{"type":"string","minLength":1}},"required":["type","capacityLedger"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"minimum"},"eligibleRights":{"type":"array","items":{"type":"string","minLength":1},"minItems":1,"maxItems":100},"minimum":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"currencyTerm":{"type":"string","minLength":1},"completeThroughFact":{"type":"string","minLength":1}},"required":["type","eligibleRights","minimum","currencyTerm","completeThroughFact"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"refund_unearned"},"monetaryLedger":{"type":"string","minLength":1},"amount":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"taxClaimFact":{"type":"string","minLength":1}},"required":["type","monetaryLedger","amount"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"profit_allocation"},"result":{"enum":["profit","loss"]},"monetaryLedger":{"type":"string","minLength":1},"ownershipLedger":{"type":"string","minLength":1},"amount":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"completeThroughFact":{"type":"string","minLength":1}},"required":["type","monetaryLedger","ownershipLedger","amount","completeThroughFact"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"profit_allocation"},"result":{"enum":["profit","loss"]},"monetaryLedger":{"type":"string","minLength":1},"ownershipBasis":{"const":"agreement"},"amount":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"completeThroughFact":{"type":"string","minLength":1}},"required":["type","monetaryLedger","ownershipBasis","amount","completeThroughFact"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"close_draws"},"monetaryLedger":{"type":"string","minLength":1},"completeThroughFact":{"type":"string","minLength":1}},"required":["type","monetaryLedger","completeThroughFact"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"authorize_units"},"unitsLedger":{"type":"string","minLength":1},"quantity":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"}},"required":["type","unitsLedger","quantity"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"issue_units"},"capitalAllocation":{"type":"object","additionalProperties":false,"properties":{"shareCapital":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"sharePremium":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"}},"required":["shareCapital","sharePremium"]},"unitsLedger":{"type":"string","minLength":1},"quantity":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"consideration":{"anyOf":[{"type":"object","additionalProperties":false,"properties":{"type":{"const":"money"},"amount":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"currencyTerm":{"type":"string","minLength":1},"recognition":{"enum":["unconditional_obligation","condition_satisfied"]}},"required":["type","amount","currencyTerm","recognition"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"units"},"quantity":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"ledger":{"type":"string","minLength":1}},"required":["type","quantity","ledger"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"claim"},"claimFact":{"type":"string","minLength":1},"amount":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"currencyTerm":{"type":"string","minLength":1}},"required":["type","claimFact","amount","currencyTerm"]}]},"restricted":{"type":"boolean"}},"required":["type","unitsLedger","quantity","consideration","restricted"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"capital_contribution"},"consideration":{"anyOf":[{"type":"object","additionalProperties":false,"properties":{"type":{"const":"money"},"amount":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"currencyTerm":{"type":"string","minLength":1},"recognition":{"enum":["unconditional_obligation","condition_satisfied"]}},"required":["type","amount","currencyTerm","recognition"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"units"},"quantity":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"ledger":{"type":"string","minLength":1}},"required":["type","quantity","ledger"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"claim"},"claimFact":{"type":"string","minLength":1},"amount":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"currencyTerm":{"type":"string","minLength":1}},"required":["type","claimFact","amount","currencyTerm"]}]}},"required":["type","consideration"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"financing_commitment"},"consideration":{"anyOf":[{"type":"object","additionalProperties":false,"properties":{"type":{"const":"money"},"amount":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"currencyTerm":{"type":"string","minLength":1},"recognition":{"enum":["unconditional_obligation","condition_satisfied"]}},"required":["type","amount","currencyTerm","recognition"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"units"},"quantity":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"ledger":{"type":"string","minLength":1}},"required":["type","quantity","ledger"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"claim"},"claimFact":{"type":"string","minLength":1},"amount":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"currencyTerm":{"type":"string","minLength":1}},"required":["type","claimFact","amount","currencyTerm"]}]},"liability":{"const":"owner_advance"}},"required":["type","consideration"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"capital_distribution"},"amount":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"}},"required":["type","amount"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"owner_draw"},"amount":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"}},"required":["type","amount"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"vest_units"},"unitsLedger":{"type":"string","minLength":1},"quantity":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"grantOccurrenceFact":{"type":"string","minLength":1}},"required":["type","unitsLedger","quantity","grantOccurrenceFact"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"vest_units"},"unitsLedger":{"type":"string","minLength":1},"quantity":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"grantConsequence":{"type":"string","minLength":1}},"required":["type","unitsLedger","quantity","grantConsequence"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"convert_claim"},"claimFact":{"type":"string","minLength":1},"amount":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"currencyTerm":{"type":"string","minLength":1},"monetaryLedger":{"type":"string","minLength":1},"equityAccount":{"enum":[3100,3110,3120]},"units":{"type":"object","additionalProperties":false,"properties":{"ledger":{"type":"string","minLength":1},"quantity":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"restricted":{"type":"boolean"}},"required":["ledger","quantity","restricted"]}},"required":["type","claimFact","amount","currencyTerm","monetaryLedger","equityAccount"]}]},"trigger":{"anyOf":[{"type":"object","additionalProperties":false,"properties":{"type":{"const":"transition"},"action":{"enum":["accept","cancel","terminate"]}},"required":["type","action"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"exercise"},"activityKey":{"type":"string","minLength":1}},"required":["type","activityKey"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"period_close"},"schedule":{"type":"object","additionalProperties":false,"properties":{"startTerm":{"type":"string","minLength":1},"anchorTerm":{"type":"string","minLength":1},"endTerm":{"type":"string","minLength":1},"everyMonths":{"type":"integer","minimum":1,"maximum":120},"timing":{"enum":["start","end"]},"offsetDays":{"type":"integer","minimum":-365,"maximum":365},"serviceEvidence":{"const":"elapsed_time"}},"required":["startTerm","everyMonths","timing","offsetDays"]}},"required":["type","schedule"]}]},"evidence":{"type":"array","items":{"enum":["acceptance","economic","service"]},"minItems":1,"maxItems":100}},"required":["key","sourceRights","trigger","rule","evidence"]},"minItems":0,"maxItems":100}},"required":["model","name","parties","activities"]}},"required":["id","expectedDocumentId","definition"]},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"source_document_id":{"description":"A registered document of kind activity, template, contract, source_document that caused this command.","type":"string","minLength":1}},"required":["name","input","idempotency_key","effective_at"],"additionalProperties":false}]},"examples":{"accounts.archive.0":{"value":{"name":"accounts.archive","input":{"financialAccountId":"fa_example_bank"},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"accounts.archive-example-0"}},"accounts.register.0":{"value":{"name":"accounts.register","input":{"financialAccountId":"fa_example_bank","name":"Operating bank","currency":"USD","kind":"checking"},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"accounts.register-example-0"}},"accounts.register.1":{"value":{"name":"accounts.register","input":{"financialAccountId":"card_founder_visa_4242","name":"Founder's Visa ending 4242","currency":"USD","kind":"card","ownerPartyId":"founder_ada"},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"accounts.register-example-1"}},"accounts.restore.0":{"value":{"name":"accounts.restore","input":{"financialAccountId":"fa_example_bank"},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"accounts.restore-example-0"}},"accounts.update.0":{"value":{"name":"accounts.update","input":{"financialAccountId":"fa_example_bank","name":"Main operating bank"},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"accounts.update-example-0"}},"activities.archive.0":{"value":{"name":"activities.archive","input":{"id":"activity_example","expectedDocumentId":"doc_current"},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"activities.archive-example-0"}},"activities.create.0":{"value":{"name":"activities.create","input":{"definition":{"model":"priced-rights-v1","name":"Consulting access","price":{"treatment":"free","evidence":[{"kind":"other","ref":"signed-free-access"}]},"economics":{"kind":"service","direction":"provide"}}},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"activities.create-example-0"}},"activities.replace.0":{"value":{"name":"activities.replace","input":{"id":"activity_example","expectedDocumentId":"doc_previous","definition":{"model":"priced-rights-v1","name":"Consulting access","price":{"treatment":"free","evidence":[{"kind":"other","ref":"signed-free-access"}]},"economics":{"kind":"service","direction":"provide"}}},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"activities.replace-example-0"}},"business.change_fiscal_year.0":{"value":{"name":"business.change_fiscal_year","input":{"yearEnd":"06-30","reason":"Align with the academic-year customer cycle"},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"business.change_fiscal_year-example-0"}},"business.change_functional_currency.0":{"value":{"name":"business.change_functional_currency","input":{"fromCurrency":"USD","toCurrency":"CHF","reason":"USD was chosen at signup by mistake; the business is Swiss"},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"business.change_functional_currency-example-0"}},"business.change_legal_form.0":{"value":{"name":"business.change_legal_form","input":{"jurisdiction":"CA-ON","legalEntityType":"corporation","reason":"Continued from Delaware into Ontario under the OBCA"},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"business.change_legal_form-example-0"}},"business.change_legal_form.1":{"value":{"name":"business.change_legal_form","input":{"legalEntityType":"llc","reason":"Statutory conversion to a Delaware LLC"},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"business.change_legal_form-example-1"}},"business.change_legal_name.0":{"value":{"name":"business.change_legal_name","input":{"name":"Acme Robotics, Inc.","reason":"Certificate of amendment filed with the Delaware Division of Corporations"},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"business.change_legal_name-example-0"}},"business.deregister_sales_tax.0":{"value":{"name":"business.deregister_sales_tax","input":{"regime":"gb_vat","effectiveUntil":"2027-04-01","reason":"HMRC cancelled the VAT registration below the threshold"},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"business.deregister_sales_tax-example-0"}},"business.elect_accounting_framework.0":{"value":{"name":"business.elect_accounting_framework","input":{"framework":"us_gaap","reason":"Board resolution adopting US GAAP"},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"business.elect_accounting_framework-example-0"}},"business.elect_accounting_framework.1":{"value":{"name":"business.elect_accounting_framework","input":{"framework":"uk_frs_105","edition":"September 2024","sizeEligibility":{"basis":"Companies Act 2006 s384A micro-entity conditions met in FY2025 and FY2026","periodEnd":"2026-12-31"},"reason":"Directors elected the micro-entities regime"},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"business.elect_accounting_framework-example-1"}},"business.incorporate.0":{"value":{"name":"business.incorporate","input":{"name":"Tidewater Studio, Inc.","legalEntityType":"c_corp","jurisdiction":"US-DE","parValue":"100","reason":"Incorporated in Delaware; the project's assets, liabilities and contracts are assigned to the corporation"},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"business.incorporate-example-0"}},"business.record_formation_date.0":{"value":{"name":"business.record_formation_date","input":{"date":"2026-09-15","reason":"Certificate of formation"},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"business.record_formation_date-example-0"}},"business.register_sales_tax.0":{"value":{"name":"business.register_sales_tax","input":{"regime":"gb_vat","registrationNumber":"GB123456789","effectiveFrom":"2026-01-01","reason":"VAT registration certificate received from HMRC"},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"business.register_sales_tax-example-0"}},"business.register_sales_tax.1":{"value":{"name":"business.register_sales_tax","input":{"regime":"ca_gst_hst","registrationNumber":"123456789RT0001","province":"CA-ON","effectiveFrom":"2026-01-01","reason":"Registered for GST/HST with the CRA"},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"business.register_sales_tax-example-1"}},"business.set_registration.0":{"value":{"name":"business.set_registration","input":{"kind":"us_ein","number":"12-3456789","reason":"EIN assigned by the IRS (notice CP 575)"},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"business.set_registration-example-0"}},"business.update.0":{"value":{"name":"business.update","input":{"description":"Accounting for agent-run startups","url":"https://example.com"},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"business.update-example-0"}},"business.update.1":{"value":{"name":"business.update","input":{"ycVerificationUrl":"https://www.ycombinator.com/verify/Example123"},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"business.update-example-1"}},"categories.create.0":{"value":{"name":"categories.create","input":{"categoryId":"cat_example","name":"Services","code":"services"},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"categories.create-example-0"}},"connections.accept.0":{"value":{"name":"connections.accept","input":{"connectionId":"con_01J00000000000000000000000","partyId":"pty_acme"},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"connections.accept-example-0"}},"connections.decline.0":{"value":{"name":"connections.decline","input":{"connectionId":"con_01J00000000000000000000000"},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"connections.decline-example-0"}},"connections.end.0":{"value":{"name":"connections.end","input":{"connectionId":"con_01J00000000000000000000000"},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"connections.end-example-0"}},"connections.request.0":{"value":{"name":"connections.request","input":{"to":"globex-1a2b3c","partyId":"pty_globex","note":"We buy from you."},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"connections.request-example-0"}},"contracts.accept.0":{"value":{"name":"contracts.accept","input":{"contractId":"ctr_example","expectedDocumentId":"doc_contract","expectedStatus":"draft","effectiveAt":"2026-10-06T00:00:00Z","sourceFactId":"agreement:accept","evidence":{"acceptance":[{"kind":"signed_doc","ref":"agreement:accept"}]}},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"contracts.accept-example-0"}},"contracts.amend.0":{"value":{"name":"contracts.amend","input":{"contractId":"ctr_example","expectedDocumentId":"doc_contract","effectiveAt":"2026-10-01T00:00:00Z","terms":{"work":{"rate":"25000"}},"acceptanceEvidence":[{"kind":"signed_doc","ref":"amendment:signed"}]},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"contracts.amend-example-0"}},"contracts.cancel.0":{"value":{"name":"contracts.cancel","input":{"contractId":"ctr_example","expectedDocumentId":"doc_contract","expectedStatus":"draft","effectiveAt":"2026-10-06T00:00:00Z","sourceFactId":"agreement:cancel","evidence":{"acceptance":[{"kind":"signed_doc","ref":"agreement:cancel"}]}},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"contracts.cancel-example-0"}},"contracts.create.0":{"value":{"name":"contracts.create","input":{"templateDocumentId":"doc_template","parties":{"customer":"party_customer"}},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"contracts.create-example-0"}},"contracts.discard.0":{"value":{"name":"contracts.discard","input":{"contractId":"ctr_example","expectedDocumentId":"doc_contract"},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"contracts.discard-example-0"}},"contracts.offer.0":{"value":{"name":"contracts.offer","input":{"contractId":"ctr_example","expectedDocumentId":"doc_contract","expectedStatus":"draft","effectiveAt":"2026-10-06T00:00:00Z","sourceFactId":"agreement:offer","evidence":{"acceptance":[{"kind":"signed_doc","ref":"agreement:offer"}]}},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"contracts.offer-example-0"}},"contracts.record.0":{"value":{"name":"contracts.record","input":{"contractId":"ctr_example","activityKey":"work","occurrenceKey":"timesheet-1","sourceFactId":"timesheet:approved:1","effectiveAt":"2026-09-01T00:00:00Z","facts":{"quantity":"12500000"},"evidence":{"service":[{"kind":"other","ref":"timesheet:approved:1"}]}},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"contracts.record-example-0"}},"contracts.terminate.0":{"value":{"name":"contracts.terminate","input":{"contractId":"ctr_example","expectedDocumentId":"doc_contract","expectedStatus":"active","effectiveAt":"2026-10-06T00:00:00Z","sourceFactId":"agreement:terminate","evidence":{"acceptance":[{"kind":"signed_doc","ref":"agreement:terminate"}]}},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"contracts.terminate-example-0"}},"documents.receive.0":{"value":{"name":"documents.receive","input":{"kind":"source_document","contentBase64":"VmVuZG9yIGludm9pY2UgIzEyMzogVVNEIDEwMC4wMA==","externalId":"vendor-invoice-123","title":"Vendor invoice 123"},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"documents.receive-example-0"}},"documents.relate.0":{"value":{"name":"documents.relate","input":{"fromDocumentId":"doc_replacement","toDocumentId":"doc_original","relation":"supersedes"},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"documents.relate-example-0"}},"ingestions.attach_original.0":{"value":{"name":"ingestions.attach_original","input":{"ingestionId":"ing_example","file":{"filename":"original.pdf","contentType":"application/pdf","size":1024}},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"ingestions.attach_original-example-0"}},"ingestions.invoice_candidates.0":{"value":{"name":"ingestions.invoice_candidates","input":{"ingestionId":"ing_example","invoiceText":"Exact retained extraction text"},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"ingestions.invoice_candidates-example-0"}},"ingestions.reissue_upload.0":{"value":{"name":"ingestions.reissue_upload","input":{"ingestionId":"ing_example","role":"primary"},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"ingestions.reissue_upload-example-0"}},"ingestions.resolve.0":{"value":{"name":"ingestions.resolve","input":{"ingestionId":"ing_example","expectedProposalRevision":1,"expenseTargets":[{"contractId":"ctr_existing","activityKey":"expense"}]},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"ingestions.resolve-example-0"}},"ingestions.start.0":{"value":{"name":"ingestions.start","input":{"source":{"type":"text","format":"markdown","text":"# Vendor invoice\nUSD 12.00"}},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"ingestions.start-example-0"}},"journal.post.0":{"value":{"name":"journal.post","input":{"description":"Founder contributed inventory","currency":"USD","lines":[{"accountCode":1140,"direction":"debit","amount":"10000"},{"accountCode":3100,"direction":"credit","amount":"10000"}]},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"journal.post-example-0"}},"journal.void.0":{"value":{"name":"journal.void","input":{"eventId":1,"reason":"Correction"},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"journal.void-example-0"}},"members.grant.0":{"value":{"name":"members.grant","input":{"principalId":"prin_example_teammate","role":"owner"},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"members.grant-example-0"}},"members.revoke.0":{"value":{"name":"members.revoke","input":{"principalId":"prin_example_teammate"},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"members.revoke-example-0"}},"messages.send.0":{"value":{"name":"messages.send","input":{"topic":"feature_suggestion","subject":"Import CSV bank statements","body":"I wanted to import last month's bank statement as CSV and found no command for it.","context":{"tool":"documents.receive"}},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"messages.send-example-0"}},"messages.send.1":{"value":{"name":"messages.send","input":{"inReplyTo":"msg_01J00000000000000000000000","body":"Thanks — the corrected invoice is attached to our books now.","about":["doc_01J00000000000000000000000"]},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"messages.send-example-1"}},"opportunities.link.0":{"value":{"name":"opportunities.link","input":{"opportunityId":"opp_example","expectedRevision":1,"contractId":"ctr_successor","contractDocumentId":"doc_successor","activityKey":"accept","occurrenceKey":"signed"},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"opportunities.link-example-0"}},"opportunities.lose.0":{"value":{"name":"opportunities.lose","input":{"opportunityId":"opp_example","expectedRevision":1,"reason":"Customer withdrew"},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"opportunities.lose-example-0"}},"opportunities.open.0":{"value":{"name":"opportunities.open","input":{"opportunityKey":"annual:example","name":"Annual service","partyId":"party_customer","cohort":"customer","kind":"new","currency":"USD","expectedValue":"1200000"},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"opportunities.open-example-0"}},"opportunities.stage.0":{"value":{"name":"opportunities.stage","input":{"opportunityId":"opp_example","expectedRevision":1,"stage":"qualified"},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"opportunities.stage-example-0"}},"parties.add_contact.0":{"value":{"name":"parties.add_contact","input":{"contactId":"contact_example_ap","partyId":"pty_example_vendor","name":"Accounts Payable","email":"ap@example.com","role":"billing"},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"parties.add_contact-example-0"}},"parties.archive.0":{"value":{"name":"parties.archive","input":{"partyId":"pty_example_vendor"},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"parties.archive-example-0"}},"parties.create.0":{"value":{"name":"parties.create","input":{"partyId":"pty_example_vendor","name":"Example Vendor","categories":["vendor"]},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"parties.create-example-0"}},"parties.remove_contact.0":{"value":{"name":"parties.remove_contact","input":{"partyId":"pty_example_vendor","contactId":"contact_example_ap"},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"parties.remove_contact-example-0"}},"parties.set_address.0":{"value":{"name":"parties.set_address","input":{"partyId":"pty_example_vendor","address":{"line1":"1 Market Street","city":"San Francisco","country":"US"}},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"parties.set_address-example-0"}},"parties.update.0":{"value":{"name":"parties.update","input":{"partyId":"pty_example_vendor","name":"Updated Vendor"},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"parties.update-example-0"}},"payment_endpoints.register.0":{"value":{"name":"payment_endpoints.register","input":{"paymentEndpointId":"vendor-ach","partyId":"vendor","uri":"payto://ach/110000000/123456789","methods":[{"direction":"in","rail":"ach","asset":"USD"}]},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"payment_endpoints.register-example-0"}},"payment_endpoints.update.0":{"value":{"name":"payment_endpoints.update","input":{"paymentEndpointId":"vendor-ach","active":false},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"payment_endpoints.update-example-0"}},"presentation_rate.record.0":{"value":{"name":"presentation_rate.record","input":{"packageId":"ch-co-ordinary-standalone-ag-gmbh-software-services-2026.1","baseCurrency":"USD","quoteCurrency":"CHF","numerator":"4","denominator":"5","observedAt":"2026-09-30T23:59:59.999Z","source":"manual_evidenced"},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"presentation_rate.record-example-0"}},"reporting_adjustment.post.0":{"value":{"name":"reporting_adjustment.post","input":{"packageId":"us-gaap-private-c-corp-software-services-2026.1","requirement":"asc-350-40-internal-use-software-conclusion","description":"Capitalize qualifying internal-use software costs","currency":"USD","lines":[{"accountCode":1280,"direction":"debit","amount":"10000"},{"accountCode":5110,"subKey":{"kind":6,"expenseFunction":"research_and_development"},"direction":"credit","amount":"10000"}]},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"reporting_adjustment.post-example-0"}},"reporting_adjustment.void.0":{"value":{"name":"reporting_adjustment.void","input":{"eventId":1,"reason":"Correction"},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"reporting_adjustment.void-example-0"}},"reporting_profile.select.0":{"value":{"name":"reporting_profile.select","input":{"packageId":"us-gaap-private-c-corp-software-services-2026.1","jurisdiction":"US","legalEntityScope":"private-c-corporation-software-services","framework":"US GAAP","frameworkEdition":"2026","policyElections":["private-company-alternatives-not-elected"]},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"reporting_profile.select-example-0"}},"shared_views.create.0":{"value":{"name":"shared_views.create","input":{"description":"Investor update","reports":["balance_sheet","income_statement"],"expiresAt":"2027-01-01T00:00:00Z"},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"shared_views.create-example-0"}},"shared_views.revoke.0":{"value":{"name":"shared_views.revoke","input":{"viewId":"shv_example"},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"shared_views.revoke-example-0"}},"subscription.cancel_request.0":{"value":{"name":"subscription.cancel_request","input":{"reason":"We no longer need this business account."},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"subscription.cancel_request-example-0"}},"subscription.revoke_cancellation.0":{"value":{"name":"subscription.revoke_cancellation","input":{"cancellationId":"can_example"},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"subscription.revoke_cancellation-example-0"}},"tax_codes.create.0":{"value":{"name":"tax_codes.create","input":{"taxCodeId":"us-ca-sales","code":"us-ca-sales","name":"California sales tax","ratePpm":72500},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"tax_codes.create-example-0"}},"tax_codes.update.0":{"value":{"name":"tax_codes.update","input":{"taxCodeId":"us-ca-sales","active":false},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"tax_codes.update-example-0"}},"templates.archive.0":{"value":{"name":"templates.archive","input":{"id":"template_example","expectedDocumentId":"doc_current"},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"templates.archive-example-0"}},"templates.create.0":{"value":{"name":"templates.create","input":{"definition":{"model":"priced-rights-v1","name":"Consulting","parties":["customer"],"activities":[{"key":"work","activityDocumentId":"doc_activity","partyRole":"customer"}]}},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"templates.create-example-0"}},"templates.replace.0":{"value":{"name":"templates.replace","input":{"id":"template_example","expectedDocumentId":"doc_previous","definition":{"model":"priced-rights-v1","name":"Consulting","parties":["customer"],"activities":[{"key":"work","activityDocumentId":"doc_activity","partyRole":"customer"}]}},"effective_at":"2026-09-01T00:00:00Z","idempotency_key":"templates.replace-example-0"}}}}}},"responses":{"200":{"description":"Canonical result; missing read objects are null. Money is in decimal integer strings.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","properties":{"financialAccountId":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"currency":{"type":"string","minLength":1},"glAccountCode":{"enum":[1110,1310,2190,2135]},"kind":{"enum":["checking","savings","card","wallet","other"]},"isDefault":{"type":"boolean"},"archived":{"type":"boolean"},"ownerPartyId":{"type":"string","minLength":1},"providerPartyId":{"type":"string","minLength":1},"providerContractId":{"type":"string","minLength":1},"last4":{"type":"string","pattern":"^[0-9]{4}$"},"network":{"type":"string","minLength":1},"brandColor":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}$","description":"The issuer's brand color as #RRGGBB, drawn as the account's card or plate."},"logoDocumentId":{"type":"string","minLength":1,"description":"The issuer's logo: the documentId of an image document (documents.receive kind image, PNG/JPEG/WebP)."}},"required":["financialAccountId","name","currency","glAccountCode","kind","isDefault","archived"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","properties":{"financialAccountId":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"currency":{"type":"string","minLength":1},"glAccountCode":{"enum":[1110,1310,2190,2135]},"kind":{"enum":["checking","savings","card","wallet","other"]},"isDefault":{"type":"boolean"},"archived":{"type":"boolean"},"ownerPartyId":{"type":"string","minLength":1},"providerPartyId":{"type":"string","minLength":1},"providerContractId":{"type":"string","minLength":1},"last4":{"type":"string","pattern":"^[0-9]{4}$"},"network":{"type":"string","minLength":1},"brandColor":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}$","description":"The issuer's brand color as #RRGGBB, drawn as the account's card or plate."},"logoDocumentId":{"type":"string","minLength":1,"description":"The issuer's logo: the documentId of an image document (documents.receive kind image, PNG/JPEG/WebP)."}},"required":["financialAccountId","name","currency","glAccountCode","kind","isDefault","archived"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","properties":{"financialAccountId":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"currency":{"type":"string","minLength":1},"glAccountCode":{"enum":[1110,1310,2190,2135]},"kind":{"enum":["checking","savings","card","wallet","other"]},"isDefault":{"type":"boolean"},"archived":{"type":"boolean"},"ownerPartyId":{"type":"string","minLength":1},"providerPartyId":{"type":"string","minLength":1},"providerContractId":{"type":"string","minLength":1},"last4":{"type":"string","pattern":"^[0-9]{4}$"},"network":{"type":"string","minLength":1},"brandColor":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}$","description":"The issuer's brand color as #RRGGBB, drawn as the account's card or plate."},"logoDocumentId":{"type":"string","minLength":1,"description":"The issuer's logo: the documentId of an image document (documents.receive kind image, PNG/JPEG/WebP)."}},"required":["financialAccountId","name","currency","glAccountCode","kind","isDefault","archived"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","properties":{"financialAccountId":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"currency":{"type":"string","minLength":1},"glAccountCode":{"enum":[1110,1310,2190,2135]},"kind":{"enum":["checking","savings","card","wallet","other"]},"isDefault":{"type":"boolean"},"archived":{"type":"boolean"},"ownerPartyId":{"type":"string","minLength":1},"providerPartyId":{"type":"string","minLength":1},"providerContractId":{"type":"string","minLength":1},"last4":{"type":"string","pattern":"^[0-9]{4}$"},"network":{"type":"string","minLength":1},"brandColor":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}$","description":"The issuer's brand color as #RRGGBB, drawn as the account's card or plate."},"logoDocumentId":{"type":"string","minLength":1,"description":"The issuer's logo: the documentId of an image document (documents.receive kind image, PNG/JPEG/WebP)."}},"required":["financialAccountId","name","currency","glAccountCode","kind","isDefault","archived"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","minLength":1}},"required":["id"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","minLength":1},"documentId":{"type":"string","minLength":1},"cid":{"type":"string","minLength":1}},"required":["id","documentId","cid"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","minLength":1},"documentId":{"type":"string","minLength":1},"cid":{"type":"string","minLength":1}},"required":["id","documentId","cid"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","required":["yearEnd","effectiveFrom","transitionPeriod"],"properties":{"yearEnd":{"type":"string"},"effectiveFrom":{"type":"string","format":"date"},"transitionPeriod":{"type":"object","required":["start","end","months","days"],"properties":{"start":{"type":"string","format":"date"},"end":{"type":"string","format":"date"},"months":{"type":"integer"},"days":{"type":"integer"}}}}},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","required":["currency","primaryLedgerId","closedLedgerIds"],"properties":{"currency":{"type":"string"},"primaryLedgerId":{"type":"string"},"closedLedgerIds":{"type":"array","items":{"type":"string"}}}},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","properties":{"demo":{"const":true,"description":"Present only on a demo business: a fictional company, its owner's alone, that never takes a plan or reaches anyone else. Its figures are not real."},"demoOpenedAt":{"type":"string","format":"date-time","description":"On a demo business: when it was opened. Its seeded books run up to here."},"name":{"type":"string","description":"The public name."},"legalName":{"type":"string","description":"The registered name agreements and documents use; a project's is its owner's."},"legalEntityType":{"enum":["unknown","llc","c_corp","s_corp","sole_proprietorship","partnership","nonprofit","unincorporated","other","private_limited_company","corporation","stock_corporation","project"]},"ownership":{"type":"object","description":"What the legal form means for equity: the balance sheet's equity heading, the ownership reports that apply (primary first) and the company-setup skill's ownership recipes.","properties":{"family":{"enum":["corporation","members","partners","owner","nonprofit","unspecified"]},"equityLabel":{"type":"string"},"reports":{"type":"array","items":{"enum":["cap_table","capital_accounts"]}},"recipes":{"type":"array","items":{"type":"string"}}},"required":["family","equityLabel","reports","recipes"]},"jurisdiction":{"type":"string"},"formationDate":{"type":"string","format":"date"},"formationDateEventId":{"type":"integer"},"nameEventId":{"type":"integer"},"legalNameEventId":{"type":"integer"},"legalEntityTypeEventId":{"type":"integer"},"jurisdictionEventId":{"type":"integer"},"registrations":{"type":"array","items":{"type":"object","properties":{"kind":{"enum":["us_ein","sg_uen","ca_bn","gb_company_number"]},"number":{"type":"string"},"eventId":{"type":"integer"}},"required":["kind","number","eventId"]}},"description":{"type":"string"},"address":{"type":"object","properties":{"line1":{"type":"string","maxLength":200,"pattern":"^[^\\r\\n]+$"},"line2":{"type":"string","maxLength":200,"pattern":"^[^\\r\\n]*$"},"city":{"type":"string","maxLength":200,"pattern":"^[^\\r\\n]+$"},"region":{"type":"string","maxLength":200,"pattern":"^[^\\r\\n]*$"},"postalCode":{"type":"string","maxLength":40,"pattern":"^[^\\r\\n]*$"},"country":{"type":"string","pattern":"^[A-Z]{2}$"}},"required":["line1","city","country"],"additionalProperties":false},"url":{"type":"string","pattern":"^https?://"},"slug":{"type":"string"},"functionalCurrency":{"type":"string"},"primaryLedgerId":{"type":"string"},"successions":{"type":"array","description":"Incorporations in place (business.incorporate), oldest first.","items":{"type":"object","properties":{"eventId":{"type":"integer"},"effectiveAt":{"type":"string"},"previousName":{"type":"string"},"previousLegalEntityType":{"type":"string"},"name":{"type":"string"},"legalEntityType":{"type":"string"},"predecessorLedgerId":{"type":"string"},"successorLedgerId":{"type":"string"}},"required":["eventId","effectiveAt","previousLegalEntityType","name","legalEntityType","predecessorLedgerId","successorLedgerId"]}},"functionalCurrencyPeriods":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string"},"ledgerId":{"type":"string"},"effectiveFrom":{"type":"string"},"effectiveUntil":{"type":"string"},"changeEventId":{"type":"integer"}},"required":["currency","ledgerId","effectiveFrom","changeEventId"]}},"accountingFramework":{"type":"object","required":["framework","reason","jurisdiction","evidenceDocumentId","evidenceDocumentCid","effectiveAt"],"properties":{"framework":{"type":"string"},"edition":{"type":"string"},"sizeRegime":{"enum":["small","micro"]},"sizeEligibility":{"type":"object","required":["basis","periodEnd"],"properties":{"basis":{"type":"string","minLength":1,"maxLength":2000,"description":"What the founder's size conclusion rests on, e.g. 'Companies Act 2006 s384A conditions met in FY2025 and FY2026'. Recorded, never computed."},"periodEnd":{"type":"string","format":"date","description":"Period end the conclusion covers."}}},"reason":{"type":"string"},"jurisdiction":{"type":"string"},"evidenceDocumentId":{"type":"string"},"evidenceDocumentCid":{"type":"string"},"effectiveAt":{"type":"string"},"eventId":{"type":"integer"}}},"accountingFrameworkHistory":{"type":"array","items":{"type":"object","required":["framework","reason","jurisdiction","evidenceDocumentId","evidenceDocumentCid","effectiveAt"],"properties":{"framework":{"type":"string"},"edition":{"type":"string"},"sizeRegime":{"enum":["small","micro"]},"sizeEligibility":{"type":"object","required":["basis","periodEnd"],"properties":{"basis":{"type":"string","minLength":1,"maxLength":2000,"description":"What the founder's size conclusion rests on, e.g. 'Companies Act 2006 s384A conditions met in FY2025 and FY2026'. Recorded, never computed."},"periodEnd":{"type":"string","format":"date","description":"Period end the conclusion covers."}}},"reason":{"type":"string"},"jurisdiction":{"type":"string"},"evidenceDocumentId":{"type":"string"},"evidenceDocumentCid":{"type":"string"},"effectiveAt":{"type":"string"},"eventId":{"type":"integer"}}}},"salesTaxRegistrations":{"type":"array","items":{"type":"object","properties":{"registrationId":{"type":"string"},"regime":{"enum":["sg_gst","ca_gst_hst","ca_qst","ca_pst_bc","ca_pst_sk","ca_rst_mb","gb_vat"],"description":"sg_gst (Singapore GST); ca_gst_hst (Canadian GST/HST), ca_qst (Quebec QST), ca_pst_bc, ca_pst_sk, ca_rst_mb (provincial sales taxes, kept apart from GST/HST); gb_vat (UK VAT). It must be a regime of the country the business is incorporated in. There is no US regime: record US state sales tax as custom codes with tax_codes.create."},"country":{"type":"string"},"registrationNumber":{"type":"string"},"province":{"type":"string"},"effectiveFrom":{"type":"string","format":"date"},"effectiveUntil":{"type":"string","format":"date"},"reason":{"type":"string"},"sourceDocumentId":{"type":"string"}},"required":["registrationId","regime","country","registrationNumber","effectiveFrom","reason","sourceDocumentId"]}},"ycVerified":{"type":"boolean"},"ycVerificationUrl":{"type":"string"},"ycVerifiedAt":{"type":"string"},"ycBatch":{"type":"string"},"ycFounderName":{"type":"string"},"ycVerificationPending":{"type":"object","properties":{"url":{"type":"string"},"requestedAt":{"type":"string"}},"required":["url","requestedAt"]},"ycVerificationError":{"type":"string"}},"required":["ycVerified"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","properties":{"demo":{"const":true,"description":"Present only on a demo business: a fictional company, its owner's alone, that never takes a plan or reaches anyone else. Its figures are not real."},"demoOpenedAt":{"type":"string","format":"date-time","description":"On a demo business: when it was opened. Its seeded books run up to here."},"name":{"type":"string","description":"The public name."},"legalName":{"type":"string","description":"The registered name agreements and documents use; a project's is its owner's."},"legalEntityType":{"enum":["unknown","llc","c_corp","s_corp","sole_proprietorship","partnership","nonprofit","unincorporated","other","private_limited_company","corporation","stock_corporation","project"]},"ownership":{"type":"object","description":"What the legal form means for equity: the balance sheet's equity heading, the ownership reports that apply (primary first) and the company-setup skill's ownership recipes.","properties":{"family":{"enum":["corporation","members","partners","owner","nonprofit","unspecified"]},"equityLabel":{"type":"string"},"reports":{"type":"array","items":{"enum":["cap_table","capital_accounts"]}},"recipes":{"type":"array","items":{"type":"string"}}},"required":["family","equityLabel","reports","recipes"]},"jurisdiction":{"type":"string"},"formationDate":{"type":"string","format":"date"},"formationDateEventId":{"type":"integer"},"nameEventId":{"type":"integer"},"legalNameEventId":{"type":"integer"},"legalEntityTypeEventId":{"type":"integer"},"jurisdictionEventId":{"type":"integer"},"registrations":{"type":"array","items":{"type":"object","properties":{"kind":{"enum":["us_ein","sg_uen","ca_bn","gb_company_number"]},"number":{"type":"string"},"eventId":{"type":"integer"}},"required":["kind","number","eventId"]}},"description":{"type":"string"},"address":{"type":"object","properties":{"line1":{"type":"string","maxLength":200,"pattern":"^[^\\r\\n]+$"},"line2":{"type":"string","maxLength":200,"pattern":"^[^\\r\\n]*$"},"city":{"type":"string","maxLength":200,"pattern":"^[^\\r\\n]+$"},"region":{"type":"string","maxLength":200,"pattern":"^[^\\r\\n]*$"},"postalCode":{"type":"string","maxLength":40,"pattern":"^[^\\r\\n]*$"},"country":{"type":"string","pattern":"^[A-Z]{2}$"}},"required":["line1","city","country"],"additionalProperties":false},"url":{"type":"string","pattern":"^https?://"},"slug":{"type":"string"},"functionalCurrency":{"type":"string"},"primaryLedgerId":{"type":"string"},"successions":{"type":"array","description":"Incorporations in place (business.incorporate), oldest first.","items":{"type":"object","properties":{"eventId":{"type":"integer"},"effectiveAt":{"type":"string"},"previousName":{"type":"string"},"previousLegalEntityType":{"type":"string"},"name":{"type":"string"},"legalEntityType":{"type":"string"},"predecessorLedgerId":{"type":"string"},"successorLedgerId":{"type":"string"}},"required":["eventId","effectiveAt","previousLegalEntityType","name","legalEntityType","predecessorLedgerId","successorLedgerId"]}},"functionalCurrencyPeriods":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string"},"ledgerId":{"type":"string"},"effectiveFrom":{"type":"string"},"effectiveUntil":{"type":"string"},"changeEventId":{"type":"integer"}},"required":["currency","ledgerId","effectiveFrom","changeEventId"]}},"accountingFramework":{"type":"object","required":["framework","reason","jurisdiction","evidenceDocumentId","evidenceDocumentCid","effectiveAt"],"properties":{"framework":{"type":"string"},"edition":{"type":"string"},"sizeRegime":{"enum":["small","micro"]},"sizeEligibility":{"type":"object","required":["basis","periodEnd"],"properties":{"basis":{"type":"string","minLength":1,"maxLength":2000,"description":"What the founder's size conclusion rests on, e.g. 'Companies Act 2006 s384A conditions met in FY2025 and FY2026'. Recorded, never computed."},"periodEnd":{"type":"string","format":"date","description":"Period end the conclusion covers."}}},"reason":{"type":"string"},"jurisdiction":{"type":"string"},"evidenceDocumentId":{"type":"string"},"evidenceDocumentCid":{"type":"string"},"effectiveAt":{"type":"string"},"eventId":{"type":"integer"}}},"accountingFrameworkHistory":{"type":"array","items":{"type":"object","required":["framework","reason","jurisdiction","evidenceDocumentId","evidenceDocumentCid","effectiveAt"],"properties":{"framework":{"type":"string"},"edition":{"type":"string"},"sizeRegime":{"enum":["small","micro"]},"sizeEligibility":{"type":"object","required":["basis","periodEnd"],"properties":{"basis":{"type":"string","minLength":1,"maxLength":2000,"description":"What the founder's size conclusion rests on, e.g. 'Companies Act 2006 s384A conditions met in FY2025 and FY2026'. Recorded, never computed."},"periodEnd":{"type":"string","format":"date","description":"Period end the conclusion covers."}}},"reason":{"type":"string"},"jurisdiction":{"type":"string"},"evidenceDocumentId":{"type":"string"},"evidenceDocumentCid":{"type":"string"},"effectiveAt":{"type":"string"},"eventId":{"type":"integer"}}}},"salesTaxRegistrations":{"type":"array","items":{"type":"object","properties":{"registrationId":{"type":"string"},"regime":{"enum":["sg_gst","ca_gst_hst","ca_qst","ca_pst_bc","ca_pst_sk","ca_rst_mb","gb_vat"],"description":"sg_gst (Singapore GST); ca_gst_hst (Canadian GST/HST), ca_qst (Quebec QST), ca_pst_bc, ca_pst_sk, ca_rst_mb (provincial sales taxes, kept apart from GST/HST); gb_vat (UK VAT). It must be a regime of the country the business is incorporated in. There is no US regime: record US state sales tax as custom codes with tax_codes.create."},"country":{"type":"string"},"registrationNumber":{"type":"string"},"province":{"type":"string"},"effectiveFrom":{"type":"string","format":"date"},"effectiveUntil":{"type":"string","format":"date"},"reason":{"type":"string"},"sourceDocumentId":{"type":"string"}},"required":["registrationId","regime","country","registrationNumber","effectiveFrom","reason","sourceDocumentId"]}},"ycVerified":{"type":"boolean"},"ycVerificationUrl":{"type":"string"},"ycVerifiedAt":{"type":"string"},"ycBatch":{"type":"string"},"ycFounderName":{"type":"string"},"ycVerificationPending":{"type":"object","properties":{"url":{"type":"string"},"requestedAt":{"type":"string"}},"required":["url","requestedAt"]},"ycVerificationError":{"type":"string"}},"required":["ycVerified"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","required":["registration"],"properties":{"registration":{"type":"object","properties":{"registrationId":{"type":"string"},"regime":{"enum":["sg_gst","ca_gst_hst","ca_qst","ca_pst_bc","ca_pst_sk","ca_rst_mb","gb_vat"],"description":"sg_gst (Singapore GST); ca_gst_hst (Canadian GST/HST), ca_qst (Quebec QST), ca_pst_bc, ca_pst_sk, ca_rst_mb (provincial sales taxes, kept apart from GST/HST); gb_vat (UK VAT). It must be a regime of the country the business is incorporated in. There is no US regime: record US state sales tax as custom codes with tax_codes.create."},"country":{"type":"string"},"registrationNumber":{"type":"string"},"province":{"type":"string"},"effectiveFrom":{"type":"string","format":"date"},"effectiveUntil":{"type":"string","format":"date"},"reason":{"type":"string"},"sourceDocumentId":{"type":"string"}},"required":["registrationId","regime","country","registrationNumber","effectiveFrom","reason","sourceDocumentId"]}}},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","required":["framework","reason","jurisdiction","evidenceDocumentId","evidenceDocumentCid","effectiveAt"],"properties":{"framework":{"type":"string"},"edition":{"type":"string"},"sizeRegime":{"enum":["small","micro"]},"sizeEligibility":{"type":"object","required":["basis","periodEnd"],"properties":{"basis":{"type":"string","minLength":1,"maxLength":2000,"description":"What the founder's size conclusion rests on, e.g. 'Companies Act 2006 s384A conditions met in FY2025 and FY2026'. Recorded, never computed."},"periodEnd":{"type":"string","format":"date","description":"Period end the conclusion covers."}}},"reason":{"type":"string"},"jurisdiction":{"type":"string"},"evidenceDocumentId":{"type":"string"},"evidenceDocumentCid":{"type":"string"},"effectiveAt":{"type":"string"},"eventId":{"type":"integer"}}},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","required":["name","legalEntityType","jurisdiction","ownerPartyId","predecessorLedgerId","primaryLedgerId","contributedCapital","parValue","openingLines","successorLedgers"],"properties":{"name":{"type":"string"},"legalEntityType":{"type":"string"},"jurisdiction":{"type":"string"},"ownerPartyId":{"type":"string"},"predecessorLedgerId":{"type":"string"},"primaryLedgerId":{"type":"string"},"contributedCapital":{"type":"string"},"parValue":{"type":"string"},"openingLines":{"type":"integer"},"successorLedgers":{"type":"array","items":{"type":"object","required":["currency","predecessorLedgerId","successorLedgerId"],"properties":{"currency":{"type":"string"},"predecessorLedgerId":{"type":"string"},"successorLedgerId":{"type":"string"}}}}}},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","required":["date"],"properties":{"date":{"type":"string","format":"date"}}},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","required":["registration","seededTaxCodes"],"properties":{"registration":{"type":"object","properties":{"registrationId":{"type":"string"},"regime":{"enum":["sg_gst","ca_gst_hst","ca_qst","ca_pst_bc","ca_pst_sk","ca_rst_mb","gb_vat"],"description":"sg_gst (Singapore GST); ca_gst_hst (Canadian GST/HST), ca_qst (Quebec QST), ca_pst_bc, ca_pst_sk, ca_rst_mb (provincial sales taxes, kept apart from GST/HST); gb_vat (UK VAT). It must be a regime of the country the business is incorporated in. There is no US regime: record US state sales tax as custom codes with tax_codes.create."},"country":{"type":"string"},"registrationNumber":{"type":"string"},"province":{"type":"string"},"effectiveFrom":{"type":"string","format":"date"},"effectiveUntil":{"type":"string","format":"date"},"reason":{"type":"string"},"sourceDocumentId":{"type":"string"}},"required":["registrationId","regime","country","registrationNumber","effectiveFrom","reason","sourceDocumentId"]},"seededTaxCodes":{"type":"array","items":{"type":"string"}}}},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","properties":{"demo":{"const":true,"description":"Present only on a demo business: a fictional company, its owner's alone, that never takes a plan or reaches anyone else. Its figures are not real."},"demoOpenedAt":{"type":"string","format":"date-time","description":"On a demo business: when it was opened. Its seeded books run up to here."},"name":{"type":"string","description":"The public name."},"legalName":{"type":"string","description":"The registered name agreements and documents use; a project's is its owner's."},"legalEntityType":{"enum":["unknown","llc","c_corp","s_corp","sole_proprietorship","partnership","nonprofit","unincorporated","other","private_limited_company","corporation","stock_corporation","project"]},"ownership":{"type":"object","description":"What the legal form means for equity: the balance sheet's equity heading, the ownership reports that apply (primary first) and the company-setup skill's ownership recipes.","properties":{"family":{"enum":["corporation","members","partners","owner","nonprofit","unspecified"]},"equityLabel":{"type":"string"},"reports":{"type":"array","items":{"enum":["cap_table","capital_accounts"]}},"recipes":{"type":"array","items":{"type":"string"}}},"required":["family","equityLabel","reports","recipes"]},"jurisdiction":{"type":"string"},"formationDate":{"type":"string","format":"date"},"formationDateEventId":{"type":"integer"},"nameEventId":{"type":"integer"},"legalNameEventId":{"type":"integer"},"legalEntityTypeEventId":{"type":"integer"},"jurisdictionEventId":{"type":"integer"},"registrations":{"type":"array","items":{"type":"object","properties":{"kind":{"enum":["us_ein","sg_uen","ca_bn","gb_company_number"]},"number":{"type":"string"},"eventId":{"type":"integer"}},"required":["kind","number","eventId"]}},"description":{"type":"string"},"address":{"type":"object","properties":{"line1":{"type":"string","maxLength":200,"pattern":"^[^\\r\\n]+$"},"line2":{"type":"string","maxLength":200,"pattern":"^[^\\r\\n]*$"},"city":{"type":"string","maxLength":200,"pattern":"^[^\\r\\n]+$"},"region":{"type":"string","maxLength":200,"pattern":"^[^\\r\\n]*$"},"postalCode":{"type":"string","maxLength":40,"pattern":"^[^\\r\\n]*$"},"country":{"type":"string","pattern":"^[A-Z]{2}$"}},"required":["line1","city","country"],"additionalProperties":false},"url":{"type":"string","pattern":"^https?://"},"slug":{"type":"string"},"functionalCurrency":{"type":"string"},"primaryLedgerId":{"type":"string"},"successions":{"type":"array","description":"Incorporations in place (business.incorporate), oldest first.","items":{"type":"object","properties":{"eventId":{"type":"integer"},"effectiveAt":{"type":"string"},"previousName":{"type":"string"},"previousLegalEntityType":{"type":"string"},"name":{"type":"string"},"legalEntityType":{"type":"string"},"predecessorLedgerId":{"type":"string"},"successorLedgerId":{"type":"string"}},"required":["eventId","effectiveAt","previousLegalEntityType","name","legalEntityType","predecessorLedgerId","successorLedgerId"]}},"functionalCurrencyPeriods":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string"},"ledgerId":{"type":"string"},"effectiveFrom":{"type":"string"},"effectiveUntil":{"type":"string"},"changeEventId":{"type":"integer"}},"required":["currency","ledgerId","effectiveFrom","changeEventId"]}},"accountingFramework":{"type":"object","required":["framework","reason","jurisdiction","evidenceDocumentId","evidenceDocumentCid","effectiveAt"],"properties":{"framework":{"type":"string"},"edition":{"type":"string"},"sizeRegime":{"enum":["small","micro"]},"sizeEligibility":{"type":"object","required":["basis","periodEnd"],"properties":{"basis":{"type":"string","minLength":1,"maxLength":2000,"description":"What the founder's size conclusion rests on, e.g. 'Companies Act 2006 s384A conditions met in FY2025 and FY2026'. Recorded, never computed."},"periodEnd":{"type":"string","format":"date","description":"Period end the conclusion covers."}}},"reason":{"type":"string"},"jurisdiction":{"type":"string"},"evidenceDocumentId":{"type":"string"},"evidenceDocumentCid":{"type":"string"},"effectiveAt":{"type":"string"},"eventId":{"type":"integer"}}},"accountingFrameworkHistory":{"type":"array","items":{"type":"object","required":["framework","reason","jurisdiction","evidenceDocumentId","evidenceDocumentCid","effectiveAt"],"properties":{"framework":{"type":"string"},"edition":{"type":"string"},"sizeRegime":{"enum":["small","micro"]},"sizeEligibility":{"type":"object","required":["basis","periodEnd"],"properties":{"basis":{"type":"string","minLength":1,"maxLength":2000,"description":"What the founder's size conclusion rests on, e.g. 'Companies Act 2006 s384A conditions met in FY2025 and FY2026'. Recorded, never computed."},"periodEnd":{"type":"string","format":"date","description":"Period end the conclusion covers."}}},"reason":{"type":"string"},"jurisdiction":{"type":"string"},"evidenceDocumentId":{"type":"string"},"evidenceDocumentCid":{"type":"string"},"effectiveAt":{"type":"string"},"eventId":{"type":"integer"}}}},"salesTaxRegistrations":{"type":"array","items":{"type":"object","properties":{"registrationId":{"type":"string"},"regime":{"enum":["sg_gst","ca_gst_hst","ca_qst","ca_pst_bc","ca_pst_sk","ca_rst_mb","gb_vat"],"description":"sg_gst (Singapore GST); ca_gst_hst (Canadian GST/HST), ca_qst (Quebec QST), ca_pst_bc, ca_pst_sk, ca_rst_mb (provincial sales taxes, kept apart from GST/HST); gb_vat (UK VAT). It must be a regime of the country the business is incorporated in. There is no US regime: record US state sales tax as custom codes with tax_codes.create."},"country":{"type":"string"},"registrationNumber":{"type":"string"},"province":{"type":"string"},"effectiveFrom":{"type":"string","format":"date"},"effectiveUntil":{"type":"string","format":"date"},"reason":{"type":"string"},"sourceDocumentId":{"type":"string"}},"required":["registrationId","regime","country","registrationNumber","effectiveFrom","reason","sourceDocumentId"]}},"ycVerified":{"type":"boolean"},"ycVerificationUrl":{"type":"string"},"ycVerifiedAt":{"type":"string"},"ycBatch":{"type":"string"},"ycFounderName":{"type":"string"},"ycVerificationPending":{"type":"object","properties":{"url":{"type":"string"},"requestedAt":{"type":"string"}},"required":["url","requestedAt"]},"ycVerificationError":{"type":"string"}},"required":["ycVerified"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","properties":{"demo":{"const":true,"description":"Present only on a demo business: a fictional company, its owner's alone, that never takes a plan or reaches anyone else. Its figures are not real."},"demoOpenedAt":{"type":"string","format":"date-time","description":"On a demo business: when it was opened. Its seeded books run up to here."},"name":{"type":"string","description":"The public name."},"legalName":{"type":"string","description":"The registered name agreements and documents use; a project's is its owner's."},"legalEntityType":{"enum":["unknown","llc","c_corp","s_corp","sole_proprietorship","partnership","nonprofit","unincorporated","other","private_limited_company","corporation","stock_corporation","project"]},"ownership":{"type":"object","description":"What the legal form means for equity: the balance sheet's equity heading, the ownership reports that apply (primary first) and the company-setup skill's ownership recipes.","properties":{"family":{"enum":["corporation","members","partners","owner","nonprofit","unspecified"]},"equityLabel":{"type":"string"},"reports":{"type":"array","items":{"enum":["cap_table","capital_accounts"]}},"recipes":{"type":"array","items":{"type":"string"}}},"required":["family","equityLabel","reports","recipes"]},"jurisdiction":{"type":"string"},"formationDate":{"type":"string","format":"date"},"formationDateEventId":{"type":"integer"},"nameEventId":{"type":"integer"},"legalNameEventId":{"type":"integer"},"legalEntityTypeEventId":{"type":"integer"},"jurisdictionEventId":{"type":"integer"},"registrations":{"type":"array","items":{"type":"object","properties":{"kind":{"enum":["us_ein","sg_uen","ca_bn","gb_company_number"]},"number":{"type":"string"},"eventId":{"type":"integer"}},"required":["kind","number","eventId"]}},"description":{"type":"string"},"address":{"type":"object","properties":{"line1":{"type":"string","maxLength":200,"pattern":"^[^\\r\\n]+$"},"line2":{"type":"string","maxLength":200,"pattern":"^[^\\r\\n]*$"},"city":{"type":"string","maxLength":200,"pattern":"^[^\\r\\n]+$"},"region":{"type":"string","maxLength":200,"pattern":"^[^\\r\\n]*$"},"postalCode":{"type":"string","maxLength":40,"pattern":"^[^\\r\\n]*$"},"country":{"type":"string","pattern":"^[A-Z]{2}$"}},"required":["line1","city","country"],"additionalProperties":false},"url":{"type":"string","pattern":"^https?://"},"slug":{"type":"string"},"functionalCurrency":{"type":"string"},"primaryLedgerId":{"type":"string"},"successions":{"type":"array","description":"Incorporations in place (business.incorporate), oldest first.","items":{"type":"object","properties":{"eventId":{"type":"integer"},"effectiveAt":{"type":"string"},"previousName":{"type":"string"},"previousLegalEntityType":{"type":"string"},"name":{"type":"string"},"legalEntityType":{"type":"string"},"predecessorLedgerId":{"type":"string"},"successorLedgerId":{"type":"string"}},"required":["eventId","effectiveAt","previousLegalEntityType","name","legalEntityType","predecessorLedgerId","successorLedgerId"]}},"functionalCurrencyPeriods":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string"},"ledgerId":{"type":"string"},"effectiveFrom":{"type":"string"},"effectiveUntil":{"type":"string"},"changeEventId":{"type":"integer"}},"required":["currency","ledgerId","effectiveFrom","changeEventId"]}},"accountingFramework":{"type":"object","required":["framework","reason","jurisdiction","evidenceDocumentId","evidenceDocumentCid","effectiveAt"],"properties":{"framework":{"type":"string"},"edition":{"type":"string"},"sizeRegime":{"enum":["small","micro"]},"sizeEligibility":{"type":"object","required":["basis","periodEnd"],"properties":{"basis":{"type":"string","minLength":1,"maxLength":2000,"description":"What the founder's size conclusion rests on, e.g. 'Companies Act 2006 s384A conditions met in FY2025 and FY2026'. Recorded, never computed."},"periodEnd":{"type":"string","format":"date","description":"Period end the conclusion covers."}}},"reason":{"type":"string"},"jurisdiction":{"type":"string"},"evidenceDocumentId":{"type":"string"},"evidenceDocumentCid":{"type":"string"},"effectiveAt":{"type":"string"},"eventId":{"type":"integer"}}},"accountingFrameworkHistory":{"type":"array","items":{"type":"object","required":["framework","reason","jurisdiction","evidenceDocumentId","evidenceDocumentCid","effectiveAt"],"properties":{"framework":{"type":"string"},"edition":{"type":"string"},"sizeRegime":{"enum":["small","micro"]},"sizeEligibility":{"type":"object","required":["basis","periodEnd"],"properties":{"basis":{"type":"string","minLength":1,"maxLength":2000,"description":"What the founder's size conclusion rests on, e.g. 'Companies Act 2006 s384A conditions met in FY2025 and FY2026'. Recorded, never computed."},"periodEnd":{"type":"string","format":"date","description":"Period end the conclusion covers."}}},"reason":{"type":"string"},"jurisdiction":{"type":"string"},"evidenceDocumentId":{"type":"string"},"evidenceDocumentCid":{"type":"string"},"effectiveAt":{"type":"string"},"eventId":{"type":"integer"}}}},"salesTaxRegistrations":{"type":"array","items":{"type":"object","properties":{"registrationId":{"type":"string"},"regime":{"enum":["sg_gst","ca_gst_hst","ca_qst","ca_pst_bc","ca_pst_sk","ca_rst_mb","gb_vat"],"description":"sg_gst (Singapore GST); ca_gst_hst (Canadian GST/HST), ca_qst (Quebec QST), ca_pst_bc, ca_pst_sk, ca_rst_mb (provincial sales taxes, kept apart from GST/HST); gb_vat (UK VAT). It must be a regime of the country the business is incorporated in. There is no US regime: record US state sales tax as custom codes with tax_codes.create."},"country":{"type":"string"},"registrationNumber":{"type":"string"},"province":{"type":"string"},"effectiveFrom":{"type":"string","format":"date"},"effectiveUntil":{"type":"string","format":"date"},"reason":{"type":"string"},"sourceDocumentId":{"type":"string"}},"required":["registrationId","regime","country","registrationNumber","effectiveFrom","reason","sourceDocumentId"]}},"ycVerified":{"type":"boolean"},"ycVerificationUrl":{"type":"string"},"ycVerifiedAt":{"type":"string"},"ycBatch":{"type":"string"},"ycFounderName":{"type":"string"},"ycVerificationPending":{"type":"object","properties":{"url":{"type":"string"},"requestedAt":{"type":"string"}},"required":["url","requestedAt"]},"ycVerificationError":{"type":"string"}},"required":["ycVerified"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","properties":{"categoryId":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"description":{"type":"string"}},"required":["categoryId","name","code"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","properties":{"connectionId":{"type":"string"},"direction":{"enum":["outbound","inbound"]},"counterparty":{"type":"string"},"partyId":{"type":"string"},"status":{"enum":["requested","pending","active","declined","ended","refused"]},"note":{"type":"string"},"requestedAt":{"type":"string","format":"date-time"}},"required":["connectionId","direction","counterparty","status","requestedAt"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","properties":{"connectionId":{"type":"string"},"direction":{"enum":["outbound","inbound"]},"counterparty":{"type":"string"},"partyId":{"type":"string"},"status":{"enum":["requested","pending","active","declined","ended","refused"]},"note":{"type":"string"},"requestedAt":{"type":"string","format":"date-time"}},"required":["connectionId","direction","counterparty","status","requestedAt"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","properties":{"connectionId":{"type":"string"},"direction":{"enum":["outbound","inbound"]},"counterparty":{"type":"string"},"partyId":{"type":"string"},"status":{"enum":["requested","pending","active","declined","ended","refused"]},"note":{"type":"string"},"requestedAt":{"type":"string","format":"date-time"}},"required":["connectionId","direction","counterparty","status","requestedAt"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","properties":{"connectionId":{"type":"string"},"direction":{"enum":["outbound","inbound"]},"counterparty":{"type":"string"},"partyId":{"type":"string"},"status":{"enum":["requested","pending","active","declined","ended","refused"]},"note":{"type":"string"},"requestedAt":{"type":"string","format":"date-time"}},"required":["connectionId","direction","counterparty","status","requestedAt"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","additionalProperties":false,"required":["id","status"],"properties":{"id":{"type":"string","minLength":1},"status":{"enum":["draft","offer","active","rejected","terminated","expired"]},"documentId":{"type":"string","minLength":1},"cid":{"type":"string","minLength":1}}},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","required":["id","documentId","cid"],"properties":{"id":{"type":"string","minLength":1},"documentId":{"type":"string","minLength":1},"cid":{"type":"string","minLength":1}}},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","additionalProperties":false,"required":["id","status"],"properties":{"id":{"type":"string","minLength":1},"status":{"enum":["draft","offer","active","rejected","terminated","expired"]},"documentId":{"type":"string","minLength":1},"cid":{"type":"string","minLength":1}}},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","minLength":1},"documentId":{"type":"string","minLength":1},"cid":{"type":"string","minLength":1}},"required":["id","documentId","cid"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","minLength":1},"status":{"const":"discarded"}},"required":["id","status"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","additionalProperties":false,"required":["id","status"],"properties":{"id":{"type":"string","minLength":1},"status":{"enum":["draft","offer","active","rejected","terminated","expired"]},"documentId":{"type":"string","minLength":1},"cid":{"type":"string","minLength":1}}},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","properties":{"occurrenceId":{"type":"string","minLength":1},"documentId":{"type":"string","minLength":1},"cid":{"type":"string","minLength":1},"duplicate":{"type":"boolean"},"evaluation":{"type":"object"},"claimIds":{"type":"array","items":{"type":"string","minLength":1}},"claims":{"type":"array","items":{"type":"object","required":["claimId","component"],"properties":{"claimId":{"type":"string","minLength":1},"component":{"type":"object","required":["originLedgerId","accountCode"],"properties":{"originLedgerId":{"type":"string","minLength":1},"accountCode":{"type":"integer"}}}}},"description":"Payment-ready claim identities returned for priced-right economic phases."}},"required":["occurrenceId","documentId","cid","duplicate","evaluation"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","required":["reversalId","documentId","occurrenceIds","repeated"],"properties":{"reversalId":{"type":"string","minLength":1},"documentId":{"type":"string","minLength":1},"occurrenceIds":{"type":"array","items":{"type":"string","minLength":1}},"refundClaims":{"type":"array","items":{"type":"object","required":["claimId","component","amount"],"properties":{"claimId":{"type":"string","minLength":1},"component":{"type":"object","required":["originLedgerId","accountCode"],"properties":{"originLedgerId":{"type":"string","minLength":1},"accountCode":{"type":"integer"}}},"amount":{"type":"string"}}}},"repeated":{"type":"boolean"}}},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","additionalProperties":false,"required":["id","status"],"properties":{"id":{"type":"string","minLength":1},"status":{"enum":["draft","offer","active","rejected","terminated","expired"]},"documentId":{"type":"string","minLength":1},"cid":{"type":"string","minLength":1}}},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","properties":{"documentId":{"type":"string","minLength":1},"cid":{"type":"string","minLength":1}},"required":["documentId","cid"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","properties":{"related":{"const":true}},"required":["related"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","additionalProperties":false,"required":["disposition","source","missing"],"allOf":[{"if":{"properties":{"disposition":{"const":"ready"}}},"then":{"required":["template","preview","termsEvidence","command"]}}],"properties":{"disposition":{"enum":["ready","needs_information"]},"source":{"type":"object","additionalProperties":false,"required":["documentId","cid","format","provenance","textCid","location"],"properties":{"documentId":{"type":"string"},"cid":{"type":"string"},"format":{"enum":["markdown","text","document"]},"provenance":{"enum":["caller_supplied_unverified","registered_bytes"]},"textCid":{"type":"string"},"location":{"type":"object","additionalProperties":false,"required":["start","end"],"properties":{"start":{"type":"integer","minimum":0},"end":{"type":"integer","minimum":0}}}}},"missing":{"type":"array","items":{"type":"string"}},"template":{"type":"object","additionalProperties":false,"required":["documentId","cid"],"properties":{"documentId":{"type":"string"},"cid":{"type":"string"}}},"preview":{"type":"object","additionalProperties":false,"required":["status","name","activities"],"properties":{"status":{"const":"draft"},"name":{"type":"string"},"activities":{"type":"array","maxItems":100,"items":{"type":"object","additionalProperties":false,"required":["key","activityDocumentId","terms"],"properties":{"key":{"type":"string"},"activityDocumentId":{"type":"string"},"terms":{"type":"object","maxProperties":100,"additionalProperties":{"type":"string"}}}}}}},"termsEvidence":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["activityKey","term","value","origin","pointer","documentId","cid","textCid"],"properties":{"activityKey":{"type":"string"},"term":{"type":"string"},"value":{"type":"string"},"origin":{"enum":["source","catalog"]},"pointer":{"type":["string","null"]},"documentId":{"type":"string"},"cid":{"type":"string"},"textCid":{"type":["string","null"]}}}},"command":{"type":"object","additionalProperties":false,"required":["name","input","source_document_id","effective_at","idempotency_key"],"properties":{"name":{"const":"contracts.create"},"input":{"type":"object","additionalProperties":false,"properties":{"templateDocumentId":{"type":"string","minLength":1},"definition":{"type":"object","additionalProperties":false,"properties":{"model":{"const":"priced-rights-v1"},"name":{"type":"string","minLength":1},"plan":{"enum":["on_sale","off_sale"]},"parties":{"type":"array","items":{"type":"string","minLength":1},"minItems":1,"maxItems":100},"ledgers":{"type":"object","maxProperties":100,"additionalProperties":{"type":"object","additionalProperties":false,"properties":{"classification":{"enum":["gaap","contractual","operational","ownership","planning"]},"unitKind":{"enum":["currency","share","usage","credit","right","token","other"]},"unitCode":{"type":"string","minLength":1},"decimals":{"type":"integer","minimum":0,"maximum":18},"accountTemplate":{"enum":["gaap_startup","contract_flow","capacity","meter","entitlement","issued_instrument"]}},"required":["classification","unitKind","unitCode","decimals","accountTemplate"]}},"activities":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"key":{"type":"string","minLength":1},"activityDocumentId":{"type":"string","minLength":1},"partyRole":{"type":"string","minLength":1},"ledgers":{"type":"object","maxProperties":100,"additionalProperties":{"type":"string","minLength":1}},"terms":{"type":"object","maxProperties":100,"additionalProperties":{"type":"string","minLength":1}}},"required":["key","activityDocumentId","partyRole"]},"minItems":1,"maxItems":100},"consequences":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"key":{"type":"string","minLength":1},"sourceRights":{"type":"array","items":{"type":"string","minLength":1},"minItems":1,"maxItems":100},"rule":{"anyOf":[{"type":"object","additionalProperties":false,"properties":{"type":{"const":"grant_capacity"},"capacityLedger":{"type":"string","minLength":1},"quantity":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"expiresAtTerm":{"type":"string","minLength":1}},"required":["type","capacityLedger","quantity","expiresAtTerm"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"consume_capacity"},"capacityLedger":{"type":"string","minLength":1},"quantity":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"grantOccurrenceFact":{"type":"string","minLength":1},"overageRight":{"type":"string","minLength":1}},"required":["type","capacityLedger","quantity","grantOccurrenceFact"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"expire_capacity"},"capacityLedger":{"type":"string","minLength":1},"valueLedger":{"type":"string","minLength":1}},"required":["type","capacityLedger"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"minimum"},"eligibleRights":{"type":"array","items":{"type":"string","minLength":1},"minItems":1,"maxItems":100},"minimum":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"currencyTerm":{"type":"string","minLength":1},"completeThroughFact":{"type":"string","minLength":1}},"required":["type","eligibleRights","minimum","currencyTerm","completeThroughFact"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"refund_unearned"},"monetaryLedger":{"type":"string","minLength":1},"amount":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"taxClaimFact":{"type":"string","minLength":1}},"required":["type","monetaryLedger","amount"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"profit_allocation"},"result":{"enum":["profit","loss"]},"monetaryLedger":{"type":"string","minLength":1},"ownershipLedger":{"type":"string","minLength":1},"amount":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"completeThroughFact":{"type":"string","minLength":1}},"required":["type","monetaryLedger","ownershipLedger","amount","completeThroughFact"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"profit_allocation"},"result":{"enum":["profit","loss"]},"monetaryLedger":{"type":"string","minLength":1},"ownershipBasis":{"const":"agreement"},"amount":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"completeThroughFact":{"type":"string","minLength":1}},"required":["type","monetaryLedger","ownershipBasis","amount","completeThroughFact"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"close_draws"},"monetaryLedger":{"type":"string","minLength":1},"completeThroughFact":{"type":"string","minLength":1}},"required":["type","monetaryLedger","completeThroughFact"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"authorize_units"},"unitsLedger":{"type":"string","minLength":1},"quantity":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"}},"required":["type","unitsLedger","quantity"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"issue_units"},"capitalAllocation":{"type":"object","additionalProperties":false,"properties":{"shareCapital":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"sharePremium":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"}},"required":["shareCapital","sharePremium"]},"unitsLedger":{"type":"string","minLength":1},"quantity":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"consideration":{"anyOf":[{"type":"object","additionalProperties":false,"properties":{"type":{"const":"money"},"amount":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"currencyTerm":{"type":"string","minLength":1},"recognition":{"enum":["unconditional_obligation","condition_satisfied"]}},"required":["type","amount","currencyTerm","recognition"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"units"},"quantity":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"ledger":{"type":"string","minLength":1}},"required":["type","quantity","ledger"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"claim"},"claimFact":{"type":"string","minLength":1},"amount":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"currencyTerm":{"type":"string","minLength":1}},"required":["type","claimFact","amount","currencyTerm"]}]},"restricted":{"type":"boolean"}},"required":["type","unitsLedger","quantity","consideration","restricted"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"capital_contribution"},"consideration":{"anyOf":[{"type":"object","additionalProperties":false,"properties":{"type":{"const":"money"},"amount":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"currencyTerm":{"type":"string","minLength":1},"recognition":{"enum":["unconditional_obligation","condition_satisfied"]}},"required":["type","amount","currencyTerm","recognition"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"units"},"quantity":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"ledger":{"type":"string","minLength":1}},"required":["type","quantity","ledger"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"claim"},"claimFact":{"type":"string","minLength":1},"amount":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"currencyTerm":{"type":"string","minLength":1}},"required":["type","claimFact","amount","currencyTerm"]}]}},"required":["type","consideration"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"financing_commitment"},"consideration":{"anyOf":[{"type":"object","additionalProperties":false,"properties":{"type":{"const":"money"},"amount":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"currencyTerm":{"type":"string","minLength":1},"recognition":{"enum":["unconditional_obligation","condition_satisfied"]}},"required":["type","amount","currencyTerm","recognition"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"units"},"quantity":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"ledger":{"type":"string","minLength":1}},"required":["type","quantity","ledger"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"claim"},"claimFact":{"type":"string","minLength":1},"amount":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"currencyTerm":{"type":"string","minLength":1}},"required":["type","claimFact","amount","currencyTerm"]}]},"liability":{"const":"owner_advance"}},"required":["type","consideration"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"capital_distribution"},"amount":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"}},"required":["type","amount"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"owner_draw"},"amount":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"}},"required":["type","amount"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"vest_units"},"unitsLedger":{"type":"string","minLength":1},"quantity":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"grantOccurrenceFact":{"type":"string","minLength":1}},"required":["type","unitsLedger","quantity","grantOccurrenceFact"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"vest_units"},"unitsLedger":{"type":"string","minLength":1},"quantity":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"grantConsequence":{"type":"string","minLength":1}},"required":["type","unitsLedger","quantity","grantConsequence"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"convert_claim"},"claimFact":{"type":"string","minLength":1},"amount":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"currencyTerm":{"type":"string","minLength":1},"monetaryLedger":{"type":"string","minLength":1},"equityAccount":{"enum":[3100,3110,3120]},"units":{"type":"object","additionalProperties":false,"properties":{"ledger":{"type":"string","minLength":1},"quantity":{"type":"string","pattern":"^(term|fact):[a-zA-Z][a-zA-Z0-9_-]{0,63}$"},"restricted":{"type":"boolean"}},"required":["ledger","quantity","restricted"]}},"required":["type","claimFact","amount","currencyTerm","monetaryLedger","equityAccount"]}]},"trigger":{"anyOf":[{"type":"object","additionalProperties":false,"properties":{"type":{"const":"transition"},"action":{"enum":["accept","cancel","terminate"]}},"required":["type","action"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"exercise"},"activityKey":{"type":"string","minLength":1}},"required":["type","activityKey"]},{"type":"object","additionalProperties":false,"properties":{"type":{"const":"period_close"},"schedule":{"type":"object","additionalProperties":false,"properties":{"startTerm":{"type":"string","minLength":1},"anchorTerm":{"type":"string","minLength":1},"endTerm":{"type":"string","minLength":1},"everyMonths":{"type":"integer","minimum":1,"maximum":120},"timing":{"enum":["start","end"]},"offsetDays":{"type":"integer","minimum":-365,"maximum":365},"serviceEvidence":{"const":"elapsed_time"}},"required":["startTerm","everyMonths","timing","offsetDays"]}},"required":["type","schedule"]}]},"evidence":{"type":"array","items":{"enum":["acceptance","economic","service"]},"minItems":1,"maxItems":100}},"required":["key","sourceRights","trigger","rule","evidence"]},"minItems":0,"maxItems":100}},"required":["model","name","parties","activities"]},"parties":{"type":"object","additionalProperties":{"type":"string","minLength":1},"maxProperties":100},"terms":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"string","minLength":1},"maxProperties":100},"maxProperties":100},"ledgerBindings":{"type":"object","additionalProperties":{"type":"string","minLength":1},"maxProperties":100,"description":"Ledger alias → existing ledger id. Every GAAP alias needs one. A business starts with its selected functional-currency ledger (USD only when omitted at initialization); binding a GAAP alias to another currency's canonical id (led_ + the zero-padded ISO 4217 numeric code, e.g. led_00000000000000000000000978 for EUR) opens that ledger with this contract, even while it is a draft."},"sourceDocumentIds":{"type":"array","items":{"type":"string","minLength":1},"maxItems":100}},"required":["parties"]},"source_document_id":{"type":"string"},"effective_at":{"type":"string","format":"date-time"},"idempotency_key":{"type":"string"}}}}},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","additionalProperties":false,"required":["disposition","source","missing"],"allOf":[{"if":{"properties":{"disposition":{"const":"ready"}}},"then":{"required":["contract","preview","termsEvidence","command"]}}],"properties":{"disposition":{"enum":["ready","needs_information"]},"source":{"type":"object","additionalProperties":false,"required":["documentId","cid","format","provenance","textCid","location"],"properties":{"documentId":{"type":"string"},"cid":{"type":"string"},"format":{"enum":["markdown","text","document"]},"provenance":{"enum":["caller_supplied_unverified","registered_bytes"]},"textCid":{"type":"string"},"location":{"type":"object","additionalProperties":false,"required":["start","end"],"properties":{"start":{"type":"integer","minimum":0},"end":{"type":"integer","minimum":0}}}}},"missing":{"type":"array","items":{"type":"string"}},"contract":{"type":"object","additionalProperties":false,"required":["id","documentId","cid"],"properties":{"id":{"type":"string"},"documentId":{"type":"string"},"cid":{"type":"string"}}},"preview":{"type":"object","additionalProperties":false,"required":["status","name","activities"],"properties":{"status":{"enum":["draft","offer","active"]},"name":{"type":"string"},"activities":{"type":"array","maxItems":100,"items":{"type":"object","additionalProperties":false,"required":["key","activityDocumentId","terms"],"properties":{"key":{"type":"string"},"activityDocumentId":{"type":"string"},"terms":{"type":"object","maxProperties":100,"additionalProperties":{"type":"string"}}}}}}},"termsEvidence":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["activityKey","term","value","origin","pointer","documentId","cid","textCid"],"properties":{"activityKey":{"type":"string"},"term":{"type":"string"},"value":{"type":"string"},"origin":{"enum":["source","contract"]},"pointer":{"type":["string","null"]},"documentId":{"type":"string"},"cid":{"type":"string"},"textCid":{"type":["string","null"]}}}},"command":{"type":"object","additionalProperties":false,"required":["name","input","source_document_id","effective_at","idempotency_key"],"properties":{"name":{"const":"contracts.amend"},"input":{"type":"object","additionalProperties":false,"required":["contractId","expectedDocumentId","effectiveAt","terms","acceptanceEvidence"],"properties":{"contractId":{"type":"string","minLength":1},"expectedDocumentId":{"type":"string","minLength":1},"effectiveAt":{"type":"string","minLength":1,"format":"date-time"},"terms":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"string","minLength":1}}},"sourceDocumentIds":{"type":"array","items":{"type":"string","minLength":1},"maxItems":100},"acceptanceEvidence":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}}}},"source_document_id":{"type":"string"},"effective_at":{"type":"string","format":"date-time"},"idempotency_key":{"type":"string"}}}}},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","additionalProperties":false,"properties":{"ingestionId":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"status":{"enum":["awaiting_upload","queued","processing","completed","failed"]},"source":{"type":"object","additionalProperties":false,"properties":{"documentId":{"type":"string"},"cid":{"type":"string"},"format":{"enum":["markdown","text","document"]},"provenance":{"enum":["caller_supplied_unverified","registered_bytes"]}},"required":["documentId","cid","format","provenance"]},"expenseTargets":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"properties":{"contractId":{"type":"string","minLength":1,"maxLength":128},"activityKey":{"type":"string","minLength":1,"maxLength":128}},"required":["contractId","activityKey"]}},"mode":{"enum":["propose","auto_record"]},"recordingPolicy":{"type":"object","additionalProperties":false,"properties":{"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"maxAmountMinor":{"type":"string","pattern":"^[1-9][0-9]{0,18}$"},"maxDailyTotalMinor":{"type":"string","pattern":"^[1-9][0-9]{0,18}$","description":"Upper bound, in currency minor units, on the total this business records automatically per UTC day across all auto_record ingestions; a proposal that would exceed it needs review (daily_total_exceeded)."},"minimumConfidencePercent":{"type":"integer","minimum":60,"maximum":100},"fundingAccounts":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["financialAccountId","currency","last4","kind","glAccountCode"],"properties":{"financialAccountId":{"type":"string","minLength":1,"maxLength":128},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"last4":{"type":"string","pattern":"^[0-9]{4}$"},"kind":{"enum":["checking","savings","card","wallet","other"]},"glAccountCode":{"enum":[1110,1310,2190,2135]},"ownerPartyId":{"type":"string","minLength":1},"providerPartyId":{"type":"string","minLength":1}}}},"targets":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"properties":{"contractId":{"type":"string","minLength":1,"maxLength":128},"activityKey":{"type":"string","minLength":1,"maxLength":128},"cid":{"type":"string","minLength":1,"maxLength":128}},"required":["contractId","activityKey","cid"]}}},"required":["currency","maxAmountMinor","maxDailyTotalMinor","minimumConfidencePercent","targets"]},"execution":{"type":"object","additionalProperties":false,"properties":{"status":{"enum":["pending","recorded","already_recorded","needs_review"]},"proposalRevision":{"type":"integer","minimum":1,"maximum":8},"commandId":{"type":"string","description":"Actual ordinary financial command receipt."},"occurrenceId":{"type":"string","description":"An already recorded matching economic fact."},"reason":{"type":"string","description":"Why automatic recording requires review."}},"required":["status","proposalRevision"],"description":"Durable financial recording disposition and actual ordinary command receipt reference."},"proposal":{"type":"object","additionalProperties":false,"description":"Frozen source-backed expense proposal. Proposal generation creates no financial entries.","required":["disposition","source","missing","lines"],"properties":{"disposition":{"enum":["ready","needs_information","duplicate","unsupported"]},"source":{"type":"object","additionalProperties":false,"properties":{"documentId":{"type":"string","minLength":1},"cid":{"type":"string","minLength":1}},"required":["documentId","cid"]},"missing":{"type":"array","maxItems":100,"items":{"type":"string","maxLength":500}},"lines":{"type":"array","maxItems":500,"items":{"type":"object","additionalProperties":false,"properties":{"index":{"type":"integer","minimum":0},"description":{"type":"string","minLength":1},"amountMinor":{"type":"string","pattern":"^[0-9]+$"}},"required":["index","description","amountMinor"]}},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"totalMinor":{"type":"string","pattern":"^[0-9]+$"},"matchedOccurrenceId":{"type":"string","minLength":1,"description":"An existing matching economic fact."},"contract":{"type":"object","additionalProperties":false,"properties":{"contractId":{"type":"string","minLength":1},"documentId":{"type":"string","minLength":1},"cid":{"type":"string","minLength":1}},"required":["contractId","documentId","cid"]},"command":{"oneOf":[{"type":"object","additionalProperties":false,"description":"Complete ordinary public command envelope; present only when ready.","required":["name","input","source_document_id","effective_at","idempotency_key"],"properties":{"name":{"const":"contracts.record"},"source_document_id":{"type":"string","minLength":1},"effective_at":{"type":"string","minLength":1,"format":"date-time"},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"input":{"type":"object","additionalProperties":false,"required":["contractId","activityKey","occurrenceKey","sourceFactId","effectiveAt","facts","evidence"],"properties":{"contractId":{"type":"string","minLength":1},"activityKey":{"type":"string","minLength":1},"occurrenceKey":{"type":"string","minLength":1},"sourceFactId":{"type":"string","minLength":1},"effectiveAt":{"type":"string","minLength":1,"format":"date-time"},"phase":{"const":"billing"},"obligationKey":{"type":"string","minLength":1},"facts":{"type":"object","maxProperties":100,"additionalProperties":{"type":"string"}},"evidence":{"type":"object","additionalProperties":false,"required":["service"],"properties":{"billing":{"type":"array","minItems":1,"maxItems":1,"items":{"type":"object","additionalProperties":false,"properties":{"kind":{"const":"other"},"ref":{"type":"string","minLength":1}},"required":["kind","ref"]}},"service":{"type":"array","minItems":1,"maxItems":1,"items":{"type":"object","additionalProperties":false,"properties":{"kind":{"const":"other"},"ref":{"type":"string","minLength":1}},"required":["kind","ref"]}}}}}}}},{"type":"object","additionalProperties":false,"description":"Complete ordinary public command envelope; present only when ready.","required":["name","input","source_document_id","effective_at","idempotency_key"],"properties":{"name":{"const":"receipts.record"},"source_document_id":{"type":"string","minLength":1},"effective_at":{"type":"string","minLength":1,"format":"date-time"},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"input":{"type":"object","additionalProperties":false,"required":["billing","payment"],"properties":{"processing":{"type":"object","additionalProperties":false,"required":["rail","netAmount","evidence"],"properties":{"rail":{"enum":["ach","ach_same_day","fedwire","rtp","sepa","sepa_instant","swift","onchain","internal","card"]},"netAmount":{"type":"string","pattern":"^(0|-?[1-9][0-9]*)$"},"feeFacts":{"type":"object","maxProperties":20,"additionalProperties":{"type":"string","pattern":"^(0|[1-9][0-9]*)$"}},"evidence":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}}}},"billing":{"type":"object","additionalProperties":false,"required":["contractId","activityKey","occurrenceKey","sourceFactId","effectiveAt","phase"],"anyOf":[{"type":"object","properties":{"obligationKey":{"type":"string","minLength":1}},"required":["obligationKey"]},{"type":"object","properties":{"period":{"type":"object","properties":{"from":{"type":"string","minLength":1},"through":{"type":"string","minLength":1}},"required":["from","through"]}},"required":["period"]}],"properties":{"contractId":{"type":"string","minLength":1},"activityKey":{"type":"string","minLength":1},"occurrenceKey":{"type":"string","minLength":1},"obligationKey":{"type":"string","minLength":1},"sourceFactId":{"type":"string","minLength":1},"effectiveAt":{"type":"string","format":"date-time"},"phase":{"const":"billing"},"dueDate":{"type":"string","format":"date"},"exchangeRate":{"type":"object","additionalProperties":false,"required":["base","quote","date","numerator","denominator","evidence"],"description":"An evidenced exchange rate (1 base = numerator/denominator quote), e.g. from a bank statement. It overrides the shared rate store for this command; omit it to use the store.","properties":{"base":{"type":"string","pattern":"^[A-Z]{3}$"},"quote":{"type":"string","pattern":"^[A-Z]{3}$"},"date":{"type":"string","format":"date"},"numerator":{"type":"string","pattern":"^[1-9][0-9]*$"},"denominator":{"type":"string","pattern":"^[1-9][0-9]*$"},"evidence":{"type":"array","minItems":1,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string"}}}}}},"period":{"type":"object","additionalProperties":false,"required":["from","through"],"properties":{"from":{"type":"string","format":"date-time"},"through":{"type":"string","format":"date-time"}}},"facts":{"type":"object","maxProperties":100,"additionalProperties":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":false,"required":["occurrenceId"],"properties":{"occurrenceId":{"type":"string","minLength":1}}},{"type":"object","additionalProperties":false,"required":["claimId","component"],"properties":{"claimId":{"type":"string","minLength":1},"component":{"type":"object","additionalProperties":false,"required":["originLedgerId","accountCode"],"properties":{"originLedgerId":{"type":"string","minLength":1},"accountCode":{"type":"integer"}}}}}]}},"evidence":{"type":"object","additionalProperties":false,"properties":{"billing":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}},"service":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}},"acceptance":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}},"economic":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}}}}}},"payment":{"type":"object","additionalProperties":false,"required":["financialAccountId","direction","amount","currency","partyId","effectiveAt","sourceFactId","evidence"],"properties":{"financialAccountId":{"type":"string","minLength":1},"direction":{"enum":["in","out"]},"amount":{"type":"string","pattern":"^[1-9][0-9]*$"},"currency":{"type":"string","minLength":1},"partyId":{"type":"string","minLength":1},"effectiveAt":{"type":"string","format":"date-time"},"sourceFactId":{"type":"string","minLength":1},"evidence":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}}}}}}}}]},"interpretation":{"type":"object","additionalProperties":false,"properties":{"cid":{"type":"string","minLength":1},"promptVersion":{"type":"string","minLength":1},"buyer":{"type":"string","minLength":1,"description":"Exact observed buyer; historical proposals without this field remain review cases."},"spans":{"type":"array","maxItems":1000,"items":{"type":"object","additionalProperties":false,"properties":{"start":{"type":"integer","minimum":0},"end":{"type":"integer","minimum":1,"maximum":65536},"text":{"type":"string","minLength":1}},"required":["start","end","text"]}}},"required":["cid","promptVersion","spans"]},"preview":{"description":"Read-only ordinary activity or priced-rights preparation, when validation succeeds."}},"oneOf":[{"properties":{"disposition":{"const":"ready"},"missing":{"maxItems":0},"lines":{"minItems":1}},"required":["command","contract","currency","totalMinor"]},{"properties":{"disposition":{"enum":["needs_information","duplicate","unsupported"]}},"not":{"required":["command"]}}]},"invoiceCorrection":{"type":"object","additionalProperties":false,"properties":{"at":{"type":"string","format":"date-time"},"principal":{"type":"string"},"provenance":{"const":"caller_selected_source_spans"},"choices":{"type":"object","additionalProperties":false,"properties":{"headers":{"type":"object","additionalProperties":false,"properties":{"vendor":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"},"buyer":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"},"externalId":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"},"date":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"},"currency":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"},"total":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"}},"required":["vendor","buyer","externalId","date","currency","total"]},"service":{"enum":["delivered","not_delivered","unclear"]},"rows":{"type":"array","maxItems":64,"items":{"type":"object","additionalProperties":false,"properties":{"role":{"enum":["charge","tax","summary","other","unclear"]},"amount":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"}},"required":["role","amount"]}}},"required":["headers","service","rows"]}},"required":["at","principal","provenance","choices"]},"proposalRevision":{"type":"integer","minimum":2,"maximum":8},"proposalHistory":{"type":"array","maxItems":7,"items":{"type":"object","additionalProperties":false,"properties":{"revision":{"type":"integer","minimum":1,"maximum":7},"at":{"type":"string","format":"date-time"},"principal":{"type":"string"},"expenseTargets":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"properties":{"contractId":{"type":"string","minLength":1,"maxLength":128},"activityKey":{"type":"string","minLength":1,"maxLength":128}},"required":["contractId","activityKey"]}},"proposal":{"type":"object","additionalProperties":false,"description":"Frozen source-backed expense proposal. Proposal generation creates no financial entries.","required":["disposition","source","missing","lines"],"properties":{"disposition":{"enum":["ready","needs_information","duplicate","unsupported"]},"source":{"type":"object","additionalProperties":false,"properties":{"documentId":{"type":"string","minLength":1},"cid":{"type":"string","minLength":1}},"required":["documentId","cid"]},"missing":{"type":"array","maxItems":100,"items":{"type":"string","maxLength":500}},"lines":{"type":"array","maxItems":500,"items":{"type":"object","additionalProperties":false,"properties":{"index":{"type":"integer","minimum":0},"description":{"type":"string","minLength":1},"amountMinor":{"type":"string","pattern":"^[0-9]+$"}},"required":["index","description","amountMinor"]}},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"totalMinor":{"type":"string","pattern":"^[0-9]+$"},"matchedOccurrenceId":{"type":"string","minLength":1,"description":"An existing matching economic fact."},"contract":{"type":"object","additionalProperties":false,"properties":{"contractId":{"type":"string","minLength":1},"documentId":{"type":"string","minLength":1},"cid":{"type":"string","minLength":1}},"required":["contractId","documentId","cid"]},"command":{"oneOf":[{"type":"object","additionalProperties":false,"description":"Complete ordinary public command envelope; present only when ready.","required":["name","input","source_document_id","effective_at","idempotency_key"],"properties":{"name":{"const":"contracts.record"},"source_document_id":{"type":"string","minLength":1},"effective_at":{"type":"string","minLength":1,"format":"date-time"},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"input":{"type":"object","additionalProperties":false,"required":["contractId","activityKey","occurrenceKey","sourceFactId","effectiveAt","facts","evidence"],"properties":{"contractId":{"type":"string","minLength":1},"activityKey":{"type":"string","minLength":1},"occurrenceKey":{"type":"string","minLength":1},"sourceFactId":{"type":"string","minLength":1},"effectiveAt":{"type":"string","minLength":1,"format":"date-time"},"phase":{"const":"billing"},"obligationKey":{"type":"string","minLength":1},"facts":{"type":"object","maxProperties":100,"additionalProperties":{"type":"string"}},"evidence":{"type":"object","additionalProperties":false,"required":["service"],"properties":{"billing":{"type":"array","minItems":1,"maxItems":1,"items":{"type":"object","additionalProperties":false,"properties":{"kind":{"const":"other"},"ref":{"type":"string","minLength":1}},"required":["kind","ref"]}},"service":{"type":"array","minItems":1,"maxItems":1,"items":{"type":"object","additionalProperties":false,"properties":{"kind":{"const":"other"},"ref":{"type":"string","minLength":1}},"required":["kind","ref"]}}}}}}}},{"type":"object","additionalProperties":false,"description":"Complete ordinary public command envelope; present only when ready.","required":["name","input","source_document_id","effective_at","idempotency_key"],"properties":{"name":{"const":"receipts.record"},"source_document_id":{"type":"string","minLength":1},"effective_at":{"type":"string","minLength":1,"format":"date-time"},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"input":{"type":"object","additionalProperties":false,"required":["billing","payment"],"properties":{"processing":{"type":"object","additionalProperties":false,"required":["rail","netAmount","evidence"],"properties":{"rail":{"enum":["ach","ach_same_day","fedwire","rtp","sepa","sepa_instant","swift","onchain","internal","card"]},"netAmount":{"type":"string","pattern":"^(0|-?[1-9][0-9]*)$"},"feeFacts":{"type":"object","maxProperties":20,"additionalProperties":{"type":"string","pattern":"^(0|[1-9][0-9]*)$"}},"evidence":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}}}},"billing":{"type":"object","additionalProperties":false,"required":["contractId","activityKey","occurrenceKey","sourceFactId","effectiveAt","phase"],"anyOf":[{"type":"object","properties":{"obligationKey":{"type":"string","minLength":1}},"required":["obligationKey"]},{"type":"object","properties":{"period":{"type":"object","properties":{"from":{"type":"string","minLength":1},"through":{"type":"string","minLength":1}},"required":["from","through"]}},"required":["period"]}],"properties":{"contractId":{"type":"string","minLength":1},"activityKey":{"type":"string","minLength":1},"occurrenceKey":{"type":"string","minLength":1},"obligationKey":{"type":"string","minLength":1},"sourceFactId":{"type":"string","minLength":1},"effectiveAt":{"type":"string","format":"date-time"},"phase":{"const":"billing"},"dueDate":{"type":"string","format":"date"},"exchangeRate":{"type":"object","additionalProperties":false,"required":["base","quote","date","numerator","denominator","evidence"],"description":"An evidenced exchange rate (1 base = numerator/denominator quote), e.g. from a bank statement. It overrides the shared rate store for this command; omit it to use the store.","properties":{"base":{"type":"string","pattern":"^[A-Z]{3}$"},"quote":{"type":"string","pattern":"^[A-Z]{3}$"},"date":{"type":"string","format":"date"},"numerator":{"type":"string","pattern":"^[1-9][0-9]*$"},"denominator":{"type":"string","pattern":"^[1-9][0-9]*$"},"evidence":{"type":"array","minItems":1,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string"}}}}}},"period":{"type":"object","additionalProperties":false,"required":["from","through"],"properties":{"from":{"type":"string","format":"date-time"},"through":{"type":"string","format":"date-time"}}},"facts":{"type":"object","maxProperties":100,"additionalProperties":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":false,"required":["occurrenceId"],"properties":{"occurrenceId":{"type":"string","minLength":1}}},{"type":"object","additionalProperties":false,"required":["claimId","component"],"properties":{"claimId":{"type":"string","minLength":1},"component":{"type":"object","additionalProperties":false,"required":["originLedgerId","accountCode"],"properties":{"originLedgerId":{"type":"string","minLength":1},"accountCode":{"type":"integer"}}}}}]}},"evidence":{"type":"object","additionalProperties":false,"properties":{"billing":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}},"service":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}},"acceptance":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}},"economic":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}}}}}},"payment":{"type":"object","additionalProperties":false,"required":["financialAccountId","direction","amount","currency","partyId","effectiveAt","sourceFactId","evidence"],"properties":{"financialAccountId":{"type":"string","minLength":1},"direction":{"enum":["in","out"]},"amount":{"type":"string","pattern":"^[1-9][0-9]*$"},"currency":{"type":"string","minLength":1},"partyId":{"type":"string","minLength":1},"effectiveAt":{"type":"string","format":"date-time"},"sourceFactId":{"type":"string","minLength":1},"evidence":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}}}}}}}}]},"interpretation":{"type":"object","additionalProperties":false,"properties":{"cid":{"type":"string","minLength":1},"promptVersion":{"type":"string","minLength":1},"buyer":{"type":"string","minLength":1,"description":"Exact observed buyer; historical proposals without this field remain review cases."},"spans":{"type":"array","maxItems":1000,"items":{"type":"object","additionalProperties":false,"properties":{"start":{"type":"integer","minimum":0},"end":{"type":"integer","minimum":1,"maximum":65536},"text":{"type":"string","minLength":1}},"required":["start","end","text"]}}},"required":["cid","promptVersion","spans"]},"preview":{"description":"Read-only ordinary activity or priced-rights preparation, when validation succeeds."}},"oneOf":[{"properties":{"disposition":{"const":"ready"},"missing":{"maxItems":0},"lines":{"minItems":1}},"required":["command","contract","currency","totalMinor"]},{"properties":{"disposition":{"enum":["needs_information","duplicate","unsupported"]}},"not":{"required":["command"]}}]},"invoiceCorrection":{"type":"object","additionalProperties":false,"properties":{"at":{"type":"string","format":"date-time"},"principal":{"type":"string"},"provenance":{"const":"caller_selected_source_spans"},"choices":{"type":"object","additionalProperties":false,"properties":{"headers":{"type":"object","additionalProperties":false,"properties":{"vendor":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"},"buyer":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"},"externalId":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"},"date":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"},"currency":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"},"total":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"}},"required":["vendor","buyer","externalId","date","currency","total"]},"service":{"enum":["delivered","not_delivered","unclear"]},"rows":{"type":"array","maxItems":64,"items":{"type":"object","additionalProperties":false,"properties":{"role":{"enum":["charge","tax","summary","other","unclear"]},"amount":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"}},"required":["role","amount"]}}},"required":["headers","service","rows"]}},"required":["at","principal","provenance","choices"]}},"required":["revision","at","principal"]}},"original":{"type":"object","additionalProperties":false,"properties":{"documentId":{"type":"string"},"cid":{"type":"string"},"format":{"enum":["markdown","text","document"]},"provenance":{"enum":["caller_supplied_unverified","registered_bytes"]}},"required":["documentId","cid","format","provenance"]},"failure":{"type":"object","additionalProperties":false,"properties":{"reason":{"type":"string"},"retryable":{"type":"boolean"}},"required":["reason","retryable"]},"lastFailure":{"type":"object","additionalProperties":false,"properties":{"reason":{"type":"string"},"retryable":{"type":"boolean"},"attempt":{"type":"integer","minimum":1,"maximum":12},"at":{"type":"string","format":"date-time"}},"required":["reason","retryable","attempt","at"]},"relationship":{"type":"object","additionalProperties":false,"properties":{"type":{"enum":["transcription","summary","related_original"]},"declaredBy":{"type":"string"},"verification":{"const":"unverified"}},"required":["type","declaredBy","verification"]},"uploads":{"type":"object","additionalProperties":false,"properties":{"primary":{"type":"object","additionalProperties":false,"properties":{"filename":{"type":"string","minLength":1,"maxLength":200},"contentType":{"enum":["application/pdf","text/plain","text/markdown","text/csv","application/json","image/png","image/jpeg","image/webp"]},"size":{"type":"integer","minimum":1,"maximum":10485760,"description":"Exact byte length. Images are limited to 256 KiB; other files to 10 MiB."},"expiresAt":{"type":"string","format":"date-time"},"status":{"enum":["awaiting_upload","uploaded","expired"]},"documentId":{"type":"string"},"cid":{"type":"string"},"url":{"type":"string","description":"Short-lived upload credential. Send exact bytes to this URL with the returned method and contentType; no OAuth header is required. Present only in the response of the command that issued it (ingestions.start, ingestions.attach_original, ingestions.reissue_upload); replays and reads omit it, so call ingestions.reissue_upload for a fresh one."},"method":{"const":"PUT","description":"Present when this response issued the upload URL."}},"required":["filename","contentType","size","expiresAt","status"]},"original":{"type":"object","additionalProperties":false,"properties":{"filename":{"type":"string","minLength":1,"maxLength":200},"contentType":{"enum":["application/pdf","text/plain","text/markdown","text/csv","application/json","image/png","image/jpeg","image/webp"]},"size":{"type":"integer","minimum":1,"maximum":10485760,"description":"Exact byte length. Images are limited to 256 KiB; other files to 10 MiB."},"expiresAt":{"type":"string","format":"date-time"},"status":{"enum":["awaiting_upload","uploaded","expired"]},"documentId":{"type":"string"},"cid":{"type":"string"},"url":{"type":"string","description":"Short-lived upload credential. Send exact bytes to this URL with the returned method and contentType; no OAuth header is required. Present only in the response of the command that issued it (ingestions.start, ingestions.attach_original, ingestions.reissue_upload); replays and reads omit it, so call ingestions.reissue_upload for a fresh one."},"method":{"const":"PUT","description":"Present when this response issued the upload URL."}},"required":["filename","contentType","size","expiresAt","status"]}}},"revisions":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"revision":{"type":"integer","minimum":1},"startedAt":{"type":"string","format":"date-time"},"business":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string"},"legalName":{"type":["string","null"]}},"required":["name","legalName"]},"completedAt":{"type":"string","format":"date-time"},"status":{"enum":["processing","completed","failed"]},"sources":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"documentId":{"type":"string"},"cid":{"type":"string"},"format":{"enum":["markdown","text","document"]},"provenance":{"enum":["caller_supplied_unverified","registered_bytes"]},"role":{"enum":["primary","original"]}},"required":["documentId","cid","format","provenance","role"]}},"failure":{"type":"object","additionalProperties":false,"properties":{"reason":{"type":"string"},"retryable":{"type":"boolean"}},"required":["reason","retryable"]},"invoiceSelection":{"type":"object","additionalProperties":false,"description":"Observed source-span choices, bound to the committed UTF-8 extraction. Choice probability is not financial accuracy or authorization.","properties":{"textCid":{"type":"string"},"promptVersion":{"enum":["invoice-spans-v1","receipt-spans-v1"]},"headers":{"type":"object","additionalProperties":false,"properties":{"vendor":{"type":"object","additionalProperties":false,"properties":{"choice":{"type":"string","maxLength":32},"probability":{"type":"string","pattern":"^(?:0(?:\\.[0-9]{1,15})?|1(?:\\.0{1,15})?)$"}},"required":["choice","probability"]},"buyer":{"type":"object","additionalProperties":false,"properties":{"choice":{"type":"string","maxLength":32},"probability":{"type":"string","pattern":"^(?:0(?:\\.[0-9]{1,15})?|1(?:\\.0{1,15})?)$"}},"required":["choice","probability"]},"externalId":{"type":"object","additionalProperties":false,"properties":{"choice":{"type":"string","maxLength":32},"probability":{"type":"string","pattern":"^(?:0(?:\\.[0-9]{1,15})?|1(?:\\.0{1,15})?)$"}},"required":["choice","probability"]},"date":{"type":"object","additionalProperties":false,"properties":{"choice":{"type":"string","maxLength":32},"probability":{"type":"string","pattern":"^(?:0(?:\\.[0-9]{1,15})?|1(?:\\.0{1,15})?)$"}},"required":["choice","probability"]},"currency":{"type":"object","additionalProperties":false,"properties":{"choice":{"type":"string","maxLength":32},"probability":{"type":"string","pattern":"^(?:0(?:\\.[0-9]{1,15})?|1(?:\\.0{1,15})?)$"}},"required":["choice","probability"]},"total":{"type":"object","additionalProperties":false,"properties":{"choice":{"type":"string","maxLength":32},"probability":{"type":"string","pattern":"^(?:0(?:\\.[0-9]{1,15})?|1(?:\\.0{1,15})?)$"}},"required":["choice","probability"]}},"required":["vendor","buyer","externalId","date","currency","total"]},"provider":{"type":"object","additionalProperties":false,"properties":{"name":{"enum":["@cf/cloudflare/clef-flash","@cf/cloudflare/clef"]},"version":{"const":"unreported"},"inputTokens":{"type":"integer","minimum":0},"outputTokens":{"type":"integer","minimum":0},"requestBytes":{"type":"integer","minimum":0},"latencyMs":{"type":"integer","minimum":0}},"required":["name","version","inputTokens","outputTokens","requestBytes","latencyMs"]},"service":{"type":"object","additionalProperties":false,"properties":{"choice":{"type":"string","maxLength":32},"probability":{"type":"string","pattern":"^(?:0(?:\\.[0-9]{1,15})?|1(?:\\.0{1,15})?)$"}},"required":["choice","probability"]},"payment":{"type":"object","additionalProperties":false,"properties":{"status":{"type":"object","additionalProperties":false,"properties":{"choice":{"type":"string","maxLength":32},"probability":{"type":"string","pattern":"^(?:0(?:\\.[0-9]{1,15})?|1(?:\\.0{1,15})?)$"}},"required":["choice","probability"]},"externalId":{"type":"object","additionalProperties":false,"properties":{"choice":{"type":"string","maxLength":32},"probability":{"type":"string","pattern":"^(?:0(?:\\.[0-9]{1,15})?|1(?:\\.0{1,15})?)$"}},"required":["choice","probability"]},"last4":{"type":"object","additionalProperties":false,"properties":{"choice":{"type":"string","maxLength":32},"probability":{"type":"string","pattern":"^(?:0(?:\\.[0-9]{1,15})?|1(?:\\.0{1,15})?)$"}},"required":["choice","probability"]}},"required":["status","externalId","last4"]},"rows":{"type":"array","maxItems":64,"items":{"type":"object","additionalProperties":false,"properties":{"role":{"type":"object","additionalProperties":false,"properties":{"choice":{"type":"string","maxLength":32},"probability":{"type":"string","pattern":"^(?:0(?:\\.[0-9]{1,15})?|1(?:\\.0{1,15})?)$"}},"required":["choice","probability"]},"amount":{"type":"object","additionalProperties":false,"properties":{"choice":{"type":"string","maxLength":32},"probability":{"type":"string","pattern":"^(?:0(?:\\.[0-9]{1,15})?|1(?:\\.0{1,15})?)$"}},"required":["choice","probability"]}},"required":["role","amount"]}}},"required":["textCid","promptVersion","headers","service","rows"]},"extraction":{"type":"object","additionalProperties":false,"properties":{"status":{"enum":["not_required","extracted","incomplete"]},"method":{"enum":["provided_text","native_pdf","image_ocr","pdf_ocr"]},"text":{"type":"string","maxLength":65536,"description":"Returned only after source-document authorization; raw history contains annex references."},"textBytes":{"type":"integer","minimum":1,"maximum":65536},"source":{"type":"object","additionalProperties":false,"properties":{"documentId":{"type":"string"},"cid":{"type":"string"},"format":{"enum":["markdown","text","document"]},"provenance":{"enum":["caller_supplied_unverified","registered_bytes"]}},"required":["documentId","cid","format","provenance"]},"derived":{"type":"object","additionalProperties":false,"properties":{"cid":{"type":"string"}},"required":["cid"]},"pageCount":{"type":["integer","null"],"minimum":1,"maximum":50},"locations":{"type":"array","maxItems":50,"items":{"type":"object","additionalProperties":false,"properties":{"page":{"type":["integer","null"],"minimum":1},"start":{"type":"integer","minimum":0},"end":{"type":"integer","minimum":0}},"required":["page","start","end"]}},"provider":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string"},"version":{"type":"string"}},"required":["name","version"]},"usage":{"type":"object","additionalProperties":false,"properties":{"inputTokens":{"type":"integer","minimum":0},"outputTokens":{"type":"integer","minimum":0},"latencyMs":{"type":"integer","minimum":0},"conversionTokens":{"type":"integer","minimum":0,"description":"Estimated native conversion tokens, distinct from inference usage."}},"required":["inputTokens","outputTokens","latencyMs"]}},"required":["status","method","textBytes","source","derived","pageCount","locations","provider","usage"]},"classification":{"type":"object","additionalProperties":false,"properties":{"documentType":{"enum":["invoice","receipt","agreement","statement_or_remittance","credit_or_correction","reminder","mixed","other","uncertain"]},"probabilities":{"type":"object","additionalProperties":false,"properties":{"invoice":{"type":"string","description":"Decimal probability between 0 and 1."},"receipt":{"type":"string","description":"Decimal probability between 0 and 1."},"agreement":{"type":"string","description":"Decimal probability between 0 and 1."},"statement_or_remittance":{"type":"string","description":"Decimal probability between 0 and 1."},"credit_or_correction":{"type":"string","description":"Decimal probability between 0 and 1."},"reminder":{"type":"string","description":"Decimal probability between 0 and 1."},"mixed":{"type":"string","description":"Decimal probability between 0 and 1."},"other":{"type":"string","description":"Decimal probability between 0 and 1."},"uncertain":{"type":"string","description":"Decimal probability between 0 and 1."}},"required":["invoice","receipt","agreement","statement_or_remittance","credit_or_correction","reminder","mixed","other","uncertain"]},"model":{"type":"string"},"modelVersion":{"type":"string"},"promptVersion":{"type":"string"},"confidence":{"type":"string","description":"Distribution confidence, not calibrated accuracy or permission to act."},"invoiceRole":{"type":"object","additionalProperties":false,"properties":{"role":{"enum":["buyer","seller","neither","unclear"]},"probabilities":{"type":"object","additionalProperties":false,"properties":{"buyer":{"type":"string"},"seller":{"type":"string"},"neither":{"type":"string"},"unclear":{"type":"string"}},"required":["buyer","seller","neither","unclear"]},"confidence":{"type":"string"},"promptVersion":{"type":"string"}},"required":["role","probabilities","confidence","promptVersion"]},"usage":{"type":"object","additionalProperties":false,"properties":{"inputTokens":{"type":"integer","minimum":0},"outputTokens":{"type":"integer","minimum":0},"requestBytes":{"type":"integer","minimum":1},"latencyMs":{"type":"integer","minimum":0}},"required":["inputTokens","outputTokens","requestBytes","latencyMs"]}},"required":["documentType","probabilities","model","modelVersion","promptVersion"]}},"required":["revision","startedAt","business","status","sources"]}}},"required":["ingestionId","createdAt","status","uploads","revisions"],"x-relative-urls":["/uploads/primary/url","/uploads/original/url"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","additionalProperties":false,"required":["disposition","source","missing"],"allOf":[{"if":{"properties":{"disposition":{"const":"ready"}}},"then":{"required":["original","lines","totalMinor","currency","preview","command"]}}],"properties":{"disposition":{"enum":["ready","needs_information"]},"source":{"type":"object","additionalProperties":false,"required":["documentId","cid","format","provenance","textCid","location"],"properties":{"documentId":{"type":"string"},"cid":{"type":"string"},"format":{"enum":["markdown","text","document"]},"provenance":{"enum":["caller_supplied_unverified","registered_bytes"]},"textCid":{"type":"string"},"location":{"type":"object","additionalProperties":false,"required":["start","end"],"properties":{"start":{"type":"integer","minimum":0},"end":{"type":"integer","minimum":0}}}}},"missing":{"type":"array","items":{"type":"string"}},"original":{"type":"object","additionalProperties":false,"required":["occurrenceId","documentId","cid","sourceFactId","contractId","activityKey","contractDocumentId","source"],"properties":{"occurrenceId":{"type":"string"},"documentId":{"type":"string"},"cid":{"type":"string"},"sourceFactId":{"type":"string"},"contractId":{"type":"string"},"activityKey":{"type":"string"},"contractDocumentId":{"type":"string"},"source":{"type":"object","additionalProperties":false,"properties":{"documentId":{"type":"string","minLength":1},"cid":{"type":"string","minLength":1}},"required":["documentId","cid"]}}},"lines":{"type":"array","maxItems":500,"items":{"type":"object","additionalProperties":false,"properties":{"index":{"type":"integer","minimum":0},"description":{"type":"string","minLength":1},"amountMinor":{"type":"string","pattern":"^[0-9]+$"}},"required":["index","description","amountMinor"]}},"totalMinor":{"type":"string"},"currency":{"type":"string"},"preview":{"type":"object","additionalProperties":false,"required":["occurrenceIds","repeated","postings"],"properties":{"occurrenceIds":{"type":"array","maxItems":1,"items":{"type":"string"}},"repeated":{"const":false},"postings":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["ledgerId","accountCode","direction","amount"],"properties":{"ledgerId":{"type":"string"},"accountCode":{"type":"integer"},"direction":{"enum":["debit","credit"]},"amount":{"type":"string","pattern":"^[0-9]+$"}}}}}},"command":{"type":"object","additionalProperties":false,"required":["name","input","source_document_id","effective_at","idempotency_key"],"properties":{"name":{"const":"contracts.reverse_economics"},"input":{"type":"object","additionalProperties":false,"required":["contractId","activityKey","occurrenceId","effectiveAt","sourceFactId","evidence"],"properties":{"contractId":{"type":"string","minLength":1},"activityKey":{"type":"string","minLength":1},"occurrenceId":{"type":"string","minLength":1},"sourceFactId":{"type":"string","minLength":1},"effectiveAt":{"type":"string","format":"date-time"},"evidence":{"type":"array","minItems":1,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}},"refundSettled":{"const":true}}},"source_document_id":{"type":"string"},"effective_at":{"type":"string","format":"date-time"},"idempotency_key":{"type":"string"}}}}},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","additionalProperties":false,"properties":{"proposalRevision":{"type":"integer","minimum":1,"maximum":8},"textCid":{"type":"string"},"candidates":{"type":"object","additionalProperties":false,"properties":{"headers":{"type":"object","additionalProperties":false,"properties":{"vendor":{"type":"array","maxItems":254,"items":{"type":"object","properties":{"start":{"type":"integer","minimum":0,"maximum":65536},"end":{"type":"integer","minimum":0,"maximum":65536},"text":{"type":"string","maxLength":65536}},"required":["start","end","text"]}},"buyer":{"type":"array","maxItems":254,"items":{"type":"object","properties":{"start":{"type":"integer","minimum":0,"maximum":65536},"end":{"type":"integer","minimum":0,"maximum":65536},"text":{"type":"string","maxLength":65536}},"required":["start","end","text"]}},"externalId":{"type":"array","maxItems":254,"items":{"type":"object","properties":{"start":{"type":"integer","minimum":0,"maximum":65536},"end":{"type":"integer","minimum":0,"maximum":65536},"text":{"type":"string","maxLength":65536}},"required":["start","end","text"]}},"date":{"type":"array","maxItems":254,"items":{"type":"object","properties":{"start":{"type":"integer","minimum":0,"maximum":65536},"end":{"type":"integer","minimum":0,"maximum":65536},"text":{"type":"string","maxLength":65536}},"required":["start","end","text"]}},"currency":{"type":"array","maxItems":254,"items":{"type":"object","properties":{"start":{"type":"integer","minimum":0,"maximum":65536},"end":{"type":"integer","minimum":0,"maximum":65536},"text":{"type":"string","maxLength":65536}},"required":["start","end","text"]}},"total":{"type":"array","maxItems":254,"items":{"type":"object","properties":{"start":{"type":"integer","minimum":0,"maximum":65536},"end":{"type":"integer","minimum":0,"maximum":65536},"text":{"type":"string","maxLength":65536}},"required":["start","end","text"]}}},"required":["vendor","buyer","externalId","date","currency","total"]},"rows":{"type":"array","maxItems":64,"items":{"type":"object","properties":{"start":{"type":"integer","minimum":0,"maximum":65536},"end":{"type":"integer","minimum":0,"maximum":65536},"text":{"type":"string","maxLength":65536},"amounts":{"type":"array","maxItems":254,"items":{"type":"object","properties":{"start":{"type":"integer","minimum":0,"maximum":65536},"end":{"type":"integer","minimum":0,"maximum":65536},"text":{"type":"string","maxLength":65536}},"required":["start","end","text"]}}},"required":["start","end","text","amounts"]}}},"required":["headers","rows"]}},"required":["proposalRevision","textCid","candidates"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","required":["disposition","source","missing"],"properties":{"disposition":{"enum":["ready","needs_information"]},"missing":{"type":"array","items":{"type":"string"}},"source":{"type":"object","required":["documentId","cid","textCid","provenance"],"properties":{"documentId":{"type":"string"},"cid":{"type":"string"},"textCid":{"type":"string"},"provenance":{"enum":["registered_bytes","caller_supplied_unverified"]}}},"billing":{"type":"object"},"preview":{"type":"object"},"command":{"type":"object","required":["name","source_document_id","effective_at","idempotency_key","input"],"properties":{"name":{"const":"receipts.record"},"source_document_id":{"type":"string"},"effective_at":{"type":"string","format":"date-time"},"idempotency_key":{"type":"string"},"input":{"type":"object","additionalProperties":false,"required":["billing","payment"],"properties":{"processing":{"type":"object","additionalProperties":false,"required":["rail","netAmount","evidence"],"properties":{"rail":{"enum":["ach","ach_same_day","fedwire","rtp","sepa","sepa_instant","swift","onchain","internal","card"]},"netAmount":{"type":"string","pattern":"^(0|-?[1-9][0-9]*)$"},"feeFacts":{"type":"object","maxProperties":20,"additionalProperties":{"type":"string","pattern":"^(0|[1-9][0-9]*)$"}},"evidence":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}}}},"billing":{"type":"object","additionalProperties":false,"required":["contractId","activityKey","occurrenceKey","sourceFactId","effectiveAt","phase"],"anyOf":[{"type":"object","properties":{"obligationKey":{"type":"string","minLength":1}},"required":["obligationKey"]},{"type":"object","properties":{"period":{"type":"object","properties":{"from":{"type":"string","minLength":1},"through":{"type":"string","minLength":1}},"required":["from","through"]}},"required":["period"]}],"properties":{"contractId":{"type":"string","minLength":1},"activityKey":{"type":"string","minLength":1},"occurrenceKey":{"type":"string","minLength":1},"obligationKey":{"type":"string","minLength":1},"sourceFactId":{"type":"string","minLength":1},"effectiveAt":{"type":"string","format":"date-time"},"phase":{"const":"billing"},"dueDate":{"type":"string","format":"date"},"exchangeRate":{"type":"object","additionalProperties":false,"required":["base","quote","date","numerator","denominator","evidence"],"description":"An evidenced exchange rate (1 base = numerator/denominator quote), e.g. from a bank statement. It overrides the shared rate store for this command; omit it to use the store.","properties":{"base":{"type":"string","pattern":"^[A-Z]{3}$"},"quote":{"type":"string","pattern":"^[A-Z]{3}$"},"date":{"type":"string","format":"date"},"numerator":{"type":"string","pattern":"^[1-9][0-9]*$"},"denominator":{"type":"string","pattern":"^[1-9][0-9]*$"},"evidence":{"type":"array","minItems":1,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string"}}}}}},"period":{"type":"object","additionalProperties":false,"required":["from","through"],"properties":{"from":{"type":"string","format":"date-time"},"through":{"type":"string","format":"date-time"}}},"facts":{"type":"object","maxProperties":100,"additionalProperties":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":false,"required":["occurrenceId"],"properties":{"occurrenceId":{"type":"string","minLength":1}}},{"type":"object","additionalProperties":false,"required":["claimId","component"],"properties":{"claimId":{"type":"string","minLength":1},"component":{"type":"object","additionalProperties":false,"required":["originLedgerId","accountCode"],"properties":{"originLedgerId":{"type":"string","minLength":1},"accountCode":{"type":"integer"}}}}}]}},"evidence":{"type":"object","additionalProperties":false,"properties":{"billing":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}},"service":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}},"acceptance":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}},"economic":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}}}}}},"payment":{"type":"object","additionalProperties":false,"required":["financialAccountId","direction","amount","currency","partyId","effectiveAt","sourceFactId","evidence"],"properties":{"financialAccountId":{"type":"string","minLength":1},"direction":{"enum":["in","out"]},"amount":{"type":"string","pattern":"^[1-9][0-9]*$"},"currency":{"type":"string","minLength":1},"partyId":{"type":"string","minLength":1},"effectiveAt":{"type":"string","format":"date-time"},"sourceFactId":{"type":"string","minLength":1},"evidence":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}}}}}}}}}},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","additionalProperties":false,"properties":{"ingestionId":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"status":{"enum":["awaiting_upload","queued","processing","completed","failed"]},"source":{"type":"object","additionalProperties":false,"properties":{"documentId":{"type":"string"},"cid":{"type":"string"},"format":{"enum":["markdown","text","document"]},"provenance":{"enum":["caller_supplied_unverified","registered_bytes"]}},"required":["documentId","cid","format","provenance"]},"expenseTargets":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"properties":{"contractId":{"type":"string","minLength":1,"maxLength":128},"activityKey":{"type":"string","minLength":1,"maxLength":128}},"required":["contractId","activityKey"]}},"mode":{"enum":["propose","auto_record"]},"recordingPolicy":{"type":"object","additionalProperties":false,"properties":{"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"maxAmountMinor":{"type":"string","pattern":"^[1-9][0-9]{0,18}$"},"maxDailyTotalMinor":{"type":"string","pattern":"^[1-9][0-9]{0,18}$","description":"Upper bound, in currency minor units, on the total this business records automatically per UTC day across all auto_record ingestions; a proposal that would exceed it needs review (daily_total_exceeded)."},"minimumConfidencePercent":{"type":"integer","minimum":60,"maximum":100},"fundingAccounts":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["financialAccountId","currency","last4","kind","glAccountCode"],"properties":{"financialAccountId":{"type":"string","minLength":1,"maxLength":128},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"last4":{"type":"string","pattern":"^[0-9]{4}$"},"kind":{"enum":["checking","savings","card","wallet","other"]},"glAccountCode":{"enum":[1110,1310,2190,2135]},"ownerPartyId":{"type":"string","minLength":1},"providerPartyId":{"type":"string","minLength":1}}}},"targets":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"properties":{"contractId":{"type":"string","minLength":1,"maxLength":128},"activityKey":{"type":"string","minLength":1,"maxLength":128},"cid":{"type":"string","minLength":1,"maxLength":128}},"required":["contractId","activityKey","cid"]}}},"required":["currency","maxAmountMinor","maxDailyTotalMinor","minimumConfidencePercent","targets"]},"execution":{"type":"object","additionalProperties":false,"properties":{"status":{"enum":["pending","recorded","already_recorded","needs_review"]},"proposalRevision":{"type":"integer","minimum":1,"maximum":8},"commandId":{"type":"string","description":"Actual ordinary financial command receipt."},"occurrenceId":{"type":"string","description":"An already recorded matching economic fact."},"reason":{"type":"string","description":"Why automatic recording requires review."}},"required":["status","proposalRevision"],"description":"Durable financial recording disposition and actual ordinary command receipt reference."},"proposal":{"type":"object","additionalProperties":false,"description":"Frozen source-backed expense proposal. Proposal generation creates no financial entries.","required":["disposition","source","missing","lines"],"properties":{"disposition":{"enum":["ready","needs_information","duplicate","unsupported"]},"source":{"type":"object","additionalProperties":false,"properties":{"documentId":{"type":"string","minLength":1},"cid":{"type":"string","minLength":1}},"required":["documentId","cid"]},"missing":{"type":"array","maxItems":100,"items":{"type":"string","maxLength":500}},"lines":{"type":"array","maxItems":500,"items":{"type":"object","additionalProperties":false,"properties":{"index":{"type":"integer","minimum":0},"description":{"type":"string","minLength":1},"amountMinor":{"type":"string","pattern":"^[0-9]+$"}},"required":["index","description","amountMinor"]}},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"totalMinor":{"type":"string","pattern":"^[0-9]+$"},"matchedOccurrenceId":{"type":"string","minLength":1,"description":"An existing matching economic fact."},"contract":{"type":"object","additionalProperties":false,"properties":{"contractId":{"type":"string","minLength":1},"documentId":{"type":"string","minLength":1},"cid":{"type":"string","minLength":1}},"required":["contractId","documentId","cid"]},"command":{"oneOf":[{"type":"object","additionalProperties":false,"description":"Complete ordinary public command envelope; present only when ready.","required":["name","input","source_document_id","effective_at","idempotency_key"],"properties":{"name":{"const":"contracts.record"},"source_document_id":{"type":"string","minLength":1},"effective_at":{"type":"string","minLength":1,"format":"date-time"},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"input":{"type":"object","additionalProperties":false,"required":["contractId","activityKey","occurrenceKey","sourceFactId","effectiveAt","facts","evidence"],"properties":{"contractId":{"type":"string","minLength":1},"activityKey":{"type":"string","minLength":1},"occurrenceKey":{"type":"string","minLength":1},"sourceFactId":{"type":"string","minLength":1},"effectiveAt":{"type":"string","minLength":1,"format":"date-time"},"phase":{"const":"billing"},"obligationKey":{"type":"string","minLength":1},"facts":{"type":"object","maxProperties":100,"additionalProperties":{"type":"string"}},"evidence":{"type":"object","additionalProperties":false,"required":["service"],"properties":{"billing":{"type":"array","minItems":1,"maxItems":1,"items":{"type":"object","additionalProperties":false,"properties":{"kind":{"const":"other"},"ref":{"type":"string","minLength":1}},"required":["kind","ref"]}},"service":{"type":"array","minItems":1,"maxItems":1,"items":{"type":"object","additionalProperties":false,"properties":{"kind":{"const":"other"},"ref":{"type":"string","minLength":1}},"required":["kind","ref"]}}}}}}}},{"type":"object","additionalProperties":false,"description":"Complete ordinary public command envelope; present only when ready.","required":["name","input","source_document_id","effective_at","idempotency_key"],"properties":{"name":{"const":"receipts.record"},"source_document_id":{"type":"string","minLength":1},"effective_at":{"type":"string","minLength":1,"format":"date-time"},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"input":{"type":"object","additionalProperties":false,"required":["billing","payment"],"properties":{"processing":{"type":"object","additionalProperties":false,"required":["rail","netAmount","evidence"],"properties":{"rail":{"enum":["ach","ach_same_day","fedwire","rtp","sepa","sepa_instant","swift","onchain","internal","card"]},"netAmount":{"type":"string","pattern":"^(0|-?[1-9][0-9]*)$"},"feeFacts":{"type":"object","maxProperties":20,"additionalProperties":{"type":"string","pattern":"^(0|[1-9][0-9]*)$"}},"evidence":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}}}},"billing":{"type":"object","additionalProperties":false,"required":["contractId","activityKey","occurrenceKey","sourceFactId","effectiveAt","phase"],"anyOf":[{"type":"object","properties":{"obligationKey":{"type":"string","minLength":1}},"required":["obligationKey"]},{"type":"object","properties":{"period":{"type":"object","properties":{"from":{"type":"string","minLength":1},"through":{"type":"string","minLength":1}},"required":["from","through"]}},"required":["period"]}],"properties":{"contractId":{"type":"string","minLength":1},"activityKey":{"type":"string","minLength":1},"occurrenceKey":{"type":"string","minLength":1},"obligationKey":{"type":"string","minLength":1},"sourceFactId":{"type":"string","minLength":1},"effectiveAt":{"type":"string","format":"date-time"},"phase":{"const":"billing"},"dueDate":{"type":"string","format":"date"},"exchangeRate":{"type":"object","additionalProperties":false,"required":["base","quote","date","numerator","denominator","evidence"],"description":"An evidenced exchange rate (1 base = numerator/denominator quote), e.g. from a bank statement. It overrides the shared rate store for this command; omit it to use the store.","properties":{"base":{"type":"string","pattern":"^[A-Z]{3}$"},"quote":{"type":"string","pattern":"^[A-Z]{3}$"},"date":{"type":"string","format":"date"},"numerator":{"type":"string","pattern":"^[1-9][0-9]*$"},"denominator":{"type":"string","pattern":"^[1-9][0-9]*$"},"evidence":{"type":"array","minItems":1,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string"}}}}}},"period":{"type":"object","additionalProperties":false,"required":["from","through"],"properties":{"from":{"type":"string","format":"date-time"},"through":{"type":"string","format":"date-time"}}},"facts":{"type":"object","maxProperties":100,"additionalProperties":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":false,"required":["occurrenceId"],"properties":{"occurrenceId":{"type":"string","minLength":1}}},{"type":"object","additionalProperties":false,"required":["claimId","component"],"properties":{"claimId":{"type":"string","minLength":1},"component":{"type":"object","additionalProperties":false,"required":["originLedgerId","accountCode"],"properties":{"originLedgerId":{"type":"string","minLength":1},"accountCode":{"type":"integer"}}}}}]}},"evidence":{"type":"object","additionalProperties":false,"properties":{"billing":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}},"service":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}},"acceptance":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}},"economic":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}}}}}},"payment":{"type":"object","additionalProperties":false,"required":["financialAccountId","direction","amount","currency","partyId","effectiveAt","sourceFactId","evidence"],"properties":{"financialAccountId":{"type":"string","minLength":1},"direction":{"enum":["in","out"]},"amount":{"type":"string","pattern":"^[1-9][0-9]*$"},"currency":{"type":"string","minLength":1},"partyId":{"type":"string","minLength":1},"effectiveAt":{"type":"string","format":"date-time"},"sourceFactId":{"type":"string","minLength":1},"evidence":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}}}}}}}}]},"interpretation":{"type":"object","additionalProperties":false,"properties":{"cid":{"type":"string","minLength":1},"promptVersion":{"type":"string","minLength":1},"buyer":{"type":"string","minLength":1,"description":"Exact observed buyer; historical proposals without this field remain review cases."},"spans":{"type":"array","maxItems":1000,"items":{"type":"object","additionalProperties":false,"properties":{"start":{"type":"integer","minimum":0},"end":{"type":"integer","minimum":1,"maximum":65536},"text":{"type":"string","minLength":1}},"required":["start","end","text"]}}},"required":["cid","promptVersion","spans"]},"preview":{"description":"Read-only ordinary activity or priced-rights preparation, when validation succeeds."}},"oneOf":[{"properties":{"disposition":{"const":"ready"},"missing":{"maxItems":0},"lines":{"minItems":1}},"required":["command","contract","currency","totalMinor"]},{"properties":{"disposition":{"enum":["needs_information","duplicate","unsupported"]}},"not":{"required":["command"]}}]},"invoiceCorrection":{"type":"object","additionalProperties":false,"properties":{"at":{"type":"string","format":"date-time"},"principal":{"type":"string"},"provenance":{"const":"caller_selected_source_spans"},"choices":{"type":"object","additionalProperties":false,"properties":{"headers":{"type":"object","additionalProperties":false,"properties":{"vendor":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"},"buyer":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"},"externalId":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"},"date":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"},"currency":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"},"total":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"}},"required":["vendor","buyer","externalId","date","currency","total"]},"service":{"enum":["delivered","not_delivered","unclear"]},"rows":{"type":"array","maxItems":64,"items":{"type":"object","additionalProperties":false,"properties":{"role":{"enum":["charge","tax","summary","other","unclear"]},"amount":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"}},"required":["role","amount"]}}},"required":["headers","service","rows"]}},"required":["at","principal","provenance","choices"]},"proposalRevision":{"type":"integer","minimum":2,"maximum":8},"proposalHistory":{"type":"array","maxItems":7,"items":{"type":"object","additionalProperties":false,"properties":{"revision":{"type":"integer","minimum":1,"maximum":7},"at":{"type":"string","format":"date-time"},"principal":{"type":"string"},"expenseTargets":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"properties":{"contractId":{"type":"string","minLength":1,"maxLength":128},"activityKey":{"type":"string","minLength":1,"maxLength":128}},"required":["contractId","activityKey"]}},"proposal":{"type":"object","additionalProperties":false,"description":"Frozen source-backed expense proposal. Proposal generation creates no financial entries.","required":["disposition","source","missing","lines"],"properties":{"disposition":{"enum":["ready","needs_information","duplicate","unsupported"]},"source":{"type":"object","additionalProperties":false,"properties":{"documentId":{"type":"string","minLength":1},"cid":{"type":"string","minLength":1}},"required":["documentId","cid"]},"missing":{"type":"array","maxItems":100,"items":{"type":"string","maxLength":500}},"lines":{"type":"array","maxItems":500,"items":{"type":"object","additionalProperties":false,"properties":{"index":{"type":"integer","minimum":0},"description":{"type":"string","minLength":1},"amountMinor":{"type":"string","pattern":"^[0-9]+$"}},"required":["index","description","amountMinor"]}},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"totalMinor":{"type":"string","pattern":"^[0-9]+$"},"matchedOccurrenceId":{"type":"string","minLength":1,"description":"An existing matching economic fact."},"contract":{"type":"object","additionalProperties":false,"properties":{"contractId":{"type":"string","minLength":1},"documentId":{"type":"string","minLength":1},"cid":{"type":"string","minLength":1}},"required":["contractId","documentId","cid"]},"command":{"oneOf":[{"type":"object","additionalProperties":false,"description":"Complete ordinary public command envelope; present only when ready.","required":["name","input","source_document_id","effective_at","idempotency_key"],"properties":{"name":{"const":"contracts.record"},"source_document_id":{"type":"string","minLength":1},"effective_at":{"type":"string","minLength":1,"format":"date-time"},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"input":{"type":"object","additionalProperties":false,"required":["contractId","activityKey","occurrenceKey","sourceFactId","effectiveAt","facts","evidence"],"properties":{"contractId":{"type":"string","minLength":1},"activityKey":{"type":"string","minLength":1},"occurrenceKey":{"type":"string","minLength":1},"sourceFactId":{"type":"string","minLength":1},"effectiveAt":{"type":"string","minLength":1,"format":"date-time"},"phase":{"const":"billing"},"obligationKey":{"type":"string","minLength":1},"facts":{"type":"object","maxProperties":100,"additionalProperties":{"type":"string"}},"evidence":{"type":"object","additionalProperties":false,"required":["service"],"properties":{"billing":{"type":"array","minItems":1,"maxItems":1,"items":{"type":"object","additionalProperties":false,"properties":{"kind":{"const":"other"},"ref":{"type":"string","minLength":1}},"required":["kind","ref"]}},"service":{"type":"array","minItems":1,"maxItems":1,"items":{"type":"object","additionalProperties":false,"properties":{"kind":{"const":"other"},"ref":{"type":"string","minLength":1}},"required":["kind","ref"]}}}}}}}},{"type":"object","additionalProperties":false,"description":"Complete ordinary public command envelope; present only when ready.","required":["name","input","source_document_id","effective_at","idempotency_key"],"properties":{"name":{"const":"receipts.record"},"source_document_id":{"type":"string","minLength":1},"effective_at":{"type":"string","minLength":1,"format":"date-time"},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"input":{"type":"object","additionalProperties":false,"required":["billing","payment"],"properties":{"processing":{"type":"object","additionalProperties":false,"required":["rail","netAmount","evidence"],"properties":{"rail":{"enum":["ach","ach_same_day","fedwire","rtp","sepa","sepa_instant","swift","onchain","internal","card"]},"netAmount":{"type":"string","pattern":"^(0|-?[1-9][0-9]*)$"},"feeFacts":{"type":"object","maxProperties":20,"additionalProperties":{"type":"string","pattern":"^(0|[1-9][0-9]*)$"}},"evidence":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}}}},"billing":{"type":"object","additionalProperties":false,"required":["contractId","activityKey","occurrenceKey","sourceFactId","effectiveAt","phase"],"anyOf":[{"type":"object","properties":{"obligationKey":{"type":"string","minLength":1}},"required":["obligationKey"]},{"type":"object","properties":{"period":{"type":"object","properties":{"from":{"type":"string","minLength":1},"through":{"type":"string","minLength":1}},"required":["from","through"]}},"required":["period"]}],"properties":{"contractId":{"type":"string","minLength":1},"activityKey":{"type":"string","minLength":1},"occurrenceKey":{"type":"string","minLength":1},"obligationKey":{"type":"string","minLength":1},"sourceFactId":{"type":"string","minLength":1},"effectiveAt":{"type":"string","format":"date-time"},"phase":{"const":"billing"},"dueDate":{"type":"string","format":"date"},"exchangeRate":{"type":"object","additionalProperties":false,"required":["base","quote","date","numerator","denominator","evidence"],"description":"An evidenced exchange rate (1 base = numerator/denominator quote), e.g. from a bank statement. It overrides the shared rate store for this command; omit it to use the store.","properties":{"base":{"type":"string","pattern":"^[A-Z]{3}$"},"quote":{"type":"string","pattern":"^[A-Z]{3}$"},"date":{"type":"string","format":"date"},"numerator":{"type":"string","pattern":"^[1-9][0-9]*$"},"denominator":{"type":"string","pattern":"^[1-9][0-9]*$"},"evidence":{"type":"array","minItems":1,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string"}}}}}},"period":{"type":"object","additionalProperties":false,"required":["from","through"],"properties":{"from":{"type":"string","format":"date-time"},"through":{"type":"string","format":"date-time"}}},"facts":{"type":"object","maxProperties":100,"additionalProperties":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":false,"required":["occurrenceId"],"properties":{"occurrenceId":{"type":"string","minLength":1}}},{"type":"object","additionalProperties":false,"required":["claimId","component"],"properties":{"claimId":{"type":"string","minLength":1},"component":{"type":"object","additionalProperties":false,"required":["originLedgerId","accountCode"],"properties":{"originLedgerId":{"type":"string","minLength":1},"accountCode":{"type":"integer"}}}}}]}},"evidence":{"type":"object","additionalProperties":false,"properties":{"billing":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}},"service":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}},"acceptance":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}},"economic":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}}}}}},"payment":{"type":"object","additionalProperties":false,"required":["financialAccountId","direction","amount","currency","partyId","effectiveAt","sourceFactId","evidence"],"properties":{"financialAccountId":{"type":"string","minLength":1},"direction":{"enum":["in","out"]},"amount":{"type":"string","pattern":"^[1-9][0-9]*$"},"currency":{"type":"string","minLength":1},"partyId":{"type":"string","minLength":1},"effectiveAt":{"type":"string","format":"date-time"},"sourceFactId":{"type":"string","minLength":1},"evidence":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}}}}}}}}]},"interpretation":{"type":"object","additionalProperties":false,"properties":{"cid":{"type":"string","minLength":1},"promptVersion":{"type":"string","minLength":1},"buyer":{"type":"string","minLength":1,"description":"Exact observed buyer; historical proposals without this field remain review cases."},"spans":{"type":"array","maxItems":1000,"items":{"type":"object","additionalProperties":false,"properties":{"start":{"type":"integer","minimum":0},"end":{"type":"integer","minimum":1,"maximum":65536},"text":{"type":"string","minLength":1}},"required":["start","end","text"]}}},"required":["cid","promptVersion","spans"]},"preview":{"description":"Read-only ordinary activity or priced-rights preparation, when validation succeeds."}},"oneOf":[{"properties":{"disposition":{"const":"ready"},"missing":{"maxItems":0},"lines":{"minItems":1}},"required":["command","contract","currency","totalMinor"]},{"properties":{"disposition":{"enum":["needs_information","duplicate","unsupported"]}},"not":{"required":["command"]}}]},"invoiceCorrection":{"type":"object","additionalProperties":false,"properties":{"at":{"type":"string","format":"date-time"},"principal":{"type":"string"},"provenance":{"const":"caller_selected_source_spans"},"choices":{"type":"object","additionalProperties":false,"properties":{"headers":{"type":"object","additionalProperties":false,"properties":{"vendor":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"},"buyer":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"},"externalId":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"},"date":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"},"currency":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"},"total":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"}},"required":["vendor","buyer","externalId","date","currency","total"]},"service":{"enum":["delivered","not_delivered","unclear"]},"rows":{"type":"array","maxItems":64,"items":{"type":"object","additionalProperties":false,"properties":{"role":{"enum":["charge","tax","summary","other","unclear"]},"amount":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"}},"required":["role","amount"]}}},"required":["headers","service","rows"]}},"required":["at","principal","provenance","choices"]}},"required":["revision","at","principal"]}},"original":{"type":"object","additionalProperties":false,"properties":{"documentId":{"type":"string"},"cid":{"type":"string"},"format":{"enum":["markdown","text","document"]},"provenance":{"enum":["caller_supplied_unverified","registered_bytes"]}},"required":["documentId","cid","format","provenance"]},"failure":{"type":"object","additionalProperties":false,"properties":{"reason":{"type":"string"},"retryable":{"type":"boolean"}},"required":["reason","retryable"]},"lastFailure":{"type":"object","additionalProperties":false,"properties":{"reason":{"type":"string"},"retryable":{"type":"boolean"},"attempt":{"type":"integer","minimum":1,"maximum":12},"at":{"type":"string","format":"date-time"}},"required":["reason","retryable","attempt","at"]},"relationship":{"type":"object","additionalProperties":false,"properties":{"type":{"enum":["transcription","summary","related_original"]},"declaredBy":{"type":"string"},"verification":{"const":"unverified"}},"required":["type","declaredBy","verification"]},"uploads":{"type":"object","additionalProperties":false,"properties":{"primary":{"type":"object","additionalProperties":false,"properties":{"filename":{"type":"string","minLength":1,"maxLength":200},"contentType":{"enum":["application/pdf","text/plain","text/markdown","text/csv","application/json","image/png","image/jpeg","image/webp"]},"size":{"type":"integer","minimum":1,"maximum":10485760,"description":"Exact byte length. Images are limited to 256 KiB; other files to 10 MiB."},"expiresAt":{"type":"string","format":"date-time"},"status":{"enum":["awaiting_upload","uploaded","expired"]},"documentId":{"type":"string"},"cid":{"type":"string"},"url":{"type":"string","description":"Short-lived upload credential. Send exact bytes to this URL with the returned method and contentType; no OAuth header is required. Present only in the response of the command that issued it (ingestions.start, ingestions.attach_original, ingestions.reissue_upload); replays and reads omit it, so call ingestions.reissue_upload for a fresh one."},"method":{"const":"PUT","description":"Present when this response issued the upload URL."}},"required":["filename","contentType","size","expiresAt","status"]},"original":{"type":"object","additionalProperties":false,"properties":{"filename":{"type":"string","minLength":1,"maxLength":200},"contentType":{"enum":["application/pdf","text/plain","text/markdown","text/csv","application/json","image/png","image/jpeg","image/webp"]},"size":{"type":"integer","minimum":1,"maximum":10485760,"description":"Exact byte length. Images are limited to 256 KiB; other files to 10 MiB."},"expiresAt":{"type":"string","format":"date-time"},"status":{"enum":["awaiting_upload","uploaded","expired"]},"documentId":{"type":"string"},"cid":{"type":"string"},"url":{"type":"string","description":"Short-lived upload credential. Send exact bytes to this URL with the returned method and contentType; no OAuth header is required. Present only in the response of the command that issued it (ingestions.start, ingestions.attach_original, ingestions.reissue_upload); replays and reads omit it, so call ingestions.reissue_upload for a fresh one."},"method":{"const":"PUT","description":"Present when this response issued the upload URL."}},"required":["filename","contentType","size","expiresAt","status"]}}},"revisions":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"revision":{"type":"integer","minimum":1},"startedAt":{"type":"string","format":"date-time"},"business":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string"},"legalName":{"type":["string","null"]}},"required":["name","legalName"]},"completedAt":{"type":"string","format":"date-time"},"status":{"enum":["processing","completed","failed"]},"sources":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"documentId":{"type":"string"},"cid":{"type":"string"},"format":{"enum":["markdown","text","document"]},"provenance":{"enum":["caller_supplied_unverified","registered_bytes"]},"role":{"enum":["primary","original"]}},"required":["documentId","cid","format","provenance","role"]}},"failure":{"type":"object","additionalProperties":false,"properties":{"reason":{"type":"string"},"retryable":{"type":"boolean"}},"required":["reason","retryable"]},"invoiceSelection":{"type":"object","additionalProperties":false,"description":"Observed source-span choices, bound to the committed UTF-8 extraction. Choice probability is not financial accuracy or authorization.","properties":{"textCid":{"type":"string"},"promptVersion":{"enum":["invoice-spans-v1","receipt-spans-v1"]},"headers":{"type":"object","additionalProperties":false,"properties":{"vendor":{"type":"object","additionalProperties":false,"properties":{"choice":{"type":"string","maxLength":32},"probability":{"type":"string","pattern":"^(?:0(?:\\.[0-9]{1,15})?|1(?:\\.0{1,15})?)$"}},"required":["choice","probability"]},"buyer":{"type":"object","additionalProperties":false,"properties":{"choice":{"type":"string","maxLength":32},"probability":{"type":"string","pattern":"^(?:0(?:\\.[0-9]{1,15})?|1(?:\\.0{1,15})?)$"}},"required":["choice","probability"]},"externalId":{"type":"object","additionalProperties":false,"properties":{"choice":{"type":"string","maxLength":32},"probability":{"type":"string","pattern":"^(?:0(?:\\.[0-9]{1,15})?|1(?:\\.0{1,15})?)$"}},"required":["choice","probability"]},"date":{"type":"object","additionalProperties":false,"properties":{"choice":{"type":"string","maxLength":32},"probability":{"type":"string","pattern":"^(?:0(?:\\.[0-9]{1,15})?|1(?:\\.0{1,15})?)$"}},"required":["choice","probability"]},"currency":{"type":"object","additionalProperties":false,"properties":{"choice":{"type":"string","maxLength":32},"probability":{"type":"string","pattern":"^(?:0(?:\\.[0-9]{1,15})?|1(?:\\.0{1,15})?)$"}},"required":["choice","probability"]},"total":{"type":"object","additionalProperties":false,"properties":{"choice":{"type":"string","maxLength":32},"probability":{"type":"string","pattern":"^(?:0(?:\\.[0-9]{1,15})?|1(?:\\.0{1,15})?)$"}},"required":["choice","probability"]}},"required":["vendor","buyer","externalId","date","currency","total"]},"provider":{"type":"object","additionalProperties":false,"properties":{"name":{"enum":["@cf/cloudflare/clef-flash","@cf/cloudflare/clef"]},"version":{"const":"unreported"},"inputTokens":{"type":"integer","minimum":0},"outputTokens":{"type":"integer","minimum":0},"requestBytes":{"type":"integer","minimum":0},"latencyMs":{"type":"integer","minimum":0}},"required":["name","version","inputTokens","outputTokens","requestBytes","latencyMs"]},"service":{"type":"object","additionalProperties":false,"properties":{"choice":{"type":"string","maxLength":32},"probability":{"type":"string","pattern":"^(?:0(?:\\.[0-9]{1,15})?|1(?:\\.0{1,15})?)$"}},"required":["choice","probability"]},"payment":{"type":"object","additionalProperties":false,"properties":{"status":{"type":"object","additionalProperties":false,"properties":{"choice":{"type":"string","maxLength":32},"probability":{"type":"string","pattern":"^(?:0(?:\\.[0-9]{1,15})?|1(?:\\.0{1,15})?)$"}},"required":["choice","probability"]},"externalId":{"type":"object","additionalProperties":false,"properties":{"choice":{"type":"string","maxLength":32},"probability":{"type":"string","pattern":"^(?:0(?:\\.[0-9]{1,15})?|1(?:\\.0{1,15})?)$"}},"required":["choice","probability"]},"last4":{"type":"object","additionalProperties":false,"properties":{"choice":{"type":"string","maxLength":32},"probability":{"type":"string","pattern":"^(?:0(?:\\.[0-9]{1,15})?|1(?:\\.0{1,15})?)$"}},"required":["choice","probability"]}},"required":["status","externalId","last4"]},"rows":{"type":"array","maxItems":64,"items":{"type":"object","additionalProperties":false,"properties":{"role":{"type":"object","additionalProperties":false,"properties":{"choice":{"type":"string","maxLength":32},"probability":{"type":"string","pattern":"^(?:0(?:\\.[0-9]{1,15})?|1(?:\\.0{1,15})?)$"}},"required":["choice","probability"]},"amount":{"type":"object","additionalProperties":false,"properties":{"choice":{"type":"string","maxLength":32},"probability":{"type":"string","pattern":"^(?:0(?:\\.[0-9]{1,15})?|1(?:\\.0{1,15})?)$"}},"required":["choice","probability"]}},"required":["role","amount"]}}},"required":["textCid","promptVersion","headers","service","rows"]},"extraction":{"type":"object","additionalProperties":false,"properties":{"status":{"enum":["not_required","extracted","incomplete"]},"method":{"enum":["provided_text","native_pdf","image_ocr","pdf_ocr"]},"text":{"type":"string","maxLength":65536,"description":"Returned only after source-document authorization; raw history contains annex references."},"textBytes":{"type":"integer","minimum":1,"maximum":65536},"source":{"type":"object","additionalProperties":false,"properties":{"documentId":{"type":"string"},"cid":{"type":"string"},"format":{"enum":["markdown","text","document"]},"provenance":{"enum":["caller_supplied_unverified","registered_bytes"]}},"required":["documentId","cid","format","provenance"]},"derived":{"type":"object","additionalProperties":false,"properties":{"cid":{"type":"string"}},"required":["cid"]},"pageCount":{"type":["integer","null"],"minimum":1,"maximum":50},"locations":{"type":"array","maxItems":50,"items":{"type":"object","additionalProperties":false,"properties":{"page":{"type":["integer","null"],"minimum":1},"start":{"type":"integer","minimum":0},"end":{"type":"integer","minimum":0}},"required":["page","start","end"]}},"provider":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string"},"version":{"type":"string"}},"required":["name","version"]},"usage":{"type":"object","additionalProperties":false,"properties":{"inputTokens":{"type":"integer","minimum":0},"outputTokens":{"type":"integer","minimum":0},"latencyMs":{"type":"integer","minimum":0},"conversionTokens":{"type":"integer","minimum":0,"description":"Estimated native conversion tokens, distinct from inference usage."}},"required":["inputTokens","outputTokens","latencyMs"]}},"required":["status","method","textBytes","source","derived","pageCount","locations","provider","usage"]},"classification":{"type":"object","additionalProperties":false,"properties":{"documentType":{"enum":["invoice","receipt","agreement","statement_or_remittance","credit_or_correction","reminder","mixed","other","uncertain"]},"probabilities":{"type":"object","additionalProperties":false,"properties":{"invoice":{"type":"string","description":"Decimal probability between 0 and 1."},"receipt":{"type":"string","description":"Decimal probability between 0 and 1."},"agreement":{"type":"string","description":"Decimal probability between 0 and 1."},"statement_or_remittance":{"type":"string","description":"Decimal probability between 0 and 1."},"credit_or_correction":{"type":"string","description":"Decimal probability between 0 and 1."},"reminder":{"type":"string","description":"Decimal probability between 0 and 1."},"mixed":{"type":"string","description":"Decimal probability between 0 and 1."},"other":{"type":"string","description":"Decimal probability between 0 and 1."},"uncertain":{"type":"string","description":"Decimal probability between 0 and 1."}},"required":["invoice","receipt","agreement","statement_or_remittance","credit_or_correction","reminder","mixed","other","uncertain"]},"model":{"type":"string"},"modelVersion":{"type":"string"},"promptVersion":{"type":"string"},"confidence":{"type":"string","description":"Distribution confidence, not calibrated accuracy or permission to act."},"invoiceRole":{"type":"object","additionalProperties":false,"properties":{"role":{"enum":["buyer","seller","neither","unclear"]},"probabilities":{"type":"object","additionalProperties":false,"properties":{"buyer":{"type":"string"},"seller":{"type":"string"},"neither":{"type":"string"},"unclear":{"type":"string"}},"required":["buyer","seller","neither","unclear"]},"confidence":{"type":"string"},"promptVersion":{"type":"string"}},"required":["role","probabilities","confidence","promptVersion"]},"usage":{"type":"object","additionalProperties":false,"properties":{"inputTokens":{"type":"integer","minimum":0},"outputTokens":{"type":"integer","minimum":0},"requestBytes":{"type":"integer","minimum":1},"latencyMs":{"type":"integer","minimum":0}},"required":["inputTokens","outputTokens","requestBytes","latencyMs"]}},"required":["documentType","probabilities","model","modelVersion","promptVersion"]}},"required":["revision","startedAt","business","status","sources"]}}},"required":["ingestionId","createdAt","status","uploads","revisions"],"x-relative-urls":["/uploads/primary/url","/uploads/original/url"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","additionalProperties":false,"properties":{"ingestionId":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"status":{"enum":["awaiting_upload","queued","processing","completed","failed"]},"source":{"type":"object","additionalProperties":false,"properties":{"documentId":{"type":"string"},"cid":{"type":"string"},"format":{"enum":["markdown","text","document"]},"provenance":{"enum":["caller_supplied_unverified","registered_bytes"]}},"required":["documentId","cid","format","provenance"]},"expenseTargets":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"properties":{"contractId":{"type":"string","minLength":1,"maxLength":128},"activityKey":{"type":"string","minLength":1,"maxLength":128}},"required":["contractId","activityKey"]}},"mode":{"enum":["propose","auto_record"]},"recordingPolicy":{"type":"object","additionalProperties":false,"properties":{"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"maxAmountMinor":{"type":"string","pattern":"^[1-9][0-9]{0,18}$"},"maxDailyTotalMinor":{"type":"string","pattern":"^[1-9][0-9]{0,18}$","description":"Upper bound, in currency minor units, on the total this business records automatically per UTC day across all auto_record ingestions; a proposal that would exceed it needs review (daily_total_exceeded)."},"minimumConfidencePercent":{"type":"integer","minimum":60,"maximum":100},"fundingAccounts":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["financialAccountId","currency","last4","kind","glAccountCode"],"properties":{"financialAccountId":{"type":"string","minLength":1,"maxLength":128},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"last4":{"type":"string","pattern":"^[0-9]{4}$"},"kind":{"enum":["checking","savings","card","wallet","other"]},"glAccountCode":{"enum":[1110,1310,2190,2135]},"ownerPartyId":{"type":"string","minLength":1},"providerPartyId":{"type":"string","minLength":1}}}},"targets":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"properties":{"contractId":{"type":"string","minLength":1,"maxLength":128},"activityKey":{"type":"string","minLength":1,"maxLength":128},"cid":{"type":"string","minLength":1,"maxLength":128}},"required":["contractId","activityKey","cid"]}}},"required":["currency","maxAmountMinor","maxDailyTotalMinor","minimumConfidencePercent","targets"]},"execution":{"type":"object","additionalProperties":false,"properties":{"status":{"enum":["pending","recorded","already_recorded","needs_review"]},"proposalRevision":{"type":"integer","minimum":1,"maximum":8},"commandId":{"type":"string","description":"Actual ordinary financial command receipt."},"occurrenceId":{"type":"string","description":"An already recorded matching economic fact."},"reason":{"type":"string","description":"Why automatic recording requires review."}},"required":["status","proposalRevision"],"description":"Durable financial recording disposition and actual ordinary command receipt reference."},"proposal":{"type":"object","additionalProperties":false,"description":"Frozen source-backed expense proposal. Proposal generation creates no financial entries.","required":["disposition","source","missing","lines"],"properties":{"disposition":{"enum":["ready","needs_information","duplicate","unsupported"]},"source":{"type":"object","additionalProperties":false,"properties":{"documentId":{"type":"string","minLength":1},"cid":{"type":"string","minLength":1}},"required":["documentId","cid"]},"missing":{"type":"array","maxItems":100,"items":{"type":"string","maxLength":500}},"lines":{"type":"array","maxItems":500,"items":{"type":"object","additionalProperties":false,"properties":{"index":{"type":"integer","minimum":0},"description":{"type":"string","minLength":1},"amountMinor":{"type":"string","pattern":"^[0-9]+$"}},"required":["index","description","amountMinor"]}},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"totalMinor":{"type":"string","pattern":"^[0-9]+$"},"matchedOccurrenceId":{"type":"string","minLength":1,"description":"An existing matching economic fact."},"contract":{"type":"object","additionalProperties":false,"properties":{"contractId":{"type":"string","minLength":1},"documentId":{"type":"string","minLength":1},"cid":{"type":"string","minLength":1}},"required":["contractId","documentId","cid"]},"command":{"oneOf":[{"type":"object","additionalProperties":false,"description":"Complete ordinary public command envelope; present only when ready.","required":["name","input","source_document_id","effective_at","idempotency_key"],"properties":{"name":{"const":"contracts.record"},"source_document_id":{"type":"string","minLength":1},"effective_at":{"type":"string","minLength":1,"format":"date-time"},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"input":{"type":"object","additionalProperties":false,"required":["contractId","activityKey","occurrenceKey","sourceFactId","effectiveAt","facts","evidence"],"properties":{"contractId":{"type":"string","minLength":1},"activityKey":{"type":"string","minLength":1},"occurrenceKey":{"type":"string","minLength":1},"sourceFactId":{"type":"string","minLength":1},"effectiveAt":{"type":"string","minLength":1,"format":"date-time"},"phase":{"const":"billing"},"obligationKey":{"type":"string","minLength":1},"facts":{"type":"object","maxProperties":100,"additionalProperties":{"type":"string"}},"evidence":{"type":"object","additionalProperties":false,"required":["service"],"properties":{"billing":{"type":"array","minItems":1,"maxItems":1,"items":{"type":"object","additionalProperties":false,"properties":{"kind":{"const":"other"},"ref":{"type":"string","minLength":1}},"required":["kind","ref"]}},"service":{"type":"array","minItems":1,"maxItems":1,"items":{"type":"object","additionalProperties":false,"properties":{"kind":{"const":"other"},"ref":{"type":"string","minLength":1}},"required":["kind","ref"]}}}}}}}},{"type":"object","additionalProperties":false,"description":"Complete ordinary public command envelope; present only when ready.","required":["name","input","source_document_id","effective_at","idempotency_key"],"properties":{"name":{"const":"receipts.record"},"source_document_id":{"type":"string","minLength":1},"effective_at":{"type":"string","minLength":1,"format":"date-time"},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"input":{"type":"object","additionalProperties":false,"required":["billing","payment"],"properties":{"processing":{"type":"object","additionalProperties":false,"required":["rail","netAmount","evidence"],"properties":{"rail":{"enum":["ach","ach_same_day","fedwire","rtp","sepa","sepa_instant","swift","onchain","internal","card"]},"netAmount":{"type":"string","pattern":"^(0|-?[1-9][0-9]*)$"},"feeFacts":{"type":"object","maxProperties":20,"additionalProperties":{"type":"string","pattern":"^(0|[1-9][0-9]*)$"}},"evidence":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}}}},"billing":{"type":"object","additionalProperties":false,"required":["contractId","activityKey","occurrenceKey","sourceFactId","effectiveAt","phase"],"anyOf":[{"type":"object","properties":{"obligationKey":{"type":"string","minLength":1}},"required":["obligationKey"]},{"type":"object","properties":{"period":{"type":"object","properties":{"from":{"type":"string","minLength":1},"through":{"type":"string","minLength":1}},"required":["from","through"]}},"required":["period"]}],"properties":{"contractId":{"type":"string","minLength":1},"activityKey":{"type":"string","minLength":1},"occurrenceKey":{"type":"string","minLength":1},"obligationKey":{"type":"string","minLength":1},"sourceFactId":{"type":"string","minLength":1},"effectiveAt":{"type":"string","format":"date-time"},"phase":{"const":"billing"},"dueDate":{"type":"string","format":"date"},"exchangeRate":{"type":"object","additionalProperties":false,"required":["base","quote","date","numerator","denominator","evidence"],"description":"An evidenced exchange rate (1 base = numerator/denominator quote), e.g. from a bank statement. It overrides the shared rate store for this command; omit it to use the store.","properties":{"base":{"type":"string","pattern":"^[A-Z]{3}$"},"quote":{"type":"string","pattern":"^[A-Z]{3}$"},"date":{"type":"string","format":"date"},"numerator":{"type":"string","pattern":"^[1-9][0-9]*$"},"denominator":{"type":"string","pattern":"^[1-9][0-9]*$"},"evidence":{"type":"array","minItems":1,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string"}}}}}},"period":{"type":"object","additionalProperties":false,"required":["from","through"],"properties":{"from":{"type":"string","format":"date-time"},"through":{"type":"string","format":"date-time"}}},"facts":{"type":"object","maxProperties":100,"additionalProperties":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":false,"required":["occurrenceId"],"properties":{"occurrenceId":{"type":"string","minLength":1}}},{"type":"object","additionalProperties":false,"required":["claimId","component"],"properties":{"claimId":{"type":"string","minLength":1},"component":{"type":"object","additionalProperties":false,"required":["originLedgerId","accountCode"],"properties":{"originLedgerId":{"type":"string","minLength":1},"accountCode":{"type":"integer"}}}}}]}},"evidence":{"type":"object","additionalProperties":false,"properties":{"billing":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}},"service":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}},"acceptance":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}},"economic":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}}}}}},"payment":{"type":"object","additionalProperties":false,"required":["financialAccountId","direction","amount","currency","partyId","effectiveAt","sourceFactId","evidence"],"properties":{"financialAccountId":{"type":"string","minLength":1},"direction":{"enum":["in","out"]},"amount":{"type":"string","pattern":"^[1-9][0-9]*$"},"currency":{"type":"string","minLength":1},"partyId":{"type":"string","minLength":1},"effectiveAt":{"type":"string","format":"date-time"},"sourceFactId":{"type":"string","minLength":1},"evidence":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}}}}}}}}]},"interpretation":{"type":"object","additionalProperties":false,"properties":{"cid":{"type":"string","minLength":1},"promptVersion":{"type":"string","minLength":1},"buyer":{"type":"string","minLength":1,"description":"Exact observed buyer; historical proposals without this field remain review cases."},"spans":{"type":"array","maxItems":1000,"items":{"type":"object","additionalProperties":false,"properties":{"start":{"type":"integer","minimum":0},"end":{"type":"integer","minimum":1,"maximum":65536},"text":{"type":"string","minLength":1}},"required":["start","end","text"]}}},"required":["cid","promptVersion","spans"]},"preview":{"description":"Read-only ordinary activity or priced-rights preparation, when validation succeeds."}},"oneOf":[{"properties":{"disposition":{"const":"ready"},"missing":{"maxItems":0},"lines":{"minItems":1}},"required":["command","contract","currency","totalMinor"]},{"properties":{"disposition":{"enum":["needs_information","duplicate","unsupported"]}},"not":{"required":["command"]}}]},"invoiceCorrection":{"type":"object","additionalProperties":false,"properties":{"at":{"type":"string","format":"date-time"},"principal":{"type":"string"},"provenance":{"const":"caller_selected_source_spans"},"choices":{"type":"object","additionalProperties":false,"properties":{"headers":{"type":"object","additionalProperties":false,"properties":{"vendor":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"},"buyer":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"},"externalId":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"},"date":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"},"currency":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"},"total":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"}},"required":["vendor","buyer","externalId","date","currency","total"]},"service":{"enum":["delivered","not_delivered","unclear"]},"rows":{"type":"array","maxItems":64,"items":{"type":"object","additionalProperties":false,"properties":{"role":{"enum":["charge","tax","summary","other","unclear"]},"amount":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"}},"required":["role","amount"]}}},"required":["headers","service","rows"]}},"required":["at","principal","provenance","choices"]},"proposalRevision":{"type":"integer","minimum":2,"maximum":8},"proposalHistory":{"type":"array","maxItems":7,"items":{"type":"object","additionalProperties":false,"properties":{"revision":{"type":"integer","minimum":1,"maximum":7},"at":{"type":"string","format":"date-time"},"principal":{"type":"string"},"expenseTargets":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"properties":{"contractId":{"type":"string","minLength":1,"maxLength":128},"activityKey":{"type":"string","minLength":1,"maxLength":128}},"required":["contractId","activityKey"]}},"proposal":{"type":"object","additionalProperties":false,"description":"Frozen source-backed expense proposal. Proposal generation creates no financial entries.","required":["disposition","source","missing","lines"],"properties":{"disposition":{"enum":["ready","needs_information","duplicate","unsupported"]},"source":{"type":"object","additionalProperties":false,"properties":{"documentId":{"type":"string","minLength":1},"cid":{"type":"string","minLength":1}},"required":["documentId","cid"]},"missing":{"type":"array","maxItems":100,"items":{"type":"string","maxLength":500}},"lines":{"type":"array","maxItems":500,"items":{"type":"object","additionalProperties":false,"properties":{"index":{"type":"integer","minimum":0},"description":{"type":"string","minLength":1},"amountMinor":{"type":"string","pattern":"^[0-9]+$"}},"required":["index","description","amountMinor"]}},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"totalMinor":{"type":"string","pattern":"^[0-9]+$"},"matchedOccurrenceId":{"type":"string","minLength":1,"description":"An existing matching economic fact."},"contract":{"type":"object","additionalProperties":false,"properties":{"contractId":{"type":"string","minLength":1},"documentId":{"type":"string","minLength":1},"cid":{"type":"string","minLength":1}},"required":["contractId","documentId","cid"]},"command":{"oneOf":[{"type":"object","additionalProperties":false,"description":"Complete ordinary public command envelope; present only when ready.","required":["name","input","source_document_id","effective_at","idempotency_key"],"properties":{"name":{"const":"contracts.record"},"source_document_id":{"type":"string","minLength":1},"effective_at":{"type":"string","minLength":1,"format":"date-time"},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"input":{"type":"object","additionalProperties":false,"required":["contractId","activityKey","occurrenceKey","sourceFactId","effectiveAt","facts","evidence"],"properties":{"contractId":{"type":"string","minLength":1},"activityKey":{"type":"string","minLength":1},"occurrenceKey":{"type":"string","minLength":1},"sourceFactId":{"type":"string","minLength":1},"effectiveAt":{"type":"string","minLength":1,"format":"date-time"},"phase":{"const":"billing"},"obligationKey":{"type":"string","minLength":1},"facts":{"type":"object","maxProperties":100,"additionalProperties":{"type":"string"}},"evidence":{"type":"object","additionalProperties":false,"required":["service"],"properties":{"billing":{"type":"array","minItems":1,"maxItems":1,"items":{"type":"object","additionalProperties":false,"properties":{"kind":{"const":"other"},"ref":{"type":"string","minLength":1}},"required":["kind","ref"]}},"service":{"type":"array","minItems":1,"maxItems":1,"items":{"type":"object","additionalProperties":false,"properties":{"kind":{"const":"other"},"ref":{"type":"string","minLength":1}},"required":["kind","ref"]}}}}}}}},{"type":"object","additionalProperties":false,"description":"Complete ordinary public command envelope; present only when ready.","required":["name","input","source_document_id","effective_at","idempotency_key"],"properties":{"name":{"const":"receipts.record"},"source_document_id":{"type":"string","minLength":1},"effective_at":{"type":"string","minLength":1,"format":"date-time"},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"input":{"type":"object","additionalProperties":false,"required":["billing","payment"],"properties":{"processing":{"type":"object","additionalProperties":false,"required":["rail","netAmount","evidence"],"properties":{"rail":{"enum":["ach","ach_same_day","fedwire","rtp","sepa","sepa_instant","swift","onchain","internal","card"]},"netAmount":{"type":"string","pattern":"^(0|-?[1-9][0-9]*)$"},"feeFacts":{"type":"object","maxProperties":20,"additionalProperties":{"type":"string","pattern":"^(0|[1-9][0-9]*)$"}},"evidence":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}}}},"billing":{"type":"object","additionalProperties":false,"required":["contractId","activityKey","occurrenceKey","sourceFactId","effectiveAt","phase"],"anyOf":[{"type":"object","properties":{"obligationKey":{"type":"string","minLength":1}},"required":["obligationKey"]},{"type":"object","properties":{"period":{"type":"object","properties":{"from":{"type":"string","minLength":1},"through":{"type":"string","minLength":1}},"required":["from","through"]}},"required":["period"]}],"properties":{"contractId":{"type":"string","minLength":1},"activityKey":{"type":"string","minLength":1},"occurrenceKey":{"type":"string","minLength":1},"obligationKey":{"type":"string","minLength":1},"sourceFactId":{"type":"string","minLength":1},"effectiveAt":{"type":"string","format":"date-time"},"phase":{"const":"billing"},"dueDate":{"type":"string","format":"date"},"exchangeRate":{"type":"object","additionalProperties":false,"required":["base","quote","date","numerator","denominator","evidence"],"description":"An evidenced exchange rate (1 base = numerator/denominator quote), e.g. from a bank statement. It overrides the shared rate store for this command; omit it to use the store.","properties":{"base":{"type":"string","pattern":"^[A-Z]{3}$"},"quote":{"type":"string","pattern":"^[A-Z]{3}$"},"date":{"type":"string","format":"date"},"numerator":{"type":"string","pattern":"^[1-9][0-9]*$"},"denominator":{"type":"string","pattern":"^[1-9][0-9]*$"},"evidence":{"type":"array","minItems":1,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string"}}}}}},"period":{"type":"object","additionalProperties":false,"required":["from","through"],"properties":{"from":{"type":"string","format":"date-time"},"through":{"type":"string","format":"date-time"}}},"facts":{"type":"object","maxProperties":100,"additionalProperties":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":false,"required":["occurrenceId"],"properties":{"occurrenceId":{"type":"string","minLength":1}}},{"type":"object","additionalProperties":false,"required":["claimId","component"],"properties":{"claimId":{"type":"string","minLength":1},"component":{"type":"object","additionalProperties":false,"required":["originLedgerId","accountCode"],"properties":{"originLedgerId":{"type":"string","minLength":1},"accountCode":{"type":"integer"}}}}}]}},"evidence":{"type":"object","additionalProperties":false,"properties":{"billing":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}},"service":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}},"acceptance":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}},"economic":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}}}}}},"payment":{"type":"object","additionalProperties":false,"required":["financialAccountId","direction","amount","currency","partyId","effectiveAt","sourceFactId","evidence"],"properties":{"financialAccountId":{"type":"string","minLength":1},"direction":{"enum":["in","out"]},"amount":{"type":"string","pattern":"^[1-9][0-9]*$"},"currency":{"type":"string","minLength":1},"partyId":{"type":"string","minLength":1},"effectiveAt":{"type":"string","format":"date-time"},"sourceFactId":{"type":"string","minLength":1},"evidence":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}}}}}}}}]},"interpretation":{"type":"object","additionalProperties":false,"properties":{"cid":{"type":"string","minLength":1},"promptVersion":{"type":"string","minLength":1},"buyer":{"type":"string","minLength":1,"description":"Exact observed buyer; historical proposals without this field remain review cases."},"spans":{"type":"array","maxItems":1000,"items":{"type":"object","additionalProperties":false,"properties":{"start":{"type":"integer","minimum":0},"end":{"type":"integer","minimum":1,"maximum":65536},"text":{"type":"string","minLength":1}},"required":["start","end","text"]}}},"required":["cid","promptVersion","spans"]},"preview":{"description":"Read-only ordinary activity or priced-rights preparation, when validation succeeds."}},"oneOf":[{"properties":{"disposition":{"const":"ready"},"missing":{"maxItems":0},"lines":{"minItems":1}},"required":["command","contract","currency","totalMinor"]},{"properties":{"disposition":{"enum":["needs_information","duplicate","unsupported"]}},"not":{"required":["command"]}}]},"invoiceCorrection":{"type":"object","additionalProperties":false,"properties":{"at":{"type":"string","format":"date-time"},"principal":{"type":"string"},"provenance":{"const":"caller_selected_source_spans"},"choices":{"type":"object","additionalProperties":false,"properties":{"headers":{"type":"object","additionalProperties":false,"properties":{"vendor":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"},"buyer":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"},"externalId":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"},"date":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"},"currency":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"},"total":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"}},"required":["vendor","buyer","externalId","date","currency","total"]},"service":{"enum":["delivered","not_delivered","unclear"]},"rows":{"type":"array","maxItems":64,"items":{"type":"object","additionalProperties":false,"properties":{"role":{"enum":["charge","tax","summary","other","unclear"]},"amount":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"}},"required":["role","amount"]}}},"required":["headers","service","rows"]}},"required":["at","principal","provenance","choices"]}},"required":["revision","at","principal"]}},"original":{"type":"object","additionalProperties":false,"properties":{"documentId":{"type":"string"},"cid":{"type":"string"},"format":{"enum":["markdown","text","document"]},"provenance":{"enum":["caller_supplied_unverified","registered_bytes"]}},"required":["documentId","cid","format","provenance"]},"failure":{"type":"object","additionalProperties":false,"properties":{"reason":{"type":"string"},"retryable":{"type":"boolean"}},"required":["reason","retryable"]},"lastFailure":{"type":"object","additionalProperties":false,"properties":{"reason":{"type":"string"},"retryable":{"type":"boolean"},"attempt":{"type":"integer","minimum":1,"maximum":12},"at":{"type":"string","format":"date-time"}},"required":["reason","retryable","attempt","at"]},"relationship":{"type":"object","additionalProperties":false,"properties":{"type":{"enum":["transcription","summary","related_original"]},"declaredBy":{"type":"string"},"verification":{"const":"unverified"}},"required":["type","declaredBy","verification"]},"uploads":{"type":"object","additionalProperties":false,"properties":{"primary":{"type":"object","additionalProperties":false,"properties":{"filename":{"type":"string","minLength":1,"maxLength":200},"contentType":{"enum":["application/pdf","text/plain","text/markdown","text/csv","application/json","image/png","image/jpeg","image/webp"]},"size":{"type":"integer","minimum":1,"maximum":10485760,"description":"Exact byte length. Images are limited to 256 KiB; other files to 10 MiB."},"expiresAt":{"type":"string","format":"date-time"},"status":{"enum":["awaiting_upload","uploaded","expired"]},"documentId":{"type":"string"},"cid":{"type":"string"},"url":{"type":"string","description":"Short-lived upload credential. Send exact bytes to this URL with the returned method and contentType; no OAuth header is required. Present only in the response of the command that issued it (ingestions.start, ingestions.attach_original, ingestions.reissue_upload); replays and reads omit it, so call ingestions.reissue_upload for a fresh one."},"method":{"const":"PUT","description":"Present when this response issued the upload URL."}},"required":["filename","contentType","size","expiresAt","status"]},"original":{"type":"object","additionalProperties":false,"properties":{"filename":{"type":"string","minLength":1,"maxLength":200},"contentType":{"enum":["application/pdf","text/plain","text/markdown","text/csv","application/json","image/png","image/jpeg","image/webp"]},"size":{"type":"integer","minimum":1,"maximum":10485760,"description":"Exact byte length. Images are limited to 256 KiB; other files to 10 MiB."},"expiresAt":{"type":"string","format":"date-time"},"status":{"enum":["awaiting_upload","uploaded","expired"]},"documentId":{"type":"string"},"cid":{"type":"string"},"url":{"type":"string","description":"Short-lived upload credential. Send exact bytes to this URL with the returned method and contentType; no OAuth header is required. Present only in the response of the command that issued it (ingestions.start, ingestions.attach_original, ingestions.reissue_upload); replays and reads omit it, so call ingestions.reissue_upload for a fresh one."},"method":{"const":"PUT","description":"Present when this response issued the upload URL."}},"required":["filename","contentType","size","expiresAt","status"]}}},"revisions":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"revision":{"type":"integer","minimum":1},"startedAt":{"type":"string","format":"date-time"},"business":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string"},"legalName":{"type":["string","null"]}},"required":["name","legalName"]},"completedAt":{"type":"string","format":"date-time"},"status":{"enum":["processing","completed","failed"]},"sources":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"documentId":{"type":"string"},"cid":{"type":"string"},"format":{"enum":["markdown","text","document"]},"provenance":{"enum":["caller_supplied_unverified","registered_bytes"]},"role":{"enum":["primary","original"]}},"required":["documentId","cid","format","provenance","role"]}},"failure":{"type":"object","additionalProperties":false,"properties":{"reason":{"type":"string"},"retryable":{"type":"boolean"}},"required":["reason","retryable"]},"invoiceSelection":{"type":"object","additionalProperties":false,"description":"Observed source-span choices, bound to the committed UTF-8 extraction. Choice probability is not financial accuracy or authorization.","properties":{"textCid":{"type":"string"},"promptVersion":{"enum":["invoice-spans-v1","receipt-spans-v1"]},"headers":{"type":"object","additionalProperties":false,"properties":{"vendor":{"type":"object","additionalProperties":false,"properties":{"choice":{"type":"string","maxLength":32},"probability":{"type":"string","pattern":"^(?:0(?:\\.[0-9]{1,15})?|1(?:\\.0{1,15})?)$"}},"required":["choice","probability"]},"buyer":{"type":"object","additionalProperties":false,"properties":{"choice":{"type":"string","maxLength":32},"probability":{"type":"string","pattern":"^(?:0(?:\\.[0-9]{1,15})?|1(?:\\.0{1,15})?)$"}},"required":["choice","probability"]},"externalId":{"type":"object","additionalProperties":false,"properties":{"choice":{"type":"string","maxLength":32},"probability":{"type":"string","pattern":"^(?:0(?:\\.[0-9]{1,15})?|1(?:\\.0{1,15})?)$"}},"required":["choice","probability"]},"date":{"type":"object","additionalProperties":false,"properties":{"choice":{"type":"string","maxLength":32},"probability":{"type":"string","pattern":"^(?:0(?:\\.[0-9]{1,15})?|1(?:\\.0{1,15})?)$"}},"required":["choice","probability"]},"currency":{"type":"object","additionalProperties":false,"properties":{"choice":{"type":"string","maxLength":32},"probability":{"type":"string","pattern":"^(?:0(?:\\.[0-9]{1,15})?|1(?:\\.0{1,15})?)$"}},"required":["choice","probability"]},"total":{"type":"object","additionalProperties":false,"properties":{"choice":{"type":"string","maxLength":32},"probability":{"type":"string","pattern":"^(?:0(?:\\.[0-9]{1,15})?|1(?:\\.0{1,15})?)$"}},"required":["choice","probability"]}},"required":["vendor","buyer","externalId","date","currency","total"]},"provider":{"type":"object","additionalProperties":false,"properties":{"name":{"enum":["@cf/cloudflare/clef-flash","@cf/cloudflare/clef"]},"version":{"const":"unreported"},"inputTokens":{"type":"integer","minimum":0},"outputTokens":{"type":"integer","minimum":0},"requestBytes":{"type":"integer","minimum":0},"latencyMs":{"type":"integer","minimum":0}},"required":["name","version","inputTokens","outputTokens","requestBytes","latencyMs"]},"service":{"type":"object","additionalProperties":false,"properties":{"choice":{"type":"string","maxLength":32},"probability":{"type":"string","pattern":"^(?:0(?:\\.[0-9]{1,15})?|1(?:\\.0{1,15})?)$"}},"required":["choice","probability"]},"payment":{"type":"object","additionalProperties":false,"properties":{"status":{"type":"object","additionalProperties":false,"properties":{"choice":{"type":"string","maxLength":32},"probability":{"type":"string","pattern":"^(?:0(?:\\.[0-9]{1,15})?|1(?:\\.0{1,15})?)$"}},"required":["choice","probability"]},"externalId":{"type":"object","additionalProperties":false,"properties":{"choice":{"type":"string","maxLength":32},"probability":{"type":"string","pattern":"^(?:0(?:\\.[0-9]{1,15})?|1(?:\\.0{1,15})?)$"}},"required":["choice","probability"]},"last4":{"type":"object","additionalProperties":false,"properties":{"choice":{"type":"string","maxLength":32},"probability":{"type":"string","pattern":"^(?:0(?:\\.[0-9]{1,15})?|1(?:\\.0{1,15})?)$"}},"required":["choice","probability"]}},"required":["status","externalId","last4"]},"rows":{"type":"array","maxItems":64,"items":{"type":"object","additionalProperties":false,"properties":{"role":{"type":"object","additionalProperties":false,"properties":{"choice":{"type":"string","maxLength":32},"probability":{"type":"string","pattern":"^(?:0(?:\\.[0-9]{1,15})?|1(?:\\.0{1,15})?)$"}},"required":["choice","probability"]},"amount":{"type":"object","additionalProperties":false,"properties":{"choice":{"type":"string","maxLength":32},"probability":{"type":"string","pattern":"^(?:0(?:\\.[0-9]{1,15})?|1(?:\\.0{1,15})?)$"}},"required":["choice","probability"]}},"required":["role","amount"]}}},"required":["textCid","promptVersion","headers","service","rows"]},"extraction":{"type":"object","additionalProperties":false,"properties":{"status":{"enum":["not_required","extracted","incomplete"]},"method":{"enum":["provided_text","native_pdf","image_ocr","pdf_ocr"]},"text":{"type":"string","maxLength":65536,"description":"Returned only after source-document authorization; raw history contains annex references."},"textBytes":{"type":"integer","minimum":1,"maximum":65536},"source":{"type":"object","additionalProperties":false,"properties":{"documentId":{"type":"string"},"cid":{"type":"string"},"format":{"enum":["markdown","text","document"]},"provenance":{"enum":["caller_supplied_unverified","registered_bytes"]}},"required":["documentId","cid","format","provenance"]},"derived":{"type":"object","additionalProperties":false,"properties":{"cid":{"type":"string"}},"required":["cid"]},"pageCount":{"type":["integer","null"],"minimum":1,"maximum":50},"locations":{"type":"array","maxItems":50,"items":{"type":"object","additionalProperties":false,"properties":{"page":{"type":["integer","null"],"minimum":1},"start":{"type":"integer","minimum":0},"end":{"type":"integer","minimum":0}},"required":["page","start","end"]}},"provider":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string"},"version":{"type":"string"}},"required":["name","version"]},"usage":{"type":"object","additionalProperties":false,"properties":{"inputTokens":{"type":"integer","minimum":0},"outputTokens":{"type":"integer","minimum":0},"latencyMs":{"type":"integer","minimum":0},"conversionTokens":{"type":"integer","minimum":0,"description":"Estimated native conversion tokens, distinct from inference usage."}},"required":["inputTokens","outputTokens","latencyMs"]}},"required":["status","method","textBytes","source","derived","pageCount","locations","provider","usage"]},"classification":{"type":"object","additionalProperties":false,"properties":{"documentType":{"enum":["invoice","receipt","agreement","statement_or_remittance","credit_or_correction","reminder","mixed","other","uncertain"]},"probabilities":{"type":"object","additionalProperties":false,"properties":{"invoice":{"type":"string","description":"Decimal probability between 0 and 1."},"receipt":{"type":"string","description":"Decimal probability between 0 and 1."},"agreement":{"type":"string","description":"Decimal probability between 0 and 1."},"statement_or_remittance":{"type":"string","description":"Decimal probability between 0 and 1."},"credit_or_correction":{"type":"string","description":"Decimal probability between 0 and 1."},"reminder":{"type":"string","description":"Decimal probability between 0 and 1."},"mixed":{"type":"string","description":"Decimal probability between 0 and 1."},"other":{"type":"string","description":"Decimal probability between 0 and 1."},"uncertain":{"type":"string","description":"Decimal probability between 0 and 1."}},"required":["invoice","receipt","agreement","statement_or_remittance","credit_or_correction","reminder","mixed","other","uncertain"]},"model":{"type":"string"},"modelVersion":{"type":"string"},"promptVersion":{"type":"string"},"confidence":{"type":"string","description":"Distribution confidence, not calibrated accuracy or permission to act."},"invoiceRole":{"type":"object","additionalProperties":false,"properties":{"role":{"enum":["buyer","seller","neither","unclear"]},"probabilities":{"type":"object","additionalProperties":false,"properties":{"buyer":{"type":"string"},"seller":{"type":"string"},"neither":{"type":"string"},"unclear":{"type":"string"}},"required":["buyer","seller","neither","unclear"]},"confidence":{"type":"string"},"promptVersion":{"type":"string"}},"required":["role","probabilities","confidence","promptVersion"]},"usage":{"type":"object","additionalProperties":false,"properties":{"inputTokens":{"type":"integer","minimum":0},"outputTokens":{"type":"integer","minimum":0},"requestBytes":{"type":"integer","minimum":1},"latencyMs":{"type":"integer","minimum":0}},"required":["inputTokens","outputTokens","requestBytes","latencyMs"]}},"required":["documentType","probabilities","model","modelVersion","promptVersion"]}},"required":["revision","startedAt","business","status","sources"]}}},"required":["ingestionId","createdAt","status","uploads","revisions"],"x-relative-urls":["/uploads/primary/url","/uploads/original/url"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","additionalProperties":false,"properties":{"ingestionId":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"status":{"enum":["awaiting_upload","queued","processing","completed","failed"]},"source":{"type":"object","additionalProperties":false,"properties":{"documentId":{"type":"string"},"cid":{"type":"string"},"format":{"enum":["markdown","text","document"]},"provenance":{"enum":["caller_supplied_unverified","registered_bytes"]}},"required":["documentId","cid","format","provenance"]},"expenseTargets":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"properties":{"contractId":{"type":"string","minLength":1,"maxLength":128},"activityKey":{"type":"string","minLength":1,"maxLength":128}},"required":["contractId","activityKey"]}},"mode":{"enum":["propose","auto_record"]},"recordingPolicy":{"type":"object","additionalProperties":false,"properties":{"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"maxAmountMinor":{"type":"string","pattern":"^[1-9][0-9]{0,18}$"},"maxDailyTotalMinor":{"type":"string","pattern":"^[1-9][0-9]{0,18}$","description":"Upper bound, in currency minor units, on the total this business records automatically per UTC day across all auto_record ingestions; a proposal that would exceed it needs review (daily_total_exceeded)."},"minimumConfidencePercent":{"type":"integer","minimum":60,"maximum":100},"fundingAccounts":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["financialAccountId","currency","last4","kind","glAccountCode"],"properties":{"financialAccountId":{"type":"string","minLength":1,"maxLength":128},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"last4":{"type":"string","pattern":"^[0-9]{4}$"},"kind":{"enum":["checking","savings","card","wallet","other"]},"glAccountCode":{"enum":[1110,1310,2190,2135]},"ownerPartyId":{"type":"string","minLength":1},"providerPartyId":{"type":"string","minLength":1}}}},"targets":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"properties":{"contractId":{"type":"string","minLength":1,"maxLength":128},"activityKey":{"type":"string","minLength":1,"maxLength":128},"cid":{"type":"string","minLength":1,"maxLength":128}},"required":["contractId","activityKey","cid"]}}},"required":["currency","maxAmountMinor","maxDailyTotalMinor","minimumConfidencePercent","targets"]},"execution":{"type":"object","additionalProperties":false,"properties":{"status":{"enum":["pending","recorded","already_recorded","needs_review"]},"proposalRevision":{"type":"integer","minimum":1,"maximum":8},"commandId":{"type":"string","description":"Actual ordinary financial command receipt."},"occurrenceId":{"type":"string","description":"An already recorded matching economic fact."},"reason":{"type":"string","description":"Why automatic recording requires review."}},"required":["status","proposalRevision"],"description":"Durable financial recording disposition and actual ordinary command receipt reference."},"proposal":{"type":"object","additionalProperties":false,"description":"Frozen source-backed expense proposal. Proposal generation creates no financial entries.","required":["disposition","source","missing","lines"],"properties":{"disposition":{"enum":["ready","needs_information","duplicate","unsupported"]},"source":{"type":"object","additionalProperties":false,"properties":{"documentId":{"type":"string","minLength":1},"cid":{"type":"string","minLength":1}},"required":["documentId","cid"]},"missing":{"type":"array","maxItems":100,"items":{"type":"string","maxLength":500}},"lines":{"type":"array","maxItems":500,"items":{"type":"object","additionalProperties":false,"properties":{"index":{"type":"integer","minimum":0},"description":{"type":"string","minLength":1},"amountMinor":{"type":"string","pattern":"^[0-9]+$"}},"required":["index","description","amountMinor"]}},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"totalMinor":{"type":"string","pattern":"^[0-9]+$"},"matchedOccurrenceId":{"type":"string","minLength":1,"description":"An existing matching economic fact."},"contract":{"type":"object","additionalProperties":false,"properties":{"contractId":{"type":"string","minLength":1},"documentId":{"type":"string","minLength":1},"cid":{"type":"string","minLength":1}},"required":["contractId","documentId","cid"]},"command":{"oneOf":[{"type":"object","additionalProperties":false,"description":"Complete ordinary public command envelope; present only when ready.","required":["name","input","source_document_id","effective_at","idempotency_key"],"properties":{"name":{"const":"contracts.record"},"source_document_id":{"type":"string","minLength":1},"effective_at":{"type":"string","minLength":1,"format":"date-time"},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"input":{"type":"object","additionalProperties":false,"required":["contractId","activityKey","occurrenceKey","sourceFactId","effectiveAt","facts","evidence"],"properties":{"contractId":{"type":"string","minLength":1},"activityKey":{"type":"string","minLength":1},"occurrenceKey":{"type":"string","minLength":1},"sourceFactId":{"type":"string","minLength":1},"effectiveAt":{"type":"string","minLength":1,"format":"date-time"},"phase":{"const":"billing"},"obligationKey":{"type":"string","minLength":1},"facts":{"type":"object","maxProperties":100,"additionalProperties":{"type":"string"}},"evidence":{"type":"object","additionalProperties":false,"required":["service"],"properties":{"billing":{"type":"array","minItems":1,"maxItems":1,"items":{"type":"object","additionalProperties":false,"properties":{"kind":{"const":"other"},"ref":{"type":"string","minLength":1}},"required":["kind","ref"]}},"service":{"type":"array","minItems":1,"maxItems":1,"items":{"type":"object","additionalProperties":false,"properties":{"kind":{"const":"other"},"ref":{"type":"string","minLength":1}},"required":["kind","ref"]}}}}}}}},{"type":"object","additionalProperties":false,"description":"Complete ordinary public command envelope; present only when ready.","required":["name","input","source_document_id","effective_at","idempotency_key"],"properties":{"name":{"const":"receipts.record"},"source_document_id":{"type":"string","minLength":1},"effective_at":{"type":"string","minLength":1,"format":"date-time"},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"input":{"type":"object","additionalProperties":false,"required":["billing","payment"],"properties":{"processing":{"type":"object","additionalProperties":false,"required":["rail","netAmount","evidence"],"properties":{"rail":{"enum":["ach","ach_same_day","fedwire","rtp","sepa","sepa_instant","swift","onchain","internal","card"]},"netAmount":{"type":"string","pattern":"^(0|-?[1-9][0-9]*)$"},"feeFacts":{"type":"object","maxProperties":20,"additionalProperties":{"type":"string","pattern":"^(0|[1-9][0-9]*)$"}},"evidence":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}}}},"billing":{"type":"object","additionalProperties":false,"required":["contractId","activityKey","occurrenceKey","sourceFactId","effectiveAt","phase"],"anyOf":[{"type":"object","properties":{"obligationKey":{"type":"string","minLength":1}},"required":["obligationKey"]},{"type":"object","properties":{"period":{"type":"object","properties":{"from":{"type":"string","minLength":1},"through":{"type":"string","minLength":1}},"required":["from","through"]}},"required":["period"]}],"properties":{"contractId":{"type":"string","minLength":1},"activityKey":{"type":"string","minLength":1},"occurrenceKey":{"type":"string","minLength":1},"obligationKey":{"type":"string","minLength":1},"sourceFactId":{"type":"string","minLength":1},"effectiveAt":{"type":"string","format":"date-time"},"phase":{"const":"billing"},"dueDate":{"type":"string","format":"date"},"exchangeRate":{"type":"object","additionalProperties":false,"required":["base","quote","date","numerator","denominator","evidence"],"description":"An evidenced exchange rate (1 base = numerator/denominator quote), e.g. from a bank statement. It overrides the shared rate store for this command; omit it to use the store.","properties":{"base":{"type":"string","pattern":"^[A-Z]{3}$"},"quote":{"type":"string","pattern":"^[A-Z]{3}$"},"date":{"type":"string","format":"date"},"numerator":{"type":"string","pattern":"^[1-9][0-9]*$"},"denominator":{"type":"string","pattern":"^[1-9][0-9]*$"},"evidence":{"type":"array","minItems":1,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string"}}}}}},"period":{"type":"object","additionalProperties":false,"required":["from","through"],"properties":{"from":{"type":"string","format":"date-time"},"through":{"type":"string","format":"date-time"}}},"facts":{"type":"object","maxProperties":100,"additionalProperties":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":false,"required":["occurrenceId"],"properties":{"occurrenceId":{"type":"string","minLength":1}}},{"type":"object","additionalProperties":false,"required":["claimId","component"],"properties":{"claimId":{"type":"string","minLength":1},"component":{"type":"object","additionalProperties":false,"required":["originLedgerId","accountCode"],"properties":{"originLedgerId":{"type":"string","minLength":1},"accountCode":{"type":"integer"}}}}}]}},"evidence":{"type":"object","additionalProperties":false,"properties":{"billing":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}},"service":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}},"acceptance":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}},"economic":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}}}}}},"payment":{"type":"object","additionalProperties":false,"required":["financialAccountId","direction","amount","currency","partyId","effectiveAt","sourceFactId","evidence"],"properties":{"financialAccountId":{"type":"string","minLength":1},"direction":{"enum":["in","out"]},"amount":{"type":"string","pattern":"^[1-9][0-9]*$"},"currency":{"type":"string","minLength":1},"partyId":{"type":"string","minLength":1},"effectiveAt":{"type":"string","format":"date-time"},"sourceFactId":{"type":"string","minLength":1},"evidence":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}}}}}}}}]},"interpretation":{"type":"object","additionalProperties":false,"properties":{"cid":{"type":"string","minLength":1},"promptVersion":{"type":"string","minLength":1},"buyer":{"type":"string","minLength":1,"description":"Exact observed buyer; historical proposals without this field remain review cases."},"spans":{"type":"array","maxItems":1000,"items":{"type":"object","additionalProperties":false,"properties":{"start":{"type":"integer","minimum":0},"end":{"type":"integer","minimum":1,"maximum":65536},"text":{"type":"string","minLength":1}},"required":["start","end","text"]}}},"required":["cid","promptVersion","spans"]},"preview":{"description":"Read-only ordinary activity or priced-rights preparation, when validation succeeds."}},"oneOf":[{"properties":{"disposition":{"const":"ready"},"missing":{"maxItems":0},"lines":{"minItems":1}},"required":["command","contract","currency","totalMinor"]},{"properties":{"disposition":{"enum":["needs_information","duplicate","unsupported"]}},"not":{"required":["command"]}}]},"invoiceCorrection":{"type":"object","additionalProperties":false,"properties":{"at":{"type":"string","format":"date-time"},"principal":{"type":"string"},"provenance":{"const":"caller_selected_source_spans"},"choices":{"type":"object","additionalProperties":false,"properties":{"headers":{"type":"object","additionalProperties":false,"properties":{"vendor":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"},"buyer":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"},"externalId":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"},"date":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"},"currency":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"},"total":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"}},"required":["vendor","buyer","externalId","date","currency","total"]},"service":{"enum":["delivered","not_delivered","unclear"]},"rows":{"type":"array","maxItems":64,"items":{"type":"object","additionalProperties":false,"properties":{"role":{"enum":["charge","tax","summary","other","unclear"]},"amount":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"}},"required":["role","amount"]}}},"required":["headers","service","rows"]}},"required":["at","principal","provenance","choices"]},"proposalRevision":{"type":"integer","minimum":2,"maximum":8},"proposalHistory":{"type":"array","maxItems":7,"items":{"type":"object","additionalProperties":false,"properties":{"revision":{"type":"integer","minimum":1,"maximum":7},"at":{"type":"string","format":"date-time"},"principal":{"type":"string"},"expenseTargets":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"properties":{"contractId":{"type":"string","minLength":1,"maxLength":128},"activityKey":{"type":"string","minLength":1,"maxLength":128}},"required":["contractId","activityKey"]}},"proposal":{"type":"object","additionalProperties":false,"description":"Frozen source-backed expense proposal. Proposal generation creates no financial entries.","required":["disposition","source","missing","lines"],"properties":{"disposition":{"enum":["ready","needs_information","duplicate","unsupported"]},"source":{"type":"object","additionalProperties":false,"properties":{"documentId":{"type":"string","minLength":1},"cid":{"type":"string","minLength":1}},"required":["documentId","cid"]},"missing":{"type":"array","maxItems":100,"items":{"type":"string","maxLength":500}},"lines":{"type":"array","maxItems":500,"items":{"type":"object","additionalProperties":false,"properties":{"index":{"type":"integer","minimum":0},"description":{"type":"string","minLength":1},"amountMinor":{"type":"string","pattern":"^[0-9]+$"}},"required":["index","description","amountMinor"]}},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"totalMinor":{"type":"string","pattern":"^[0-9]+$"},"matchedOccurrenceId":{"type":"string","minLength":1,"description":"An existing matching economic fact."},"contract":{"type":"object","additionalProperties":false,"properties":{"contractId":{"type":"string","minLength":1},"documentId":{"type":"string","minLength":1},"cid":{"type":"string","minLength":1}},"required":["contractId","documentId","cid"]},"command":{"oneOf":[{"type":"object","additionalProperties":false,"description":"Complete ordinary public command envelope; present only when ready.","required":["name","input","source_document_id","effective_at","idempotency_key"],"properties":{"name":{"const":"contracts.record"},"source_document_id":{"type":"string","minLength":1},"effective_at":{"type":"string","minLength":1,"format":"date-time"},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"input":{"type":"object","additionalProperties":false,"required":["contractId","activityKey","occurrenceKey","sourceFactId","effectiveAt","facts","evidence"],"properties":{"contractId":{"type":"string","minLength":1},"activityKey":{"type":"string","minLength":1},"occurrenceKey":{"type":"string","minLength":1},"sourceFactId":{"type":"string","minLength":1},"effectiveAt":{"type":"string","minLength":1,"format":"date-time"},"phase":{"const":"billing"},"obligationKey":{"type":"string","minLength":1},"facts":{"type":"object","maxProperties":100,"additionalProperties":{"type":"string"}},"evidence":{"type":"object","additionalProperties":false,"required":["service"],"properties":{"billing":{"type":"array","minItems":1,"maxItems":1,"items":{"type":"object","additionalProperties":false,"properties":{"kind":{"const":"other"},"ref":{"type":"string","minLength":1}},"required":["kind","ref"]}},"service":{"type":"array","minItems":1,"maxItems":1,"items":{"type":"object","additionalProperties":false,"properties":{"kind":{"const":"other"},"ref":{"type":"string","minLength":1}},"required":["kind","ref"]}}}}}}}},{"type":"object","additionalProperties":false,"description":"Complete ordinary public command envelope; present only when ready.","required":["name","input","source_document_id","effective_at","idempotency_key"],"properties":{"name":{"const":"receipts.record"},"source_document_id":{"type":"string","minLength":1},"effective_at":{"type":"string","minLength":1,"format":"date-time"},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"input":{"type":"object","additionalProperties":false,"required":["billing","payment"],"properties":{"processing":{"type":"object","additionalProperties":false,"required":["rail","netAmount","evidence"],"properties":{"rail":{"enum":["ach","ach_same_day","fedwire","rtp","sepa","sepa_instant","swift","onchain","internal","card"]},"netAmount":{"type":"string","pattern":"^(0|-?[1-9][0-9]*)$"},"feeFacts":{"type":"object","maxProperties":20,"additionalProperties":{"type":"string","pattern":"^(0|[1-9][0-9]*)$"}},"evidence":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}}}},"billing":{"type":"object","additionalProperties":false,"required":["contractId","activityKey","occurrenceKey","sourceFactId","effectiveAt","phase"],"anyOf":[{"type":"object","properties":{"obligationKey":{"type":"string","minLength":1}},"required":["obligationKey"]},{"type":"object","properties":{"period":{"type":"object","properties":{"from":{"type":"string","minLength":1},"through":{"type":"string","minLength":1}},"required":["from","through"]}},"required":["period"]}],"properties":{"contractId":{"type":"string","minLength":1},"activityKey":{"type":"string","minLength":1},"occurrenceKey":{"type":"string","minLength":1},"obligationKey":{"type":"string","minLength":1},"sourceFactId":{"type":"string","minLength":1},"effectiveAt":{"type":"string","format":"date-time"},"phase":{"const":"billing"},"dueDate":{"type":"string","format":"date"},"exchangeRate":{"type":"object","additionalProperties":false,"required":["base","quote","date","numerator","denominator","evidence"],"description":"An evidenced exchange rate (1 base = numerator/denominator quote), e.g. from a bank statement. It overrides the shared rate store for this command; omit it to use the store.","properties":{"base":{"type":"string","pattern":"^[A-Z]{3}$"},"quote":{"type":"string","pattern":"^[A-Z]{3}$"},"date":{"type":"string","format":"date"},"numerator":{"type":"string","pattern":"^[1-9][0-9]*$"},"denominator":{"type":"string","pattern":"^[1-9][0-9]*$"},"evidence":{"type":"array","minItems":1,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string"}}}}}},"period":{"type":"object","additionalProperties":false,"required":["from","through"],"properties":{"from":{"type":"string","format":"date-time"},"through":{"type":"string","format":"date-time"}}},"facts":{"type":"object","maxProperties":100,"additionalProperties":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":false,"required":["occurrenceId"],"properties":{"occurrenceId":{"type":"string","minLength":1}}},{"type":"object","additionalProperties":false,"required":["claimId","component"],"properties":{"claimId":{"type":"string","minLength":1},"component":{"type":"object","additionalProperties":false,"required":["originLedgerId","accountCode"],"properties":{"originLedgerId":{"type":"string","minLength":1},"accountCode":{"type":"integer"}}}}}]}},"evidence":{"type":"object","additionalProperties":false,"properties":{"billing":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}},"service":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}},"acceptance":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}},"economic":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}}}}}},"payment":{"type":"object","additionalProperties":false,"required":["financialAccountId","direction","amount","currency","partyId","effectiveAt","sourceFactId","evidence"],"properties":{"financialAccountId":{"type":"string","minLength":1},"direction":{"enum":["in","out"]},"amount":{"type":"string","pattern":"^[1-9][0-9]*$"},"currency":{"type":"string","minLength":1},"partyId":{"type":"string","minLength":1},"effectiveAt":{"type":"string","format":"date-time"},"sourceFactId":{"type":"string","minLength":1},"evidence":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["tap_message","x402_receipt","chain_tx","signed_doc","stripe_object","other"]},"ref":{"type":"string","minLength":1},"signer":{"type":"string","minLength":1}}}}}}}}}}]},"interpretation":{"type":"object","additionalProperties":false,"properties":{"cid":{"type":"string","minLength":1},"promptVersion":{"type":"string","minLength":1},"buyer":{"type":"string","minLength":1,"description":"Exact observed buyer; historical proposals without this field remain review cases."},"spans":{"type":"array","maxItems":1000,"items":{"type":"object","additionalProperties":false,"properties":{"start":{"type":"integer","minimum":0},"end":{"type":"integer","minimum":1,"maximum":65536},"text":{"type":"string","minLength":1}},"required":["start","end","text"]}}},"required":["cid","promptVersion","spans"]},"preview":{"description":"Read-only ordinary activity or priced-rights preparation, when validation succeeds."}},"oneOf":[{"properties":{"disposition":{"const":"ready"},"missing":{"maxItems":0},"lines":{"minItems":1}},"required":["command","contract","currency","totalMinor"]},{"properties":{"disposition":{"enum":["needs_information","duplicate","unsupported"]}},"not":{"required":["command"]}}]},"invoiceCorrection":{"type":"object","additionalProperties":false,"properties":{"at":{"type":"string","format":"date-time"},"principal":{"type":"string"},"provenance":{"const":"caller_selected_source_spans"},"choices":{"type":"object","additionalProperties":false,"properties":{"headers":{"type":"object","additionalProperties":false,"properties":{"vendor":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"},"buyer":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"},"externalId":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"},"date":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"},"currency":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"},"total":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"}},"required":["vendor","buyer","externalId","date","currency","total"]},"service":{"enum":["delivered","not_delivered","unclear"]},"rows":{"type":"array","maxItems":64,"items":{"type":"object","additionalProperties":false,"properties":{"role":{"enum":["charge","tax","summary","other","unclear"]},"amount":{"type":"string","pattern":"^(?:none|v[0-9]{1,3})$"}},"required":["role","amount"]}}},"required":["headers","service","rows"]}},"required":["at","principal","provenance","choices"]}},"required":["revision","at","principal"]}},"original":{"type":"object","additionalProperties":false,"properties":{"documentId":{"type":"string"},"cid":{"type":"string"},"format":{"enum":["markdown","text","document"]},"provenance":{"enum":["caller_supplied_unverified","registered_bytes"]}},"required":["documentId","cid","format","provenance"]},"failure":{"type":"object","additionalProperties":false,"properties":{"reason":{"type":"string"},"retryable":{"type":"boolean"}},"required":["reason","retryable"]},"lastFailure":{"type":"object","additionalProperties":false,"properties":{"reason":{"type":"string"},"retryable":{"type":"boolean"},"attempt":{"type":"integer","minimum":1,"maximum":12},"at":{"type":"string","format":"date-time"}},"required":["reason","retryable","attempt","at"]},"relationship":{"type":"object","additionalProperties":false,"properties":{"type":{"enum":["transcription","summary","related_original"]},"declaredBy":{"type":"string"},"verification":{"const":"unverified"}},"required":["type","declaredBy","verification"]},"uploads":{"type":"object","additionalProperties":false,"properties":{"primary":{"type":"object","additionalProperties":false,"properties":{"filename":{"type":"string","minLength":1,"maxLength":200},"contentType":{"enum":["application/pdf","text/plain","text/markdown","text/csv","application/json","image/png","image/jpeg","image/webp"]},"size":{"type":"integer","minimum":1,"maximum":10485760,"description":"Exact byte length. Images are limited to 256 KiB; other files to 10 MiB."},"expiresAt":{"type":"string","format":"date-time"},"status":{"enum":["awaiting_upload","uploaded","expired"]},"documentId":{"type":"string"},"cid":{"type":"string"},"url":{"type":"string","description":"Short-lived upload credential. Send exact bytes to this URL with the returned method and contentType; no OAuth header is required. Present only in the response of the command that issued it (ingestions.start, ingestions.attach_original, ingestions.reissue_upload); replays and reads omit it, so call ingestions.reissue_upload for a fresh one."},"method":{"const":"PUT","description":"Present when this response issued the upload URL."}},"required":["filename","contentType","size","expiresAt","status"]},"original":{"type":"object","additionalProperties":false,"properties":{"filename":{"type":"string","minLength":1,"maxLength":200},"contentType":{"enum":["application/pdf","text/plain","text/markdown","text/csv","application/json","image/png","image/jpeg","image/webp"]},"size":{"type":"integer","minimum":1,"maximum":10485760,"description":"Exact byte length. Images are limited to 256 KiB; other files to 10 MiB."},"expiresAt":{"type":"string","format":"date-time"},"status":{"enum":["awaiting_upload","uploaded","expired"]},"documentId":{"type":"string"},"cid":{"type":"string"},"url":{"type":"string","description":"Short-lived upload credential. Send exact bytes to this URL with the returned method and contentType; no OAuth header is required. Present only in the response of the command that issued it (ingestions.start, ingestions.attach_original, ingestions.reissue_upload); replays and reads omit it, so call ingestions.reissue_upload for a fresh one."},"method":{"const":"PUT","description":"Present when this response issued the upload URL."}},"required":["filename","contentType","size","expiresAt","status"]}}},"revisions":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"revision":{"type":"integer","minimum":1},"startedAt":{"type":"string","format":"date-time"},"business":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string"},"legalName":{"type":["string","null"]}},"required":["name","legalName"]},"completedAt":{"type":"string","format":"date-time"},"status":{"enum":["processing","completed","failed"]},"sources":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"documentId":{"type":"string"},"cid":{"type":"string"},"format":{"enum":["markdown","text","document"]},"provenance":{"enum":["caller_supplied_unverified","registered_bytes"]},"role":{"enum":["primary","original"]}},"required":["documentId","cid","format","provenance","role"]}},"failure":{"type":"object","additionalProperties":false,"properties":{"reason":{"type":"string"},"retryable":{"type":"boolean"}},"required":["reason","retryable"]},"invoiceSelection":{"type":"object","additionalProperties":false,"description":"Observed source-span choices, bound to the committed UTF-8 extraction. Choice probability is not financial accuracy or authorization.","properties":{"textCid":{"type":"string"},"promptVersion":{"enum":["invoice-spans-v1","receipt-spans-v1"]},"headers":{"type":"object","additionalProperties":false,"properties":{"vendor":{"type":"object","additionalProperties":false,"properties":{"choice":{"type":"string","maxLength":32},"probability":{"type":"string","pattern":"^(?:0(?:\\.[0-9]{1,15})?|1(?:\\.0{1,15})?)$"}},"required":["choice","probability"]},"buyer":{"type":"object","additionalProperties":false,"properties":{"choice":{"type":"string","maxLength":32},"probability":{"type":"string","pattern":"^(?:0(?:\\.[0-9]{1,15})?|1(?:\\.0{1,15})?)$"}},"required":["choice","probability"]},"externalId":{"type":"object","additionalProperties":false,"properties":{"choice":{"type":"string","maxLength":32},"probability":{"type":"string","pattern":"^(?:0(?:\\.[0-9]{1,15})?|1(?:\\.0{1,15})?)$"}},"required":["choice","probability"]},"date":{"type":"object","additionalProperties":false,"properties":{"choice":{"type":"string","maxLength":32},"probability":{"type":"string","pattern":"^(?:0(?:\\.[0-9]{1,15})?|1(?:\\.0{1,15})?)$"}},"required":["choice","probability"]},"currency":{"type":"object","additionalProperties":false,"properties":{"choice":{"type":"string","maxLength":32},"probability":{"type":"string","pattern":"^(?:0(?:\\.[0-9]{1,15})?|1(?:\\.0{1,15})?)$"}},"required":["choice","probability"]},"total":{"type":"object","additionalProperties":false,"properties":{"choice":{"type":"string","maxLength":32},"probability":{"type":"string","pattern":"^(?:0(?:\\.[0-9]{1,15})?|1(?:\\.0{1,15})?)$"}},"required":["choice","probability"]}},"required":["vendor","buyer","externalId","date","currency","total"]},"provider":{"type":"object","additionalProperties":false,"properties":{"name":{"enum":["@cf/cloudflare/clef-flash","@cf/cloudflare/clef"]},"version":{"const":"unreported"},"inputTokens":{"type":"integer","minimum":0},"outputTokens":{"type":"integer","minimum":0},"requestBytes":{"type":"integer","minimum":0},"latencyMs":{"type":"integer","minimum":0}},"required":["name","version","inputTokens","outputTokens","requestBytes","latencyMs"]},"service":{"type":"object","additionalProperties":false,"properties":{"choice":{"type":"string","maxLength":32},"probability":{"type":"string","pattern":"^(?:0(?:\\.[0-9]{1,15})?|1(?:\\.0{1,15})?)$"}},"required":["choice","probability"]},"payment":{"type":"object","additionalProperties":false,"properties":{"status":{"type":"object","additionalProperties":false,"properties":{"choice":{"type":"string","maxLength":32},"probability":{"type":"string","pattern":"^(?:0(?:\\.[0-9]{1,15})?|1(?:\\.0{1,15})?)$"}},"required":["choice","probability"]},"externalId":{"type":"object","additionalProperties":false,"properties":{"choice":{"type":"string","maxLength":32},"probability":{"type":"string","pattern":"^(?:0(?:\\.[0-9]{1,15})?|1(?:\\.0{1,15})?)$"}},"required":["choice","probability"]},"last4":{"type":"object","additionalProperties":false,"properties":{"choice":{"type":"string","maxLength":32},"probability":{"type":"string","pattern":"^(?:0(?:\\.[0-9]{1,15})?|1(?:\\.0{1,15})?)$"}},"required":["choice","probability"]}},"required":["status","externalId","last4"]},"rows":{"type":"array","maxItems":64,"items":{"type":"object","additionalProperties":false,"properties":{"role":{"type":"object","additionalProperties":false,"properties":{"choice":{"type":"string","maxLength":32},"probability":{"type":"string","pattern":"^(?:0(?:\\.[0-9]{1,15})?|1(?:\\.0{1,15})?)$"}},"required":["choice","probability"]},"amount":{"type":"object","additionalProperties":false,"properties":{"choice":{"type":"string","maxLength":32},"probability":{"type":"string","pattern":"^(?:0(?:\\.[0-9]{1,15})?|1(?:\\.0{1,15})?)$"}},"required":["choice","probability"]}},"required":["role","amount"]}}},"required":["textCid","promptVersion","headers","service","rows"]},"extraction":{"type":"object","additionalProperties":false,"properties":{"status":{"enum":["not_required","extracted","incomplete"]},"method":{"enum":["provided_text","native_pdf","image_ocr","pdf_ocr"]},"text":{"type":"string","maxLength":65536,"description":"Returned only after source-document authorization; raw history contains annex references."},"textBytes":{"type":"integer","minimum":1,"maximum":65536},"source":{"type":"object","additionalProperties":false,"properties":{"documentId":{"type":"string"},"cid":{"type":"string"},"format":{"enum":["markdown","text","document"]},"provenance":{"enum":["caller_supplied_unverified","registered_bytes"]}},"required":["documentId","cid","format","provenance"]},"derived":{"type":"object","additionalProperties":false,"properties":{"cid":{"type":"string"}},"required":["cid"]},"pageCount":{"type":["integer","null"],"minimum":1,"maximum":50},"locations":{"type":"array","maxItems":50,"items":{"type":"object","additionalProperties":false,"properties":{"page":{"type":["integer","null"],"minimum":1},"start":{"type":"integer","minimum":0},"end":{"type":"integer","minimum":0}},"required":["page","start","end"]}},"provider":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string"},"version":{"type":"string"}},"required":["name","version"]},"usage":{"type":"object","additionalProperties":false,"properties":{"inputTokens":{"type":"integer","minimum":0},"outputTokens":{"type":"integer","minimum":0},"latencyMs":{"type":"integer","minimum":0},"conversionTokens":{"type":"integer","minimum":0,"description":"Estimated native conversion tokens, distinct from inference usage."}},"required":["inputTokens","outputTokens","latencyMs"]}},"required":["status","method","textBytes","source","derived","pageCount","locations","provider","usage"]},"classification":{"type":"object","additionalProperties":false,"properties":{"documentType":{"enum":["invoice","receipt","agreement","statement_or_remittance","credit_or_correction","reminder","mixed","other","uncertain"]},"probabilities":{"type":"object","additionalProperties":false,"properties":{"invoice":{"type":"string","description":"Decimal probability between 0 and 1."},"receipt":{"type":"string","description":"Decimal probability between 0 and 1."},"agreement":{"type":"string","description":"Decimal probability between 0 and 1."},"statement_or_remittance":{"type":"string","description":"Decimal probability between 0 and 1."},"credit_or_correction":{"type":"string","description":"Decimal probability between 0 and 1."},"reminder":{"type":"string","description":"Decimal probability between 0 and 1."},"mixed":{"type":"string","description":"Decimal probability between 0 and 1."},"other":{"type":"string","description":"Decimal probability between 0 and 1."},"uncertain":{"type":"string","description":"Decimal probability between 0 and 1."}},"required":["invoice","receipt","agreement","statement_or_remittance","credit_or_correction","reminder","mixed","other","uncertain"]},"model":{"type":"string"},"modelVersion":{"type":"string"},"promptVersion":{"type":"string"},"confidence":{"type":"string","description":"Distribution confidence, not calibrated accuracy or permission to act."},"invoiceRole":{"type":"object","additionalProperties":false,"properties":{"role":{"enum":["buyer","seller","neither","unclear"]},"probabilities":{"type":"object","additionalProperties":false,"properties":{"buyer":{"type":"string"},"seller":{"type":"string"},"neither":{"type":"string"},"unclear":{"type":"string"}},"required":["buyer","seller","neither","unclear"]},"confidence":{"type":"string"},"promptVersion":{"type":"string"}},"required":["role","probabilities","confidence","promptVersion"]},"usage":{"type":"object","additionalProperties":false,"properties":{"inputTokens":{"type":"integer","minimum":0},"outputTokens":{"type":"integer","minimum":0},"requestBytes":{"type":"integer","minimum":1},"latencyMs":{"type":"integer","minimum":0}},"required":["inputTokens","outputTokens","requestBytes","latencyMs"]}},"required":["documentType","probabilities","model","modelVersion","promptVersion"]}},"required":["revision","startedAt","business","status","sources"]}}},"required":["ingestionId","createdAt","status","uploads","revisions"],"x-relative-urls":["/uploads/primary/url","/uploads/original/url"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","additionalProperties":false,"properties":{"disposition":{"enum":["review","needs_information"]},"missing":{"type":"array","items":{"type":"string"}},"source":{"type":"object","properties":{"documentId":{"type":"string"},"cid":{"type":"string"},"textCid":{"type":"string"},"provenance":{"enum":["registered_bytes","caller_supplied_unverified"]}},"required":["documentId","cid","textCid","provenance"]},"currency":{"type":"string"},"decimals":{"type":"integer","minimum":0,"maximum":18},"totals":{"type":"object","properties":{"in":{"type":"string","pattern":"^(0|[1-9][0-9]{0,18})$"},"out":{"type":"string","pattern":"^(0|[1-9][0-9]{0,18})$"}},"required":["in","out"]},"rows":{"type":"array","maxItems":500,"items":{"type":"object","properties":{"index":{"type":"integer","minimum":0,"maximum":499},"sourcePointer":{"type":"string"},"id":{"type":"string"},"date":{"type":"string","format":"date"},"direction":{"enum":["in","out"]},"amountMinor":{"type":"string","pattern":"^(0|[1-9][0-9]{0,18})$"},"party":{"type":"string"},"reference":{"type":"string"},"disposition":{"enum":["matched","unmatched","ambiguous","needs_information"]},"candidateCount":{"type":["integer","null"],"minimum":0},"candidatesTruncated":{"type":"boolean"},"candidates":{"type":"array","maxItems":20,"items":{"type":"object","properties":{"claimId":{"type":"string"},"component":{"type":"object","properties":{"originLedgerId":{"type":"string"},"accountCode":{"type":"integer"}},"required":["originLedgerId","accountCode"]},"partyId":{"type":"string"},"original":{"type":"string","pattern":"^(0|[1-9][0-9]{0,18})$"},"outstanding":{"type":"string","pattern":"^(0|[1-9][0-9]{0,18})$"},"status":{"enum":["open","settled","converted","cancelled"]},"sourceFactId":{"type":"string"}},"required":["claimId","component","partyId","original","outstanding","status","sourceFactId"]}}},"required":["index","sourcePointer","id","date","direction","amountMinor","party","disposition","candidateCount","candidatesTruncated","candidates"]}}},"required":["disposition","missing","source","rows"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","required":["eventId"],"properties":{"eventId":{"type":"integer"}}},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","required":["eventId"],"properties":{"eventId":{"type":"integer"}}},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","properties":{"principalId":{"type":"string","minLength":1,"maxLength":128},"role":{"enum":["owner","member"]}},"required":["principalId","role"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","properties":{"principalId":{"type":"string","minLength":1,"maxLength":128}},"required":["principalId"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","properties":{"messageId":{"type":"string","minLength":1},"direction":{"enum":["outbound"]},"status":{"enum":["sent"]},"to":{"type":"string","minLength":1},"toName":{"type":"string"},"relationship":{"type":"object","properties":{"contractId":{"type":"string"},"agreementId":{"type":"string"},"connectionId":{"type":"string"}}},"topic":{"enum":["support","feature_suggestion","general"]},"subject":{"type":"string"},"body":{"type":"string"},"context":{"type":"object","additionalProperties":{"type":"string"}},"about":{"type":"array","items":{"type":"object","properties":{"cid":{"type":"string"},"kind":{"type":"string"},"title":{"type":"string"},"documentId":{"type":"string"}},"required":["cid","kind"]}},"inReplyTo":{"type":"object","properties":{"messageId":{"type":"string"},"sourceMessageId":{"type":"string"}},"required":["messageId","sourceMessageId"]},"sentAt":{"type":"string","format":"date-time"}},"required":["messageId","direction","status","to","toName","relationship","topic","subject","body","sentAt"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","minLength":1},"revision":{"type":"integer"}},"required":["id","revision"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","minLength":1},"revision":{"type":"integer"}},"required":["id","revision"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","minLength":1},"revision":{"type":"integer"}},"required":["id","revision"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","minLength":1},"revision":{"type":"integer"}},"required":["id","revision"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","properties":{"contactId":{"type":"string","minLength":1},"partyId":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"email":{"type":"string","format":"email","maxLength":254},"role":{"type":"string"}},"required":["contactId","partyId","name","email"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","properties":{"partyId":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"legalName":{"type":"string"},"relatedParty":{"type":"boolean","description":"Current, explicitly supplied relationship to this business; independent of customer/vendor roles."},"url":{"type":"string"},"iri":{"type":"string","minLength":1},"categories":{"type":"array","items":{"enum":["customer","vendor","founder","investor","provider","employee"]}},"archived":{"type":"boolean"},"contacts":{"type":"array","items":{"type":"object"}},"address":{"type":"object"}},"required":["partyId","iri","name","categories","archived","contacts"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","properties":{"partyId":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"legalName":{"type":"string"},"relatedParty":{"type":"boolean","description":"Current, explicitly supplied relationship to this business; independent of customer/vendor roles."},"url":{"type":"string"},"iri":{"type":"string","minLength":1},"categories":{"type":"array","items":{"enum":["customer","vendor","founder","investor","provider","employee"]}},"archived":{"type":"boolean"},"contacts":{"type":"array","items":{"type":"object"}},"address":{"type":"object"}},"required":["partyId","iri","name","categories","archived","contacts"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","properties":{"partyId":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"legalName":{"type":"string"},"relatedParty":{"type":"boolean","description":"Current, explicitly supplied relationship to this business; independent of customer/vendor roles."},"url":{"type":"string"},"iri":{"type":"string","minLength":1},"categories":{"type":"array","items":{"enum":["customer","vendor","founder","investor","provider","employee"]}},"archived":{"type":"boolean"},"contacts":{"type":"array","items":{"type":"object"}},"address":{"type":"object"}},"required":["partyId","iri","name","categories","archived","contacts"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","properties":{"partyId":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"legalName":{"type":"string"},"relatedParty":{"type":"boolean","description":"Current, explicitly supplied relationship to this business; independent of customer/vendor roles."},"url":{"type":"string"},"iri":{"type":"string","minLength":1},"categories":{"type":"array","items":{"enum":["customer","vendor","founder","investor","provider","employee"]}},"archived":{"type":"boolean"},"contacts":{"type":"array","items":{"type":"object"}},"address":{"type":"object"}},"required":["partyId","iri","name","categories","archived","contacts"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","properties":{"partyId":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"legalName":{"type":"string"},"relatedParty":{"type":"boolean","description":"Current, explicitly supplied relationship to this business; independent of customer/vendor roles."},"url":{"type":"string"},"iri":{"type":"string","minLength":1},"categories":{"type":"array","items":{"enum":["customer","vendor","founder","investor","provider","employee"]}},"archived":{"type":"boolean"},"contacts":{"type":"array","items":{"type":"object"}},"address":{"type":"object"}},"required":["partyId","iri","name","categories","archived","contacts"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object"},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object"},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","properties":{"allocationId":{"type":"string","minLength":1},"paymentId":{"type":"string","minLength":1},"remaining":{"type":"string"}},"required":["allocationId","paymentId","remaining"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","required":["payment","grossAmount","netAmount","fee"],"properties":{"payment":{"type":"object"},"grossAmount":{"type":"string"},"netAmount":{"type":"string"},"fee":{"type":"object"}}},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","properties":{"paymentId":{"type":"string","minLength":1},"residual":{"type":"string"},"recoverableClaim":{"type":"object","properties":{"claimId":{"type":"string","minLength":1},"component":{"type":"object","additionalProperties":false,"required":["originLedgerId","accountCode"],"properties":{"originLedgerId":{"type":"string","minLength":1},"accountCode":{"type":"integer"}}}},"required":["claimId","component"]},"unappliedClaim":{"type":"object","properties":{"claimId":{"type":"string","minLength":1},"component":{"type":"object","additionalProperties":false,"required":["originLedgerId","accountCode"],"properties":{"originLedgerId":{"type":"string","minLength":1},"accountCode":{"type":"integer"}}}},"required":["claimId","component"]},"fundingClaims":{"type":"array","items":{"type":"object","properties":{"claimId":{"type":"string","minLength":1},"component":{"type":"object","additionalProperties":false,"required":["originLedgerId","accountCode"],"properties":{"originLedgerId":{"type":"string","minLength":1},"accountCode":{"type":"integer"}}}},"required":["claimId","component"]}}},"required":["paymentId","residual","fundingClaims"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","required":["paymentId","reversalId"],"properties":{"paymentId":{"type":"string","minLength":1},"reversalId":{"type":"string","minLength":1}}},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","required":["paymentId"],"properties":{"paymentId":{"type":"string","minLength":1}}},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","required":["unallocationId","paymentId","amount"],"properties":{"unallocationId":{"type":"string","minLength":1},"paymentId":{"type":"string","minLength":1},"amount":{"type":"string"}}},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","required":["eventId"],"properties":{"eventId":{"type":"integer"}}},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","required":["economic","payment"],"properties":{"economic":{"type":"object"},"payment":{"type":"object"},"processing":{"type":"object"}}},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","required":["eventId"],"properties":{"eventId":{"type":"integer"}}},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","required":["eventId"],"properties":{"eventId":{"type":"integer"}}},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","required":["packageId","jurisdiction","legalEntityScope","framework","frameworkEdition","policyElections","overrides","evidenceDocumentId","evidenceDocumentCid"],"properties":{"packageId":{"type":"string"},"jurisdiction":{"type":"string"},"legalEntityScope":{"type":"string"},"framework":{"type":"string"},"frameworkEdition":{"type":"string"},"policyElections":{"type":"array","items":{"type":"string"}},"overrideSetCid":{"type":"string"},"overrides":{"type":"array","items":{"type":"object","required":["ruleId","destination"],"properties":{"ruleId":{"type":"string"},"destination":{"type":"object","required":["code","label","reportLineIds"],"properties":{"code":{"type":"string"},"label":{"type":"string"},"reportLineIds":{"type":"array","minItems":1,"maxItems":32,"items":{"type":"string"}}}}}}},"evidenceDocumentId":{"type":"string"},"evidenceDocumentCid":{"type":"string"}}},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","properties":{"viewId":{"type":"string"},"token":{"type":"string"},"description":{"type":"string"},"reports":{"type":"array","items":{"type":"string","minLength":1},"uniqueItems":true},"documents":{"type":"array","items":{"type":"string","minLength":1},"uniqueItems":true},"contracts":{"type":"array","items":{"type":"string","minLength":1},"uniqueItems":true},"currency":{"type":"string"},"expiresAt":{"type":"string"},"createdEventId":{"type":"integer"},"revokedEventId":{"type":"integer"}},"required":["viewId","token","description","reports","documents","contracts","currency"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","properties":{"viewId":{"type":"string"},"token":{"type":"string"},"description":{"type":"string"},"reports":{"type":"array","items":{"type":"string","minLength":1},"uniqueItems":true},"documents":{"type":"array","items":{"type":"string","minLength":1},"uniqueItems":true},"contracts":{"type":"array","items":{"type":"string","minLength":1},"uniqueItems":true},"currency":{"type":"string"},"expiresAt":{"type":"string"},"createdEventId":{"type":"integer"},"revokedEventId":{"type":"integer"}},"required":["viewId","token","description","reports","documents","contracts","currency"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","properties":{"cancellationId":{"type":"string","minLength":1},"status":{"enum":["pending","scheduled","revoked","expired","completed"]},"requestedAt":{"type":"string","format":"date-time"},"requestedBy":{"type":"string"},"reason":{"type":"string"},"expiresAt":{"type":"string","format":"date-time"},"effectiveAt":{"type":"string","format":"date-time"},"approvedAt":{"type":"string","format":"date-time"},"approvedBy":{"type":"string"},"closedAt":{"type":"string","format":"date-time"},"closedBy":{"type":"string"}},"required":["cancellationId","status","requestedAt","expiresAt"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","properties":{"cancellationId":{"type":"string","minLength":1},"status":{"enum":["pending","scheduled","revoked","expired","completed"]},"requestedAt":{"type":"string","format":"date-time"},"requestedBy":{"type":"string"},"reason":{"type":"string"},"expiresAt":{"type":"string","format":"date-time"},"effectiveAt":{"type":"string","format":"date-time"},"approvedAt":{"type":"string","format":"date-time"},"approvedBy":{"type":"string"},"closedAt":{"type":"string","format":"date-time"},"closedBy":{"type":"string"}},"required":["cancellationId","status","requestedAt","expiresAt"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","properties":{"taxCodeId":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"role":{"enum":["output","input","reverse_charge","imported_services","non_recoverable"],"default":"output","description":"How the code posts: output credits 2160; input debits recoverable 1170; reverse_charge and imported_services debit 1170 and credit 2165; non_recoverable tax is added to the expense."},"ratePpm":{"type":"integer","minimum":0,"maximum":1000000,"description":"Rate in parts per million: 50000 means 5%, 99750 means 9.975%."},"effectiveFrom":{"type":"string","format":"date","description":"First day the rate applies; omit for no lower bound."},"effectiveUntil":{"type":"string","format":"date","description":"First day the rate no longer applies (exclusive); omit for open-ended."},"regime":{"type":"string","description":"The sales-tax registration regime that seeded this code, if any."},"liabilityAccountCode":{"type":"integer"},"recoverable":{"type":"boolean"},"active":{"type":"boolean"}},"required":["taxCodeId","code","name","role","ratePpm","active"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","properties":{"taxCodeId":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"role":{"enum":["output","input","reverse_charge","imported_services","non_recoverable"],"default":"output","description":"How the code posts: output credits 2160; input debits recoverable 1170; reverse_charge and imported_services debit 1170 and credit 2165; non_recoverable tax is added to the expense."},"ratePpm":{"type":"integer","minimum":0,"maximum":1000000,"description":"Rate in parts per million: 50000 means 5%, 99750 means 9.975%."},"effectiveFrom":{"type":"string","format":"date","description":"First day the rate applies; omit for no lower bound."},"effectiveUntil":{"type":"string","format":"date","description":"First day the rate no longer applies (exclusive); omit for open-ended."},"regime":{"type":"string","description":"The sales-tax registration regime that seeded this code, if any."},"liabilityAccountCode":{"type":"integer"},"recoverable":{"type":"boolean"},"active":{"type":"boolean"}},"required":["taxCodeId","code","name","role","ratePpm","active"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","minLength":1}},"required":["id"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","minLength":1},"documentId":{"type":"string","minLength":1},"cid":{"type":"string","minLength":1}},"required":["id","documentId","cid"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","minLength":1},"documentId":{"type":"string","minLength":1},"cid":{"type":"string","minLength":1}},"required":["id","documentId","cid"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["code","message"],"properties":{"code":{"const":"no_change"},"message":{"type":"string"},"hint":{"type":"string"},"details":{}}}]}}}},"400":{"description":"Invalid envelope, query or domain input; also `missing_rates`, a foreign-currency command whose exchange rates the shared store could not supply (`details.missing_rates: [{ base, quote, date }]`, plus `details.refusal: { code, message }` when the command also refused), answered by stating an evidenced `exchangeRate`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token. Follow the WWW-Authenticate resource_metadata URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"}}}},"402":{"description":"plan_required: the command needs a platform plan this business is not on (members beyond the owner and shared views need Startup), or the command would record more events than Solo's monthly allowance has left. The allowance refusal writes nothing (a retry may keep its idempotency key) and carries `details: { reason, included, used, requested, from, through }` (counts as decimal strings; `from`/`through` the current events period as UTC instants). `reason` `solo_limit`: Solo's allowance; tell the founder the limit and that it resets at `through`, then retry after `through`, or once they upgrade to Startup or accept paid extra events. `reason` `plan_cancelled`: Startup was cancelled, or Solo's extra events were turned off; the extra events so far were billed then, and until the plan ends at `endsAt` the business has only `allowed` events in each billing period (its included events, or up to the end of a started block the cancellation billed), with no further extra events; after that it is on Solo (`after` `solo`, for Startup); retry after `through` (the next period's included events) or after `endsAt`. Tell the founder; they can keep Startup (or the extra events) from the billing page once the extra events billed then are paid (for monthly Startup whose cancellation billed extra events, keeping it takes a new Startup agreement from the end; a first-year YC price cannot carry over, so that plan ends as scheduled), or choose it again once it has ended. Any new paid plan (Startup, extra events, a switch or that new agreement) starts only once every invoice from Economico is paid; until then the billing page says so. `reason` `usage_settled`: Startup or Solo's extra events were kept after a cancel; this period's usage was settled then, so retry after `through`. With `details.closesAt`, the business is set to close then (its owner approved closing it): tell the founder, and do not wait for `endsAt` or suggest keeping or upgrading the plan; the owner can stop the closing at /account/cancel until then. Reads, exports and payment setup stay available, and so does upgrading unless the business is set to close (`closesAt`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Membership revoked, business unavailable for writes, or command credential requirements not met (browser-only commands refuse all OAuth tokens). `demo_business`: the business is a demo (`demo: true` on the business read: fictional, its owner's alone) and the command would reach someone else, send a message (support included, for now), publish it, take a plan or make it look like a real company, or the demo has recorded the 2,000 events it may record; tell the user, who can create their own business to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown route or missing required resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not supported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Allow":{"schema":{"type":"string"}}}},"408":{"description":"Request body transfer timed out (code `upload_timeout`): it took over 30 s, or paused over 5 s between chunks; retry the same request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Domain or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Length required (code `length_required`): a JSON body larger than 256 KiB must send Content-Length.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Payload too large (code `payload_too_large`): the request body exceeds the admitted byte limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"JSON body required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Address rate budget exhausted. Wait for Retry-After seconds before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","pattern":"^[0-9]+$"}}}},"500":{"description":"Internal failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Busy (code `busy`): the business is still receiving other document uploads or serving other large documents, and did not start this request. Retry the same request after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string"}}}}},"parameters":[{"name":"X-Economico-Business","in":"header","required":true,"description":"Explicit business slug for this request; must be approved by the connection and token.","schema":{"type":"string"}}]}},"/v1/commands/{id}":{"get":{"operationId":"commands.get","description":"Retrieve an accepted receipt without executing a command.","parameters":[{"name":"X-Economico-Business","in":"header","required":true,"description":"Explicit business slug for this request; must be approved by the connection and token.","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Canonical result; missing read objects are null. Money is in decimal integer strings.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"null"}]}}}},"400":{"description":"Invalid envelope, query or domain input; also `missing_rates`, a foreign-currency command whose exchange rates the shared store could not supply (`details.missing_rates: [{ base, quote, date }]`, plus `details.refusal: { code, message }` when the command also refused), answered by stating an evidenced `exchangeRate`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token. Follow the WWW-Authenticate resource_metadata URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"}}}},"402":{"description":"plan_required: the command needs a platform plan this business is not on (members beyond the owner and shared views need Startup), or the command would record more events than Solo's monthly allowance has left. The allowance refusal writes nothing (a retry may keep its idempotency key) and carries `details: { reason, included, used, requested, from, through }` (counts as decimal strings; `from`/`through` the current events period as UTC instants). `reason` `solo_limit`: Solo's allowance; tell the founder the limit and that it resets at `through`, then retry after `through`, or once they upgrade to Startup or accept paid extra events. `reason` `plan_cancelled`: Startup was cancelled, or Solo's extra events were turned off; the extra events so far were billed then, and until the plan ends at `endsAt` the business has only `allowed` events in each billing period (its included events, or up to the end of a started block the cancellation billed), with no further extra events; after that it is on Solo (`after` `solo`, for Startup); retry after `through` (the next period's included events) or after `endsAt`. Tell the founder; they can keep Startup (or the extra events) from the billing page once the extra events billed then are paid (for monthly Startup whose cancellation billed extra events, keeping it takes a new Startup agreement from the end; a first-year YC price cannot carry over, so that plan ends as scheduled), or choose it again once it has ended. Any new paid plan (Startup, extra events, a switch or that new agreement) starts only once every invoice from Economico is paid; until then the billing page says so. `reason` `usage_settled`: Startup or Solo's extra events were kept after a cancel; this period's usage was settled then, so retry after `through`. With `details.closesAt`, the business is set to close then (its owner approved closing it): tell the founder, and do not wait for `endsAt` or suggest keeping or upgrading the plan; the owner can stop the closing at /account/cancel until then. Reads, exports and payment setup stay available, and so does upgrading unless the business is set to close (`closesAt`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Membership revoked, business unavailable for writes, or command credential requirements not met (browser-only commands refuse all OAuth tokens). `demo_business`: the business is a demo (`demo: true` on the business read: fictional, its owner's alone) and the command would reach someone else, send a message (support included, for now), publish it, take a plan or make it look like a real company, or the demo has recorded the 2,000 events it may record; tell the user, who can create their own business to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown route or missing required resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not supported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Allow":{"schema":{"type":"string"}}}},"408":{"description":"Request body transfer timed out (code `upload_timeout`): it took over 30 s, or paused over 5 s between chunks; retry the same request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Domain or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Length required (code `length_required`): a JSON body larger than 256 KiB must send Content-Length.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Payload too large (code `payload_too_large`): the request body exceeds the admitted byte limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"JSON body required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Address rate budget exhausted. Wait for Retry-After seconds before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","pattern":"^[0-9]+$"}}}},"500":{"description":"Internal failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Busy (code `busy`): the business is still receiving other document uploads or serving other large documents, and did not start this request. Retry the same request after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string"}}}}}}},"/v1/documents":{"get":{"operationId":"documents.list","description":"Read immutable document metadata and exact bytes. Every row carries label (the founder word: Invoice, Bill, Payment receipt, Charge, Plan, Contract, …) and title; a statement also carries counterpartyId and, when its first effect is money, its headline amount (integer minor units) and currency. Relations rows carry fromLabel, fromTitle, toLabel and toTitle (null when that document is missing). Get requires id and returns contentBase64; a source_document or image also carries size, its exact registered byte count. List supports kind, external_id and label filters with an exclusive document-ID after cursor; label takes a record type's founder word (Invoice, Payment receipt, Bill, Bill payment, Refund, Credit note, Cancellation or Activity statement) and refuses any other word, so filter catalog documents by kind. Relations requires id and pages by the exclusive numeric after_id relation cursor.","parameters":[{"name":"X-Economico-Business","in":"header","required":true,"description":"Explicit business slug for this request; must be approved by the connection and token.","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":500,"default":100}},{"name":"id","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"kind","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"external_id","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"label","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"after","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"after_id","in":"query","required":false,"schema":{"type":"integer","minimum":0}}],"responses":{"200":{"description":"Canonical result; missing read objects are null. Money is in decimal integer strings.","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid envelope, query or domain input; also `missing_rates`, a foreign-currency command whose exchange rates the shared store could not supply (`details.missing_rates: [{ base, quote, date }]`, plus `details.refusal: { code, message }` when the command also refused), answered by stating an evidenced `exchangeRate`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token. Follow the WWW-Authenticate resource_metadata URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"}}}},"402":{"description":"plan_required: the command needs a platform plan this business is not on (members beyond the owner and shared views need Startup), or the command would record more events than Solo's monthly allowance has left. The allowance refusal writes nothing (a retry may keep its idempotency key) and carries `details: { reason, included, used, requested, from, through }` (counts as decimal strings; `from`/`through` the current events period as UTC instants). `reason` `solo_limit`: Solo's allowance; tell the founder the limit and that it resets at `through`, then retry after `through`, or once they upgrade to Startup or accept paid extra events. `reason` `plan_cancelled`: Startup was cancelled, or Solo's extra events were turned off; the extra events so far were billed then, and until the plan ends at `endsAt` the business has only `allowed` events in each billing period (its included events, or up to the end of a started block the cancellation billed), with no further extra events; after that it is on Solo (`after` `solo`, for Startup); retry after `through` (the next period's included events) or after `endsAt`. Tell the founder; they can keep Startup (or the extra events) from the billing page once the extra events billed then are paid (for monthly Startup whose cancellation billed extra events, keeping it takes a new Startup agreement from the end; a first-year YC price cannot carry over, so that plan ends as scheduled), or choose it again once it has ended. Any new paid plan (Startup, extra events, a switch or that new agreement) starts only once every invoice from Economico is paid; until then the billing page says so. `reason` `usage_settled`: Startup or Solo's extra events were kept after a cancel; this period's usage was settled then, so retry after `through`. With `details.closesAt`, the business is set to close then (its owner approved closing it): tell the founder, and do not wait for `endsAt` or suggest keeping or upgrading the plan; the owner can stop the closing at /account/cancel until then. Reads, exports and payment setup stay available, and so does upgrading unless the business is set to close (`closesAt`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Membership revoked, business unavailable for writes, or command credential requirements not met (browser-only commands refuse all OAuth tokens). `demo_business`: the business is a demo (`demo: true` on the business read: fictional, its owner's alone) and the command would reach someone else, send a message (support included, for now), publish it, take a plan or make it look like a real company, or the demo has recorded the 2,000 events it may record; tell the user, who can create their own business to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown route or missing required resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not supported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Allow":{"schema":{"type":"string"}}}},"408":{"description":"Request body transfer timed out (code `upload_timeout`): it took over 30 s, or paused over 5 s between chunks; retry the same request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Domain or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Length required (code `length_required`): a JSON body larger than 256 KiB must send Content-Length.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Payload too large (code `payload_too_large`): the request body exceeds the admitted byte limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"JSON body required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Address rate budget exhausted. Wait for Retry-After seconds before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","pattern":"^[0-9]+$"}}}},"500":{"description":"Internal failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Busy (code `busy`): the business is still receiving other document uploads or serving other large documents, and did not start this request. Retry the same request after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string"}}}}}},"post":{"operationId":"documents.submit","description":"Register an immutable artifact via documents.receive. Same idempotency and receipts as commands.execute; omit name. Native upload uses multipart/form-data with metadata (the JSON envelope without input.contentBase64) and file (exact bytes).","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"input":{"type":"object","properties":{"kind":{"enum":["source_document","activity","template","contract","activity_statement","contract_lifecycle_statement","image"]},"contentBase64":{"type":"string","minLength":1,"maxLength":13981016,"pattern":"^[A-Za-z0-9+/]+={0,2}$","description":"The exact artifact bytes encoded as base64: at most 10485760 bytes for a source_document, 262144 bytes for the structured kinds."},"externalId":{"type":"string","minLength":1,"maxLength":200},"title":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[^\\r\\n]*\\S[^\\r\\n]*$","description":"What the document is called, in the founder's words. Omit to take it from the content."}},"required":["kind","contentBase64"],"additionalProperties":false},"idempotency_key":{"type":"string","minLength":1,"maxLength":256},"effective_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["input","idempotency_key","effective_at"],"additionalProperties":false}},"multipart/form-data":{"schema":{"type":"object","additionalProperties":false,"required":["metadata","file"],"properties":{"metadata":{"type":"string","maxLength":65536,"contentMediaType":"application/json","description":"JSON command envelope, omitting name and input.contentBase64."},"file":{"type":"string","format":"binary","x-max-bytes":10485760,"description":"Exact artifact bytes. Each document kind retains its existing size limit."}}}}}},"responses":{"200":{"description":"Canonical result; missing read objects are null. Money is in decimal integer strings.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["commandId","replayed","result","events"],"properties":{"commandId":{"type":"string"},"replayed":{"type":"boolean"},"imported":{"const":true,"description":"The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."},"result":{"type":"object","properties":{"documentId":{"type":"string","minLength":1},"cid":{"type":"string","minLength":1}},"required":["documentId","cid"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"cid":{"type":"string"}}}}}},{"type":"object","required":["code","message"],"properties":{"code":{"const":"no_change"},"message":{"type":"string"},"hint":{"type":"string"},"details":{}}}]}}}},"400":{"description":"Invalid envelope, query or domain input; also `missing_rates`, a foreign-currency command whose exchange rates the shared store could not supply (`details.missing_rates: [{ base, quote, date }]`, plus `details.refusal: { code, message }` when the command also refused), answered by stating an evidenced `exchangeRate`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token. Follow the WWW-Authenticate resource_metadata URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"}}}},"402":{"description":"plan_required: the command needs a platform plan this business is not on (members beyond the owner and shared views need Startup), or the command would record more events than Solo's monthly allowance has left. The allowance refusal writes nothing (a retry may keep its idempotency key) and carries `details: { reason, included, used, requested, from, through }` (counts as decimal strings; `from`/`through` the current events period as UTC instants). `reason` `solo_limit`: Solo's allowance; tell the founder the limit and that it resets at `through`, then retry after `through`, or once they upgrade to Startup or accept paid extra events. `reason` `plan_cancelled`: Startup was cancelled, or Solo's extra events were turned off; the extra events so far were billed then, and until the plan ends at `endsAt` the business has only `allowed` events in each billing period (its included events, or up to the end of a started block the cancellation billed), with no further extra events; after that it is on Solo (`after` `solo`, for Startup); retry after `through` (the next period's included events) or after `endsAt`. Tell the founder; they can keep Startup (or the extra events) from the billing page once the extra events billed then are paid (for monthly Startup whose cancellation billed extra events, keeping it takes a new Startup agreement from the end; a first-year YC price cannot carry over, so that plan ends as scheduled), or choose it again once it has ended. Any new paid plan (Startup, extra events, a switch or that new agreement) starts only once every invoice from Economico is paid; until then the billing page says so. `reason` `usage_settled`: Startup or Solo's extra events were kept after a cancel; this period's usage was settled then, so retry after `through`. With `details.closesAt`, the business is set to close then (its owner approved closing it): tell the founder, and do not wait for `endsAt` or suggest keeping or upgrading the plan; the owner can stop the closing at /account/cancel until then. Reads, exports and payment setup stay available, and so does upgrading unless the business is set to close (`closesAt`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Membership revoked, business unavailable for writes, or command credential requirements not met (browser-only commands refuse all OAuth tokens). `demo_business`: the business is a demo (`demo: true` on the business read: fictional, its owner's alone) and the command would reach someone else, send a message (support included, for now), publish it, take a plan or make it look like a real company, or the demo has recorded the 2,000 events it may record; tell the user, who can create their own business to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown route or missing required resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not supported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Allow":{"schema":{"type":"string"}}}},"408":{"description":"Request body transfer timed out (code `upload_timeout`): it took over 30 s, or paused over 5 s between chunks; retry the same request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Domain or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Length required (code `length_required`): a multipart upload, or a JSON body larger than 256 KiB, must send Content-Length.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload body or file exceeds the admitted byte limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Use application/json or multipart/form-data.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Address rate budget exhausted. Wait for Retry-After seconds before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","pattern":"^[0-9]+$"}}}},"500":{"description":"Internal failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Busy (code `busy`): the business is still receiving other document uploads or serving other large documents, and did not start this request. Retry the same request after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string"}}}}},"parameters":[{"name":"X-Economico-Business","in":"header","required":true,"description":"Explicit business slug for this request; must be approved by the connection and token.","schema":{"type":"string"}}]}},"/v1/events":{"get":{"operationId":"events.list","description":"Read event history and provenance. Every row carries commandName and the documents the event produced, each with its founder label (Invoice, Bill, Contract, …); a document.related row also carries relatedDocuments, the from and to documents its payload relates, each with id, kind, label and title (null when that document is missing). List is oldest first and pages by an exclusive numeric after cursor; with order desc it is newest first and pages by an exclusive numeric before cursor instead. Get requires id. List accepts footprint_contract_id to select only events with postings attributed to that contract by the ledger footprint, including independent payment allocations and reversals, under events.read authority. A subject_id filter also needs its subject_type. kind_prefix narrows to event kinds in one or more namespaces, comma-separated (party.,party_contact.), which selects the business, document, party and financial-account events that carry no subject. Payload amounts are integer strings. An ingestion.* payload omits the delegation captured at intake (authority) and each upload's tokenHash, as the ingestions read does. No verification sweep is triggered.","parameters":[{"name":"X-Economico-Business","in":"header","required":true,"description":"Explicit business slug for this request; must be approved by the connection and token.","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":500,"default":100}},{"name":"after","in":"query","required":false,"schema":{"type":"integer","minimum":0}},{"name":"before","in":"query","required":false,"schema":{"type":"integer","minimum":1}},{"name":"order","in":"query","required":false,"schema":{"enum":["asc","desc"]}},{"name":"id","in":"query","required":false,"schema":{"type":"integer","minimum":1}},{"name":"subject_type","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"subject_id","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"kind_prefix","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"footprint_contract_id","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Canonical result; missing read objects are null. Money is in decimal integer strings.","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid envelope, query or domain input; also `missing_rates`, a foreign-currency command whose exchange rates the shared store could not supply (`details.missing_rates: [{ base, quote, date }]`, plus `details.refusal: { code, message }` when the command also refused), answered by stating an evidenced `exchangeRate`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token. Follow the WWW-Authenticate resource_metadata URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"}}}},"402":{"description":"plan_required: the command needs a platform plan this business is not on (members beyond the owner and shared views need Startup), or the command would record more events than Solo's monthly allowance has left. The allowance refusal writes nothing (a retry may keep its idempotency key) and carries `details: { reason, included, used, requested, from, through }` (counts as decimal strings; `from`/`through` the current events period as UTC instants). `reason` `solo_limit`: Solo's allowance; tell the founder the limit and that it resets at `through`, then retry after `through`, or once they upgrade to Startup or accept paid extra events. `reason` `plan_cancelled`: Startup was cancelled, or Solo's extra events were turned off; the extra events so far were billed then, and until the plan ends at `endsAt` the business has only `allowed` events in each billing period (its included events, or up to the end of a started block the cancellation billed), with no further extra events; after that it is on Solo (`after` `solo`, for Startup); retry after `through` (the next period's included events) or after `endsAt`. Tell the founder; they can keep Startup (or the extra events) from the billing page once the extra events billed then are paid (for monthly Startup whose cancellation billed extra events, keeping it takes a new Startup agreement from the end; a first-year YC price cannot carry over, so that plan ends as scheduled), or choose it again once it has ended. Any new paid plan (Startup, extra events, a switch or that new agreement) starts only once every invoice from Economico is paid; until then the billing page says so. `reason` `usage_settled`: Startup or Solo's extra events were kept after a cancel; this period's usage was settled then, so retry after `through`. With `details.closesAt`, the business is set to close then (its owner approved closing it): tell the founder, and do not wait for `endsAt` or suggest keeping or upgrading the plan; the owner can stop the closing at /account/cancel until then. Reads, exports and payment setup stay available, and so does upgrading unless the business is set to close (`closesAt`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Membership revoked, business unavailable for writes, or command credential requirements not met (browser-only commands refuse all OAuth tokens). `demo_business`: the business is a demo (`demo: true` on the business read: fictional, its owner's alone) and the command would reach someone else, send a message (support included, for now), publish it, take a plan or make it look like a real company, or the demo has recorded the 2,000 events it may record; tell the user, who can create their own business to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown route or missing required resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not supported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Allow":{"schema":{"type":"string"}}}},"408":{"description":"Request body transfer timed out (code `upload_timeout`): it took over 30 s, or paused over 5 s between chunks; retry the same request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Domain or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Length required (code `length_required`): a JSON body larger than 256 KiB must send Content-Length.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Payload too large (code `payload_too_large`): the request body exceeds the admitted byte limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"JSON body required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Address rate budget exhausted. Wait for Retry-After seconds before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","pattern":"^[0-9]+$"}}}},"500":{"description":"Internal failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Busy (code `busy`): the business is still receiving other document uploads or serving other large documents, and did not start this request. Retry the same request after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string"}}}}}}},"/v1/events/head":{"get":{"operationId":"events.head","description":"Read event history and provenance. Every row carries commandName and the documents the event produced, each with its founder label (Invoice, Bill, Contract, …); a document.related row also carries relatedDocuments, the from and to documents its payload relates, each with id, kind, label and title (null when that document is missing). List is oldest first and pages by an exclusive numeric after cursor; with order desc it is newest first and pages by an exclusive numeric before cursor instead. Get requires id. List accepts footprint_contract_id to select only events with postings attributed to that contract by the ledger footprint, including independent payment allocations and reversals, under events.read authority. A subject_id filter also needs its subject_type. kind_prefix narrows to event kinds in one or more namespaces, comma-separated (party.,party_contact.), which selects the business, document, party and financial-account events that carry no subject. Payload amounts are integer strings. An ingestion.* payload omits the delegation captured at intake (authority) and each upload's tokenHash, as the ingestions read does. No verification sweep is triggered.","parameters":[{"name":"X-Economico-Business","in":"header","required":true,"description":"Explicit business slug for this request; must be approved by the connection and token.","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":500,"default":100}},{"name":"after","in":"query","required":false,"schema":{"type":"integer","minimum":0}},{"name":"before","in":"query","required":false,"schema":{"type":"integer","minimum":1}},{"name":"order","in":"query","required":false,"schema":{"enum":["asc","desc"]}},{"name":"id","in":"query","required":false,"schema":{"type":"integer","minimum":1}},{"name":"subject_type","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"subject_id","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"kind_prefix","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"footprint_contract_id","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Canonical result; missing read objects are null. Money is in decimal integer strings.","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid envelope, query or domain input; also `missing_rates`, a foreign-currency command whose exchange rates the shared store could not supply (`details.missing_rates: [{ base, quote, date }]`, plus `details.refusal: { code, message }` when the command also refused), answered by stating an evidenced `exchangeRate`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token. Follow the WWW-Authenticate resource_metadata URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"}}}},"402":{"description":"plan_required: the command needs a platform plan this business is not on (members beyond the owner and shared views need Startup), or the command would record more events than Solo's monthly allowance has left. The allowance refusal writes nothing (a retry may keep its idempotency key) and carries `details: { reason, included, used, requested, from, through }` (counts as decimal strings; `from`/`through` the current events period as UTC instants). `reason` `solo_limit`: Solo's allowance; tell the founder the limit and that it resets at `through`, then retry after `through`, or once they upgrade to Startup or accept paid extra events. `reason` `plan_cancelled`: Startup was cancelled, or Solo's extra events were turned off; the extra events so far were billed then, and until the plan ends at `endsAt` the business has only `allowed` events in each billing period (its included events, or up to the end of a started block the cancellation billed), with no further extra events; after that it is on Solo (`after` `solo`, for Startup); retry after `through` (the next period's included events) or after `endsAt`. Tell the founder; they can keep Startup (or the extra events) from the billing page once the extra events billed then are paid (for monthly Startup whose cancellation billed extra events, keeping it takes a new Startup agreement from the end; a first-year YC price cannot carry over, so that plan ends as scheduled), or choose it again once it has ended. Any new paid plan (Startup, extra events, a switch or that new agreement) starts only once every invoice from Economico is paid; until then the billing page says so. `reason` `usage_settled`: Startup or Solo's extra events were kept after a cancel; this period's usage was settled then, so retry after `through`. With `details.closesAt`, the business is set to close then (its owner approved closing it): tell the founder, and do not wait for `endsAt` or suggest keeping or upgrading the plan; the owner can stop the closing at /account/cancel until then. Reads, exports and payment setup stay available, and so does upgrading unless the business is set to close (`closesAt`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Membership revoked, business unavailable for writes, or command credential requirements not met (browser-only commands refuse all OAuth tokens). `demo_business`: the business is a demo (`demo: true` on the business read: fictional, its owner's alone) and the command would reach someone else, send a message (support included, for now), publish it, take a plan or make it look like a real company, or the demo has recorded the 2,000 events it may record; tell the user, who can create their own business to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown route or missing required resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not supported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Allow":{"schema":{"type":"string"}}}},"408":{"description":"Request body transfer timed out (code `upload_timeout`): it took over 30 s, or paused over 5 s between chunks; retry the same request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Domain or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Length required (code `length_required`): a JSON body larger than 256 KiB must send Content-Length.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Payload too large (code `payload_too_large`): the request body exceeds the admitted byte limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"JSON body required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Address rate budget exhausted. Wait for Retry-After seconds before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","pattern":"^[0-9]+$"}}}},"500":{"description":"Internal failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Busy (code `busy`): the business is still receiving other document uploads or serving other large documents, and did not start this request. Retry the same request after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string"}}}}}}},"/v1/subjects":{"get":{"operationId":"subjects.types","description":"Read derived lifecycle state. Call types first: it lists every subject type with its statuses and the filters its list accepts. List and get require type; get requires id. List supports status, the type's declared filters (contract_id, activity_key, document_id, record_type, plan) and an exclusive subject-ID after cursor; a filter the type does not declare is refused. An activity_occurrence's state carries recordType (invoice, payment_receipt, bill, bill_payment, refund, credit_note, cancellation or activity_statement), and record_type filters by it. Types carry a founder label and note; activity, template, contract and activity_occurrence rows carry label and title (an occurrence also counterpartyId and, when its headline effect is money, amount, currency and decimals). An invoice, bill or receipt is titled by its occurrence key; a recording that moved nothing (an acceptance, a delivery) by the name of the activity it ran; correlate on state.occurrenceKey, never on title.","parameters":[{"name":"X-Economico-Business","in":"header","required":true,"description":"Explicit business slug for this request; must be approved by the connection and token.","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":500,"default":100}},{"name":"type","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"id","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"status","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"after","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"contract_id","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"activity_key","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"document_id","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"record_type","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"plan","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Canonical result; missing read objects are null. Money is in decimal integer strings.","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid envelope, query or domain input; also `missing_rates`, a foreign-currency command whose exchange rates the shared store could not supply (`details.missing_rates: [{ base, quote, date }]`, plus `details.refusal: { code, message }` when the command also refused), answered by stating an evidenced `exchangeRate`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token. Follow the WWW-Authenticate resource_metadata URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"}}}},"402":{"description":"plan_required: the command needs a platform plan this business is not on (members beyond the owner and shared views need Startup), or the command would record more events than Solo's monthly allowance has left. The allowance refusal writes nothing (a retry may keep its idempotency key) and carries `details: { reason, included, used, requested, from, through }` (counts as decimal strings; `from`/`through` the current events period as UTC instants). `reason` `solo_limit`: Solo's allowance; tell the founder the limit and that it resets at `through`, then retry after `through`, or once they upgrade to Startup or accept paid extra events. `reason` `plan_cancelled`: Startup was cancelled, or Solo's extra events were turned off; the extra events so far were billed then, and until the plan ends at `endsAt` the business has only `allowed` events in each billing period (its included events, or up to the end of a started block the cancellation billed), with no further extra events; after that it is on Solo (`after` `solo`, for Startup); retry after `through` (the next period's included events) or after `endsAt`. Tell the founder; they can keep Startup (or the extra events) from the billing page once the extra events billed then are paid (for monthly Startup whose cancellation billed extra events, keeping it takes a new Startup agreement from the end; a first-year YC price cannot carry over, so that plan ends as scheduled), or choose it again once it has ended. Any new paid plan (Startup, extra events, a switch or that new agreement) starts only once every invoice from Economico is paid; until then the billing page says so. `reason` `usage_settled`: Startup or Solo's extra events were kept after a cancel; this period's usage was settled then, so retry after `through`. With `details.closesAt`, the business is set to close then (its owner approved closing it): tell the founder, and do not wait for `endsAt` or suggest keeping or upgrading the plan; the owner can stop the closing at /account/cancel until then. Reads, exports and payment setup stay available, and so does upgrading unless the business is set to close (`closesAt`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Membership revoked, business unavailable for writes, or command credential requirements not met (browser-only commands refuse all OAuth tokens). `demo_business`: the business is a demo (`demo: true` on the business read: fictional, its owner's alone) and the command would reach someone else, send a message (support included, for now), publish it, take a plan or make it look like a real company, or the demo has recorded the 2,000 events it may record; tell the user, who can create their own business to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown route or missing required resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not supported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Allow":{"schema":{"type":"string"}}}},"408":{"description":"Request body transfer timed out (code `upload_timeout`): it took over 30 s, or paused over 5 s between chunks; retry the same request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Domain or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Length required (code `length_required`): a JSON body larger than 256 KiB must send Content-Length.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Payload too large (code `payload_too_large`): the request body exceeds the admitted byte limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"JSON body required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Address rate budget exhausted. Wait for Retry-After seconds before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","pattern":"^[0-9]+$"}}}},"500":{"description":"Internal failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Busy (code `busy`): the business is still receiving other document uploads or serving other large documents, and did not start this request. Retry the same request after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string"}}}}}}},"/v1/ledgers":{"get":{"operationId":"ledgers.list","description":"Read native-unit ledger metadata, balances and posting statements. Get, balances and statement require ledger_id. Balances returns one ledger's per-(account, sub-key) debits, credits and balance in its own unit — the balance read for usage meters, prepaid capacity and share classes as well as currency ledgers; an optional as_of (a YYYY-MM-DD date or a UTC instant, exclusive) counts only postings effective before it, sub-keys intact. Statement pages postings by the exclusive numeric after_id cursor and can be narrowed to one account_code and, with it, one sub_key (the statement's own subKey string). List pages by the exclusive string ledger-ID after cursor. Currencies names each currency the business's GAAP ledgers hold real postings in, once, and in ledgers the ledger that holds it now (the open one, else the most recently closed; a functional-currency change or an incorporation succeeds a currency's ledger). A business starts with its selected functional-currency ledger (USD when omitted); other canonical currency ledgers open when a contract first binds them. Amounts remain exact strings and are never summed across units. Transaction requires occurrence_id (an invoice, bill or payment record) and returns every posting of every event that touched its claims (the record itself, the payments, credits and corrections against it, with each correction's reversal), in effective order, each with the record it came from, plus otherClaims: other invoices or bills those events also settled. Footprint takes exactly one of party_id, contract_id or occurrence_id and returns every posting of every recording on that party's contracts, on that contract, or in that record's transaction, in effective order, each attributed to its record (occurrenceId, occurrenceKey), activity, pattern and party the way the activity_balances report attributes it, with its ledger's unit and decimals; plus contracts, the contracts it spans. Null when the party, contract or record does not exist.","parameters":[{"name":"X-Economico-Business","in":"header","required":true,"description":"Explicit business slug for this request; must be approved by the connection and token.","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":500,"default":100}},{"name":"ledger_id","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"occurrence_id","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"party_id","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"contract_id","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"account_code","in":"query","required":false,"schema":{"type":"integer","minimum":0}},{"name":"event_id","in":"query","required":false,"schema":{"type":"integer","minimum":1}},{"name":"sub_key","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"after","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"after_id","in":"query","required":false,"schema":{"type":"integer","minimum":0}},{"name":"as_of","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Canonical result; missing read objects are null. Money is in decimal integer strings.","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid envelope, query or domain input; also `missing_rates`, a foreign-currency command whose exchange rates the shared store could not supply (`details.missing_rates: [{ base, quote, date }]`, plus `details.refusal: { code, message }` when the command also refused), answered by stating an evidenced `exchangeRate`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token. Follow the WWW-Authenticate resource_metadata URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"}}}},"402":{"description":"plan_required: the command needs a platform plan this business is not on (members beyond the owner and shared views need Startup), or the command would record more events than Solo's monthly allowance has left. The allowance refusal writes nothing (a retry may keep its idempotency key) and carries `details: { reason, included, used, requested, from, through }` (counts as decimal strings; `from`/`through` the current events period as UTC instants). `reason` `solo_limit`: Solo's allowance; tell the founder the limit and that it resets at `through`, then retry after `through`, or once they upgrade to Startup or accept paid extra events. `reason` `plan_cancelled`: Startup was cancelled, or Solo's extra events were turned off; the extra events so far were billed then, and until the plan ends at `endsAt` the business has only `allowed` events in each billing period (its included events, or up to the end of a started block the cancellation billed), with no further extra events; after that it is on Solo (`after` `solo`, for Startup); retry after `through` (the next period's included events) or after `endsAt`. Tell the founder; they can keep Startup (or the extra events) from the billing page once the extra events billed then are paid (for monthly Startup whose cancellation billed extra events, keeping it takes a new Startup agreement from the end; a first-year YC price cannot carry over, so that plan ends as scheduled), or choose it again once it has ended. Any new paid plan (Startup, extra events, a switch or that new agreement) starts only once every invoice from Economico is paid; until then the billing page says so. `reason` `usage_settled`: Startup or Solo's extra events were kept after a cancel; this period's usage was settled then, so retry after `through`. With `details.closesAt`, the business is set to close then (its owner approved closing it): tell the founder, and do not wait for `endsAt` or suggest keeping or upgrading the plan; the owner can stop the closing at /account/cancel until then. Reads, exports and payment setup stay available, and so does upgrading unless the business is set to close (`closesAt`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Membership revoked, business unavailable for writes, or command credential requirements not met (browser-only commands refuse all OAuth tokens). `demo_business`: the business is a demo (`demo: true` on the business read: fictional, its owner's alone) and the command would reach someone else, send a message (support included, for now), publish it, take a plan or make it look like a real company, or the demo has recorded the 2,000 events it may record; tell the user, who can create their own business to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown route or missing required resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not supported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Allow":{"schema":{"type":"string"}}}},"408":{"description":"Request body transfer timed out (code `upload_timeout`): it took over 30 s, or paused over 5 s between chunks; retry the same request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Domain or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Length required (code `length_required`): a JSON body larger than 256 KiB must send Content-Length.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Payload too large (code `payload_too_large`): the request body exceeds the admitted byte limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"JSON body required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Address rate budget exhausted. Wait for Retry-After seconds before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","pattern":"^[0-9]+$"}}}},"500":{"description":"Internal failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Busy (code `busy`): the business is still receiving other document uploads or serving other large documents, and did not start this request. Retry the same request after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string"}}}}}}},"/v1/parties":{"get":{"operationId":"parties.list","description":"Read counterparties and contacts. Get requires id. List uses an exclusive party-ID after cursor and includes archived records; category narrows it to parties playing that role (customer, vendor, founder, investor, provider, employee), and vendor also matches providers. Categories returns the relationship categories in use.","parameters":[{"name":"X-Economico-Business","in":"header","required":true,"description":"Explicit business slug for this request; must be approved by the connection and token.","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":500,"default":100}},{"name":"id","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"after","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"category","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Canonical result; missing read objects are null. Money is in decimal integer strings.","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid envelope, query or domain input; also `missing_rates`, a foreign-currency command whose exchange rates the shared store could not supply (`details.missing_rates: [{ base, quote, date }]`, plus `details.refusal: { code, message }` when the command also refused), answered by stating an evidenced `exchangeRate`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token. Follow the WWW-Authenticate resource_metadata URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"}}}},"402":{"description":"plan_required: the command needs a platform plan this business is not on (members beyond the owner and shared views need Startup), or the command would record more events than Solo's monthly allowance has left. The allowance refusal writes nothing (a retry may keep its idempotency key) and carries `details: { reason, included, used, requested, from, through }` (counts as decimal strings; `from`/`through` the current events period as UTC instants). `reason` `solo_limit`: Solo's allowance; tell the founder the limit and that it resets at `through`, then retry after `through`, or once they upgrade to Startup or accept paid extra events. `reason` `plan_cancelled`: Startup was cancelled, or Solo's extra events were turned off; the extra events so far were billed then, and until the plan ends at `endsAt` the business has only `allowed` events in each billing period (its included events, or up to the end of a started block the cancellation billed), with no further extra events; after that it is on Solo (`after` `solo`, for Startup); retry after `through` (the next period's included events) or after `endsAt`. Tell the founder; they can keep Startup (or the extra events) from the billing page once the extra events billed then are paid (for monthly Startup whose cancellation billed extra events, keeping it takes a new Startup agreement from the end; a first-year YC price cannot carry over, so that plan ends as scheduled), or choose it again once it has ended. Any new paid plan (Startup, extra events, a switch or that new agreement) starts only once every invoice from Economico is paid; until then the billing page says so. `reason` `usage_settled`: Startup or Solo's extra events were kept after a cancel; this period's usage was settled then, so retry after `through`. With `details.closesAt`, the business is set to close then (its owner approved closing it): tell the founder, and do not wait for `endsAt` or suggest keeping or upgrading the plan; the owner can stop the closing at /account/cancel until then. Reads, exports and payment setup stay available, and so does upgrading unless the business is set to close (`closesAt`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Membership revoked, business unavailable for writes, or command credential requirements not met (browser-only commands refuse all OAuth tokens). `demo_business`: the business is a demo (`demo: true` on the business read: fictional, its owner's alone) and the command would reach someone else, send a message (support included, for now), publish it, take a plan or make it look like a real company, or the demo has recorded the 2,000 events it may record; tell the user, who can create their own business to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown route or missing required resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not supported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Allow":{"schema":{"type":"string"}}}},"408":{"description":"Request body transfer timed out (code `upload_timeout`): it took over 30 s, or paused over 5 s between chunks; retry the same request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Domain or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Length required (code `length_required`): a JSON body larger than 256 KiB must send Content-Length.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Payload too large (code `payload_too_large`): the request body exceeds the admitted byte limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"JSON body required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Address rate budget exhausted. Wait for Retry-After seconds before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","pattern":"^[0-9]+$"}}}},"500":{"description":"Internal failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Busy (code `busy`): the business is still receiving other document uploads or serving other large documents, and did not start this request. Retry the same request after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string"}}}}}}},"/v1/parties/categories":{"get":{"operationId":"parties.categories","description":"Read counterparties and contacts. Get requires id. List uses an exclusive party-ID after cursor and includes archived records; category narrows it to parties playing that role (customer, vendor, founder, investor, provider, employee), and vendor also matches providers. Categories returns the relationship categories in use.","parameters":[{"name":"X-Economico-Business","in":"header","required":true,"description":"Explicit business slug for this request; must be approved by the connection and token.","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":500,"default":100}},{"name":"id","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"after","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"category","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Canonical result; missing read objects are null. Money is in decimal integer strings.","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid envelope, query or domain input; also `missing_rates`, a foreign-currency command whose exchange rates the shared store could not supply (`details.missing_rates: [{ base, quote, date }]`, plus `details.refusal: { code, message }` when the command also refused), answered by stating an evidenced `exchangeRate`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token. Follow the WWW-Authenticate resource_metadata URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"}}}},"402":{"description":"plan_required: the command needs a platform plan this business is not on (members beyond the owner and shared views need Startup), or the command would record more events than Solo's monthly allowance has left. The allowance refusal writes nothing (a retry may keep its idempotency key) and carries `details: { reason, included, used, requested, from, through }` (counts as decimal strings; `from`/`through` the current events period as UTC instants). `reason` `solo_limit`: Solo's allowance; tell the founder the limit and that it resets at `through`, then retry after `through`, or once they upgrade to Startup or accept paid extra events. `reason` `plan_cancelled`: Startup was cancelled, or Solo's extra events were turned off; the extra events so far were billed then, and until the plan ends at `endsAt` the business has only `allowed` events in each billing period (its included events, or up to the end of a started block the cancellation billed), with no further extra events; after that it is on Solo (`after` `solo`, for Startup); retry after `through` (the next period's included events) or after `endsAt`. Tell the founder; they can keep Startup (or the extra events) from the billing page once the extra events billed then are paid (for monthly Startup whose cancellation billed extra events, keeping it takes a new Startup agreement from the end; a first-year YC price cannot carry over, so that plan ends as scheduled), or choose it again once it has ended. Any new paid plan (Startup, extra events, a switch or that new agreement) starts only once every invoice from Economico is paid; until then the billing page says so. `reason` `usage_settled`: Startup or Solo's extra events were kept after a cancel; this period's usage was settled then, so retry after `through`. With `details.closesAt`, the business is set to close then (its owner approved closing it): tell the founder, and do not wait for `endsAt` or suggest keeping or upgrading the plan; the owner can stop the closing at /account/cancel until then. Reads, exports and payment setup stay available, and so does upgrading unless the business is set to close (`closesAt`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Membership revoked, business unavailable for writes, or command credential requirements not met (browser-only commands refuse all OAuth tokens). `demo_business`: the business is a demo (`demo: true` on the business read: fictional, its owner's alone) and the command would reach someone else, send a message (support included, for now), publish it, take a plan or make it look like a real company, or the demo has recorded the 2,000 events it may record; tell the user, who can create their own business to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown route or missing required resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not supported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Allow":{"schema":{"type":"string"}}}},"408":{"description":"Request body transfer timed out (code `upload_timeout`): it took over 30 s, or paused over 5 s between chunks; retry the same request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Domain or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Length required (code `length_required`): a JSON body larger than 256 KiB must send Content-Length.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Payload too large (code `payload_too_large`): the request body exceeds the admitted byte limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"JSON body required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Address rate budget exhausted. Wait for Retry-After seconds before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","pattern":"^[0-9]+$"}}}},"500":{"description":"Internal failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Busy (code `busy`): the business is still receiving other document uploads or serving other large documents, and did not start this request. Retry the same request after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string"}}}}}}},"/v1/accounts":{"get":{"operationId":"accounts.list","description":"Read registered financial accounts, their currency, provider, brand color, logo and default status. Get, activity and overview require id. Activity returns the account's recent recorded payment effects and provider fees with their exact total. Overview returns what the account's page shows: the GL account it is held on (2135 keyed to the owner for a person's own card, whose balance is what the company owes that person across all their own accounts) and its balance; the latest movements (limit caps them, newest first; count is the total), each signed by the account's normal balance with its counterparty, running balance, counter accounts and, through a settled bill, the expense accounts it landed on; totals by month, counter account, expense account and counterparty; and its payment endpoints with full payto/CAIP-10 URIs and rails. List uses an exclusive financial-account-ID after cursor and includes archived accounts.","parameters":[{"name":"X-Economico-Business","in":"header","required":true,"description":"Explicit business slug for this request; must be approved by the connection and token.","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":500,"default":100}},{"name":"after","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Canonical result; missing read objects are null. Money is in decimal integer strings.","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid envelope, query or domain input; also `missing_rates`, a foreign-currency command whose exchange rates the shared store could not supply (`details.missing_rates: [{ base, quote, date }]`, plus `details.refusal: { code, message }` when the command also refused), answered by stating an evidenced `exchangeRate`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token. Follow the WWW-Authenticate resource_metadata URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"}}}},"402":{"description":"plan_required: the command needs a platform plan this business is not on (members beyond the owner and shared views need Startup), or the command would record more events than Solo's monthly allowance has left. The allowance refusal writes nothing (a retry may keep its idempotency key) and carries `details: { reason, included, used, requested, from, through }` (counts as decimal strings; `from`/`through` the current events period as UTC instants). `reason` `solo_limit`: Solo's allowance; tell the founder the limit and that it resets at `through`, then retry after `through`, or once they upgrade to Startup or accept paid extra events. `reason` `plan_cancelled`: Startup was cancelled, or Solo's extra events were turned off; the extra events so far were billed then, and until the plan ends at `endsAt` the business has only `allowed` events in each billing period (its included events, or up to the end of a started block the cancellation billed), with no further extra events; after that it is on Solo (`after` `solo`, for Startup); retry after `through` (the next period's included events) or after `endsAt`. Tell the founder; they can keep Startup (or the extra events) from the billing page once the extra events billed then are paid (for monthly Startup whose cancellation billed extra events, keeping it takes a new Startup agreement from the end; a first-year YC price cannot carry over, so that plan ends as scheduled), or choose it again once it has ended. Any new paid plan (Startup, extra events, a switch or that new agreement) starts only once every invoice from Economico is paid; until then the billing page says so. `reason` `usage_settled`: Startup or Solo's extra events were kept after a cancel; this period's usage was settled then, so retry after `through`. With `details.closesAt`, the business is set to close then (its owner approved closing it): tell the founder, and do not wait for `endsAt` or suggest keeping or upgrading the plan; the owner can stop the closing at /account/cancel until then. Reads, exports and payment setup stay available, and so does upgrading unless the business is set to close (`closesAt`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Membership revoked, business unavailable for writes, or command credential requirements not met (browser-only commands refuse all OAuth tokens). `demo_business`: the business is a demo (`demo: true` on the business read: fictional, its owner's alone) and the command would reach someone else, send a message (support included, for now), publish it, take a plan or make it look like a real company, or the demo has recorded the 2,000 events it may record; tell the user, who can create their own business to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown route or missing required resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not supported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Allow":{"schema":{"type":"string"}}}},"408":{"description":"Request body transfer timed out (code `upload_timeout`): it took over 30 s, or paused over 5 s between chunks; retry the same request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Domain or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Length required (code `length_required`): a JSON body larger than 256 KiB must send Content-Length.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Payload too large (code `payload_too_large`): the request body exceeds the admitted byte limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"JSON body required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Address rate budget exhausted. Wait for Retry-After seconds before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","pattern":"^[0-9]+$"}}}},"500":{"description":"Internal failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Busy (code `busy`): the business is still receiving other document uploads or serving other large documents, and did not start this request. Retry the same request after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string"}}}}}}},"/v1/payment_routes/quote":{"get":{"operationId":"payment_routes.quote","description":"Quote eligible outbound or inbound payment routes from active payment endpoints and provider-contract fee schedules. Pure read; does not move money. Amount and costs are exact minor-unit strings.","parameters":[{"name":"X-Economico-Business","in":"header","required":true,"description":"Explicit business slug for this request; must be approved by the connection and token.","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":500,"default":100}},{"name":"direction","in":"query","required":true,"schema":{"enum":["in","out"]}},{"name":"amount_minor","in":"query","required":true,"schema":{"type":"string","pattern":"^[1-9][0-9]*$"}},{"name":"party_id","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"assets","in":"query","required":false,"schema":{"type":"array","items":{"type":"string","minLength":1}}},{"name":"rails","in":"query","required":false,"schema":{"type":"array","items":{"type":"string","minLength":1}}},{"name":"max_eta_seconds","in":"query","required":false,"schema":{"type":"integer","minimum":0}},{"name":"optimize","in":"query","required":false,"schema":{"enum":["cheapest","fastest"]}}],"responses":{"200":{"description":"Canonical result; missing read objects are null. Money is in decimal integer strings.","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid envelope, query or domain input; also `missing_rates`, a foreign-currency command whose exchange rates the shared store could not supply (`details.missing_rates: [{ base, quote, date }]`, plus `details.refusal: { code, message }` when the command also refused), answered by stating an evidenced `exchangeRate`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token. Follow the WWW-Authenticate resource_metadata URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"}}}},"402":{"description":"plan_required: the command needs a platform plan this business is not on (members beyond the owner and shared views need Startup), or the command would record more events than Solo's monthly allowance has left. The allowance refusal writes nothing (a retry may keep its idempotency key) and carries `details: { reason, included, used, requested, from, through }` (counts as decimal strings; `from`/`through` the current events period as UTC instants). `reason` `solo_limit`: Solo's allowance; tell the founder the limit and that it resets at `through`, then retry after `through`, or once they upgrade to Startup or accept paid extra events. `reason` `plan_cancelled`: Startup was cancelled, or Solo's extra events were turned off; the extra events so far were billed then, and until the plan ends at `endsAt` the business has only `allowed` events in each billing period (its included events, or up to the end of a started block the cancellation billed), with no further extra events; after that it is on Solo (`after` `solo`, for Startup); retry after `through` (the next period's included events) or after `endsAt`. Tell the founder; they can keep Startup (or the extra events) from the billing page once the extra events billed then are paid (for monthly Startup whose cancellation billed extra events, keeping it takes a new Startup agreement from the end; a first-year YC price cannot carry over, so that plan ends as scheduled), or choose it again once it has ended. Any new paid plan (Startup, extra events, a switch or that new agreement) starts only once every invoice from Economico is paid; until then the billing page says so. `reason` `usage_settled`: Startup or Solo's extra events were kept after a cancel; this period's usage was settled then, so retry after `through`. With `details.closesAt`, the business is set to close then (its owner approved closing it): tell the founder, and do not wait for `endsAt` or suggest keeping or upgrading the plan; the owner can stop the closing at /account/cancel until then. Reads, exports and payment setup stay available, and so does upgrading unless the business is set to close (`closesAt`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Membership revoked, business unavailable for writes, or command credential requirements not met (browser-only commands refuse all OAuth tokens). `demo_business`: the business is a demo (`demo: true` on the business read: fictional, its owner's alone) and the command would reach someone else, send a message (support included, for now), publish it, take a plan or make it look like a real company, or the demo has recorded the 2,000 events it may record; tell the user, who can create their own business to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown route or missing required resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not supported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Allow":{"schema":{"type":"string"}}}},"408":{"description":"Request body transfer timed out (code `upload_timeout`): it took over 30 s, or paused over 5 s between chunks; retry the same request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Domain or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Length required (code `length_required`): a JSON body larger than 256 KiB must send Content-Length.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Payload too large (code `payload_too_large`): the request body exceeds the admitted byte limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"JSON body required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Address rate budget exhausted. Wait for Retry-After seconds before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","pattern":"^[0-9]+$"}}}},"500":{"description":"Internal failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Busy (code `busy`): the business is still receiving other document uploads or serving other large documents, and did not start this request. Retry the same request after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string"}}}}}}},"/v1/categories":{"get":{"operationId":"categories.list","description":"Read revenue categories. Get requires id. List pages by exclusive category-ID cursor.","parameters":[{"name":"X-Economico-Business","in":"header","required":true,"description":"Explicit business slug for this request; must be approved by the connection and token.","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":500,"default":100}},{"name":"id","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"after","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Canonical result; missing read objects are null. Money is in decimal integer strings.","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid envelope, query or domain input; also `missing_rates`, a foreign-currency command whose exchange rates the shared store could not supply (`details.missing_rates: [{ base, quote, date }]`, plus `details.refusal: { code, message }` when the command also refused), answered by stating an evidenced `exchangeRate`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token. Follow the WWW-Authenticate resource_metadata URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"}}}},"402":{"description":"plan_required: the command needs a platform plan this business is not on (members beyond the owner and shared views need Startup), or the command would record more events than Solo's monthly allowance has left. The allowance refusal writes nothing (a retry may keep its idempotency key) and carries `details: { reason, included, used, requested, from, through }` (counts as decimal strings; `from`/`through` the current events period as UTC instants). `reason` `solo_limit`: Solo's allowance; tell the founder the limit and that it resets at `through`, then retry after `through`, or once they upgrade to Startup or accept paid extra events. `reason` `plan_cancelled`: Startup was cancelled, or Solo's extra events were turned off; the extra events so far were billed then, and until the plan ends at `endsAt` the business has only `allowed` events in each billing period (its included events, or up to the end of a started block the cancellation billed), with no further extra events; after that it is on Solo (`after` `solo`, for Startup); retry after `through` (the next period's included events) or after `endsAt`. Tell the founder; they can keep Startup (or the extra events) from the billing page once the extra events billed then are paid (for monthly Startup whose cancellation billed extra events, keeping it takes a new Startup agreement from the end; a first-year YC price cannot carry over, so that plan ends as scheduled), or choose it again once it has ended. Any new paid plan (Startup, extra events, a switch or that new agreement) starts only once every invoice from Economico is paid; until then the billing page says so. `reason` `usage_settled`: Startup or Solo's extra events were kept after a cancel; this period's usage was settled then, so retry after `through`. With `details.closesAt`, the business is set to close then (its owner approved closing it): tell the founder, and do not wait for `endsAt` or suggest keeping or upgrading the plan; the owner can stop the closing at /account/cancel until then. Reads, exports and payment setup stay available, and so does upgrading unless the business is set to close (`closesAt`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Membership revoked, business unavailable for writes, or command credential requirements not met (browser-only commands refuse all OAuth tokens). `demo_business`: the business is a demo (`demo: true` on the business read: fictional, its owner's alone) and the command would reach someone else, send a message (support included, for now), publish it, take a plan or make it look like a real company, or the demo has recorded the 2,000 events it may record; tell the user, who can create their own business to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown route or missing required resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not supported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Allow":{"schema":{"type":"string"}}}},"408":{"description":"Request body transfer timed out (code `upload_timeout`): it took over 30 s, or paused over 5 s between chunks; retry the same request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Domain or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Length required (code `length_required`): a JSON body larger than 256 KiB must send Content-Length.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Payload too large (code `payload_too_large`): the request body exceeds the admitted byte limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"JSON body required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Address rate budget exhausted. Wait for Retry-After seconds before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","pattern":"^[0-9]+$"}}}},"500":{"description":"Internal failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Busy (code `busy`): the business is still receiving other document uploads or serving other large documents, and did not start this request. Retry the same request after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string"}}}}}}},"/v1/tax_codes":{"get":{"operationId":"tax_codes.list","description":"Read configured tax codes: role (output, input, reverse_charge, imported_services, non_recoverable), rate in parts per million, effective period, the liability it credits and the sales-tax regime that seeded it. Get requires id. List includes inactive codes and pages by exclusive tax-code-ID cursor.","parameters":[{"name":"X-Economico-Business","in":"header","required":true,"description":"Explicit business slug for this request; must be approved by the connection and token.","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":500,"default":100}},{"name":"id","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"after","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Canonical result; missing read objects are null. Money is in decimal integer strings.","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid envelope, query or domain input; also `missing_rates`, a foreign-currency command whose exchange rates the shared store could not supply (`details.missing_rates: [{ base, quote, date }]`, plus `details.refusal: { code, message }` when the command also refused), answered by stating an evidenced `exchangeRate`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token. Follow the WWW-Authenticate resource_metadata URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"}}}},"402":{"description":"plan_required: the command needs a platform plan this business is not on (members beyond the owner and shared views need Startup), or the command would record more events than Solo's monthly allowance has left. The allowance refusal writes nothing (a retry may keep its idempotency key) and carries `details: { reason, included, used, requested, from, through }` (counts as decimal strings; `from`/`through` the current events period as UTC instants). `reason` `solo_limit`: Solo's allowance; tell the founder the limit and that it resets at `through`, then retry after `through`, or once they upgrade to Startup or accept paid extra events. `reason` `plan_cancelled`: Startup was cancelled, or Solo's extra events were turned off; the extra events so far were billed then, and until the plan ends at `endsAt` the business has only `allowed` events in each billing period (its included events, or up to the end of a started block the cancellation billed), with no further extra events; after that it is on Solo (`after` `solo`, for Startup); retry after `through` (the next period's included events) or after `endsAt`. Tell the founder; they can keep Startup (or the extra events) from the billing page once the extra events billed then are paid (for monthly Startup whose cancellation billed extra events, keeping it takes a new Startup agreement from the end; a first-year YC price cannot carry over, so that plan ends as scheduled), or choose it again once it has ended. Any new paid plan (Startup, extra events, a switch or that new agreement) starts only once every invoice from Economico is paid; until then the billing page says so. `reason` `usage_settled`: Startup or Solo's extra events were kept after a cancel; this period's usage was settled then, so retry after `through`. With `details.closesAt`, the business is set to close then (its owner approved closing it): tell the founder, and do not wait for `endsAt` or suggest keeping or upgrading the plan; the owner can stop the closing at /account/cancel until then. Reads, exports and payment setup stay available, and so does upgrading unless the business is set to close (`closesAt`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Membership revoked, business unavailable for writes, or command credential requirements not met (browser-only commands refuse all OAuth tokens). `demo_business`: the business is a demo (`demo: true` on the business read: fictional, its owner's alone) and the command would reach someone else, send a message (support included, for now), publish it, take a plan or make it look like a real company, or the demo has recorded the 2,000 events it may record; tell the user, who can create their own business to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown route or missing required resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not supported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Allow":{"schema":{"type":"string"}}}},"408":{"description":"Request body transfer timed out (code `upload_timeout`): it took over 30 s, or paused over 5 s between chunks; retry the same request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Domain or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Length required (code `length_required`): a JSON body larger than 256 KiB must send Content-Length.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Payload too large (code `payload_too_large`): the request body exceeds the admitted byte limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"JSON body required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Address rate budget exhausted. Wait for Retry-After seconds before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","pattern":"^[0-9]+$"}}}},"500":{"description":"Internal failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Busy (code `busy`): the business is still receiving other document uploads or serving other large documents, and did not start this request. Retry the same request after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string"}}}}}}},"/v1/shared_views":{"get":{"operationId":"shared_views.list","description":"List this business's capability links (shared views): every share ever created, revoked ones included with their revoking event, oldest first, with the token each resolves at /e/{slug}/share/{token} on this server. Pages by the exclusive view-ID after cursor. Create and revoke through the shared_views.create and shared_views.revoke commands.","parameters":[{"name":"X-Economico-Business","in":"header","required":true,"description":"Explicit business slug for this request; must be approved by the connection and token.","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":500,"default":100}},{"name":"after","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Canonical result; missing read objects are null. Money is in decimal integer strings.","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid envelope, query or domain input; also `missing_rates`, a foreign-currency command whose exchange rates the shared store could not supply (`details.missing_rates: [{ base, quote, date }]`, plus `details.refusal: { code, message }` when the command also refused), answered by stating an evidenced `exchangeRate`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token. Follow the WWW-Authenticate resource_metadata URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"}}}},"402":{"description":"plan_required: the command needs a platform plan this business is not on (members beyond the owner and shared views need Startup), or the command would record more events than Solo's monthly allowance has left. The allowance refusal writes nothing (a retry may keep its idempotency key) and carries `details: { reason, included, used, requested, from, through }` (counts as decimal strings; `from`/`through` the current events period as UTC instants). `reason` `solo_limit`: Solo's allowance; tell the founder the limit and that it resets at `through`, then retry after `through`, or once they upgrade to Startup or accept paid extra events. `reason` `plan_cancelled`: Startup was cancelled, or Solo's extra events were turned off; the extra events so far were billed then, and until the plan ends at `endsAt` the business has only `allowed` events in each billing period (its included events, or up to the end of a started block the cancellation billed), with no further extra events; after that it is on Solo (`after` `solo`, for Startup); retry after `through` (the next period's included events) or after `endsAt`. Tell the founder; they can keep Startup (or the extra events) from the billing page once the extra events billed then are paid (for monthly Startup whose cancellation billed extra events, keeping it takes a new Startup agreement from the end; a first-year YC price cannot carry over, so that plan ends as scheduled), or choose it again once it has ended. Any new paid plan (Startup, extra events, a switch or that new agreement) starts only once every invoice from Economico is paid; until then the billing page says so. `reason` `usage_settled`: Startup or Solo's extra events were kept after a cancel; this period's usage was settled then, so retry after `through`. With `details.closesAt`, the business is set to close then (its owner approved closing it): tell the founder, and do not wait for `endsAt` or suggest keeping or upgrading the plan; the owner can stop the closing at /account/cancel until then. Reads, exports and payment setup stay available, and so does upgrading unless the business is set to close (`closesAt`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Membership revoked, business unavailable for writes, or command credential requirements not met (browser-only commands refuse all OAuth tokens). `demo_business`: the business is a demo (`demo: true` on the business read: fictional, its owner's alone) and the command would reach someone else, send a message (support included, for now), publish it, take a plan or make it look like a real company, or the demo has recorded the 2,000 events it may record; tell the user, who can create their own business to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown route or missing required resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not supported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Allow":{"schema":{"type":"string"}}}},"408":{"description":"Request body transfer timed out (code `upload_timeout`): it took over 30 s, or paused over 5 s between chunks; retry the same request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Domain or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Length required (code `length_required`): a JSON body larger than 256 KiB must send Content-Length.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Payload too large (code `payload_too_large`): the request body exceeds the admitted byte limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"JSON body required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Address rate budget exhausted. Wait for Retry-After seconds before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","pattern":"^[0-9]+$"}}}},"500":{"description":"Internal failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Busy (code `busy`): the business is still receiving other document uploads or serving other large documents, and did not start this request. Retry the same request after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string"}}}}}}},"/v1/business":{"get":{"operationId":"business.get","description":"Read the authenticated business's profile (including its fiscal year end and fiscal-year settings, and its sales-tax registrations in force), preview a fiscal-year change (effective_at, year_end MM-DD): its transition period and the fiscal years that follow; list the sales-tax regimes the business can register for in its country, with each regime's registration-number format and the tax codes registering would seed (sales_tax_regimes); read the platform plan (plan): free (the Solo plan), team (the Startup plan) or system, and, on team, the active Startup contract's id (read its terms through subjects to find a trial end or billing date); or read its Economico plan's event meter (meter): the monthly billing period running now, the billable events recorded in it so far and the allowance, and, while a cancelled plan's usage is closed, allowed: the most events the period permits (its included events, or the end of a started block the cancel billed; the period's total, not what is left); or read the event ledger (event_totals): the business's billable events per UTC day, newest first, a page at a time (after: the cursor); or read its imports (imports): the one-time import allowance (null in Economico's own books), the events imported so far, what remains, and the cutoff: a change dated before it (when the business was created on Economico) is recorded as an import, free of monthly events, while the allowance lasts. Returns null for get if no profile has been recorded. Does not change the business.","parameters":[{"name":"X-Economico-Business","in":"header","required":true,"description":"Explicit business slug for this request; must be approved by the connection and token.","schema":{"type":"string"}}],"responses":{"200":{"description":"Canonical result; missing read objects are null. Money is in decimal integer strings.","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid envelope, query or domain input; also `missing_rates`, a foreign-currency command whose exchange rates the shared store could not supply (`details.missing_rates: [{ base, quote, date }]`, plus `details.refusal: { code, message }` when the command also refused), answered by stating an evidenced `exchangeRate`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token. Follow the WWW-Authenticate resource_metadata URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"}}}},"402":{"description":"plan_required: the command needs a platform plan this business is not on (members beyond the owner and shared views need Startup), or the command would record more events than Solo's monthly allowance has left. The allowance refusal writes nothing (a retry may keep its idempotency key) and carries `details: { reason, included, used, requested, from, through }` (counts as decimal strings; `from`/`through` the current events period as UTC instants). `reason` `solo_limit`: Solo's allowance; tell the founder the limit and that it resets at `through`, then retry after `through`, or once they upgrade to Startup or accept paid extra events. `reason` `plan_cancelled`: Startup was cancelled, or Solo's extra events were turned off; the extra events so far were billed then, and until the plan ends at `endsAt` the business has only `allowed` events in each billing period (its included events, or up to the end of a started block the cancellation billed), with no further extra events; after that it is on Solo (`after` `solo`, for Startup); retry after `through` (the next period's included events) or after `endsAt`. Tell the founder; they can keep Startup (or the extra events) from the billing page once the extra events billed then are paid (for monthly Startup whose cancellation billed extra events, keeping it takes a new Startup agreement from the end; a first-year YC price cannot carry over, so that plan ends as scheduled), or choose it again once it has ended. Any new paid plan (Startup, extra events, a switch or that new agreement) starts only once every invoice from Economico is paid; until then the billing page says so. `reason` `usage_settled`: Startup or Solo's extra events were kept after a cancel; this period's usage was settled then, so retry after `through`. With `details.closesAt`, the business is set to close then (its owner approved closing it): tell the founder, and do not wait for `endsAt` or suggest keeping or upgrading the plan; the owner can stop the closing at /account/cancel until then. Reads, exports and payment setup stay available, and so does upgrading unless the business is set to close (`closesAt`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Membership revoked, business unavailable for writes, or command credential requirements not met (browser-only commands refuse all OAuth tokens). `demo_business`: the business is a demo (`demo: true` on the business read: fictional, its owner's alone) and the command would reach someone else, send a message (support included, for now), publish it, take a plan or make it look like a real company, or the demo has recorded the 2,000 events it may record; tell the user, who can create their own business to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown route or missing required resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not supported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Allow":{"schema":{"type":"string"}}}},"408":{"description":"Request body transfer timed out (code `upload_timeout`): it took over 30 s, or paused over 5 s between chunks; retry the same request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Domain or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Length required (code `length_required`): a JSON body larger than 256 KiB must send Content-Length.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Payload too large (code `payload_too_large`): the request body exceeds the admitted byte limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"JSON body required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Address rate budget exhausted. Wait for Retry-After seconds before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","pattern":"^[0-9]+$"}}}},"500":{"description":"Internal failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Busy (code `busy`): the business is still receiving other document uploads or serving other large documents, and did not start this request. Retry the same request after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string"}}}}}}},"/v1/business/fiscal-year-change-preview":{"get":{"operationId":"business.fiscal_year_change_preview","description":"Read the authenticated business's profile (including its fiscal year end and fiscal-year settings, and its sales-tax registrations in force), preview a fiscal-year change (effective_at, year_end MM-DD): its transition period and the fiscal years that follow; list the sales-tax regimes the business can register for in its country, with each regime's registration-number format and the tax codes registering would seed (sales_tax_regimes); read the platform plan (plan): free (the Solo plan), team (the Startup plan) or system, and, on team, the active Startup contract's id (read its terms through subjects to find a trial end or billing date); or read its Economico plan's event meter (meter): the monthly billing period running now, the billable events recorded in it so far and the allowance, and, while a cancelled plan's usage is closed, allowed: the most events the period permits (its included events, or the end of a started block the cancel billed; the period's total, not what is left); or read the event ledger (event_totals): the business's billable events per UTC day, newest first, a page at a time (after: the cursor); or read its imports (imports): the one-time import allowance (null in Economico's own books), the events imported so far, what remains, and the cutoff: a change dated before it (when the business was created on Economico) is recorded as an import, free of monthly events, while the allowance lasts. Returns null for get if no profile has been recorded. Does not change the business.","parameters":[{"name":"X-Economico-Business","in":"header","required":true,"description":"Explicit business slug for this request; must be approved by the connection and token.","schema":{"type":"string"}},{"name":"effective_at","in":"query","required":true,"schema":{"type":"string","minLength":1}},{"name":"year_end","in":"query","required":true,"schema":{"type":"string","pattern":"^(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$","description":"Proposed fiscal year end as MM-DD, e.g. 06-30."}}],"responses":{"200":{"description":"Canonical result; missing read objects are null. Money is in decimal integer strings.","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid envelope, query or domain input; also `missing_rates`, a foreign-currency command whose exchange rates the shared store could not supply (`details.missing_rates: [{ base, quote, date }]`, plus `details.refusal: { code, message }` when the command also refused), answered by stating an evidenced `exchangeRate`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token. Follow the WWW-Authenticate resource_metadata URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"}}}},"402":{"description":"plan_required: the command needs a platform plan this business is not on (members beyond the owner and shared views need Startup), or the command would record more events than Solo's monthly allowance has left. The allowance refusal writes nothing (a retry may keep its idempotency key) and carries `details: { reason, included, used, requested, from, through }` (counts as decimal strings; `from`/`through` the current events period as UTC instants). `reason` `solo_limit`: Solo's allowance; tell the founder the limit and that it resets at `through`, then retry after `through`, or once they upgrade to Startup or accept paid extra events. `reason` `plan_cancelled`: Startup was cancelled, or Solo's extra events were turned off; the extra events so far were billed then, and until the plan ends at `endsAt` the business has only `allowed` events in each billing period (its included events, or up to the end of a started block the cancellation billed), with no further extra events; after that it is on Solo (`after` `solo`, for Startup); retry after `through` (the next period's included events) or after `endsAt`. Tell the founder; they can keep Startup (or the extra events) from the billing page once the extra events billed then are paid (for monthly Startup whose cancellation billed extra events, keeping it takes a new Startup agreement from the end; a first-year YC price cannot carry over, so that plan ends as scheduled), or choose it again once it has ended. Any new paid plan (Startup, extra events, a switch or that new agreement) starts only once every invoice from Economico is paid; until then the billing page says so. `reason` `usage_settled`: Startup or Solo's extra events were kept after a cancel; this period's usage was settled then, so retry after `through`. With `details.closesAt`, the business is set to close then (its owner approved closing it): tell the founder, and do not wait for `endsAt` or suggest keeping or upgrading the plan; the owner can stop the closing at /account/cancel until then. Reads, exports and payment setup stay available, and so does upgrading unless the business is set to close (`closesAt`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Membership revoked, business unavailable for writes, or command credential requirements not met (browser-only commands refuse all OAuth tokens). `demo_business`: the business is a demo (`demo: true` on the business read: fictional, its owner's alone) and the command would reach someone else, send a message (support included, for now), publish it, take a plan or make it look like a real company, or the demo has recorded the 2,000 events it may record; tell the user, who can create their own business to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown route or missing required resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not supported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Allow":{"schema":{"type":"string"}}}},"408":{"description":"Request body transfer timed out (code `upload_timeout`): it took over 30 s, or paused over 5 s between chunks; retry the same request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Domain or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Length required (code `length_required`): a JSON body larger than 256 KiB must send Content-Length.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Payload too large (code `payload_too_large`): the request body exceeds the admitted byte limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"JSON body required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Address rate budget exhausted. Wait for Retry-After seconds before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","pattern":"^[0-9]+$"}}}},"500":{"description":"Internal failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Busy (code `busy`): the business is still receiving other document uploads or serving other large documents, and did not start this request. Retry the same request after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string"}}}}}}},"/v1/business/sales-tax-regimes":{"get":{"operationId":"business.sales_tax_regimes","description":"Read the authenticated business's profile (including its fiscal year end and fiscal-year settings, and its sales-tax registrations in force), preview a fiscal-year change (effective_at, year_end MM-DD): its transition period and the fiscal years that follow; list the sales-tax regimes the business can register for in its country, with each regime's registration-number format and the tax codes registering would seed (sales_tax_regimes); read the platform plan (plan): free (the Solo plan), team (the Startup plan) or system, and, on team, the active Startup contract's id (read its terms through subjects to find a trial end or billing date); or read its Economico plan's event meter (meter): the monthly billing period running now, the billable events recorded in it so far and the allowance, and, while a cancelled plan's usage is closed, allowed: the most events the period permits (its included events, or the end of a started block the cancel billed; the period's total, not what is left); or read the event ledger (event_totals): the business's billable events per UTC day, newest first, a page at a time (after: the cursor); or read its imports (imports): the one-time import allowance (null in Economico's own books), the events imported so far, what remains, and the cutoff: a change dated before it (when the business was created on Economico) is recorded as an import, free of monthly events, while the allowance lasts. Returns null for get if no profile has been recorded. Does not change the business.","parameters":[{"name":"X-Economico-Business","in":"header","required":true,"description":"Explicit business slug for this request; must be approved by the connection and token.","schema":{"type":"string"}}],"responses":{"200":{"description":"Canonical result; missing read objects are null. Money is in decimal integer strings.","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid envelope, query or domain input; also `missing_rates`, a foreign-currency command whose exchange rates the shared store could not supply (`details.missing_rates: [{ base, quote, date }]`, plus `details.refusal: { code, message }` when the command also refused), answered by stating an evidenced `exchangeRate`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token. Follow the WWW-Authenticate resource_metadata URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"}}}},"402":{"description":"plan_required: the command needs a platform plan this business is not on (members beyond the owner and shared views need Startup), or the command would record more events than Solo's monthly allowance has left. The allowance refusal writes nothing (a retry may keep its idempotency key) and carries `details: { reason, included, used, requested, from, through }` (counts as decimal strings; `from`/`through` the current events period as UTC instants). `reason` `solo_limit`: Solo's allowance; tell the founder the limit and that it resets at `through`, then retry after `through`, or once they upgrade to Startup or accept paid extra events. `reason` `plan_cancelled`: Startup was cancelled, or Solo's extra events were turned off; the extra events so far were billed then, and until the plan ends at `endsAt` the business has only `allowed` events in each billing period (its included events, or up to the end of a started block the cancellation billed), with no further extra events; after that it is on Solo (`after` `solo`, for Startup); retry after `through` (the next period's included events) or after `endsAt`. Tell the founder; they can keep Startup (or the extra events) from the billing page once the extra events billed then are paid (for monthly Startup whose cancellation billed extra events, keeping it takes a new Startup agreement from the end; a first-year YC price cannot carry over, so that plan ends as scheduled), or choose it again once it has ended. Any new paid plan (Startup, extra events, a switch or that new agreement) starts only once every invoice from Economico is paid; until then the billing page says so. `reason` `usage_settled`: Startup or Solo's extra events were kept after a cancel; this period's usage was settled then, so retry after `through`. With `details.closesAt`, the business is set to close then (its owner approved closing it): tell the founder, and do not wait for `endsAt` or suggest keeping or upgrading the plan; the owner can stop the closing at /account/cancel until then. Reads, exports and payment setup stay available, and so does upgrading unless the business is set to close (`closesAt`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Membership revoked, business unavailable for writes, or command credential requirements not met (browser-only commands refuse all OAuth tokens). `demo_business`: the business is a demo (`demo: true` on the business read: fictional, its owner's alone) and the command would reach someone else, send a message (support included, for now), publish it, take a plan or make it look like a real company, or the demo has recorded the 2,000 events it may record; tell the user, who can create their own business to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown route or missing required resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not supported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Allow":{"schema":{"type":"string"}}}},"408":{"description":"Request body transfer timed out (code `upload_timeout`): it took over 30 s, or paused over 5 s between chunks; retry the same request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Domain or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Length required (code `length_required`): a JSON body larger than 256 KiB must send Content-Length.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Payload too large (code `payload_too_large`): the request body exceeds the admitted byte limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"JSON body required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Address rate budget exhausted. Wait for Retry-After seconds before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","pattern":"^[0-9]+$"}}}},"500":{"description":"Internal failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Busy (code `busy`): the business is still receiving other document uploads or serving other large documents, and did not start this request. Retry the same request after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string"}}}}}}},"/v1/business/plan":{"get":{"operationId":"business.plan","description":"Read the authenticated business's profile (including its fiscal year end and fiscal-year settings, and its sales-tax registrations in force), preview a fiscal-year change (effective_at, year_end MM-DD): its transition period and the fiscal years that follow; list the sales-tax regimes the business can register for in its country, with each regime's registration-number format and the tax codes registering would seed (sales_tax_regimes); read the platform plan (plan): free (the Solo plan), team (the Startup plan) or system, and, on team, the active Startup contract's id (read its terms through subjects to find a trial end or billing date); or read its Economico plan's event meter (meter): the monthly billing period running now, the billable events recorded in it so far and the allowance, and, while a cancelled plan's usage is closed, allowed: the most events the period permits (its included events, or the end of a started block the cancel billed; the period's total, not what is left); or read the event ledger (event_totals): the business's billable events per UTC day, newest first, a page at a time (after: the cursor); or read its imports (imports): the one-time import allowance (null in Economico's own books), the events imported so far, what remains, and the cutoff: a change dated before it (when the business was created on Economico) is recorded as an import, free of monthly events, while the allowance lasts. Returns null for get if no profile has been recorded. Does not change the business.","parameters":[{"name":"X-Economico-Business","in":"header","required":true,"description":"Explicit business slug for this request; must be approved by the connection and token.","schema":{"type":"string"}}],"responses":{"200":{"description":"Canonical result; missing read objects are null. Money is in decimal integer strings.","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid envelope, query or domain input; also `missing_rates`, a foreign-currency command whose exchange rates the shared store could not supply (`details.missing_rates: [{ base, quote, date }]`, plus `details.refusal: { code, message }` when the command also refused), answered by stating an evidenced `exchangeRate`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token. Follow the WWW-Authenticate resource_metadata URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"}}}},"402":{"description":"plan_required: the command needs a platform plan this business is not on (members beyond the owner and shared views need Startup), or the command would record more events than Solo's monthly allowance has left. The allowance refusal writes nothing (a retry may keep its idempotency key) and carries `details: { reason, included, used, requested, from, through }` (counts as decimal strings; `from`/`through` the current events period as UTC instants). `reason` `solo_limit`: Solo's allowance; tell the founder the limit and that it resets at `through`, then retry after `through`, or once they upgrade to Startup or accept paid extra events. `reason` `plan_cancelled`: Startup was cancelled, or Solo's extra events were turned off; the extra events so far were billed then, and until the plan ends at `endsAt` the business has only `allowed` events in each billing period (its included events, or up to the end of a started block the cancellation billed), with no further extra events; after that it is on Solo (`after` `solo`, for Startup); retry after `through` (the next period's included events) or after `endsAt`. Tell the founder; they can keep Startup (or the extra events) from the billing page once the extra events billed then are paid (for monthly Startup whose cancellation billed extra events, keeping it takes a new Startup agreement from the end; a first-year YC price cannot carry over, so that plan ends as scheduled), or choose it again once it has ended. Any new paid plan (Startup, extra events, a switch or that new agreement) starts only once every invoice from Economico is paid; until then the billing page says so. `reason` `usage_settled`: Startup or Solo's extra events were kept after a cancel; this period's usage was settled then, so retry after `through`. With `details.closesAt`, the business is set to close then (its owner approved closing it): tell the founder, and do not wait for `endsAt` or suggest keeping or upgrading the plan; the owner can stop the closing at /account/cancel until then. Reads, exports and payment setup stay available, and so does upgrading unless the business is set to close (`closesAt`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Membership revoked, business unavailable for writes, or command credential requirements not met (browser-only commands refuse all OAuth tokens). `demo_business`: the business is a demo (`demo: true` on the business read: fictional, its owner's alone) and the command would reach someone else, send a message (support included, for now), publish it, take a plan or make it look like a real company, or the demo has recorded the 2,000 events it may record; tell the user, who can create their own business to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown route or missing required resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not supported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Allow":{"schema":{"type":"string"}}}},"408":{"description":"Request body transfer timed out (code `upload_timeout`): it took over 30 s, or paused over 5 s between chunks; retry the same request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Domain or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Length required (code `length_required`): a JSON body larger than 256 KiB must send Content-Length.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Payload too large (code `payload_too_large`): the request body exceeds the admitted byte limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"JSON body required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Address rate budget exhausted. Wait for Retry-After seconds before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","pattern":"^[0-9]+$"}}}},"500":{"description":"Internal failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Busy (code `busy`): the business is still receiving other document uploads or serving other large documents, and did not start this request. Retry the same request after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string"}}}}}}},"/v1/business/meter":{"get":{"operationId":"business.meter","description":"Read the authenticated business's profile (including its fiscal year end and fiscal-year settings, and its sales-tax registrations in force), preview a fiscal-year change (effective_at, year_end MM-DD): its transition period and the fiscal years that follow; list the sales-tax regimes the business can register for in its country, with each regime's registration-number format and the tax codes registering would seed (sales_tax_regimes); read the platform plan (plan): free (the Solo plan), team (the Startup plan) or system, and, on team, the active Startup contract's id (read its terms through subjects to find a trial end or billing date); or read its Economico plan's event meter (meter): the monthly billing period running now, the billable events recorded in it so far and the allowance, and, while a cancelled plan's usage is closed, allowed: the most events the period permits (its included events, or the end of a started block the cancel billed; the period's total, not what is left); or read the event ledger (event_totals): the business's billable events per UTC day, newest first, a page at a time (after: the cursor); or read its imports (imports): the one-time import allowance (null in Economico's own books), the events imported so far, what remains, and the cutoff: a change dated before it (when the business was created on Economico) is recorded as an import, free of monthly events, while the allowance lasts. Returns null for get if no profile has been recorded. Does not change the business.","parameters":[{"name":"X-Economico-Business","in":"header","required":true,"description":"Explicit business slug for this request; must be approved by the connection and token.","schema":{"type":"string"}}],"responses":{"200":{"description":"Canonical result; missing read objects are null. Money is in decimal integer strings.","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid envelope, query or domain input; also `missing_rates`, a foreign-currency command whose exchange rates the shared store could not supply (`details.missing_rates: [{ base, quote, date }]`, plus `details.refusal: { code, message }` when the command also refused), answered by stating an evidenced `exchangeRate`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token. Follow the WWW-Authenticate resource_metadata URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"}}}},"402":{"description":"plan_required: the command needs a platform plan this business is not on (members beyond the owner and shared views need Startup), or the command would record more events than Solo's monthly allowance has left. The allowance refusal writes nothing (a retry may keep its idempotency key) and carries `details: { reason, included, used, requested, from, through }` (counts as decimal strings; `from`/`through` the current events period as UTC instants). `reason` `solo_limit`: Solo's allowance; tell the founder the limit and that it resets at `through`, then retry after `through`, or once they upgrade to Startup or accept paid extra events. `reason` `plan_cancelled`: Startup was cancelled, or Solo's extra events were turned off; the extra events so far were billed then, and until the plan ends at `endsAt` the business has only `allowed` events in each billing period (its included events, or up to the end of a started block the cancellation billed), with no further extra events; after that it is on Solo (`after` `solo`, for Startup); retry after `through` (the next period's included events) or after `endsAt`. Tell the founder; they can keep Startup (or the extra events) from the billing page once the extra events billed then are paid (for monthly Startup whose cancellation billed extra events, keeping it takes a new Startup agreement from the end; a first-year YC price cannot carry over, so that plan ends as scheduled), or choose it again once it has ended. Any new paid plan (Startup, extra events, a switch or that new agreement) starts only once every invoice from Economico is paid; until then the billing page says so. `reason` `usage_settled`: Startup or Solo's extra events were kept after a cancel; this period's usage was settled then, so retry after `through`. With `details.closesAt`, the business is set to close then (its owner approved closing it): tell the founder, and do not wait for `endsAt` or suggest keeping or upgrading the plan; the owner can stop the closing at /account/cancel until then. Reads, exports and payment setup stay available, and so does upgrading unless the business is set to close (`closesAt`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Membership revoked, business unavailable for writes, or command credential requirements not met (browser-only commands refuse all OAuth tokens). `demo_business`: the business is a demo (`demo: true` on the business read: fictional, its owner's alone) and the command would reach someone else, send a message (support included, for now), publish it, take a plan or make it look like a real company, or the demo has recorded the 2,000 events it may record; tell the user, who can create their own business to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown route or missing required resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not supported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Allow":{"schema":{"type":"string"}}}},"408":{"description":"Request body transfer timed out (code `upload_timeout`): it took over 30 s, or paused over 5 s between chunks; retry the same request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Domain or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Length required (code `length_required`): a JSON body larger than 256 KiB must send Content-Length.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Payload too large (code `payload_too_large`): the request body exceeds the admitted byte limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"JSON body required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Address rate budget exhausted. Wait for Retry-After seconds before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","pattern":"^[0-9]+$"}}}},"500":{"description":"Internal failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Busy (code `busy`): the business is still receiving other document uploads or serving other large documents, and did not start this request. Retry the same request after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string"}}}}}}},"/v1/business/event-totals":{"get":{"operationId":"business.event_totals","description":"Read the authenticated business's profile (including its fiscal year end and fiscal-year settings, and its sales-tax registrations in force), preview a fiscal-year change (effective_at, year_end MM-DD): its transition period and the fiscal years that follow; list the sales-tax regimes the business can register for in its country, with each regime's registration-number format and the tax codes registering would seed (sales_tax_regimes); read the platform plan (plan): free (the Solo plan), team (the Startup plan) or system, and, on team, the active Startup contract's id (read its terms through subjects to find a trial end or billing date); or read its Economico plan's event meter (meter): the monthly billing period running now, the billable events recorded in it so far and the allowance, and, while a cancelled plan's usage is closed, allowed: the most events the period permits (its included events, or the end of a started block the cancel billed; the period's total, not what is left); or read the event ledger (event_totals): the business's billable events per UTC day, newest first, a page at a time (after: the cursor); or read its imports (imports): the one-time import allowance (null in Economico's own books), the events imported so far, what remains, and the cutoff: a change dated before it (when the business was created on Economico) is recorded as an import, free of monthly events, while the allowance lasts. Returns null for get if no profile has been recorded. Does not change the business.","parameters":[{"name":"X-Economico-Business","in":"header","required":true,"description":"Explicit business slug for this request; must be approved by the connection and token.","schema":{"type":"string"}}],"responses":{"200":{"description":"Canonical result; missing read objects are null. Money is in decimal integer strings.","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid envelope, query or domain input; also `missing_rates`, a foreign-currency command whose exchange rates the shared store could not supply (`details.missing_rates: [{ base, quote, date }]`, plus `details.refusal: { code, message }` when the command also refused), answered by stating an evidenced `exchangeRate`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token. Follow the WWW-Authenticate resource_metadata URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"}}}},"402":{"description":"plan_required: the command needs a platform plan this business is not on (members beyond the owner and shared views need Startup), or the command would record more events than Solo's monthly allowance has left. The allowance refusal writes nothing (a retry may keep its idempotency key) and carries `details: { reason, included, used, requested, from, through }` (counts as decimal strings; `from`/`through` the current events period as UTC instants). `reason` `solo_limit`: Solo's allowance; tell the founder the limit and that it resets at `through`, then retry after `through`, or once they upgrade to Startup or accept paid extra events. `reason` `plan_cancelled`: Startup was cancelled, or Solo's extra events were turned off; the extra events so far were billed then, and until the plan ends at `endsAt` the business has only `allowed` events in each billing period (its included events, or up to the end of a started block the cancellation billed), with no further extra events; after that it is on Solo (`after` `solo`, for Startup); retry after `through` (the next period's included events) or after `endsAt`. Tell the founder; they can keep Startup (or the extra events) from the billing page once the extra events billed then are paid (for monthly Startup whose cancellation billed extra events, keeping it takes a new Startup agreement from the end; a first-year YC price cannot carry over, so that plan ends as scheduled), or choose it again once it has ended. Any new paid plan (Startup, extra events, a switch or that new agreement) starts only once every invoice from Economico is paid; until then the billing page says so. `reason` `usage_settled`: Startup or Solo's extra events were kept after a cancel; this period's usage was settled then, so retry after `through`. With `details.closesAt`, the business is set to close then (its owner approved closing it): tell the founder, and do not wait for `endsAt` or suggest keeping or upgrading the plan; the owner can stop the closing at /account/cancel until then. Reads, exports and payment setup stay available, and so does upgrading unless the business is set to close (`closesAt`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Membership revoked, business unavailable for writes, or command credential requirements not met (browser-only commands refuse all OAuth tokens). `demo_business`: the business is a demo (`demo: true` on the business read: fictional, its owner's alone) and the command would reach someone else, send a message (support included, for now), publish it, take a plan or make it look like a real company, or the demo has recorded the 2,000 events it may record; tell the user, who can create their own business to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown route or missing required resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not supported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Allow":{"schema":{"type":"string"}}}},"408":{"description":"Request body transfer timed out (code `upload_timeout`): it took over 30 s, or paused over 5 s between chunks; retry the same request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Domain or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Length required (code `length_required`): a JSON body larger than 256 KiB must send Content-Length.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Payload too large (code `payload_too_large`): the request body exceeds the admitted byte limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"JSON body required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Address rate budget exhausted. Wait for Retry-After seconds before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","pattern":"^[0-9]+$"}}}},"500":{"description":"Internal failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Busy (code `busy`): the business is still receiving other document uploads or serving other large documents, and did not start this request. Retry the same request after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string"}}}}}}},"/v1/business/imports":{"get":{"operationId":"business.imports","description":"Read the authenticated business's profile (including its fiscal year end and fiscal-year settings, and its sales-tax registrations in force), preview a fiscal-year change (effective_at, year_end MM-DD): its transition period and the fiscal years that follow; list the sales-tax regimes the business can register for in its country, with each regime's registration-number format and the tax codes registering would seed (sales_tax_regimes); read the platform plan (plan): free (the Solo plan), team (the Startup plan) or system, and, on team, the active Startup contract's id (read its terms through subjects to find a trial end or billing date); or read its Economico plan's event meter (meter): the monthly billing period running now, the billable events recorded in it so far and the allowance, and, while a cancelled plan's usage is closed, allowed: the most events the period permits (its included events, or the end of a started block the cancel billed; the period's total, not what is left); or read the event ledger (event_totals): the business's billable events per UTC day, newest first, a page at a time (after: the cursor); or read its imports (imports): the one-time import allowance (null in Economico's own books), the events imported so far, what remains, and the cutoff: a change dated before it (when the business was created on Economico) is recorded as an import, free of monthly events, while the allowance lasts. Returns null for get if no profile has been recorded. Does not change the business.","parameters":[{"name":"X-Economico-Business","in":"header","required":true,"description":"Explicit business slug for this request; must be approved by the connection and token.","schema":{"type":"string"}}],"responses":{"200":{"description":"Canonical result; missing read objects are null. Money is in decimal integer strings.","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid envelope, query or domain input; also `missing_rates`, a foreign-currency command whose exchange rates the shared store could not supply (`details.missing_rates: [{ base, quote, date }]`, plus `details.refusal: { code, message }` when the command also refused), answered by stating an evidenced `exchangeRate`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token. Follow the WWW-Authenticate resource_metadata URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"}}}},"402":{"description":"plan_required: the command needs a platform plan this business is not on (members beyond the owner and shared views need Startup), or the command would record more events than Solo's monthly allowance has left. The allowance refusal writes nothing (a retry may keep its idempotency key) and carries `details: { reason, included, used, requested, from, through }` (counts as decimal strings; `from`/`through` the current events period as UTC instants). `reason` `solo_limit`: Solo's allowance; tell the founder the limit and that it resets at `through`, then retry after `through`, or once they upgrade to Startup or accept paid extra events. `reason` `plan_cancelled`: Startup was cancelled, or Solo's extra events were turned off; the extra events so far were billed then, and until the plan ends at `endsAt` the business has only `allowed` events in each billing period (its included events, or up to the end of a started block the cancellation billed), with no further extra events; after that it is on Solo (`after` `solo`, for Startup); retry after `through` (the next period's included events) or after `endsAt`. Tell the founder; they can keep Startup (or the extra events) from the billing page once the extra events billed then are paid (for monthly Startup whose cancellation billed extra events, keeping it takes a new Startup agreement from the end; a first-year YC price cannot carry over, so that plan ends as scheduled), or choose it again once it has ended. Any new paid plan (Startup, extra events, a switch or that new agreement) starts only once every invoice from Economico is paid; until then the billing page says so. `reason` `usage_settled`: Startup or Solo's extra events were kept after a cancel; this period's usage was settled then, so retry after `through`. With `details.closesAt`, the business is set to close then (its owner approved closing it): tell the founder, and do not wait for `endsAt` or suggest keeping or upgrading the plan; the owner can stop the closing at /account/cancel until then. Reads, exports and payment setup stay available, and so does upgrading unless the business is set to close (`closesAt`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Membership revoked, business unavailable for writes, or command credential requirements not met (browser-only commands refuse all OAuth tokens). `demo_business`: the business is a demo (`demo: true` on the business read: fictional, its owner's alone) and the command would reach someone else, send a message (support included, for now), publish it, take a plan or make it look like a real company, or the demo has recorded the 2,000 events it may record; tell the user, who can create their own business to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown route or missing required resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not supported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Allow":{"schema":{"type":"string"}}}},"408":{"description":"Request body transfer timed out (code `upload_timeout`): it took over 30 s, or paused over 5 s between chunks; retry the same request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Domain or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Length required (code `length_required`): a JSON body larger than 256 KiB must send Content-Length.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Payload too large (code `payload_too_large`): the request body exceeds the admitted byte limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"JSON body required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Address rate budget exhausted. Wait for Retry-After seconds before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","pattern":"^[0-9]+$"}}}},"500":{"description":"Internal failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Busy (code `busy`): the business is still receiving other document uploads or serving other large documents, and did not start this request. Retry the same request after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string"}}}}}}},"/v1/ingestions/{id}":{"get":{"operationId":"ingestions.get","description":"Get document intake status, immutable source references and provenance, attachment status, processing revisions and financial execution by id. delivery describes processing; recordingDelivery describes automatic financial delivery, including exhausted failures requiring an operator retry. Pending uploads are independent of the primary source. This read does not return upload URLs or captured permissions; an upload URL appears only in the live response of the command that issued it — call ingestions.reissue_upload for a fresh one. A revision's extraction carries its exact retained text only when include_text is true (default false), which reads it from storage on every call; otherwise the extraction carries textBytes and its derived CID only, so a status poll stays cheap. Requires business read access for frozen identity context and document read access to every registered source and pending attachment kind.","parameters":[{"name":"X-Economico-Business","in":"header","required":true,"description":"Explicit business slug for this request; must be approved by the connection and token.","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"name":"include_text","in":"query","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"Canonical result; missing read objects are null. Money is in decimal integer strings.","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid envelope, query or domain input; also `missing_rates`, a foreign-currency command whose exchange rates the shared store could not supply (`details.missing_rates: [{ base, quote, date }]`, plus `details.refusal: { code, message }` when the command also refused), answered by stating an evidenced `exchangeRate`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token. Follow the WWW-Authenticate resource_metadata URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"}}}},"402":{"description":"plan_required: the command needs a platform plan this business is not on (members beyond the owner and shared views need Startup), or the command would record more events than Solo's monthly allowance has left. The allowance refusal writes nothing (a retry may keep its idempotency key) and carries `details: { reason, included, used, requested, from, through }` (counts as decimal strings; `from`/`through` the current events period as UTC instants). `reason` `solo_limit`: Solo's allowance; tell the founder the limit and that it resets at `through`, then retry after `through`, or once they upgrade to Startup or accept paid extra events. `reason` `plan_cancelled`: Startup was cancelled, or Solo's extra events were turned off; the extra events so far were billed then, and until the plan ends at `endsAt` the business has only `allowed` events in each billing period (its included events, or up to the end of a started block the cancellation billed), with no further extra events; after that it is on Solo (`after` `solo`, for Startup); retry after `through` (the next period's included events) or after `endsAt`. Tell the founder; they can keep Startup (or the extra events) from the billing page once the extra events billed then are paid (for monthly Startup whose cancellation billed extra events, keeping it takes a new Startup agreement from the end; a first-year YC price cannot carry over, so that plan ends as scheduled), or choose it again once it has ended. Any new paid plan (Startup, extra events, a switch or that new agreement) starts only once every invoice from Economico is paid; until then the billing page says so. `reason` `usage_settled`: Startup or Solo's extra events were kept after a cancel; this period's usage was settled then, so retry after `through`. With `details.closesAt`, the business is set to close then (its owner approved closing it): tell the founder, and do not wait for `endsAt` or suggest keeping or upgrading the plan; the owner can stop the closing at /account/cancel until then. Reads, exports and payment setup stay available, and so does upgrading unless the business is set to close (`closesAt`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Membership revoked, business unavailable for writes, or command credential requirements not met (browser-only commands refuse all OAuth tokens). `demo_business`: the business is a demo (`demo: true` on the business read: fictional, its owner's alone) and the command would reach someone else, send a message (support included, for now), publish it, take a plan or make it look like a real company, or the demo has recorded the 2,000 events it may record; tell the user, who can create their own business to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown route or missing required resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not supported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Allow":{"schema":{"type":"string"}}}},"408":{"description":"Request body transfer timed out (code `upload_timeout`): it took over 30 s, or paused over 5 s between chunks; retry the same request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Domain or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Length required (code `length_required`): a JSON body larger than 256 KiB must send Content-Length.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Payload too large (code `payload_too_large`): the request body exceeds the admitted byte limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"JSON body required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Address rate budget exhausted. Wait for Retry-After seconds before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","pattern":"^[0-9]+$"}}}},"500":{"description":"Internal failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Busy (code `busy`): the business is still receiving other document uploads or serving other large documents, and did not start this request. Retry the same request after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string"}}}}}}},"/v1/documents/{id}":{"get":{"operationId":"documents.get","description":"Read immutable document metadata and exact bytes. Every row carries label (the founder word: Invoice, Bill, Payment receipt, Charge, Plan, Contract, …) and title; a statement also carries counterpartyId and, when its first effect is money, its headline amount (integer minor units) and currency. Relations rows carry fromLabel, fromTitle, toLabel and toTitle (null when that document is missing). Get requires id and returns contentBase64; a source_document or image also carries size, its exact registered byte count. List supports kind, external_id and label filters with an exclusive document-ID after cursor; label takes a record type's founder word (Invoice, Payment receipt, Bill, Bill payment, Refund, Credit note, Cancellation or Activity statement) and refuses any other word, so filter catalog documents by kind. Relations requires id and pages by the exclusive numeric after_id relation cursor.","parameters":[{"name":"X-Economico-Business","in":"header","required":true,"description":"Explicit business slug for this request; must be approved by the connection and token.","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":500,"default":100}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"name":"kind","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"external_id","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"label","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"after","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"after_id","in":"query","required":false,"schema":{"type":"integer","minimum":0}}],"responses":{"200":{"description":"Canonical result; missing read objects are null. Money is in decimal integer strings.","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid envelope, query or domain input; also `missing_rates`, a foreign-currency command whose exchange rates the shared store could not supply (`details.missing_rates: [{ base, quote, date }]`, plus `details.refusal: { code, message }` when the command also refused), answered by stating an evidenced `exchangeRate`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token. Follow the WWW-Authenticate resource_metadata URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"}}}},"402":{"description":"plan_required: the command needs a platform plan this business is not on (members beyond the owner and shared views need Startup), or the command would record more events than Solo's monthly allowance has left. The allowance refusal writes nothing (a retry may keep its idempotency key) and carries `details: { reason, included, used, requested, from, through }` (counts as decimal strings; `from`/`through` the current events period as UTC instants). `reason` `solo_limit`: Solo's allowance; tell the founder the limit and that it resets at `through`, then retry after `through`, or once they upgrade to Startup or accept paid extra events. `reason` `plan_cancelled`: Startup was cancelled, or Solo's extra events were turned off; the extra events so far were billed then, and until the plan ends at `endsAt` the business has only `allowed` events in each billing period (its included events, or up to the end of a started block the cancellation billed), with no further extra events; after that it is on Solo (`after` `solo`, for Startup); retry after `through` (the next period's included events) or after `endsAt`. Tell the founder; they can keep Startup (or the extra events) from the billing page once the extra events billed then are paid (for monthly Startup whose cancellation billed extra events, keeping it takes a new Startup agreement from the end; a first-year YC price cannot carry over, so that plan ends as scheduled), or choose it again once it has ended. Any new paid plan (Startup, extra events, a switch or that new agreement) starts only once every invoice from Economico is paid; until then the billing page says so. `reason` `usage_settled`: Startup or Solo's extra events were kept after a cancel; this period's usage was settled then, so retry after `through`. With `details.closesAt`, the business is set to close then (its owner approved closing it): tell the founder, and do not wait for `endsAt` or suggest keeping or upgrading the plan; the owner can stop the closing at /account/cancel until then. Reads, exports and payment setup stay available, and so does upgrading unless the business is set to close (`closesAt`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Membership revoked, business unavailable for writes, or command credential requirements not met (browser-only commands refuse all OAuth tokens). `demo_business`: the business is a demo (`demo: true` on the business read: fictional, its owner's alone) and the command would reach someone else, send a message (support included, for now), publish it, take a plan or make it look like a real company, or the demo has recorded the 2,000 events it may record; tell the user, who can create their own business to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown route or missing required resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not supported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Allow":{"schema":{"type":"string"}}}},"408":{"description":"Request body transfer timed out (code `upload_timeout`): it took over 30 s, or paused over 5 s between chunks; retry the same request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Domain or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Length required (code `length_required`): a JSON body larger than 256 KiB must send Content-Length.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Payload too large (code `payload_too_large`): the request body exceeds the admitted byte limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"JSON body required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Address rate budget exhausted. Wait for Retry-After seconds before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","pattern":"^[0-9]+$"}}}},"500":{"description":"Internal failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Busy (code `busy`): the business is still receiving other document uploads or serving other large documents, and did not start this request. Retry the same request after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string"}}}}}}},"/v1/documents/{id}/relations":{"get":{"operationId":"documents.relations","description":"Read immutable document metadata and exact bytes. Every row carries label (the founder word: Invoice, Bill, Payment receipt, Charge, Plan, Contract, …) and title; a statement also carries counterpartyId and, when its first effect is money, its headline amount (integer minor units) and currency. Relations rows carry fromLabel, fromTitle, toLabel and toTitle (null when that document is missing). Get requires id and returns contentBase64; a source_document or image also carries size, its exact registered byte count. List supports kind, external_id and label filters with an exclusive document-ID after cursor; label takes a record type's founder word (Invoice, Payment receipt, Bill, Bill payment, Refund, Credit note, Cancellation or Activity statement) and refuses any other word, so filter catalog documents by kind. Relations requires id and pages by the exclusive numeric after_id relation cursor.","parameters":[{"name":"X-Economico-Business","in":"header","required":true,"description":"Explicit business slug for this request; must be approved by the connection and token.","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":500,"default":100}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"name":"kind","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"external_id","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"label","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"after","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"after_id","in":"query","required":false,"schema":{"type":"integer","minimum":0}}],"responses":{"200":{"description":"Canonical result; missing read objects are null. Money is in decimal integer strings.","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid envelope, query or domain input; also `missing_rates`, a foreign-currency command whose exchange rates the shared store could not supply (`details.missing_rates: [{ base, quote, date }]`, plus `details.refusal: { code, message }` when the command also refused), answered by stating an evidenced `exchangeRate`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token. Follow the WWW-Authenticate resource_metadata URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"}}}},"402":{"description":"plan_required: the command needs a platform plan this business is not on (members beyond the owner and shared views need Startup), or the command would record more events than Solo's monthly allowance has left. The allowance refusal writes nothing (a retry may keep its idempotency key) and carries `details: { reason, included, used, requested, from, through }` (counts as decimal strings; `from`/`through` the current events period as UTC instants). `reason` `solo_limit`: Solo's allowance; tell the founder the limit and that it resets at `through`, then retry after `through`, or once they upgrade to Startup or accept paid extra events. `reason` `plan_cancelled`: Startup was cancelled, or Solo's extra events were turned off; the extra events so far were billed then, and until the plan ends at `endsAt` the business has only `allowed` events in each billing period (its included events, or up to the end of a started block the cancellation billed), with no further extra events; after that it is on Solo (`after` `solo`, for Startup); retry after `through` (the next period's included events) or after `endsAt`. Tell the founder; they can keep Startup (or the extra events) from the billing page once the extra events billed then are paid (for monthly Startup whose cancellation billed extra events, keeping it takes a new Startup agreement from the end; a first-year YC price cannot carry over, so that plan ends as scheduled), or choose it again once it has ended. Any new paid plan (Startup, extra events, a switch or that new agreement) starts only once every invoice from Economico is paid; until then the billing page says so. `reason` `usage_settled`: Startup or Solo's extra events were kept after a cancel; this period's usage was settled then, so retry after `through`. With `details.closesAt`, the business is set to close then (its owner approved closing it): tell the founder, and do not wait for `endsAt` or suggest keeping or upgrading the plan; the owner can stop the closing at /account/cancel until then. Reads, exports and payment setup stay available, and so does upgrading unless the business is set to close (`closesAt`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Membership revoked, business unavailable for writes, or command credential requirements not met (browser-only commands refuse all OAuth tokens). `demo_business`: the business is a demo (`demo: true` on the business read: fictional, its owner's alone) and the command would reach someone else, send a message (support included, for now), publish it, take a plan or make it look like a real company, or the demo has recorded the 2,000 events it may record; tell the user, who can create their own business to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown route or missing required resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not supported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Allow":{"schema":{"type":"string"}}}},"408":{"description":"Request body transfer timed out (code `upload_timeout`): it took over 30 s, or paused over 5 s between chunks; retry the same request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Domain or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Length required (code `length_required`): a JSON body larger than 256 KiB must send Content-Length.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Payload too large (code `payload_too_large`): the request body exceeds the admitted byte limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"JSON body required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Address rate budget exhausted. Wait for Retry-After seconds before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","pattern":"^[0-9]+$"}}}},"500":{"description":"Internal failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Busy (code `busy`): the business is still receiving other document uploads or serving other large documents, and did not start this request. Retry the same request after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string"}}}}}}},"/v1/events/{id}":{"get":{"operationId":"events.get","description":"Read event history and provenance. Every row carries commandName and the documents the event produced, each with its founder label (Invoice, Bill, Contract, …); a document.related row also carries relatedDocuments, the from and to documents its payload relates, each with id, kind, label and title (null when that document is missing). List is oldest first and pages by an exclusive numeric after cursor; with order desc it is newest first and pages by an exclusive numeric before cursor instead. Get requires id. List accepts footprint_contract_id to select only events with postings attributed to that contract by the ledger footprint, including independent payment allocations and reversals, under events.read authority. A subject_id filter also needs its subject_type. kind_prefix narrows to event kinds in one or more namespaces, comma-separated (party.,party_contact.), which selects the business, document, party and financial-account events that carry no subject. Payload amounts are integer strings. An ingestion.* payload omits the delegation captured at intake (authority) and each upload's tokenHash, as the ingestions read does. No verification sweep is triggered.","parameters":[{"name":"X-Economico-Business","in":"header","required":true,"description":"Explicit business slug for this request; must be approved by the connection and token.","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":500,"default":100}},{"name":"after","in":"query","required":false,"schema":{"type":"integer","minimum":0}},{"name":"before","in":"query","required":false,"schema":{"type":"integer","minimum":1}},{"name":"order","in":"query","required":false,"schema":{"enum":["asc","desc"]}},{"name":"id","in":"path","required":true,"schema":{"type":"integer","minimum":1}},{"name":"subject_type","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"subject_id","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"kind_prefix","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"footprint_contract_id","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Canonical result; missing read objects are null. Money is in decimal integer strings.","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid envelope, query or domain input; also `missing_rates`, a foreign-currency command whose exchange rates the shared store could not supply (`details.missing_rates: [{ base, quote, date }]`, plus `details.refusal: { code, message }` when the command also refused), answered by stating an evidenced `exchangeRate`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token. Follow the WWW-Authenticate resource_metadata URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"}}}},"402":{"description":"plan_required: the command needs a platform plan this business is not on (members beyond the owner and shared views need Startup), or the command would record more events than Solo's monthly allowance has left. The allowance refusal writes nothing (a retry may keep its idempotency key) and carries `details: { reason, included, used, requested, from, through }` (counts as decimal strings; `from`/`through` the current events period as UTC instants). `reason` `solo_limit`: Solo's allowance; tell the founder the limit and that it resets at `through`, then retry after `through`, or once they upgrade to Startup or accept paid extra events. `reason` `plan_cancelled`: Startup was cancelled, or Solo's extra events were turned off; the extra events so far were billed then, and until the plan ends at `endsAt` the business has only `allowed` events in each billing period (its included events, or up to the end of a started block the cancellation billed), with no further extra events; after that it is on Solo (`after` `solo`, for Startup); retry after `through` (the next period's included events) or after `endsAt`. Tell the founder; they can keep Startup (or the extra events) from the billing page once the extra events billed then are paid (for monthly Startup whose cancellation billed extra events, keeping it takes a new Startup agreement from the end; a first-year YC price cannot carry over, so that plan ends as scheduled), or choose it again once it has ended. Any new paid plan (Startup, extra events, a switch or that new agreement) starts only once every invoice from Economico is paid; until then the billing page says so. `reason` `usage_settled`: Startup or Solo's extra events were kept after a cancel; this period's usage was settled then, so retry after `through`. With `details.closesAt`, the business is set to close then (its owner approved closing it): tell the founder, and do not wait for `endsAt` or suggest keeping or upgrading the plan; the owner can stop the closing at /account/cancel until then. Reads, exports and payment setup stay available, and so does upgrading unless the business is set to close (`closesAt`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Membership revoked, business unavailable for writes, or command credential requirements not met (browser-only commands refuse all OAuth tokens). `demo_business`: the business is a demo (`demo: true` on the business read: fictional, its owner's alone) and the command would reach someone else, send a message (support included, for now), publish it, take a plan or make it look like a real company, or the demo has recorded the 2,000 events it may record; tell the user, who can create their own business to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown route or missing required resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not supported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Allow":{"schema":{"type":"string"}}}},"408":{"description":"Request body transfer timed out (code `upload_timeout`): it took over 30 s, or paused over 5 s between chunks; retry the same request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Domain or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Length required (code `length_required`): a JSON body larger than 256 KiB must send Content-Length.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Payload too large (code `payload_too_large`): the request body exceeds the admitted byte limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"JSON body required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Address rate budget exhausted. Wait for Retry-After seconds before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","pattern":"^[0-9]+$"}}}},"500":{"description":"Internal failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Busy (code `busy`): the business is still receiving other document uploads or serving other large documents, and did not start this request. Retry the same request after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string"}}}}}}},"/v1/subjects/{type}":{"get":{"operationId":"subjects.list","description":"Read derived lifecycle state. Call types first: it lists every subject type with its statuses and the filters its list accepts. List and get require type; get requires id. List supports status, the type's declared filters (contract_id, activity_key, document_id, record_type, plan) and an exclusive subject-ID after cursor; a filter the type does not declare is refused. An activity_occurrence's state carries recordType (invoice, payment_receipt, bill, bill_payment, refund, credit_note, cancellation or activity_statement), and record_type filters by it. Types carry a founder label and note; activity, template, contract and activity_occurrence rows carry label and title (an occurrence also counterpartyId and, when its headline effect is money, amount, currency and decimals). An invoice, bill or receipt is titled by its occurrence key; a recording that moved nothing (an acceptance, a delivery) by the name of the activity it ran; correlate on state.occurrenceKey, never on title.","parameters":[{"name":"X-Economico-Business","in":"header","required":true,"description":"Explicit business slug for this request; must be approved by the connection and token.","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":500,"default":100}},{"name":"type","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"name":"id","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"status","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"after","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"contract_id","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"activity_key","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"document_id","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"record_type","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"plan","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Canonical result; missing read objects are null. Money is in decimal integer strings.","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid envelope, query or domain input; also `missing_rates`, a foreign-currency command whose exchange rates the shared store could not supply (`details.missing_rates: [{ base, quote, date }]`, plus `details.refusal: { code, message }` when the command also refused), answered by stating an evidenced `exchangeRate`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token. Follow the WWW-Authenticate resource_metadata URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"}}}},"402":{"description":"plan_required: the command needs a platform plan this business is not on (members beyond the owner and shared views need Startup), or the command would record more events than Solo's monthly allowance has left. The allowance refusal writes nothing (a retry may keep its idempotency key) and carries `details: { reason, included, used, requested, from, through }` (counts as decimal strings; `from`/`through` the current events period as UTC instants). `reason` `solo_limit`: Solo's allowance; tell the founder the limit and that it resets at `through`, then retry after `through`, or once they upgrade to Startup or accept paid extra events. `reason` `plan_cancelled`: Startup was cancelled, or Solo's extra events were turned off; the extra events so far were billed then, and until the plan ends at `endsAt` the business has only `allowed` events in each billing period (its included events, or up to the end of a started block the cancellation billed), with no further extra events; after that it is on Solo (`after` `solo`, for Startup); retry after `through` (the next period's included events) or after `endsAt`. Tell the founder; they can keep Startup (or the extra events) from the billing page once the extra events billed then are paid (for monthly Startup whose cancellation billed extra events, keeping it takes a new Startup agreement from the end; a first-year YC price cannot carry over, so that plan ends as scheduled), or choose it again once it has ended. Any new paid plan (Startup, extra events, a switch or that new agreement) starts only once every invoice from Economico is paid; until then the billing page says so. `reason` `usage_settled`: Startup or Solo's extra events were kept after a cancel; this period's usage was settled then, so retry after `through`. With `details.closesAt`, the business is set to close then (its owner approved closing it): tell the founder, and do not wait for `endsAt` or suggest keeping or upgrading the plan; the owner can stop the closing at /account/cancel until then. Reads, exports and payment setup stay available, and so does upgrading unless the business is set to close (`closesAt`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Membership revoked, business unavailable for writes, or command credential requirements not met (browser-only commands refuse all OAuth tokens). `demo_business`: the business is a demo (`demo: true` on the business read: fictional, its owner's alone) and the command would reach someone else, send a message (support included, for now), publish it, take a plan or make it look like a real company, or the demo has recorded the 2,000 events it may record; tell the user, who can create their own business to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown route or missing required resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not supported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Allow":{"schema":{"type":"string"}}}},"408":{"description":"Request body transfer timed out (code `upload_timeout`): it took over 30 s, or paused over 5 s between chunks; retry the same request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Domain or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Length required (code `length_required`): a JSON body larger than 256 KiB must send Content-Length.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Payload too large (code `payload_too_large`): the request body exceeds the admitted byte limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"JSON body required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Address rate budget exhausted. Wait for Retry-After seconds before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","pattern":"^[0-9]+$"}}}},"500":{"description":"Internal failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Busy (code `busy`): the business is still receiving other document uploads or serving other large documents, and did not start this request. Retry the same request after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string"}}}}}}},"/v1/ledgers/{ledger_id}":{"get":{"operationId":"ledgers.get","description":"Read native-unit ledger metadata, balances and posting statements. Get, balances and statement require ledger_id. Balances returns one ledger's per-(account, sub-key) debits, credits and balance in its own unit — the balance read for usage meters, prepaid capacity and share classes as well as currency ledgers; an optional as_of (a YYYY-MM-DD date or a UTC instant, exclusive) counts only postings effective before it, sub-keys intact. Statement pages postings by the exclusive numeric after_id cursor and can be narrowed to one account_code and, with it, one sub_key (the statement's own subKey string). List pages by the exclusive string ledger-ID after cursor. Currencies names each currency the business's GAAP ledgers hold real postings in, once, and in ledgers the ledger that holds it now (the open one, else the most recently closed; a functional-currency change or an incorporation succeeds a currency's ledger). A business starts with its selected functional-currency ledger (USD when omitted); other canonical currency ledgers open when a contract first binds them. Amounts remain exact strings and are never summed across units. Transaction requires occurrence_id (an invoice, bill or payment record) and returns every posting of every event that touched its claims (the record itself, the payments, credits and corrections against it, with each correction's reversal), in effective order, each with the record it came from, plus otherClaims: other invoices or bills those events also settled. Footprint takes exactly one of party_id, contract_id or occurrence_id and returns every posting of every recording on that party's contracts, on that contract, or in that record's transaction, in effective order, each attributed to its record (occurrenceId, occurrenceKey), activity, pattern and party the way the activity_balances report attributes it, with its ledger's unit and decimals; plus contracts, the contracts it spans. Null when the party, contract or record does not exist.","parameters":[{"name":"X-Economico-Business","in":"header","required":true,"description":"Explicit business slug for this request; must be approved by the connection and token.","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":500,"default":100}},{"name":"ledger_id","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"name":"occurrence_id","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"party_id","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"contract_id","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"account_code","in":"query","required":false,"schema":{"type":"integer","minimum":0}},{"name":"event_id","in":"query","required":false,"schema":{"type":"integer","minimum":1}},{"name":"sub_key","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"after","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"after_id","in":"query","required":false,"schema":{"type":"integer","minimum":0}},{"name":"as_of","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Canonical result; missing read objects are null. Money is in decimal integer strings.","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid envelope, query or domain input; also `missing_rates`, a foreign-currency command whose exchange rates the shared store could not supply (`details.missing_rates: [{ base, quote, date }]`, plus `details.refusal: { code, message }` when the command also refused), answered by stating an evidenced `exchangeRate`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token. Follow the WWW-Authenticate resource_metadata URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"}}}},"402":{"description":"plan_required: the command needs a platform plan this business is not on (members beyond the owner and shared views need Startup), or the command would record more events than Solo's monthly allowance has left. The allowance refusal writes nothing (a retry may keep its idempotency key) and carries `details: { reason, included, used, requested, from, through }` (counts as decimal strings; `from`/`through` the current events period as UTC instants). `reason` `solo_limit`: Solo's allowance; tell the founder the limit and that it resets at `through`, then retry after `through`, or once they upgrade to Startup or accept paid extra events. `reason` `plan_cancelled`: Startup was cancelled, or Solo's extra events were turned off; the extra events so far were billed then, and until the plan ends at `endsAt` the business has only `allowed` events in each billing period (its included events, or up to the end of a started block the cancellation billed), with no further extra events; after that it is on Solo (`after` `solo`, for Startup); retry after `through` (the next period's included events) or after `endsAt`. Tell the founder; they can keep Startup (or the extra events) from the billing page once the extra events billed then are paid (for monthly Startup whose cancellation billed extra events, keeping it takes a new Startup agreement from the end; a first-year YC price cannot carry over, so that plan ends as scheduled), or choose it again once it has ended. Any new paid plan (Startup, extra events, a switch or that new agreement) starts only once every invoice from Economico is paid; until then the billing page says so. `reason` `usage_settled`: Startup or Solo's extra events were kept after a cancel; this period's usage was settled then, so retry after `through`. With `details.closesAt`, the business is set to close then (its owner approved closing it): tell the founder, and do not wait for `endsAt` or suggest keeping or upgrading the plan; the owner can stop the closing at /account/cancel until then. Reads, exports and payment setup stay available, and so does upgrading unless the business is set to close (`closesAt`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Membership revoked, business unavailable for writes, or command credential requirements not met (browser-only commands refuse all OAuth tokens). `demo_business`: the business is a demo (`demo: true` on the business read: fictional, its owner's alone) and the command would reach someone else, send a message (support included, for now), publish it, take a plan or make it look like a real company, or the demo has recorded the 2,000 events it may record; tell the user, who can create their own business to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown route or missing required resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not supported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Allow":{"schema":{"type":"string"}}}},"408":{"description":"Request body transfer timed out (code `upload_timeout`): it took over 30 s, or paused over 5 s between chunks; retry the same request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Domain or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Length required (code `length_required`): a JSON body larger than 256 KiB must send Content-Length.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Payload too large (code `payload_too_large`): the request body exceeds the admitted byte limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"JSON body required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Address rate budget exhausted. Wait for Retry-After seconds before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","pattern":"^[0-9]+$"}}}},"500":{"description":"Internal failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Busy (code `busy`): the business is still receiving other document uploads or serving other large documents, and did not start this request. Retry the same request after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string"}}}}}}},"/v1/ledgers/{ledger_id}/balances":{"get":{"operationId":"ledgers.balances","description":"Read native-unit ledger metadata, balances and posting statements. Get, balances and statement require ledger_id. Balances returns one ledger's per-(account, sub-key) debits, credits and balance in its own unit — the balance read for usage meters, prepaid capacity and share classes as well as currency ledgers; an optional as_of (a YYYY-MM-DD date or a UTC instant, exclusive) counts only postings effective before it, sub-keys intact. Statement pages postings by the exclusive numeric after_id cursor and can be narrowed to one account_code and, with it, one sub_key (the statement's own subKey string). List pages by the exclusive string ledger-ID after cursor. Currencies names each currency the business's GAAP ledgers hold real postings in, once, and in ledgers the ledger that holds it now (the open one, else the most recently closed; a functional-currency change or an incorporation succeeds a currency's ledger). A business starts with its selected functional-currency ledger (USD when omitted); other canonical currency ledgers open when a contract first binds them. Amounts remain exact strings and are never summed across units. Transaction requires occurrence_id (an invoice, bill or payment record) and returns every posting of every event that touched its claims (the record itself, the payments, credits and corrections against it, with each correction's reversal), in effective order, each with the record it came from, plus otherClaims: other invoices or bills those events also settled. Footprint takes exactly one of party_id, contract_id or occurrence_id and returns every posting of every recording on that party's contracts, on that contract, or in that record's transaction, in effective order, each attributed to its record (occurrenceId, occurrenceKey), activity, pattern and party the way the activity_balances report attributes it, with its ledger's unit and decimals; plus contracts, the contracts it spans. Null when the party, contract or record does not exist.","parameters":[{"name":"X-Economico-Business","in":"header","required":true,"description":"Explicit business slug for this request; must be approved by the connection and token.","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":500,"default":100}},{"name":"ledger_id","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"name":"occurrence_id","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"party_id","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"contract_id","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"account_code","in":"query","required":false,"schema":{"type":"integer","minimum":0}},{"name":"event_id","in":"query","required":false,"schema":{"type":"integer","minimum":1}},{"name":"sub_key","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"after","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"after_id","in":"query","required":false,"schema":{"type":"integer","minimum":0}},{"name":"as_of","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Canonical result; missing read objects are null. Money is in decimal integer strings.","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid envelope, query or domain input; also `missing_rates`, a foreign-currency command whose exchange rates the shared store could not supply (`details.missing_rates: [{ base, quote, date }]`, plus `details.refusal: { code, message }` when the command also refused), answered by stating an evidenced `exchangeRate`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token. Follow the WWW-Authenticate resource_metadata URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"}}}},"402":{"description":"plan_required: the command needs a platform plan this business is not on (members beyond the owner and shared views need Startup), or the command would record more events than Solo's monthly allowance has left. The allowance refusal writes nothing (a retry may keep its idempotency key) and carries `details: { reason, included, used, requested, from, through }` (counts as decimal strings; `from`/`through` the current events period as UTC instants). `reason` `solo_limit`: Solo's allowance; tell the founder the limit and that it resets at `through`, then retry after `through`, or once they upgrade to Startup or accept paid extra events. `reason` `plan_cancelled`: Startup was cancelled, or Solo's extra events were turned off; the extra events so far were billed then, and until the plan ends at `endsAt` the business has only `allowed` events in each billing period (its included events, or up to the end of a started block the cancellation billed), with no further extra events; after that it is on Solo (`after` `solo`, for Startup); retry after `through` (the next period's included events) or after `endsAt`. Tell the founder; they can keep Startup (or the extra events) from the billing page once the extra events billed then are paid (for monthly Startup whose cancellation billed extra events, keeping it takes a new Startup agreement from the end; a first-year YC price cannot carry over, so that plan ends as scheduled), or choose it again once it has ended. Any new paid plan (Startup, extra events, a switch or that new agreement) starts only once every invoice from Economico is paid; until then the billing page says so. `reason` `usage_settled`: Startup or Solo's extra events were kept after a cancel; this period's usage was settled then, so retry after `through`. With `details.closesAt`, the business is set to close then (its owner approved closing it): tell the founder, and do not wait for `endsAt` or suggest keeping or upgrading the plan; the owner can stop the closing at /account/cancel until then. Reads, exports and payment setup stay available, and so does upgrading unless the business is set to close (`closesAt`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Membership revoked, business unavailable for writes, or command credential requirements not met (browser-only commands refuse all OAuth tokens). `demo_business`: the business is a demo (`demo: true` on the business read: fictional, its owner's alone) and the command would reach someone else, send a message (support included, for now), publish it, take a plan or make it look like a real company, or the demo has recorded the 2,000 events it may record; tell the user, who can create their own business to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown route or missing required resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not supported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Allow":{"schema":{"type":"string"}}}},"408":{"description":"Request body transfer timed out (code `upload_timeout`): it took over 30 s, or paused over 5 s between chunks; retry the same request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Domain or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Length required (code `length_required`): a JSON body larger than 256 KiB must send Content-Length.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Payload too large (code `payload_too_large`): the request body exceeds the admitted byte limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"JSON body required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Address rate budget exhausted. Wait for Retry-After seconds before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","pattern":"^[0-9]+$"}}}},"500":{"description":"Internal failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Busy (code `busy`): the business is still receiving other document uploads or serving other large documents, and did not start this request. Retry the same request after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string"}}}}}}},"/v1/ledgers/{ledger_id}/statement":{"get":{"operationId":"ledgers.statement","description":"Read native-unit ledger metadata, balances and posting statements. Get, balances and statement require ledger_id. Balances returns one ledger's per-(account, sub-key) debits, credits and balance in its own unit — the balance read for usage meters, prepaid capacity and share classes as well as currency ledgers; an optional as_of (a YYYY-MM-DD date or a UTC instant, exclusive) counts only postings effective before it, sub-keys intact. Statement pages postings by the exclusive numeric after_id cursor and can be narrowed to one account_code and, with it, one sub_key (the statement's own subKey string). List pages by the exclusive string ledger-ID after cursor. Currencies names each currency the business's GAAP ledgers hold real postings in, once, and in ledgers the ledger that holds it now (the open one, else the most recently closed; a functional-currency change or an incorporation succeeds a currency's ledger). A business starts with its selected functional-currency ledger (USD when omitted); other canonical currency ledgers open when a contract first binds them. Amounts remain exact strings and are never summed across units. Transaction requires occurrence_id (an invoice, bill or payment record) and returns every posting of every event that touched its claims (the record itself, the payments, credits and corrections against it, with each correction's reversal), in effective order, each with the record it came from, plus otherClaims: other invoices or bills those events also settled. Footprint takes exactly one of party_id, contract_id or occurrence_id and returns every posting of every recording on that party's contracts, on that contract, or in that record's transaction, in effective order, each attributed to its record (occurrenceId, occurrenceKey), activity, pattern and party the way the activity_balances report attributes it, with its ledger's unit and decimals; plus contracts, the contracts it spans. Null when the party, contract or record does not exist.","parameters":[{"name":"X-Economico-Business","in":"header","required":true,"description":"Explicit business slug for this request; must be approved by the connection and token.","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":500,"default":100}},{"name":"ledger_id","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"name":"occurrence_id","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"party_id","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"contract_id","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"account_code","in":"query","required":false,"schema":{"type":"integer","minimum":0}},{"name":"event_id","in":"query","required":false,"schema":{"type":"integer","minimum":1}},{"name":"sub_key","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"after","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"after_id","in":"query","required":false,"schema":{"type":"integer","minimum":0}},{"name":"as_of","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Canonical result; missing read objects are null. Money is in decimal integer strings.","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid envelope, query or domain input; also `missing_rates`, a foreign-currency command whose exchange rates the shared store could not supply (`details.missing_rates: [{ base, quote, date }]`, plus `details.refusal: { code, message }` when the command also refused), answered by stating an evidenced `exchangeRate`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token. Follow the WWW-Authenticate resource_metadata URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"}}}},"402":{"description":"plan_required: the command needs a platform plan this business is not on (members beyond the owner and shared views need Startup), or the command would record more events than Solo's monthly allowance has left. The allowance refusal writes nothing (a retry may keep its idempotency key) and carries `details: { reason, included, used, requested, from, through }` (counts as decimal strings; `from`/`through` the current events period as UTC instants). `reason` `solo_limit`: Solo's allowance; tell the founder the limit and that it resets at `through`, then retry after `through`, or once they upgrade to Startup or accept paid extra events. `reason` `plan_cancelled`: Startup was cancelled, or Solo's extra events were turned off; the extra events so far were billed then, and until the plan ends at `endsAt` the business has only `allowed` events in each billing period (its included events, or up to the end of a started block the cancellation billed), with no further extra events; after that it is on Solo (`after` `solo`, for Startup); retry after `through` (the next period's included events) or after `endsAt`. Tell the founder; they can keep Startup (or the extra events) from the billing page once the extra events billed then are paid (for monthly Startup whose cancellation billed extra events, keeping it takes a new Startup agreement from the end; a first-year YC price cannot carry over, so that plan ends as scheduled), or choose it again once it has ended. Any new paid plan (Startup, extra events, a switch or that new agreement) starts only once every invoice from Economico is paid; until then the billing page says so. `reason` `usage_settled`: Startup or Solo's extra events were kept after a cancel; this period's usage was settled then, so retry after `through`. With `details.closesAt`, the business is set to close then (its owner approved closing it): tell the founder, and do not wait for `endsAt` or suggest keeping or upgrading the plan; the owner can stop the closing at /account/cancel until then. Reads, exports and payment setup stay available, and so does upgrading unless the business is set to close (`closesAt`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Membership revoked, business unavailable for writes, or command credential requirements not met (browser-only commands refuse all OAuth tokens). `demo_business`: the business is a demo (`demo: true` on the business read: fictional, its owner's alone) and the command would reach someone else, send a message (support included, for now), publish it, take a plan or make it look like a real company, or the demo has recorded the 2,000 events it may record; tell the user, who can create their own business to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown route or missing required resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not supported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Allow":{"schema":{"type":"string"}}}},"408":{"description":"Request body transfer timed out (code `upload_timeout`): it took over 30 s, or paused over 5 s between chunks; retry the same request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Domain or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Length required (code `length_required`): a JSON body larger than 256 KiB must send Content-Length.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Payload too large (code `payload_too_large`): the request body exceeds the admitted byte limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"JSON body required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Address rate budget exhausted. Wait for Retry-After seconds before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","pattern":"^[0-9]+$"}}}},"500":{"description":"Internal failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Busy (code `busy`): the business is still receiving other document uploads or serving other large documents, and did not start this request. Retry the same request after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string"}}}}}}},"/v1/ledgers/{ledger_id}/currencies":{"get":{"operationId":"ledgers.currencies","description":"Read native-unit ledger metadata, balances and posting statements. Get, balances and statement require ledger_id. Balances returns one ledger's per-(account, sub-key) debits, credits and balance in its own unit — the balance read for usage meters, prepaid capacity and share classes as well as currency ledgers; an optional as_of (a YYYY-MM-DD date or a UTC instant, exclusive) counts only postings effective before it, sub-keys intact. Statement pages postings by the exclusive numeric after_id cursor and can be narrowed to one account_code and, with it, one sub_key (the statement's own subKey string). List pages by the exclusive string ledger-ID after cursor. Currencies names each currency the business's GAAP ledgers hold real postings in, once, and in ledgers the ledger that holds it now (the open one, else the most recently closed; a functional-currency change or an incorporation succeeds a currency's ledger). A business starts with its selected functional-currency ledger (USD when omitted); other canonical currency ledgers open when a contract first binds them. Amounts remain exact strings and are never summed across units. Transaction requires occurrence_id (an invoice, bill or payment record) and returns every posting of every event that touched its claims (the record itself, the payments, credits and corrections against it, with each correction's reversal), in effective order, each with the record it came from, plus otherClaims: other invoices or bills those events also settled. Footprint takes exactly one of party_id, contract_id or occurrence_id and returns every posting of every recording on that party's contracts, on that contract, or in that record's transaction, in effective order, each attributed to its record (occurrenceId, occurrenceKey), activity, pattern and party the way the activity_balances report attributes it, with its ledger's unit and decimals; plus contracts, the contracts it spans. Null when the party, contract or record does not exist.","parameters":[{"name":"X-Economico-Business","in":"header","required":true,"description":"Explicit business slug for this request; must be approved by the connection and token.","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":500,"default":100}},{"name":"ledger_id","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"name":"occurrence_id","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"party_id","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"contract_id","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"account_code","in":"query","required":false,"schema":{"type":"integer","minimum":0}},{"name":"event_id","in":"query","required":false,"schema":{"type":"integer","minimum":1}},{"name":"sub_key","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"after","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"after_id","in":"query","required":false,"schema":{"type":"integer","minimum":0}},{"name":"as_of","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Canonical result; missing read objects are null. Money is in decimal integer strings.","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid envelope, query or domain input; also `missing_rates`, a foreign-currency command whose exchange rates the shared store could not supply (`details.missing_rates: [{ base, quote, date }]`, plus `details.refusal: { code, message }` when the command also refused), answered by stating an evidenced `exchangeRate`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token. Follow the WWW-Authenticate resource_metadata URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"}}}},"402":{"description":"plan_required: the command needs a platform plan this business is not on (members beyond the owner and shared views need Startup), or the command would record more events than Solo's monthly allowance has left. The allowance refusal writes nothing (a retry may keep its idempotency key) and carries `details: { reason, included, used, requested, from, through }` (counts as decimal strings; `from`/`through` the current events period as UTC instants). `reason` `solo_limit`: Solo's allowance; tell the founder the limit and that it resets at `through`, then retry after `through`, or once they upgrade to Startup or accept paid extra events. `reason` `plan_cancelled`: Startup was cancelled, or Solo's extra events were turned off; the extra events so far were billed then, and until the plan ends at `endsAt` the business has only `allowed` events in each billing period (its included events, or up to the end of a started block the cancellation billed), with no further extra events; after that it is on Solo (`after` `solo`, for Startup); retry after `through` (the next period's included events) or after `endsAt`. Tell the founder; they can keep Startup (or the extra events) from the billing page once the extra events billed then are paid (for monthly Startup whose cancellation billed extra events, keeping it takes a new Startup agreement from the end; a first-year YC price cannot carry over, so that plan ends as scheduled), or choose it again once it has ended. Any new paid plan (Startup, extra events, a switch or that new agreement) starts only once every invoice from Economico is paid; until then the billing page says so. `reason` `usage_settled`: Startup or Solo's extra events were kept after a cancel; this period's usage was settled then, so retry after `through`. With `details.closesAt`, the business is set to close then (its owner approved closing it): tell the founder, and do not wait for `endsAt` or suggest keeping or upgrading the plan; the owner can stop the closing at /account/cancel until then. Reads, exports and payment setup stay available, and so does upgrading unless the business is set to close (`closesAt`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Membership revoked, business unavailable for writes, or command credential requirements not met (browser-only commands refuse all OAuth tokens). `demo_business`: the business is a demo (`demo: true` on the business read: fictional, its owner's alone) and the command would reach someone else, send a message (support included, for now), publish it, take a plan or make it look like a real company, or the demo has recorded the 2,000 events it may record; tell the user, who can create their own business to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown route or missing required resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not supported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Allow":{"schema":{"type":"string"}}}},"408":{"description":"Request body transfer timed out (code `upload_timeout`): it took over 30 s, or paused over 5 s between chunks; retry the same request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Domain or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Length required (code `length_required`): a JSON body larger than 256 KiB must send Content-Length.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Payload too large (code `payload_too_large`): the request body exceeds the admitted byte limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"JSON body required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Address rate budget exhausted. Wait for Retry-After seconds before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","pattern":"^[0-9]+$"}}}},"500":{"description":"Internal failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Busy (code `busy`): the business is still receiving other document uploads or serving other large documents, and did not start this request. Retry the same request after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string"}}}}}}},"/v1/ledgers/{ledger_id}/transaction":{"get":{"operationId":"ledgers.transaction","description":"Read native-unit ledger metadata, balances and posting statements. Get, balances and statement require ledger_id. Balances returns one ledger's per-(account, sub-key) debits, credits and balance in its own unit — the balance read for usage meters, prepaid capacity and share classes as well as currency ledgers; an optional as_of (a YYYY-MM-DD date or a UTC instant, exclusive) counts only postings effective before it, sub-keys intact. Statement pages postings by the exclusive numeric after_id cursor and can be narrowed to one account_code and, with it, one sub_key (the statement's own subKey string). List pages by the exclusive string ledger-ID after cursor. Currencies names each currency the business's GAAP ledgers hold real postings in, once, and in ledgers the ledger that holds it now (the open one, else the most recently closed; a functional-currency change or an incorporation succeeds a currency's ledger). A business starts with its selected functional-currency ledger (USD when omitted); other canonical currency ledgers open when a contract first binds them. Amounts remain exact strings and are never summed across units. Transaction requires occurrence_id (an invoice, bill or payment record) and returns every posting of every event that touched its claims (the record itself, the payments, credits and corrections against it, with each correction's reversal), in effective order, each with the record it came from, plus otherClaims: other invoices or bills those events also settled. Footprint takes exactly one of party_id, contract_id or occurrence_id and returns every posting of every recording on that party's contracts, on that contract, or in that record's transaction, in effective order, each attributed to its record (occurrenceId, occurrenceKey), activity, pattern and party the way the activity_balances report attributes it, with its ledger's unit and decimals; plus contracts, the contracts it spans. Null when the party, contract or record does not exist.","parameters":[{"name":"X-Economico-Business","in":"header","required":true,"description":"Explicit business slug for this request; must be approved by the connection and token.","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":500,"default":100}},{"name":"ledger_id","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"name":"occurrence_id","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"party_id","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"contract_id","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"account_code","in":"query","required":false,"schema":{"type":"integer","minimum":0}},{"name":"event_id","in":"query","required":false,"schema":{"type":"integer","minimum":1}},{"name":"sub_key","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"after","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"after_id","in":"query","required":false,"schema":{"type":"integer","minimum":0}},{"name":"as_of","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Canonical result; missing read objects are null. Money is in decimal integer strings.","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid envelope, query or domain input; also `missing_rates`, a foreign-currency command whose exchange rates the shared store could not supply (`details.missing_rates: [{ base, quote, date }]`, plus `details.refusal: { code, message }` when the command also refused), answered by stating an evidenced `exchangeRate`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token. Follow the WWW-Authenticate resource_metadata URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"}}}},"402":{"description":"plan_required: the command needs a platform plan this business is not on (members beyond the owner and shared views need Startup), or the command would record more events than Solo's monthly allowance has left. The allowance refusal writes nothing (a retry may keep its idempotency key) and carries `details: { reason, included, used, requested, from, through }` (counts as decimal strings; `from`/`through` the current events period as UTC instants). `reason` `solo_limit`: Solo's allowance; tell the founder the limit and that it resets at `through`, then retry after `through`, or once they upgrade to Startup or accept paid extra events. `reason` `plan_cancelled`: Startup was cancelled, or Solo's extra events were turned off; the extra events so far were billed then, and until the plan ends at `endsAt` the business has only `allowed` events in each billing period (its included events, or up to the end of a started block the cancellation billed), with no further extra events; after that it is on Solo (`after` `solo`, for Startup); retry after `through` (the next period's included events) or after `endsAt`. Tell the founder; they can keep Startup (or the extra events) from the billing page once the extra events billed then are paid (for monthly Startup whose cancellation billed extra events, keeping it takes a new Startup agreement from the end; a first-year YC price cannot carry over, so that plan ends as scheduled), or choose it again once it has ended. Any new paid plan (Startup, extra events, a switch or that new agreement) starts only once every invoice from Economico is paid; until then the billing page says so. `reason` `usage_settled`: Startup or Solo's extra events were kept after a cancel; this period's usage was settled then, so retry after `through`. With `details.closesAt`, the business is set to close then (its owner approved closing it): tell the founder, and do not wait for `endsAt` or suggest keeping or upgrading the plan; the owner can stop the closing at /account/cancel until then. Reads, exports and payment setup stay available, and so does upgrading unless the business is set to close (`closesAt`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Membership revoked, business unavailable for writes, or command credential requirements not met (browser-only commands refuse all OAuth tokens). `demo_business`: the business is a demo (`demo: true` on the business read: fictional, its owner's alone) and the command would reach someone else, send a message (support included, for now), publish it, take a plan or make it look like a real company, or the demo has recorded the 2,000 events it may record; tell the user, who can create their own business to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown route or missing required resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not supported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Allow":{"schema":{"type":"string"}}}},"408":{"description":"Request body transfer timed out (code `upload_timeout`): it took over 30 s, or paused over 5 s between chunks; retry the same request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Domain or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Length required (code `length_required`): a JSON body larger than 256 KiB must send Content-Length.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Payload too large (code `payload_too_large`): the request body exceeds the admitted byte limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"JSON body required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Address rate budget exhausted. Wait for Retry-After seconds before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","pattern":"^[0-9]+$"}}}},"500":{"description":"Internal failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Busy (code `busy`): the business is still receiving other document uploads or serving other large documents, and did not start this request. Retry the same request after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string"}}}}}}},"/v1/ledgers/{ledger_id}/footprint":{"get":{"operationId":"ledgers.footprint","description":"Read native-unit ledger metadata, balances and posting statements. Get, balances and statement require ledger_id. Balances returns one ledger's per-(account, sub-key) debits, credits and balance in its own unit — the balance read for usage meters, prepaid capacity and share classes as well as currency ledgers; an optional as_of (a YYYY-MM-DD date or a UTC instant, exclusive) counts only postings effective before it, sub-keys intact. Statement pages postings by the exclusive numeric after_id cursor and can be narrowed to one account_code and, with it, one sub_key (the statement's own subKey string). List pages by the exclusive string ledger-ID after cursor. Currencies names each currency the business's GAAP ledgers hold real postings in, once, and in ledgers the ledger that holds it now (the open one, else the most recently closed; a functional-currency change or an incorporation succeeds a currency's ledger). A business starts with its selected functional-currency ledger (USD when omitted); other canonical currency ledgers open when a contract first binds them. Amounts remain exact strings and are never summed across units. Transaction requires occurrence_id (an invoice, bill or payment record) and returns every posting of every event that touched its claims (the record itself, the payments, credits and corrections against it, with each correction's reversal), in effective order, each with the record it came from, plus otherClaims: other invoices or bills those events also settled. Footprint takes exactly one of party_id, contract_id or occurrence_id and returns every posting of every recording on that party's contracts, on that contract, or in that record's transaction, in effective order, each attributed to its record (occurrenceId, occurrenceKey), activity, pattern and party the way the activity_balances report attributes it, with its ledger's unit and decimals; plus contracts, the contracts it spans. Null when the party, contract or record does not exist.","parameters":[{"name":"X-Economico-Business","in":"header","required":true,"description":"Explicit business slug for this request; must be approved by the connection and token.","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":500,"default":100}},{"name":"ledger_id","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"name":"occurrence_id","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"party_id","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"contract_id","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"account_code","in":"query","required":false,"schema":{"type":"integer","minimum":0}},{"name":"event_id","in":"query","required":false,"schema":{"type":"integer","minimum":1}},{"name":"sub_key","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"after","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"after_id","in":"query","required":false,"schema":{"type":"integer","minimum":0}},{"name":"as_of","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Canonical result; missing read objects are null. Money is in decimal integer strings.","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid envelope, query or domain input; also `missing_rates`, a foreign-currency command whose exchange rates the shared store could not supply (`details.missing_rates: [{ base, quote, date }]`, plus `details.refusal: { code, message }` when the command also refused), answered by stating an evidenced `exchangeRate`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token. Follow the WWW-Authenticate resource_metadata URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"}}}},"402":{"description":"plan_required: the command needs a platform plan this business is not on (members beyond the owner and shared views need Startup), or the command would record more events than Solo's monthly allowance has left. The allowance refusal writes nothing (a retry may keep its idempotency key) and carries `details: { reason, included, used, requested, from, through }` (counts as decimal strings; `from`/`through` the current events period as UTC instants). `reason` `solo_limit`: Solo's allowance; tell the founder the limit and that it resets at `through`, then retry after `through`, or once they upgrade to Startup or accept paid extra events. `reason` `plan_cancelled`: Startup was cancelled, or Solo's extra events were turned off; the extra events so far were billed then, and until the plan ends at `endsAt` the business has only `allowed` events in each billing period (its included events, or up to the end of a started block the cancellation billed), with no further extra events; after that it is on Solo (`after` `solo`, for Startup); retry after `through` (the next period's included events) or after `endsAt`. Tell the founder; they can keep Startup (or the extra events) from the billing page once the extra events billed then are paid (for monthly Startup whose cancellation billed extra events, keeping it takes a new Startup agreement from the end; a first-year YC price cannot carry over, so that plan ends as scheduled), or choose it again once it has ended. Any new paid plan (Startup, extra events, a switch or that new agreement) starts only once every invoice from Economico is paid; until then the billing page says so. `reason` `usage_settled`: Startup or Solo's extra events were kept after a cancel; this period's usage was settled then, so retry after `through`. With `details.closesAt`, the business is set to close then (its owner approved closing it): tell the founder, and do not wait for `endsAt` or suggest keeping or upgrading the plan; the owner can stop the closing at /account/cancel until then. Reads, exports and payment setup stay available, and so does upgrading unless the business is set to close (`closesAt`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Membership revoked, business unavailable for writes, or command credential requirements not met (browser-only commands refuse all OAuth tokens). `demo_business`: the business is a demo (`demo: true` on the business read: fictional, its owner's alone) and the command would reach someone else, send a message (support included, for now), publish it, take a plan or make it look like a real company, or the demo has recorded the 2,000 events it may record; tell the user, who can create their own business to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown route or missing required resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not supported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Allow":{"schema":{"type":"string"}}}},"408":{"description":"Request body transfer timed out (code `upload_timeout`): it took over 30 s, or paused over 5 s between chunks; retry the same request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Domain or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Length required (code `length_required`): a JSON body larger than 256 KiB must send Content-Length.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Payload too large (code `payload_too_large`): the request body exceeds the admitted byte limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"JSON body required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Address rate budget exhausted. Wait for Retry-After seconds before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","pattern":"^[0-9]+$"}}}},"500":{"description":"Internal failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Busy (code `busy`): the business is still receiving other document uploads or serving other large documents, and did not start this request. Retry the same request after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string"}}}}}}},"/v1/parties/{id}":{"get":{"operationId":"parties.get","description":"Read counterparties and contacts. Get requires id. List uses an exclusive party-ID after cursor and includes archived records; category narrows it to parties playing that role (customer, vendor, founder, investor, provider, employee), and vendor also matches providers. Categories returns the relationship categories in use.","parameters":[{"name":"X-Economico-Business","in":"header","required":true,"description":"Explicit business slug for this request; must be approved by the connection and token.","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":500,"default":100}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"name":"after","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"category","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Canonical result; missing read objects are null. Money is in decimal integer strings.","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid envelope, query or domain input; also `missing_rates`, a foreign-currency command whose exchange rates the shared store could not supply (`details.missing_rates: [{ base, quote, date }]`, plus `details.refusal: { code, message }` when the command also refused), answered by stating an evidenced `exchangeRate`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token. Follow the WWW-Authenticate resource_metadata URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"}}}},"402":{"description":"plan_required: the command needs a platform plan this business is not on (members beyond the owner and shared views need Startup), or the command would record more events than Solo's monthly allowance has left. The allowance refusal writes nothing (a retry may keep its idempotency key) and carries `details: { reason, included, used, requested, from, through }` (counts as decimal strings; `from`/`through` the current events period as UTC instants). `reason` `solo_limit`: Solo's allowance; tell the founder the limit and that it resets at `through`, then retry after `through`, or once they upgrade to Startup or accept paid extra events. `reason` `plan_cancelled`: Startup was cancelled, or Solo's extra events were turned off; the extra events so far were billed then, and until the plan ends at `endsAt` the business has only `allowed` events in each billing period (its included events, or up to the end of a started block the cancellation billed), with no further extra events; after that it is on Solo (`after` `solo`, for Startup); retry after `through` (the next period's included events) or after `endsAt`. Tell the founder; they can keep Startup (or the extra events) from the billing page once the extra events billed then are paid (for monthly Startup whose cancellation billed extra events, keeping it takes a new Startup agreement from the end; a first-year YC price cannot carry over, so that plan ends as scheduled), or choose it again once it has ended. Any new paid plan (Startup, extra events, a switch or that new agreement) starts only once every invoice from Economico is paid; until then the billing page says so. `reason` `usage_settled`: Startup or Solo's extra events were kept after a cancel; this period's usage was settled then, so retry after `through`. With `details.closesAt`, the business is set to close then (its owner approved closing it): tell the founder, and do not wait for `endsAt` or suggest keeping or upgrading the plan; the owner can stop the closing at /account/cancel until then. Reads, exports and payment setup stay available, and so does upgrading unless the business is set to close (`closesAt`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Membership revoked, business unavailable for writes, or command credential requirements not met (browser-only commands refuse all OAuth tokens). `demo_business`: the business is a demo (`demo: true` on the business read: fictional, its owner's alone) and the command would reach someone else, send a message (support included, for now), publish it, take a plan or make it look like a real company, or the demo has recorded the 2,000 events it may record; tell the user, who can create their own business to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown route or missing required resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not supported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Allow":{"schema":{"type":"string"}}}},"408":{"description":"Request body transfer timed out (code `upload_timeout`): it took over 30 s, or paused over 5 s between chunks; retry the same request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Domain or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Length required (code `length_required`): a JSON body larger than 256 KiB must send Content-Length.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Payload too large (code `payload_too_large`): the request body exceeds the admitted byte limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"JSON body required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Address rate budget exhausted. Wait for Retry-After seconds before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","pattern":"^[0-9]+$"}}}},"500":{"description":"Internal failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Busy (code `busy`): the business is still receiving other document uploads or serving other large documents, and did not start this request. Retry the same request after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string"}}}}}}},"/v1/accounts/{id}":{"get":{"operationId":"accounts.get","description":"Read registered financial accounts, their currency, provider, brand color, logo and default status. Get, activity and overview require id. Activity returns the account's recent recorded payment effects and provider fees with their exact total. Overview returns what the account's page shows: the GL account it is held on (2135 keyed to the owner for a person's own card, whose balance is what the company owes that person across all their own accounts) and its balance; the latest movements (limit caps them, newest first; count is the total), each signed by the account's normal balance with its counterparty, running balance, counter accounts and, through a settled bill, the expense accounts it landed on; totals by month, counter account, expense account and counterparty; and its payment endpoints with full payto/CAIP-10 URIs and rails. List uses an exclusive financial-account-ID after cursor and includes archived accounts.","parameters":[{"name":"X-Economico-Business","in":"header","required":true,"description":"Explicit business slug for this request; must be approved by the connection and token.","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Canonical result; missing read objects are null. Money is in decimal integer strings.","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid envelope, query or domain input; also `missing_rates`, a foreign-currency command whose exchange rates the shared store could not supply (`details.missing_rates: [{ base, quote, date }]`, plus `details.refusal: { code, message }` when the command also refused), answered by stating an evidenced `exchangeRate`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token. Follow the WWW-Authenticate resource_metadata URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"}}}},"402":{"description":"plan_required: the command needs a platform plan this business is not on (members beyond the owner and shared views need Startup), or the command would record more events than Solo's monthly allowance has left. The allowance refusal writes nothing (a retry may keep its idempotency key) and carries `details: { reason, included, used, requested, from, through }` (counts as decimal strings; `from`/`through` the current events period as UTC instants). `reason` `solo_limit`: Solo's allowance; tell the founder the limit and that it resets at `through`, then retry after `through`, or once they upgrade to Startup or accept paid extra events. `reason` `plan_cancelled`: Startup was cancelled, or Solo's extra events were turned off; the extra events so far were billed then, and until the plan ends at `endsAt` the business has only `allowed` events in each billing period (its included events, or up to the end of a started block the cancellation billed), with no further extra events; after that it is on Solo (`after` `solo`, for Startup); retry after `through` (the next period's included events) or after `endsAt`. Tell the founder; they can keep Startup (or the extra events) from the billing page once the extra events billed then are paid (for monthly Startup whose cancellation billed extra events, keeping it takes a new Startup agreement from the end; a first-year YC price cannot carry over, so that plan ends as scheduled), or choose it again once it has ended. Any new paid plan (Startup, extra events, a switch or that new agreement) starts only once every invoice from Economico is paid; until then the billing page says so. `reason` `usage_settled`: Startup or Solo's extra events were kept after a cancel; this period's usage was settled then, so retry after `through`. With `details.closesAt`, the business is set to close then (its owner approved closing it): tell the founder, and do not wait for `endsAt` or suggest keeping or upgrading the plan; the owner can stop the closing at /account/cancel until then. Reads, exports and payment setup stay available, and so does upgrading unless the business is set to close (`closesAt`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Membership revoked, business unavailable for writes, or command credential requirements not met (browser-only commands refuse all OAuth tokens). `demo_business`: the business is a demo (`demo: true` on the business read: fictional, its owner's alone) and the command would reach someone else, send a message (support included, for now), publish it, take a plan or make it look like a real company, or the demo has recorded the 2,000 events it may record; tell the user, who can create their own business to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown route or missing required resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not supported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Allow":{"schema":{"type":"string"}}}},"408":{"description":"Request body transfer timed out (code `upload_timeout`): it took over 30 s, or paused over 5 s between chunks; retry the same request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Domain or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Length required (code `length_required`): a JSON body larger than 256 KiB must send Content-Length.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Payload too large (code `payload_too_large`): the request body exceeds the admitted byte limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"JSON body required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Address rate budget exhausted. Wait for Retry-After seconds before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","pattern":"^[0-9]+$"}}}},"500":{"description":"Internal failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Busy (code `busy`): the business is still receiving other document uploads or serving other large documents, and did not start this request. Retry the same request after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string"}}}}}}},"/v1/accounts/{id}/activity":{"get":{"operationId":"accounts.activity","description":"Read registered financial accounts, their currency, provider, brand color, logo and default status. Get, activity and overview require id. Activity returns the account's recent recorded payment effects and provider fees with their exact total. Overview returns what the account's page shows: the GL account it is held on (2135 keyed to the owner for a person's own card, whose balance is what the company owes that person across all their own accounts) and its balance; the latest movements (limit caps them, newest first; count is the total), each signed by the account's normal balance with its counterparty, running balance, counter accounts and, through a settled bill, the expense accounts it landed on; totals by month, counter account, expense account and counterparty; and its payment endpoints with full payto/CAIP-10 URIs and rails. List uses an exclusive financial-account-ID after cursor and includes archived accounts.","parameters":[{"name":"X-Economico-Business","in":"header","required":true,"description":"Explicit business slug for this request; must be approved by the connection and token.","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":500,"default":100}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Canonical result; missing read objects are null. Money is in decimal integer strings.","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid envelope, query or domain input; also `missing_rates`, a foreign-currency command whose exchange rates the shared store could not supply (`details.missing_rates: [{ base, quote, date }]`, plus `details.refusal: { code, message }` when the command also refused), answered by stating an evidenced `exchangeRate`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token. Follow the WWW-Authenticate resource_metadata URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"}}}},"402":{"description":"plan_required: the command needs a platform plan this business is not on (members beyond the owner and shared views need Startup), or the command would record more events than Solo's monthly allowance has left. The allowance refusal writes nothing (a retry may keep its idempotency key) and carries `details: { reason, included, used, requested, from, through }` (counts as decimal strings; `from`/`through` the current events period as UTC instants). `reason` `solo_limit`: Solo's allowance; tell the founder the limit and that it resets at `through`, then retry after `through`, or once they upgrade to Startup or accept paid extra events. `reason` `plan_cancelled`: Startup was cancelled, or Solo's extra events were turned off; the extra events so far were billed then, and until the plan ends at `endsAt` the business has only `allowed` events in each billing period (its included events, or up to the end of a started block the cancellation billed), with no further extra events; after that it is on Solo (`after` `solo`, for Startup); retry after `through` (the next period's included events) or after `endsAt`. Tell the founder; they can keep Startup (or the extra events) from the billing page once the extra events billed then are paid (for monthly Startup whose cancellation billed extra events, keeping it takes a new Startup agreement from the end; a first-year YC price cannot carry over, so that plan ends as scheduled), or choose it again once it has ended. Any new paid plan (Startup, extra events, a switch or that new agreement) starts only once every invoice from Economico is paid; until then the billing page says so. `reason` `usage_settled`: Startup or Solo's extra events were kept after a cancel; this period's usage was settled then, so retry after `through`. With `details.closesAt`, the business is set to close then (its owner approved closing it): tell the founder, and do not wait for `endsAt` or suggest keeping or upgrading the plan; the owner can stop the closing at /account/cancel until then. Reads, exports and payment setup stay available, and so does upgrading unless the business is set to close (`closesAt`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Membership revoked, business unavailable for writes, or command credential requirements not met (browser-only commands refuse all OAuth tokens). `demo_business`: the business is a demo (`demo: true` on the business read: fictional, its owner's alone) and the command would reach someone else, send a message (support included, for now), publish it, take a plan or make it look like a real company, or the demo has recorded the 2,000 events it may record; tell the user, who can create their own business to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown route or missing required resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not supported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Allow":{"schema":{"type":"string"}}}},"408":{"description":"Request body transfer timed out (code `upload_timeout`): it took over 30 s, or paused over 5 s between chunks; retry the same request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Domain or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Length required (code `length_required`): a JSON body larger than 256 KiB must send Content-Length.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Payload too large (code `payload_too_large`): the request body exceeds the admitted byte limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"JSON body required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Address rate budget exhausted. Wait for Retry-After seconds before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","pattern":"^[0-9]+$"}}}},"500":{"description":"Internal failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Busy (code `busy`): the business is still receiving other document uploads or serving other large documents, and did not start this request. Retry the same request after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string"}}}}}}},"/v1/accounts/{id}/overview":{"get":{"operationId":"accounts.overview","description":"Read registered financial accounts, their currency, provider, brand color, logo and default status. Get, activity and overview require id. Activity returns the account's recent recorded payment effects and provider fees with their exact total. Overview returns what the account's page shows: the GL account it is held on (2135 keyed to the owner for a person's own card, whose balance is what the company owes that person across all their own accounts) and its balance; the latest movements (limit caps them, newest first; count is the total), each signed by the account's normal balance with its counterparty, running balance, counter accounts and, through a settled bill, the expense accounts it landed on; totals by month, counter account, expense account and counterparty; and its payment endpoints with full payto/CAIP-10 URIs and rails. List uses an exclusive financial-account-ID after cursor and includes archived accounts.","parameters":[{"name":"X-Economico-Business","in":"header","required":true,"description":"Explicit business slug for this request; must be approved by the connection and token.","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":500,"default":100}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Canonical result; missing read objects are null. Money is in decimal integer strings.","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid envelope, query or domain input; also `missing_rates`, a foreign-currency command whose exchange rates the shared store could not supply (`details.missing_rates: [{ base, quote, date }]`, plus `details.refusal: { code, message }` when the command also refused), answered by stating an evidenced `exchangeRate`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token. Follow the WWW-Authenticate resource_metadata URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"}}}},"402":{"description":"plan_required: the command needs a platform plan this business is not on (members beyond the owner and shared views need Startup), or the command would record more events than Solo's monthly allowance has left. The allowance refusal writes nothing (a retry may keep its idempotency key) and carries `details: { reason, included, used, requested, from, through }` (counts as decimal strings; `from`/`through` the current events period as UTC instants). `reason` `solo_limit`: Solo's allowance; tell the founder the limit and that it resets at `through`, then retry after `through`, or once they upgrade to Startup or accept paid extra events. `reason` `plan_cancelled`: Startup was cancelled, or Solo's extra events were turned off; the extra events so far were billed then, and until the plan ends at `endsAt` the business has only `allowed` events in each billing period (its included events, or up to the end of a started block the cancellation billed), with no further extra events; after that it is on Solo (`after` `solo`, for Startup); retry after `through` (the next period's included events) or after `endsAt`. Tell the founder; they can keep Startup (or the extra events) from the billing page once the extra events billed then are paid (for monthly Startup whose cancellation billed extra events, keeping it takes a new Startup agreement from the end; a first-year YC price cannot carry over, so that plan ends as scheduled), or choose it again once it has ended. Any new paid plan (Startup, extra events, a switch or that new agreement) starts only once every invoice from Economico is paid; until then the billing page says so. `reason` `usage_settled`: Startup or Solo's extra events were kept after a cancel; this period's usage was settled then, so retry after `through`. With `details.closesAt`, the business is set to close then (its owner approved closing it): tell the founder, and do not wait for `endsAt` or suggest keeping or upgrading the plan; the owner can stop the closing at /account/cancel until then. Reads, exports and payment setup stay available, and so does upgrading unless the business is set to close (`closesAt`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Membership revoked, business unavailable for writes, or command credential requirements not met (browser-only commands refuse all OAuth tokens). `demo_business`: the business is a demo (`demo: true` on the business read: fictional, its owner's alone) and the command would reach someone else, send a message (support included, for now), publish it, take a plan or make it look like a real company, or the demo has recorded the 2,000 events it may record; tell the user, who can create their own business to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown route or missing required resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not supported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Allow":{"schema":{"type":"string"}}}},"408":{"description":"Request body transfer timed out (code `upload_timeout`): it took over 30 s, or paused over 5 s between chunks; retry the same request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Domain or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Length required (code `length_required`): a JSON body larger than 256 KiB must send Content-Length.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Payload too large (code `payload_too_large`): the request body exceeds the admitted byte limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"JSON body required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Address rate budget exhausted. Wait for Retry-After seconds before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","pattern":"^[0-9]+$"}}}},"500":{"description":"Internal failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Busy (code `busy`): the business is still receiving other document uploads or serving other large documents, and did not start this request. Retry the same request after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string"}}}}}}},"/v1/categories/{id}":{"get":{"operationId":"categories.get","description":"Read revenue categories. Get requires id. List pages by exclusive category-ID cursor.","parameters":[{"name":"X-Economico-Business","in":"header","required":true,"description":"Explicit business slug for this request; must be approved by the connection and token.","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":500,"default":100}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"name":"after","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Canonical result; missing read objects are null. Money is in decimal integer strings.","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid envelope, query or domain input; also `missing_rates`, a foreign-currency command whose exchange rates the shared store could not supply (`details.missing_rates: [{ base, quote, date }]`, plus `details.refusal: { code, message }` when the command also refused), answered by stating an evidenced `exchangeRate`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token. Follow the WWW-Authenticate resource_metadata URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"}}}},"402":{"description":"plan_required: the command needs a platform plan this business is not on (members beyond the owner and shared views need Startup), or the command would record more events than Solo's monthly allowance has left. The allowance refusal writes nothing (a retry may keep its idempotency key) and carries `details: { reason, included, used, requested, from, through }` (counts as decimal strings; `from`/`through` the current events period as UTC instants). `reason` `solo_limit`: Solo's allowance; tell the founder the limit and that it resets at `through`, then retry after `through`, or once they upgrade to Startup or accept paid extra events. `reason` `plan_cancelled`: Startup was cancelled, or Solo's extra events were turned off; the extra events so far were billed then, and until the plan ends at `endsAt` the business has only `allowed` events in each billing period (its included events, or up to the end of a started block the cancellation billed), with no further extra events; after that it is on Solo (`after` `solo`, for Startup); retry after `through` (the next period's included events) or after `endsAt`. Tell the founder; they can keep Startup (or the extra events) from the billing page once the extra events billed then are paid (for monthly Startup whose cancellation billed extra events, keeping it takes a new Startup agreement from the end; a first-year YC price cannot carry over, so that plan ends as scheduled), or choose it again once it has ended. Any new paid plan (Startup, extra events, a switch or that new agreement) starts only once every invoice from Economico is paid; until then the billing page says so. `reason` `usage_settled`: Startup or Solo's extra events were kept after a cancel; this period's usage was settled then, so retry after `through`. With `details.closesAt`, the business is set to close then (its owner approved closing it): tell the founder, and do not wait for `endsAt` or suggest keeping or upgrading the plan; the owner can stop the closing at /account/cancel until then. Reads, exports and payment setup stay available, and so does upgrading unless the business is set to close (`closesAt`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Membership revoked, business unavailable for writes, or command credential requirements not met (browser-only commands refuse all OAuth tokens). `demo_business`: the business is a demo (`demo: true` on the business read: fictional, its owner's alone) and the command would reach someone else, send a message (support included, for now), publish it, take a plan or make it look like a real company, or the demo has recorded the 2,000 events it may record; tell the user, who can create their own business to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown route or missing required resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not supported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Allow":{"schema":{"type":"string"}}}},"408":{"description":"Request body transfer timed out (code `upload_timeout`): it took over 30 s, or paused over 5 s between chunks; retry the same request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Domain or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Length required (code `length_required`): a JSON body larger than 256 KiB must send Content-Length.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Payload too large (code `payload_too_large`): the request body exceeds the admitted byte limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"JSON body required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Address rate budget exhausted. Wait for Retry-After seconds before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","pattern":"^[0-9]+$"}}}},"500":{"description":"Internal failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Busy (code `busy`): the business is still receiving other document uploads or serving other large documents, and did not start this request. Retry the same request after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string"}}}}}}},"/v1/tax_codes/{id}":{"get":{"operationId":"tax_codes.get","description":"Read configured tax codes: role (output, input, reverse_charge, imported_services, non_recoverable), rate in parts per million, effective period, the liability it credits and the sales-tax regime that seeded it. Get requires id. List includes inactive codes and pages by exclusive tax-code-ID cursor.","parameters":[{"name":"X-Economico-Business","in":"header","required":true,"description":"Explicit business slug for this request; must be approved by the connection and token.","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":500,"default":100}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"name":"after","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Canonical result; missing read objects are null. Money is in decimal integer strings.","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid envelope, query or domain input; also `missing_rates`, a foreign-currency command whose exchange rates the shared store could not supply (`details.missing_rates: [{ base, quote, date }]`, plus `details.refusal: { code, message }` when the command also refused), answered by stating an evidenced `exchangeRate`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token. Follow the WWW-Authenticate resource_metadata URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"}}}},"402":{"description":"plan_required: the command needs a platform plan this business is not on (members beyond the owner and shared views need Startup), or the command would record more events than Solo's monthly allowance has left. The allowance refusal writes nothing (a retry may keep its idempotency key) and carries `details: { reason, included, used, requested, from, through }` (counts as decimal strings; `from`/`through` the current events period as UTC instants). `reason` `solo_limit`: Solo's allowance; tell the founder the limit and that it resets at `through`, then retry after `through`, or once they upgrade to Startup or accept paid extra events. `reason` `plan_cancelled`: Startup was cancelled, or Solo's extra events were turned off; the extra events so far were billed then, and until the plan ends at `endsAt` the business has only `allowed` events in each billing period (its included events, or up to the end of a started block the cancellation billed), with no further extra events; after that it is on Solo (`after` `solo`, for Startup); retry after `through` (the next period's included events) or after `endsAt`. Tell the founder; they can keep Startup (or the extra events) from the billing page once the extra events billed then are paid (for monthly Startup whose cancellation billed extra events, keeping it takes a new Startup agreement from the end; a first-year YC price cannot carry over, so that plan ends as scheduled), or choose it again once it has ended. Any new paid plan (Startup, extra events, a switch or that new agreement) starts only once every invoice from Economico is paid; until then the billing page says so. `reason` `usage_settled`: Startup or Solo's extra events were kept after a cancel; this period's usage was settled then, so retry after `through`. With `details.closesAt`, the business is set to close then (its owner approved closing it): tell the founder, and do not wait for `endsAt` or suggest keeping or upgrading the plan; the owner can stop the closing at /account/cancel until then. Reads, exports and payment setup stay available, and so does upgrading unless the business is set to close (`closesAt`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Membership revoked, business unavailable for writes, or command credential requirements not met (browser-only commands refuse all OAuth tokens). `demo_business`: the business is a demo (`demo: true` on the business read: fictional, its owner's alone) and the command would reach someone else, send a message (support included, for now), publish it, take a plan or make it look like a real company, or the demo has recorded the 2,000 events it may record; tell the user, who can create their own business to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown route or missing required resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not supported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Allow":{"schema":{"type":"string"}}}},"408":{"description":"Request body transfer timed out (code `upload_timeout`): it took over 30 s, or paused over 5 s between chunks; retry the same request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Domain or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Length required (code `length_required`): a JSON body larger than 256 KiB must send Content-Length.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Payload too large (code `payload_too_large`): the request body exceeds the admitted byte limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"JSON body required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Address rate budget exhausted. Wait for Retry-After seconds before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","pattern":"^[0-9]+$"}}}},"500":{"description":"Internal failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Busy (code `busy`): the business is still receiving other document uploads or serving other large documents, and did not start this request. Retry the same request after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string"}}}}}}},"/v1/subjects/{type}/{id}":{"get":{"operationId":"subjects.get","description":"Read derived lifecycle state. Call types first: it lists every subject type with its statuses and the filters its list accepts. List and get require type; get requires id. List supports status, the type's declared filters (contract_id, activity_key, document_id, record_type, plan) and an exclusive subject-ID after cursor; a filter the type does not declare is refused. An activity_occurrence's state carries recordType (invoice, payment_receipt, bill, bill_payment, refund, credit_note, cancellation or activity_statement), and record_type filters by it. Types carry a founder label and note; activity, template, contract and activity_occurrence rows carry label and title (an occurrence also counterpartyId and, when its headline effect is money, amount, currency and decimals). An invoice, bill or receipt is titled by its occurrence key; a recording that moved nothing (an acceptance, a delivery) by the name of the activity it ran; correlate on state.occurrenceKey, never on title.","parameters":[{"name":"X-Economico-Business","in":"header","required":true,"description":"Explicit business slug for this request; must be approved by the connection and token.","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":500,"default":100}},{"name":"type","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"name":"status","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"after","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"contract_id","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"activity_key","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"document_id","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"record_type","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"plan","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Canonical result; missing read objects are null. Money is in decimal integer strings.","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid envelope, query or domain input; also `missing_rates`, a foreign-currency command whose exchange rates the shared store could not supply (`details.missing_rates: [{ base, quote, date }]`, plus `details.refusal: { code, message }` when the command also refused), answered by stating an evidenced `exchangeRate`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token. Follow the WWW-Authenticate resource_metadata URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"}}}},"402":{"description":"plan_required: the command needs a platform plan this business is not on (members beyond the owner and shared views need Startup), or the command would record more events than Solo's monthly allowance has left. The allowance refusal writes nothing (a retry may keep its idempotency key) and carries `details: { reason, included, used, requested, from, through }` (counts as decimal strings; `from`/`through` the current events period as UTC instants). `reason` `solo_limit`: Solo's allowance; tell the founder the limit and that it resets at `through`, then retry after `through`, or once they upgrade to Startup or accept paid extra events. `reason` `plan_cancelled`: Startup was cancelled, or Solo's extra events were turned off; the extra events so far were billed then, and until the plan ends at `endsAt` the business has only `allowed` events in each billing period (its included events, or up to the end of a started block the cancellation billed), with no further extra events; after that it is on Solo (`after` `solo`, for Startup); retry after `through` (the next period's included events) or after `endsAt`. Tell the founder; they can keep Startup (or the extra events) from the billing page once the extra events billed then are paid (for monthly Startup whose cancellation billed extra events, keeping it takes a new Startup agreement from the end; a first-year YC price cannot carry over, so that plan ends as scheduled), or choose it again once it has ended. Any new paid plan (Startup, extra events, a switch or that new agreement) starts only once every invoice from Economico is paid; until then the billing page says so. `reason` `usage_settled`: Startup or Solo's extra events were kept after a cancel; this period's usage was settled then, so retry after `through`. With `details.closesAt`, the business is set to close then (its owner approved closing it): tell the founder, and do not wait for `endsAt` or suggest keeping or upgrading the plan; the owner can stop the closing at /account/cancel until then. Reads, exports and payment setup stay available, and so does upgrading unless the business is set to close (`closesAt`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Membership revoked, business unavailable for writes, or command credential requirements not met (browser-only commands refuse all OAuth tokens). `demo_business`: the business is a demo (`demo: true` on the business read: fictional, its owner's alone) and the command would reach someone else, send a message (support included, for now), publish it, take a plan or make it look like a real company, or the demo has recorded the 2,000 events it may record; tell the user, who can create their own business to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown route or missing required resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not supported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Allow":{"schema":{"type":"string"}}}},"408":{"description":"Request body transfer timed out (code `upload_timeout`): it took over 30 s, or paused over 5 s between chunks; retry the same request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Domain or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Length required (code `length_required`): a JSON body larger than 256 KiB must send Content-Length.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Payload too large (code `payload_too_large`): the request body exceeds the admitted byte limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"JSON body required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Address rate budget exhausted. Wait for Retry-After seconds before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","pattern":"^[0-9]+$"}}}},"500":{"description":"Internal failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Busy (code `busy`): the business is still receiving other document uploads or serving other large documents, and did not start this request. Retry the same request after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string"}}}}}}},"/v1/reports":{"post":{"operationId":"reports.run","description":"Run one public report. Monetary values are integer strings; ratios and assumptions may be fractional numbers.","requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","additionalProperties":false,"properties":{"kind":{"const":"fx_rate"},"base":{"description":"Source ISO 4217 currency code.","type":"string","minLength":1},"quote":{"description":"Destination ISO 4217 currency code; defaults to functional currency.","type":"string","minLength":1},"date":{"description":"Requested rate day (YYYY-MM-DD or UTC RFC 3339 instant); defaults to the runtime day. Future days are refused.","type":"string","minLength":1}},"required":["kind","base"]},{"type":"object","additionalProperties":false,"properties":{"kind":{"const":"activity_balances"},"as_of":{"description":"Date (YYYY-MM-DD) or RFC 3339 instant the report is taken at; postings effective before it count.","type":"string","minLength":1},"contract_id":{"description":"Resolved activity-contract subject ID.","type":"string","minLength":1},"activity_key":{"description":"Activity binding key within the contract.","type":"string","minLength":1},"party_id":{"description":"Party subject ID.","type":"string","minLength":1},"ledger_id":{"description":"Native ledger ID.","type":"string","minLength":1},"account_code":{"description":"Native chart account code.","type":"integer","minimum":1}},"required":["kind","as_of"]},{"type":"object","additionalProperties":false,"properties":{"kind":{"const":"party_contract_values"},"party_ids":{"description":"One or more party ids, comma-separated, e.g. pty_a,pty_b (at most 50; spaces around commas are ignored).","type":"string","minLength":1},"as_of":{"description":"Date (YYYY-MM-DD) or RFC 3339 instant the report is taken at; postings effective before it count.","type":"string","minLength":1},"contract_value_only":{"description":"true returns only party/side/unit identity and contractValue, using maintained effective-time totals for list reads; cannot be combined with by_contract. valueSource describes maintained, mixed or computed fallback reads.","type":"boolean"},"by_contract":{"description":"true splits each row by contract, adding contractId, contractName and annualised (the row holds an open-ended right's one year rather than only a committed term); the rows add up to those without it.","type":"boolean"}},"required":["kind","party_ids"]},{"type":"object","additionalProperties":false,"properties":{"kind":{"const":"activity_claims"},"contract_id":{"description":"Resolved activity-contract subject ID.","type":"string","minLength":1},"party_id":{"description":"Party subject ID.","type":"string","minLength":1},"open":{"description":"true returns only the party's claims still open now (needs party_id; no as_of).","type":"boolean"},"as_of":{"description":"Date (YYYY-MM-DD) or RFC 3339 instant the report is taken at; postings effective before it count.","type":"string","minLength":1}},"required":["kind"]},{"type":"object","additionalProperties":false,"properties":{"kind":{"const":"activity_plan"},"contract_id":{"description":"Resolved activity-contract subject ID.","type":"string","minLength":1},"from":{"description":"Inclusive window start; date (YYYY-MM-DD) or RFC 3339 instant. A date starts at midnight UTC, so that whole day is included.","type":"string","minLength":1},"through":{"description":"Inclusive end; date (YYYY-MM-DD) or RFC 3339 instant. A date means midnight UTC at its START, so pass an end-of-day instant to include that day.","type":"string","minLength":1}},"required":["kind","contract_id","from","through"]},{"type":"object","additionalProperties":false,"properties":{"kind":{"const":"pipeline"}},"required":["kind"]},{"type":"object","additionalProperties":false,"properties":{"kind":{"const":"activity_capacity"},"contract_id":{"description":"Resolved activity-contract subject ID.","type":"string","minLength":1},"as_of":{"description":"Date (YYYY-MM-DD) or RFC 3339 instant the report is taken at; postings effective before it count.","type":"string","minLength":1}},"required":["kind","contract_id","as_of"]},{"type":"object","additionalProperties":false,"properties":{"kind":{"const":"activity_effects"},"contract_id":{"description":"Resolved activity-contract subject ID.","type":"string","minLength":1},"activity_key":{"description":"Activity binding key within the contract.","type":"string","minLength":1},"occurrence_key":{"description":"Stable occurrence key for exact billing claim identities; omitted previews use an unrecorded preview identity.","type":"string","minLength":1},"effective_at":{"description":"Effective date (YYYY-MM-DD) or RFC 3339 instant for activity evaluation and balances.","type":"string","minLength":1},"facts":{"description":"Named observed facts: integer amounts as decimal strings, dates and text. Required names and units come from the bound activity.","type":"object","maxProperties":100,"additionalProperties":{"type":"string"}}},"required":["kind"]},{"type":"object","additionalProperties":false,"properties":{"kind":{"const":"balances"},"currency":{"description":"Ledger currency (default: the functional currency active for the report period).","type":"string","minLength":1}},"required":["kind"]},{"type":"object","additionalProperties":false,"properties":{"kind":{"const":"mapped_trial_balance"},"package_id":{"description":"Exact immutable reporting-profile package ID; no jurisdiction fallback.","type":"string","minLength":1},"as_of":{"description":"Date (YYYY-MM-DD) or RFC 3339 instant the report is taken at; postings effective before it count.","type":"string","minLength":1},"currency":{"description":"Ledger currency (default: the functional currency active for the report period).","type":"string","minLength":1},"presentation":{"description":"Reference to one exact evidenced source-to-national-currency rate event when the selected statutory package requires a presentation currency different from the native ledger.","type":"object","additionalProperties":false,"required":["rate_event_id"],"properties":{"rate_event_id":{"type":"integer","minimum":1}}}},"required":["kind","package_id","as_of"]},{"type":"object","additionalProperties":false,"properties":{"kind":{"const":"balance_sheet"},"currency":{"description":"Ledger currency (default: the functional currency active for the report period).","type":"string","minLength":1},"as_of":{"description":"Date (YYYY-MM-DD) or RFC 3339 instant the report is taken at; postings effective before it count.","type":"string","minLength":1}},"required":["kind"]},{"type":"object","additionalProperties":false,"properties":{"kind":{"const":"capital_accounts"},"currency":{"description":"Ledger currency (default: the functional currency active for the report period).","type":"string","minLength":1},"as_of":{"description":"Date (YYYY-MM-DD) or RFC 3339 instant the report is taken at; postings effective before it count.","type":"string","minLength":1}},"required":["kind"]},{"type":"object","additionalProperties":false,"properties":{"kind":{"const":"income_statement"},"currency":{"description":"Ledger currency (default: the functional currency active for the report period).","type":"string","minLength":1},"from":{"description":"Inclusive window start; date (YYYY-MM-DD) or RFC 3339 instant. A date starts at midnight UTC, so that whole day is included.","type":"string","minLength":1},"until":{"description":"Exclusive window end; date (YYYY-MM-DD) or RFC 3339 instant. A date means midnight UTC at its START, so that day is excluded — pass the first day after the period.","type":"string","minLength":1},"window":{"description":"Instead of from/until: all, YYYY, YYYY-Qn, YYYY-MM, or ytd / qtd / mtd (to the moment the report runs).","type":"string","minLength":1}},"required":["kind"]},{"type":"object","additionalProperties":false,"properties":{"kind":{"const":"income_statement_periods"},"currency":{"description":"Ledger currency (default: the functional currency active for the report period).","type":"string","minLength":1},"through_month":{"description":"Last month, YYYY-MM (default: this month).","type":"string","minLength":1,"pattern":"^[0-9]{4}-[0-9]{2}$"},"months":{"description":"How many monthly columns, 2–24 (default 6).","type":"integer","minimum":2,"maximum":24}},"required":["kind"]},{"type":"object","additionalProperties":false,"properties":{"kind":{"const":"revenue_summary"},"period_start":{"description":"Inclusive window start; date (YYYY-MM-DD) or RFC 3339 instant. A date starts at midnight UTC, so that whole day is included.","type":"string","minLength":1},"period_end":{"description":"Inclusive end; date (YYYY-MM-DD) or RFC 3339 instant. A date means midnight UTC at its START, so pass an end-of-day instant to include that day.","type":"string","minLength":1}},"required":["kind","period_start","period_end"]},{"type":"object","additionalProperties":false,"properties":{"kind":{"const":"recognition"},"as_of":{"description":"Date (YYYY-MM-DD) or RFC 3339 instant the report is taken at; postings effective before it count.","type":"string","minLength":1},"contract_id":{"description":"Resolved activity-contract subject ID.","type":"string","minLength":1},"through":{"description":"Inclusive end; date (YYYY-MM-DD) or RFC 3339 instant. A date means midnight UTC at its START, so pass an end-of-day instant to include that day.","type":"string","minLength":1},"party_id":{"description":"Party subject ID.","type":"string","minLength":1},"document_id":{"description":"An invoice or bill document. Priced rights follow its obligation through recognition; right-scoped refunds without document attribution refuse this filter.","type":"string","minLength":1}},"required":["kind","as_of"]},{"type":"object","additionalProperties":false,"properties":{"kind":{"const":"amortization"},"as_of":{"description":"Date (YYYY-MM-DD) or RFC 3339 instant the report is taken at; postings effective before it count.","type":"string","minLength":1},"contract_id":{"description":"Resolved activity-contract subject ID.","type":"string","minLength":1},"through":{"description":"Inclusive end; date (YYYY-MM-DD) or RFC 3339 instant. A date means midnight UTC at its START, so pass an end-of-day instant to include that day.","type":"string","minLength":1},"party_id":{"description":"Party subject ID.","type":"string","minLength":1},"document_id":{"description":"An invoice or bill document. Priced rights follow its obligation through recognition; right-scoped refunds without document attribution refuse this filter.","type":"string","minLength":1}},"required":["kind","as_of"]},{"type":"object","additionalProperties":false,"properties":{"kind":{"const":"aging"},"direction":{"description":"receivable (default) or payable.","type":"string","minLength":1,"enum":["receivable","payable"]},"as_of":{"description":"Date (YYYY-MM-DD) or RFC 3339 instant the report is taken at; postings effective before it count.","type":"string","minLength":1},"party_id":{"description":"Party subject ID.","type":"string","minLength":1}},"required":["kind","as_of"]},{"type":"object","additionalProperties":false,"properties":{"kind":{"const":"saas_metrics"},"year":{"description":"Calendar year (not the business fiscal year); quarter is a calendar quarter.","type":"integer","minimum":2000,"maximum":2100},"month":{"description":"Month; exclusive with quarter.","type":"integer","minimum":1,"maximum":12},"quarter":{"description":"Quarter; exclusive with month.","type":"integer","minimum":1,"maximum":4},"currency":{"description":"Ledger currency (default: the functional currency active for the report period).","type":"string","minLength":1},"as_of":{"description":"Date (YYYY-MM-DD) or RFC 3339 instant the report is taken at; postings effective before it count.","type":"string","minLength":1},"trend":{"description":"true adds a 12-month series per supported metric ending at the month (month granularity only).","type":"boolean"}},"required":["kind","year"]},{"type":"object","additionalProperties":false,"properties":{"kind":{"const":"default_alive"},"period":{"description":"YYYY-MM.","type":"string","minLength":1,"pattern":"^[0-9]{4}-[0-9]{2}$"},"currency":{"description":"Ledger currency (default: the functional currency active for the report period).","type":"string","minLength":1},"cash_minor_units":{"description":"What-if: cash in minor units (integer string) instead of the books'.","type":"string","minLength":1},"monthly_revenue_minor_units":{"description":"What-if: monthly revenue in minor units (integer string).","type":"string","minLength":1},"monthly_expenses_minor_units":{"description":"What-if: monthly expenses in minor units (integer string).","type":"string","minLength":1},"monthly_growth_rate":{"description":"What-if: month-over-month revenue growth as a decimal, e.g. 0.12 for 12%.","type":"number","exclusiveMinimum":-1,"maximum":5},"exclude_startup_credits":{"description":"true adds back promotional/startup credits applied this month (5950).","type":"boolean"}},"required":["kind","period"]},{"type":"object","additionalProperties":false,"properties":{"kind":{"const":"unit_economics"},"currency":{"description":"Ledger currency (default: the functional currency active for the report period).","type":"string","minLength":1},"from":{"description":"Inclusive window start; date (YYYY-MM-DD) or RFC 3339 instant. A date starts at midnight UTC, so that whole day is included.","type":"string","minLength":1},"until":{"description":"Exclusive window end; date (YYYY-MM-DD) or RFC 3339 instant. A date means midnight UTC at its START, so that day is excluded — pass the first day after the period.","type":"string","minLength":1}},"required":["kind"]},{"type":"object","additionalProperties":false,"properties":{"kind":{"const":"platform_fees"},"period":{"description":"YYYY-MM.","type":"string","minLength":1,"pattern":"^[0-9]{4}-[0-9]{2}$"}},"required":["kind","period"]},{"type":"object","additionalProperties":false,"properties":{"kind":{"const":"model_preview"},"model":{"type":"object","additionalProperties":false,"required":["plans"],"properties":{"company":{"type":"string","minLength":1,"maxLength":1000},"sells":{"type":"string","minLength":1,"maxLength":1000,"description":"What the company sells, to whom, and how it is delivered."},"plans":{"type":"array","maxItems":50,"items":{"type":"object","additionalProperties":false,"required":["key","name","cadence"],"properties":{"key":{"type":"string","minLength":1,"maxLength":1000,"description":"The plan's id in this proposal; customers name it."},"name":{"type":"string","minLength":1,"maxLength":1000},"price":{"type":"string","description":"Minor units as an integer string: 4900 is $49.00."},"currency":{"type":"string","minLength":1,"maxLength":1000,"description":"Supported ISO currency; defaults to the report currency."},"pricing":{"type":"string","minLength":1,"maxLength":1000,"description":"Variable or tiered price terms; omit price when unknown."},"cadence":{"enum":["month","year","one_time","usage"],"description":"When it bills: usage is priced per unit."},"includes":{"type":"string","minLength":1,"maxLength":1000},"overage":{"type":"string","minLength":1,"maxLength":1000},"template":{"type":"string","minLength":1,"maxLength":1000,"description":"The template this plan will become."},"source":{"type":"string","minLength":1,"maxLength":1000}}}},"customers":{"type":"array","maxItems":500,"items":{"type":"object","additionalProperties":false,"required":["name","plan"],"properties":{"name":{"type":"string","minLength":1,"maxLength":1000},"plan":{"type":"string","minLength":1,"maxLength":1000,"description":"A plan key."},"since":{"type":"string","description":"YYYY-MM-DD."},"price":{"type":"string","description":"Only when it differs from the plan's list price."},"status":{"enum":["active","ended"]},"source":{"type":"string","minLength":1,"maxLength":1000}}}},"vendors":{"type":"array","maxItems":100,"items":{"type":"object","additionalProperties":false,"required":["name","for","cadence"],"properties":{"name":{"type":"string","minLength":1,"maxLength":1000},"for":{"type":"string","minLength":1,"maxLength":1000},"amount":{"type":"string","description":"Per cadence; omit when unknown, never substitute zero."},"currency":{"type":"string","minLength":1,"maxLength":1000,"description":"Supported ISO currency; defaults to the report currency."},"status":{"enum":["active","ended"]},"amount_basis":{"enum":["tax_inclusive","tax_exclusive"]},"tax":{"type":"string","minLength":1,"maxLength":1000,"description":"Observed tax terms; no tax or recoverability is inferred."},"cadence":{"enum":["month","year","one_time","usage"]},"paid_by":{"type":"string","minLength":1,"maxLength":1000},"account":{"type":"integer","description":"Expense account code in the chart."},"function":{"enum":["cost_of_revenue","research_and_development","sales_and_marketing","general_and_administrative","other"]},"drivers":{"type":"array","maxItems":20,"items":{"type":"string","minLength":1,"maxLength":1000},"description":"The product actions that drive this vendor's cost (the service-call map)."},"source":{"type":"string","minLength":1,"maxLength":1000}}}}},"description":"The proposal: plans (key, name, cadence, optional price, currency, pricing), customers (name, plan key, since, price when not list), vendors (name, for, cadence, optional amount, currency, status, amount_basis, tax, account, function, drivers). Known amounts are minor-unit integer strings; omit unknown amounts."},"currency":{"description":"Ledger currency (default: the functional currency active for the report period).","type":"string","minLength":1}},"required":["kind","model"]},{"type":"object","additionalProperties":false,"properties":{"kind":{"const":"cap_table"},"as_of":{"description":"Date (YYYY-MM-DD) or RFC 3339 instant the report is taken at; postings effective before it count.","type":"string","minLength":1},"ledger_id":{"description":"Native ledger ID.","type":"string","minLength":1}},"required":["kind"]}]}}}},"responses":{"200":{"description":"Canonical result; missing read objects are null. Money is in decimal integer strings.","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid envelope, query or domain input; also `missing_rates`, a foreign-currency command whose exchange rates the shared store could not supply (`details.missing_rates: [{ base, quote, date }]`, plus `details.refusal: { code, message }` when the command also refused), answered by stating an evidenced `exchangeRate`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token. Follow the WWW-Authenticate resource_metadata URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"}}}},"402":{"description":"plan_required: the command needs a platform plan this business is not on (members beyond the owner and shared views need Startup), or the command would record more events than Solo's monthly allowance has left. The allowance refusal writes nothing (a retry may keep its idempotency key) and carries `details: { reason, included, used, requested, from, through }` (counts as decimal strings; `from`/`through` the current events period as UTC instants). `reason` `solo_limit`: Solo's allowance; tell the founder the limit and that it resets at `through`, then retry after `through`, or once they upgrade to Startup or accept paid extra events. `reason` `plan_cancelled`: Startup was cancelled, or Solo's extra events were turned off; the extra events so far were billed then, and until the plan ends at `endsAt` the business has only `allowed` events in each billing period (its included events, or up to the end of a started block the cancellation billed), with no further extra events; after that it is on Solo (`after` `solo`, for Startup); retry after `through` (the next period's included events) or after `endsAt`. Tell the founder; they can keep Startup (or the extra events) from the billing page once the extra events billed then are paid (for monthly Startup whose cancellation billed extra events, keeping it takes a new Startup agreement from the end; a first-year YC price cannot carry over, so that plan ends as scheduled), or choose it again once it has ended. Any new paid plan (Startup, extra events, a switch or that new agreement) starts only once every invoice from Economico is paid; until then the billing page says so. `reason` `usage_settled`: Startup or Solo's extra events were kept after a cancel; this period's usage was settled then, so retry after `through`. With `details.closesAt`, the business is set to close then (its owner approved closing it): tell the founder, and do not wait for `endsAt` or suggest keeping or upgrading the plan; the owner can stop the closing at /account/cancel until then. Reads, exports and payment setup stay available, and so does upgrading unless the business is set to close (`closesAt`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Membership revoked, business unavailable for writes, or command credential requirements not met (browser-only commands refuse all OAuth tokens). `demo_business`: the business is a demo (`demo: true` on the business read: fictional, its owner's alone) and the command would reach someone else, send a message (support included, for now), publish it, take a plan or make it look like a real company, or the demo has recorded the 2,000 events it may record; tell the user, who can create their own business to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown route or missing required resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not supported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Allow":{"schema":{"type":"string"}}}},"408":{"description":"Request body transfer timed out (code `upload_timeout`): it took over 30 s, or paused over 5 s between chunks; retry the same request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Domain or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Length required (code `length_required`): a JSON body larger than 256 KiB must send Content-Length.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Payload too large (code `payload_too_large`): the request body exceeds the admitted byte limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"JSON body required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Address rate budget exhausted. Wait for Retry-After seconds before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","pattern":"^[0-9]+$"}}}},"500":{"description":"Internal failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Busy (code `busy`): the business is still receiving other document uploads or serving other large documents, and did not start this request. Retry the same request after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string"}}}}},"parameters":[{"name":"X-Economico-Business","in":"header","required":true,"description":"Explicit business slug for this request; must be approved by the connection and token.","schema":{"type":"string"}}]},"get":{"operationId":"reports.list","description":"List all public report kinds, parameters and examples.","responses":{"200":{"description":"Canonical result; missing read objects are null. Money is in decimal integer strings.","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid envelope, query or domain input; also `missing_rates`, a foreign-currency command whose exchange rates the shared store could not supply (`details.missing_rates: [{ base, quote, date }]`, plus `details.refusal: { code, message }` when the command also refused), answered by stating an evidenced `exchangeRate`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token. Follow the WWW-Authenticate resource_metadata URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"}}}},"402":{"description":"plan_required: the command needs a platform plan this business is not on (members beyond the owner and shared views need Startup), or the command would record more events than Solo's monthly allowance has left. The allowance refusal writes nothing (a retry may keep its idempotency key) and carries `details: { reason, included, used, requested, from, through }` (counts as decimal strings; `from`/`through` the current events period as UTC instants). `reason` `solo_limit`: Solo's allowance; tell the founder the limit and that it resets at `through`, then retry after `through`, or once they upgrade to Startup or accept paid extra events. `reason` `plan_cancelled`: Startup was cancelled, or Solo's extra events were turned off; the extra events so far were billed then, and until the plan ends at `endsAt` the business has only `allowed` events in each billing period (its included events, or up to the end of a started block the cancellation billed), with no further extra events; after that it is on Solo (`after` `solo`, for Startup); retry after `through` (the next period's included events) or after `endsAt`. Tell the founder; they can keep Startup (or the extra events) from the billing page once the extra events billed then are paid (for monthly Startup whose cancellation billed extra events, keeping it takes a new Startup agreement from the end; a first-year YC price cannot carry over, so that plan ends as scheduled), or choose it again once it has ended. Any new paid plan (Startup, extra events, a switch or that new agreement) starts only once every invoice from Economico is paid; until then the billing page says so. `reason` `usage_settled`: Startup or Solo's extra events were kept after a cancel; this period's usage was settled then, so retry after `through`. With `details.closesAt`, the business is set to close then (its owner approved closing it): tell the founder, and do not wait for `endsAt` or suggest keeping or upgrading the plan; the owner can stop the closing at /account/cancel until then. Reads, exports and payment setup stay available, and so does upgrading unless the business is set to close (`closesAt`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Membership revoked, business unavailable for writes, or command credential requirements not met (browser-only commands refuse all OAuth tokens). `demo_business`: the business is a demo (`demo: true` on the business read: fictional, its owner's alone) and the command would reach someone else, send a message (support included, for now), publish it, take a plan or make it look like a real company, or the demo has recorded the 2,000 events it may record; tell the user, who can create their own business to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown route or missing required resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not supported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Allow":{"schema":{"type":"string"}}}},"408":{"description":"Request body transfer timed out (code `upload_timeout`): it took over 30 s, or paused over 5 s between chunks; retry the same request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Domain or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Length required (code `length_required`): a JSON body larger than 256 KiB must send Content-Length.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Payload too large (code `payload_too_large`): the request body exceeds the admitted byte limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"JSON body required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Address rate budget exhausted. Wait for Retry-After seconds before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","pattern":"^[0-9]+$"}}}},"500":{"description":"Internal failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Busy (code `busy`): the business is still receiving other document uploads or serving other large documents, and did not start this request. Retry the same request after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string"}}}}},"parameters":[{"name":"X-Economico-Business","in":"header","required":true,"description":"Explicit business slug for this request; must be approved by the connection and token.","schema":{"type":"string"}}]}},"/v1/catalog":{"get":{"operationId":"catalog.list","description":"List permitted command names and descriptions.","responses":{"200":{"description":"Canonical result; missing read objects are null. Money is in decimal integer strings.","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid envelope, query or domain input; also `missing_rates`, a foreign-currency command whose exchange rates the shared store could not supply (`details.missing_rates: [{ base, quote, date }]`, plus `details.refusal: { code, message }` when the command also refused), answered by stating an evidenced `exchangeRate`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token. Follow the WWW-Authenticate resource_metadata URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"}}}},"402":{"description":"plan_required: the command needs a platform plan this business is not on (members beyond the owner and shared views need Startup), or the command would record more events than Solo's monthly allowance has left. The allowance refusal writes nothing (a retry may keep its idempotency key) and carries `details: { reason, included, used, requested, from, through }` (counts as decimal strings; `from`/`through` the current events period as UTC instants). `reason` `solo_limit`: Solo's allowance; tell the founder the limit and that it resets at `through`, then retry after `through`, or once they upgrade to Startup or accept paid extra events. `reason` `plan_cancelled`: Startup was cancelled, or Solo's extra events were turned off; the extra events so far were billed then, and until the plan ends at `endsAt` the business has only `allowed` events in each billing period (its included events, or up to the end of a started block the cancellation billed), with no further extra events; after that it is on Solo (`after` `solo`, for Startup); retry after `through` (the next period's included events) or after `endsAt`. Tell the founder; they can keep Startup (or the extra events) from the billing page once the extra events billed then are paid (for monthly Startup whose cancellation billed extra events, keeping it takes a new Startup agreement from the end; a first-year YC price cannot carry over, so that plan ends as scheduled), or choose it again once it has ended. Any new paid plan (Startup, extra events, a switch or that new agreement) starts only once every invoice from Economico is paid; until then the billing page says so. `reason` `usage_settled`: Startup or Solo's extra events were kept after a cancel; this period's usage was settled then, so retry after `through`. With `details.closesAt`, the business is set to close then (its owner approved closing it): tell the founder, and do not wait for `endsAt` or suggest keeping or upgrading the plan; the owner can stop the closing at /account/cancel until then. Reads, exports and payment setup stay available, and so does upgrading unless the business is set to close (`closesAt`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Membership revoked, business unavailable for writes, or command credential requirements not met (browser-only commands refuse all OAuth tokens). `demo_business`: the business is a demo (`demo: true` on the business read: fictional, its owner's alone) and the command would reach someone else, send a message (support included, for now), publish it, take a plan or make it look like a real company, or the demo has recorded the 2,000 events it may record; tell the user, who can create their own business to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown route or missing required resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not supported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Allow":{"schema":{"type":"string"}}}},"408":{"description":"Request body transfer timed out (code `upload_timeout`): it took over 30 s, or paused over 5 s between chunks; retry the same request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Domain or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Length required (code `length_required`): a JSON body larger than 256 KiB must send Content-Length.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Payload too large (code `payload_too_large`): the request body exceeds the admitted byte limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"JSON body required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Address rate budget exhausted. Wait for Retry-After seconds before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","pattern":"^[0-9]+$"}}}},"500":{"description":"Internal failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Busy (code `busy`): the business is still receiving other document uploads or serving other large documents, and did not start this request. Retry the same request after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string"}}}}},"parameters":[{"name":"X-Economico-Business","in":"header","required":true,"description":"Explicit business slug for this request; must be approved by the connection and token.","schema":{"type":"string"}}]}},"/v1/catalog/permissions":{"get":{"operationId":"catalog.permissions","description":"Read effective permission statements and resource constraints.","responses":{"200":{"description":"Canonical result; missing read objects are null. Money is in decimal integer strings.","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid envelope, query or domain input; also `missing_rates`, a foreign-currency command whose exchange rates the shared store could not supply (`details.missing_rates: [{ base, quote, date }]`, plus `details.refusal: { code, message }` when the command also refused), answered by stating an evidenced `exchangeRate`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token. Follow the WWW-Authenticate resource_metadata URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"}}}},"402":{"description":"plan_required: the command needs a platform plan this business is not on (members beyond the owner and shared views need Startup), or the command would record more events than Solo's monthly allowance has left. The allowance refusal writes nothing (a retry may keep its idempotency key) and carries `details: { reason, included, used, requested, from, through }` (counts as decimal strings; `from`/`through` the current events period as UTC instants). `reason` `solo_limit`: Solo's allowance; tell the founder the limit and that it resets at `through`, then retry after `through`, or once they upgrade to Startup or accept paid extra events. `reason` `plan_cancelled`: Startup was cancelled, or Solo's extra events were turned off; the extra events so far were billed then, and until the plan ends at `endsAt` the business has only `allowed` events in each billing period (its included events, or up to the end of a started block the cancellation billed), with no further extra events; after that it is on Solo (`after` `solo`, for Startup); retry after `through` (the next period's included events) or after `endsAt`. Tell the founder; they can keep Startup (or the extra events) from the billing page once the extra events billed then are paid (for monthly Startup whose cancellation billed extra events, keeping it takes a new Startup agreement from the end; a first-year YC price cannot carry over, so that plan ends as scheduled), or choose it again once it has ended. Any new paid plan (Startup, extra events, a switch or that new agreement) starts only once every invoice from Economico is paid; until then the billing page says so. `reason` `usage_settled`: Startup or Solo's extra events were kept after a cancel; this period's usage was settled then, so retry after `through`. With `details.closesAt`, the business is set to close then (its owner approved closing it): tell the founder, and do not wait for `endsAt` or suggest keeping or upgrading the plan; the owner can stop the closing at /account/cancel until then. Reads, exports and payment setup stay available, and so does upgrading unless the business is set to close (`closesAt`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Membership revoked, business unavailable for writes, or command credential requirements not met (browser-only commands refuse all OAuth tokens). `demo_business`: the business is a demo (`demo: true` on the business read: fictional, its owner's alone) and the command would reach someone else, send a message (support included, for now), publish it, take a plan or make it look like a real company, or the demo has recorded the 2,000 events it may record; tell the user, who can create their own business to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown route or missing required resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not supported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Allow":{"schema":{"type":"string"}}}},"408":{"description":"Request body transfer timed out (code `upload_timeout`): it took over 30 s, or paused over 5 s between chunks; retry the same request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Domain or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Length required (code `length_required`): a JSON body larger than 256 KiB must send Content-Length.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Payload too large (code `payload_too_large`): the request body exceeds the admitted byte limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"JSON body required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Address rate budget exhausted. Wait for Retry-After seconds before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","pattern":"^[0-9]+$"}}}},"500":{"description":"Internal failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Busy (code `busy`): the business is still receiving other document uploads or serving other large documents, and did not start this request. Retry the same request after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string"}}}}},"parameters":[{"name":"X-Economico-Business","in":"header","required":true,"description":"Explicit business slug for this request; must be approved by the connection and token.","schema":{"type":"string"}}]}},"/v1/export":{"get":{"operationId":"export.get","description":"Export the event history and document manifest with authenticated download URLs. Event paging remains deferred maintenance. The export is the raw content-addressed DAG-CBOR blocks and is not redacted: unlike the events read, ingestion.* payloads keep the captured delegation (authority) and each upload's tokenHash, so treat an export as sensitive.","responses":{"200":{"description":"Canonical result; missing read objects are null. Money is in decimal integer strings.","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid envelope, query or domain input; also `missing_rates`, a foreign-currency command whose exchange rates the shared store could not supply (`details.missing_rates: [{ base, quote, date }]`, plus `details.refusal: { code, message }` when the command also refused), answered by stating an evidenced `exchangeRate`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token. Follow the WWW-Authenticate resource_metadata URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"}}}},"402":{"description":"plan_required: the command needs a platform plan this business is not on (members beyond the owner and shared views need Startup), or the command would record more events than Solo's monthly allowance has left. The allowance refusal writes nothing (a retry may keep its idempotency key) and carries `details: { reason, included, used, requested, from, through }` (counts as decimal strings; `from`/`through` the current events period as UTC instants). `reason` `solo_limit`: Solo's allowance; tell the founder the limit and that it resets at `through`, then retry after `through`, or once they upgrade to Startup or accept paid extra events. `reason` `plan_cancelled`: Startup was cancelled, or Solo's extra events were turned off; the extra events so far were billed then, and until the plan ends at `endsAt` the business has only `allowed` events in each billing period (its included events, or up to the end of a started block the cancellation billed), with no further extra events; after that it is on Solo (`after` `solo`, for Startup); retry after `through` (the next period's included events) or after `endsAt`. Tell the founder; they can keep Startup (or the extra events) from the billing page once the extra events billed then are paid (for monthly Startup whose cancellation billed extra events, keeping it takes a new Startup agreement from the end; a first-year YC price cannot carry over, so that plan ends as scheduled), or choose it again once it has ended. Any new paid plan (Startup, extra events, a switch or that new agreement) starts only once every invoice from Economico is paid; until then the billing page says so. `reason` `usage_settled`: Startup or Solo's extra events were kept after a cancel; this period's usage was settled then, so retry after `through`. With `details.closesAt`, the business is set to close then (its owner approved closing it): tell the founder, and do not wait for `endsAt` or suggest keeping or upgrading the plan; the owner can stop the closing at /account/cancel until then. Reads, exports and payment setup stay available, and so does upgrading unless the business is set to close (`closesAt`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Membership revoked, business unavailable for writes, or command credential requirements not met (browser-only commands refuse all OAuth tokens). `demo_business`: the business is a demo (`demo: true` on the business read: fictional, its owner's alone) and the command would reach someone else, send a message (support included, for now), publish it, take a plan or make it look like a real company, or the demo has recorded the 2,000 events it may record; tell the user, who can create their own business to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown route or missing required resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not supported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Allow":{"schema":{"type":"string"}}}},"408":{"description":"Request body transfer timed out (code `upload_timeout`): it took over 30 s, or paused over 5 s between chunks; retry the same request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Domain or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Length required (code `length_required`): a JSON body larger than 256 KiB must send Content-Length.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Payload too large (code `payload_too_large`): the request body exceeds the admitted byte limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"JSON body required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Address rate budget exhausted. Wait for Retry-After seconds before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","pattern":"^[0-9]+$"}}}},"500":{"description":"Internal failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Busy (code `busy`): the business is still receiving other document uploads or serving other large documents, and did not start this request. Retry the same request after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string"}}}}},"parameters":[{"name":"X-Economico-Business","in":"header","required":true,"description":"Explicit business slug for this request; must be approved by the connection and token.","schema":{"type":"string"}}]}},"/v1/openapi.json":{"get":{"operationId":"openapi.get","description":"Generated OpenAPI for the current public catalog.","responses":{"200":{"description":"Canonical result; missing read objects are null. Money is in decimal integer strings.","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid envelope, query or domain input; also `missing_rates`, a foreign-currency command whose exchange rates the shared store could not supply (`details.missing_rates: [{ base, quote, date }]`, plus `details.refusal: { code, message }` when the command also refused), answered by stating an evidenced `exchangeRate`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token. Follow the WWW-Authenticate resource_metadata URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"}}}},"402":{"description":"plan_required: the command needs a platform plan this business is not on (members beyond the owner and shared views need Startup), or the command would record more events than Solo's monthly allowance has left. The allowance refusal writes nothing (a retry may keep its idempotency key) and carries `details: { reason, included, used, requested, from, through }` (counts as decimal strings; `from`/`through` the current events period as UTC instants). `reason` `solo_limit`: Solo's allowance; tell the founder the limit and that it resets at `through`, then retry after `through`, or once they upgrade to Startup or accept paid extra events. `reason` `plan_cancelled`: Startup was cancelled, or Solo's extra events were turned off; the extra events so far were billed then, and until the plan ends at `endsAt` the business has only `allowed` events in each billing period (its included events, or up to the end of a started block the cancellation billed), with no further extra events; after that it is on Solo (`after` `solo`, for Startup); retry after `through` (the next period's included events) or after `endsAt`. Tell the founder; they can keep Startup (or the extra events) from the billing page once the extra events billed then are paid (for monthly Startup whose cancellation billed extra events, keeping it takes a new Startup agreement from the end; a first-year YC price cannot carry over, so that plan ends as scheduled), or choose it again once it has ended. Any new paid plan (Startup, extra events, a switch or that new agreement) starts only once every invoice from Economico is paid; until then the billing page says so. `reason` `usage_settled`: Startup or Solo's extra events were kept after a cancel; this period's usage was settled then, so retry after `through`. With `details.closesAt`, the business is set to close then (its owner approved closing it): tell the founder, and do not wait for `endsAt` or suggest keeping or upgrading the plan; the owner can stop the closing at /account/cancel until then. Reads, exports and payment setup stay available, and so does upgrading unless the business is set to close (`closesAt`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Membership revoked, business unavailable for writes, or command credential requirements not met (browser-only commands refuse all OAuth tokens). `demo_business`: the business is a demo (`demo: true` on the business read: fictional, its owner's alone) and the command would reach someone else, send a message (support included, for now), publish it, take a plan or make it look like a real company, or the demo has recorded the 2,000 events it may record; tell the user, who can create their own business to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown route or missing required resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not supported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Allow":{"schema":{"type":"string"}}}},"408":{"description":"Request body transfer timed out (code `upload_timeout`): it took over 30 s, or paused over 5 s between chunks; retry the same request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Domain or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Length required (code `length_required`): a JSON body larger than 256 KiB must send Content-Length.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Payload too large (code `payload_too_large`): the request body exceeds the admitted byte limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"JSON body required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Address rate budget exhausted. Wait for Retry-After seconds before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","pattern":"^[0-9]+$"}}}},"500":{"description":"Internal failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Busy (code `busy`): the business is still receiving other document uploads or serving other large documents, and did not start this request. Retry the same request after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string"}}}}},"parameters":[{"name":"X-Economico-Business","in":"header","required":true,"description":"Explicit business slug for this request; must be approved by the connection and token.","schema":{"type":"string"}}]}},"/v1/documents/{id}/download":{"get":{"operationId":"export.document","description":"Download one original R2-backed document from a portable export. Requires export and history permission for this business.","parameters":[{"name":"X-Economico-Business","in":"header","required":true,"description":"Explicit business slug for this request; must be approved by the connection and token.","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Exact original bytes.","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Invalid envelope, query or domain input; also `missing_rates`, a foreign-currency command whose exchange rates the shared store could not supply (`details.missing_rates: [{ base, quote, date }]`, plus `details.refusal: { code, message }` when the command also refused), answered by stating an evidenced `exchangeRate`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token. Follow the WWW-Authenticate resource_metadata URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"}}}},"402":{"description":"plan_required: the command needs a platform plan this business is not on (members beyond the owner and shared views need Startup), or the command would record more events than Solo's monthly allowance has left. The allowance refusal writes nothing (a retry may keep its idempotency key) and carries `details: { reason, included, used, requested, from, through }` (counts as decimal strings; `from`/`through` the current events period as UTC instants). `reason` `solo_limit`: Solo's allowance; tell the founder the limit and that it resets at `through`, then retry after `through`, or once they upgrade to Startup or accept paid extra events. `reason` `plan_cancelled`: Startup was cancelled, or Solo's extra events were turned off; the extra events so far were billed then, and until the plan ends at `endsAt` the business has only `allowed` events in each billing period (its included events, or up to the end of a started block the cancellation billed), with no further extra events; after that it is on Solo (`after` `solo`, for Startup); retry after `through` (the next period's included events) or after `endsAt`. Tell the founder; they can keep Startup (or the extra events) from the billing page once the extra events billed then are paid (for monthly Startup whose cancellation billed extra events, keeping it takes a new Startup agreement from the end; a first-year YC price cannot carry over, so that plan ends as scheduled), or choose it again once it has ended. Any new paid plan (Startup, extra events, a switch or that new agreement) starts only once every invoice from Economico is paid; until then the billing page says so. `reason` `usage_settled`: Startup or Solo's extra events were kept after a cancel; this period's usage was settled then, so retry after `through`. With `details.closesAt`, the business is set to close then (its owner approved closing it): tell the founder, and do not wait for `endsAt` or suggest keeping or upgrading the plan; the owner can stop the closing at /account/cancel until then. Reads, exports and payment setup stay available, and so does upgrading unless the business is set to close (`closesAt`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Membership revoked, business unavailable for writes, or command credential requirements not met (browser-only commands refuse all OAuth tokens). `demo_business`: the business is a demo (`demo: true` on the business read: fictional, its owner's alone) and the command would reach someone else, send a message (support included, for now), publish it, take a plan or make it look like a real company, or the demo has recorded the 2,000 events it may record; tell the user, who can create their own business to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown route or missing required resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not supported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Allow":{"schema":{"type":"string"}}}},"408":{"description":"Request body transfer timed out (code `upload_timeout`): it took over 30 s, or paused over 5 s between chunks; retry the same request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Domain or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Length required (code `length_required`): a JSON body larger than 256 KiB must send Content-Length.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Payload too large (code `payload_too_large`): the request body exceeds the admitted byte limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"JSON body required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Address rate budget exhausted. Wait for Retry-After seconds before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","pattern":"^[0-9]+$"}}}},"500":{"description":"Internal failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Busy (code `busy`): the business is still receiving other document uploads or serving other large documents, and did not start this request. Retry the same request after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string"}}}}}}},"/v1/catalog/commands/{name}":{"get":{"operationId":"catalog.describe","description":"Describe a public command: input/result schemas, examples, the source-document kinds it accepts, the credential it needs and the input fields that must name a known principal.","parameters":[{"name":"X-Economico-Business","in":"header","required":true,"description":"Explicit business slug for this request; must be approved by the connection and token.","schema":{"type":"string"}},{"name":"name","in":"path","required":true,"schema":{"type":"string","enum":["accounts.archive","accounts.register","accounts.restore","accounts.update","activities.archive","activities.create","activities.replace","business.change_fiscal_year","business.change_functional_currency","business.change_legal_form","business.change_legal_name","business.deregister_sales_tax","business.elect_accounting_framework","business.incorporate","business.record_formation_date","business.register_sales_tax","business.set_registration","business.update","categories.create","connections.accept","connections.decline","connections.end","connections.request","contracts.accept","contracts.amend","contracts.cancel","contracts.create","contracts.discard","contracts.offer","contracts.record","contracts.reverse_economics","contracts.terminate","documents.receive","documents.relate","ingestions.agreement_proposal","ingestions.amendment_proposal","ingestions.attach_original","ingestions.credit_proposal","ingestions.invoice_candidates","ingestions.receipt_proposal","ingestions.reissue_upload","ingestions.resolve","ingestions.start","ingestions.statement_matches","journal.post","journal.void","members.grant","members.revoke","messages.send","opportunities.link","opportunities.lose","opportunities.open","opportunities.stage","parties.add_contact","parties.archive","parties.create","parties.remove_contact","parties.set_address","parties.update","payment_endpoints.register","payment_endpoints.update","payments.allocate","payments.process","payments.record","payments.reverse","payments.transfer","payments.unallocate","presentation_rate.record","receipts.record","reporting_adjustment.post","reporting_adjustment.void","reporting_profile.select","shared_views.create","shared_views.revoke","subscription.cancel_request","subscription.revoke_cancellation","tax_codes.create","tax_codes.update","templates.archive","templates.create","templates.replace"]}}],"responses":{"200":{"description":"Canonical result; missing read objects are null. Money is in decimal integer strings.","content":{"application/json":{"schema":{"type":"object","required":["name","description","inputSchema","resultSchema","examples","sourceDocumentKinds","credential","principalFields"],"properties":{"name":{"type":"string","enum":["accounts.archive","accounts.register","accounts.restore","accounts.update","activities.archive","activities.create","activities.replace","business.change_fiscal_year","business.change_functional_currency","business.change_legal_form","business.change_legal_name","business.deregister_sales_tax","business.elect_accounting_framework","business.incorporate","business.record_formation_date","business.register_sales_tax","business.set_registration","business.update","categories.create","connections.accept","connections.decline","connections.end","connections.request","contracts.accept","contracts.amend","contracts.cancel","contracts.create","contracts.discard","contracts.offer","contracts.record","contracts.reverse_economics","contracts.terminate","documents.receive","documents.relate","ingestions.agreement_proposal","ingestions.amendment_proposal","ingestions.attach_original","ingestions.credit_proposal","ingestions.invoice_candidates","ingestions.receipt_proposal","ingestions.reissue_upload","ingestions.resolve","ingestions.start","ingestions.statement_matches","journal.post","journal.void","members.grant","members.revoke","messages.send","opportunities.link","opportunities.lose","opportunities.open","opportunities.stage","parties.add_contact","parties.archive","parties.create","parties.remove_contact","parties.set_address","parties.update","payment_endpoints.register","payment_endpoints.update","payments.allocate","payments.process","payments.record","payments.reverse","payments.transfer","payments.unallocate","presentation_rate.record","receipts.record","reporting_adjustment.post","reporting_adjustment.void","reporting_profile.select","shared_views.create","shared_views.revoke","subscription.cancel_request","subscription.revoke_cancellation","tax_codes.create","tax_codes.update","templates.archive","templates.create","templates.replace"]},"description":{"type":"string"},"inputSchema":{"type":"object"},"resultSchema":{"type":"object"},"examples":{"type":"array","items":{"type":"object","required":["input"],"properties":{"input":{"type":"object"}}}},"sourceDocumentKinds":{"type":"array","items":{"type":"string"},"description":"Registered document kinds accepted as source_document_id; empty means none."},"credential":{"enum":["any","interactive","browser"],"description":"interactive: refused (403) to a headless client credential; browser: refused (403) to every OAuth token, only the signed-in account pages may run it."},"principalFields":{"type":"array","items":{"type":"string"},"description":"Input fields that must name a principal this platform knows."}}}}}},"400":{"description":"Invalid envelope, query or domain input; also `missing_rates`, a foreign-currency command whose exchange rates the shared store could not supply (`details.missing_rates: [{ base, quote, date }]`, plus `details.refusal: { code, message }` when the command also refused), answered by stating an evidenced `exchangeRate`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token. Follow the WWW-Authenticate resource_metadata URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"}}}},"402":{"description":"plan_required: the command needs a platform plan this business is not on (members beyond the owner and shared views need Startup), or the command would record more events than Solo's monthly allowance has left. The allowance refusal writes nothing (a retry may keep its idempotency key) and carries `details: { reason, included, used, requested, from, through }` (counts as decimal strings; `from`/`through` the current events period as UTC instants). `reason` `solo_limit`: Solo's allowance; tell the founder the limit and that it resets at `through`, then retry after `through`, or once they upgrade to Startup or accept paid extra events. `reason` `plan_cancelled`: Startup was cancelled, or Solo's extra events were turned off; the extra events so far were billed then, and until the plan ends at `endsAt` the business has only `allowed` events in each billing period (its included events, or up to the end of a started block the cancellation billed), with no further extra events; after that it is on Solo (`after` `solo`, for Startup); retry after `through` (the next period's included events) or after `endsAt`. Tell the founder; they can keep Startup (or the extra events) from the billing page once the extra events billed then are paid (for monthly Startup whose cancellation billed extra events, keeping it takes a new Startup agreement from the end; a first-year YC price cannot carry over, so that plan ends as scheduled), or choose it again once it has ended. Any new paid plan (Startup, extra events, a switch or that new agreement) starts only once every invoice from Economico is paid; until then the billing page says so. `reason` `usage_settled`: Startup or Solo's extra events were kept after a cancel; this period's usage was settled then, so retry after `through`. With `details.closesAt`, the business is set to close then (its owner approved closing it): tell the founder, and do not wait for `endsAt` or suggest keeping or upgrading the plan; the owner can stop the closing at /account/cancel until then. Reads, exports and payment setup stay available, and so does upgrading unless the business is set to close (`closesAt`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Membership revoked, business unavailable for writes, or command credential requirements not met (browser-only commands refuse all OAuth tokens). `demo_business`: the business is a demo (`demo: true` on the business read: fictional, its owner's alone) and the command would reach someone else, send a message (support included, for now), publish it, take a plan or make it look like a real company, or the demo has recorded the 2,000 events it may record; tell the user, who can create their own business to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown route or missing required resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not supported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Allow":{"schema":{"type":"string"}}}},"408":{"description":"Request body transfer timed out (code `upload_timeout`): it took over 30 s, or paused over 5 s between chunks; retry the same request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Domain or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Length required (code `length_required`): a JSON body larger than 256 KiB must send Content-Length.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Payload too large (code `payload_too_large`): the request body exceeds the admitted byte limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"JSON body required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Address rate budget exhausted. Wait for Retry-After seconds before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","pattern":"^[0-9]+$"}}}},"500":{"description":"Internal failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Busy (code `busy`): the business is still receiving other document uploads or serving other large documents, and did not start this request. Retry the same request after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string"}}}}}}},"/v1/events/verify":{"post":{"operationId":"events.verify","description":"Verify the ledger without appending commands. Takes no body. A result with ok false, empty diffs and a pending list means the core state matched and only derived contract-value coverage is still being filled in.","responses":{"200":{"description":"Canonical result; missing read objects are null. Money is in decimal integer strings.","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid envelope, query or domain input; also `missing_rates`, a foreign-currency command whose exchange rates the shared store could not supply (`details.missing_rates: [{ base, quote, date }]`, plus `details.refusal: { code, message }` when the command also refused), answered by stating an evidenced `exchangeRate`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token. Follow the WWW-Authenticate resource_metadata URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"}}}},"402":{"description":"plan_required: the command needs a platform plan this business is not on (members beyond the owner and shared views need Startup), or the command would record more events than Solo's monthly allowance has left. The allowance refusal writes nothing (a retry may keep its idempotency key) and carries `details: { reason, included, used, requested, from, through }` (counts as decimal strings; `from`/`through` the current events period as UTC instants). `reason` `solo_limit`: Solo's allowance; tell the founder the limit and that it resets at `through`, then retry after `through`, or once they upgrade to Startup or accept paid extra events. `reason` `plan_cancelled`: Startup was cancelled, or Solo's extra events were turned off; the extra events so far were billed then, and until the plan ends at `endsAt` the business has only `allowed` events in each billing period (its included events, or up to the end of a started block the cancellation billed), with no further extra events; after that it is on Solo (`after` `solo`, for Startup); retry after `through` (the next period's included events) or after `endsAt`. Tell the founder; they can keep Startup (or the extra events) from the billing page once the extra events billed then are paid (for monthly Startup whose cancellation billed extra events, keeping it takes a new Startup agreement from the end; a first-year YC price cannot carry over, so that plan ends as scheduled), or choose it again once it has ended. Any new paid plan (Startup, extra events, a switch or that new agreement) starts only once every invoice from Economico is paid; until then the billing page says so. `reason` `usage_settled`: Startup or Solo's extra events were kept after a cancel; this period's usage was settled then, so retry after `through`. With `details.closesAt`, the business is set to close then (its owner approved closing it): tell the founder, and do not wait for `endsAt` or suggest keeping or upgrading the plan; the owner can stop the closing at /account/cancel until then. Reads, exports and payment setup stay available, and so does upgrading unless the business is set to close (`closesAt`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Membership revoked, business unavailable for writes, or command credential requirements not met (browser-only commands refuse all OAuth tokens). `demo_business`: the business is a demo (`demo: true` on the business read: fictional, its owner's alone) and the command would reach someone else, send a message (support included, for now), publish it, take a plan or make it look like a real company, or the demo has recorded the 2,000 events it may record; tell the user, who can create their own business to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown route or missing required resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not supported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Allow":{"schema":{"type":"string"}}}},"408":{"description":"Request body transfer timed out (code `upload_timeout`): it took over 30 s, or paused over 5 s between chunks; retry the same request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Domain or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Length required (code `length_required`): a JSON body larger than 256 KiB must send Content-Length.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Payload too large (code `payload_too_large`): the request body exceeds the admitted byte limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"JSON body required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Address rate budget exhausted. Wait for Retry-After seconds before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","pattern":"^[0-9]+$"}}}},"500":{"description":"Internal failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Busy (code `busy`): the business is still receiving other document uploads or serving other large documents, and did not start this request. Retry the same request after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string"}}}}},"parameters":[{"name":"X-Economico-Business","in":"header","required":true,"description":"Explicit business slug for this request; must be approved by the connection and token.","schema":{"type":"string"}}]}},"/v1/businesses":{"get":{"operationId":"businesses.list","description":"List approved businesses and, with separate consent, current memberships. Set audience=public for the separate public directory. Select a business with --business for its operations.","parameters":[{"name":"audience","in":"query","required":false,"schema":{"enum":["accessible","public"],"type":"string"}},{"name":"after","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"Canonical result; missing read objects are null. Money is in decimal integer strings.","content":{"application/json":{"schema":{"type":"object","required":["businesses","cursor"],"properties":{"businesses":{"type":"array","items":{"type":"object","required":["slug"],"properties":{"slug":{"type":"string"},"displayName":{"type":"string"}}}},"cursor":{"type":["string","null"]}}}}}},"400":{"description":"Invalid envelope, query or domain input; also `missing_rates`, a foreign-currency command whose exchange rates the shared store could not supply (`details.missing_rates: [{ base, quote, date }]`, plus `details.refusal: { code, message }` when the command also refused), answered by stating an evidenced `exchangeRate`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token. Follow the WWW-Authenticate resource_metadata URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"WWW-Authenticate":{"schema":{"type":"string"}}}},"402":{"description":"plan_required: the command needs a platform plan this business is not on (members beyond the owner and shared views need Startup), or the command would record more events than Solo's monthly allowance has left. The allowance refusal writes nothing (a retry may keep its idempotency key) and carries `details: { reason, included, used, requested, from, through }` (counts as decimal strings; `from`/`through` the current events period as UTC instants). `reason` `solo_limit`: Solo's allowance; tell the founder the limit and that it resets at `through`, then retry after `through`, or once they upgrade to Startup or accept paid extra events. `reason` `plan_cancelled`: Startup was cancelled, or Solo's extra events were turned off; the extra events so far were billed then, and until the plan ends at `endsAt` the business has only `allowed` events in each billing period (its included events, or up to the end of a started block the cancellation billed), with no further extra events; after that it is on Solo (`after` `solo`, for Startup); retry after `through` (the next period's included events) or after `endsAt`. Tell the founder; they can keep Startup (or the extra events) from the billing page once the extra events billed then are paid (for monthly Startup whose cancellation billed extra events, keeping it takes a new Startup agreement from the end; a first-year YC price cannot carry over, so that plan ends as scheduled), or choose it again once it has ended. Any new paid plan (Startup, extra events, a switch or that new agreement) starts only once every invoice from Economico is paid; until then the billing page says so. `reason` `usage_settled`: Startup or Solo's extra events were kept after a cancel; this period's usage was settled then, so retry after `through`. With `details.closesAt`, the business is set to close then (its owner approved closing it): tell the founder, and do not wait for `endsAt` or suggest keeping or upgrading the plan; the owner can stop the closing at /account/cancel until then. Reads, exports and payment setup stay available, and so does upgrading unless the business is set to close (`closesAt`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Membership revoked, business unavailable for writes, or command credential requirements not met (browser-only commands refuse all OAuth tokens). `demo_business`: the business is a demo (`demo: true` on the business read: fictional, its owner's alone) and the command would reach someone else, send a message (support included, for now), publish it, take a plan or make it look like a real company, or the demo has recorded the 2,000 events it may record; tell the user, who can create their own business to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown route or missing required resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not supported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Allow":{"schema":{"type":"string"}}}},"408":{"description":"Request body transfer timed out (code `upload_timeout`): it took over 30 s, or paused over 5 s between chunks; retry the same request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Domain or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"411":{"description":"Length required (code `length_required`): a JSON body larger than 256 KiB must send Content-Length.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Payload too large (code `payload_too_large`): the request body exceeds the admitted byte limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"JSON body required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Address rate budget exhausted. Wait for Retry-After seconds before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string","pattern":"^[0-9]+$"}}}},"500":{"description":"Internal failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Busy (code `busy`): the business is still receiving other document uploads or serving other large documents, and did not start this request. Retry the same request after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string"}}}}}}}},"components":{"schemas":{"Error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"details":{}}}},"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Opaque OAuth or headless JWT token bound to https://economi.co/mcp."}}},"externalDocs":{"url":"https://economi.co/docs/api/","description":"Authentication, exact amounts, idempotency and retry guidance"}}