{"openapi":"3.1.0","info":{"title":"Journal Trial Balance","version":"1.0.0","description":"Roll opening balances and debit or credit postings into a trial balance while flagging unbalanced entries even when their errors cancel overall.","contact":{"email":"jeremy@jeremycarter.ca"}},"servers":[{"url":"https://gptenv-x402-catalog.defcronyke.workers.dev"}],"paths":{"/journal-trial-balance/v1/check":{"post":{"operationId":"journal_trial_balance","summary":"Roll opening balances and debit or credit postings into a trial balance while flagging unbalanced entries even when their errors cancel overall.","x-payment-info":{"protocols":[{"x402":{}}],"price":{"mode":"fixed","currency":"USD","amount":"0.04"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"opening":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"account":{"type":"string","minLength":1,"maxLength":80},"signed_debit_cents":{"type":"integer","minimum":-1000000000,"maximum":1000000000}},"required":["account","signed_debit_cents"],"additionalProperties":false}},"entries":{"maxItems":150,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80},"postings":{"minItems":1,"maxItems":40,"type":"array","items":{"type":"object","properties":{"account":{"type":"string","minLength":1,"maxLength":80},"side":{"type":"string","enum":["debit","credit"]},"cents":{"type":"integer","minimum":1,"maximum":1000000000}},"required":["account","side","cents"],"additionalProperties":false}}},"required":["id","postings"],"additionalProperties":false}}},"required":["opening","entries"],"additionalProperties":false},"example":{"opening":[{"account":"cash","signed_debit_cents":1000},{"account":"equity","signed_debit_cents":-1000}],"entries":[{"id":"x","postings":[{"account":"cash","side":"debit","cents":100}]},{"id":"y","postings":[{"account":"revenue","side":"credit","cents":100}]}]}}}},"responses":{"200":{"description":"Service result","content":{"application/json":{"schema":{"type":"object"},"example":{"opening_delta_cents":0,"closing_delta_cents":0,"entry_imbalances":[{"id":"x","delta_cents":100},{"id":"y","delta_cents":-100}],"accounts":[{"account":"cash","debit_cents":1100,"credit_cents":0},{"account":"equity","debit_cents":0,"credit_cents":1000},{"account":"revenue","debit_cents":0,"credit_cents":100}]}}}},"400":{"description":"Invalid request"},"402":{"description":"x402 exact payment required on Base"},"503":{"description":"Payment unavailable"}}}}}}