{"openapi": "3.1.0", "info": {"title": "Tasur", "description": "Self-hosted double-entry accounting", "version": "0.6.1"}, "paths": {"/": {"get": {"summary": "Root", "operationId": "root__get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/webhooks/stripe": {"post": {"tags": ["webhooks"], "summary": "Stripe Webhook", "description": "Receive and process a Stripe event.\n\nAlways returns 2xx on valid signatures \u2014 including for events we\nchoose to ignore \u2014 so Stripe does not retry. Non-2xx is reserved\nfor signature failures and configuration errors that warrant retry.\n\nReturns:\n    200 ``{\"received\": true, \"handled\": <bool>}``\n    400 on signature failure or malformed payload.\n    503 when STRIPE_WEBHOOK_SECRET is not configured.", "operationId": "stripe_webhook_webhooks_stripe_post", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/api/v1/version": {"get": {"tags": ["health"], "summary": "Api Version", "description": "Return API edition + package version.\n\nDeliberately open (no bearer) so downstream clients can render a\n\"connected to\" banner before the user has signed in.", "operationId": "api_version_api_v1_version_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"additionalProperties": {"type": "string"}, "type": "object", "title": "Response Api Version Api V1 Version Get"}}}}}}}, "/api/v1/license": {"get": {"tags": ["health"], "summary": "Api License", "description": "Return the active edition and per-flag matrix.\n\nDeliberately open (no bearer) \u2014 the edition and enabled flags are\nnon-sensitive public metadata already shown on the /admin/license\nHTML page. The web frontend calls this to conditionally render\nmulti-company UI elements without burning an auth'd call.\n\nM2 \u00a73 retrofit: the six developer-only flags (hard_delete,\ndev_tools, edit_frozen_state, raw_json_inspector, tenant_switcher,\nskip_audit_trail) and the internal \"developer\" tier are excluded\nfrom ``flags``/``all_flags``/``tier_order`` \u2014 this endpoint used to\nleak them unfiltered (confirmed in the M2 module-architecture audit\n\u00a72.1/\u00a78.2), which the new GET /api/v1/modules deliberately does not\ninherit. Reuses the same DEVELOPER_ONLY_FLAGS / PUBLIC_TIER_ORDER\nthe new registry endpoint filters on, so the two surfaces can't\ndrift apart.", "operationId": "api_license_api_v1_license_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"additionalProperties": true, "type": "object", "title": "Response Api License Api V1 License Get"}}}}}}}, "/api/v1/auth/login": {"post": {"tags": ["auth"], "summary": "Login", "description": "Exchange email + password for a JWT access token.\n\nReturns 401 (same message) for unknown email, wrong password.\nReturns 403 if the account is archived.", "operationId": "login_api_v1_auth_login_post", "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/LoginRequest"}}}, "required": true}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/saebooks__api__v1__login__TokenResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/auth/refresh": {"post": {"tags": ["auth"], "summary": "Refresh Token", "description": "Issue a new token for a currently-valid token.\n\nAccepts the current token either as ``Authorization: Bearer <token>``\nor (for clients that POST a body) as ``{\"refresh_token\": \"<token>\"}``.\nThe token must not yet be expired.", "operationId": "refresh_token_api_v1_auth_refresh_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "requestBody": {"content": {"application/json": {"schema": {"anyOf": [{"$ref": "#/components/schemas/RefreshRequest"}, {"type": "null"}], "title": "Body"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/saebooks__api__v1__login__TokenResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/auth/me": {"get": {"tags": ["auth"], "summary": "Me", "description": "Return the profile of the authenticated user.\n\nRequires a valid JWT in ``Authorization: Bearer <token>``.\nReturns 401 if the token is missing, invalid, or expired.", "operationId": "me_api_v1_auth_me_get", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/UserProfile"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/auth/change-password": {"post": {"tags": ["auth"], "summary": "Change Password", "description": "Change the authenticated user's password.\n\nRequires a valid JWT and the correct current password.\nReturns 204 on success, 401 on bad token or wrong current password.", "operationId": "change_password_api_v1_auth_change_password_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ChangePasswordRequest"}}}}, "responses": {"204": {"description": "Successful Response"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/auth/oauth-handoff": {"post": {"tags": ["auth"], "summary": "Oauth Handoff", "description": "Internal endpoint \u2014 saebooks-web calls this after a successful OAuth\ncallback to create/lookup the user and mint a JWT. The shared\nSAEBOOKS_OAUTH_HANDOFF_SECRET (in both containers' env) gates access.\n\nNot exposed externally \u2014 Caddy routes /api/v1/* to saebooks-web, which\nonly relays calls users have authenticated for; this endpoint exists\nsolely for the OAuth callback in saebooks-web to invoke directly.", "operationId": "oauth_handoff_api_v1_auth_oauth_handoff_post", "parameters": [{"name": "X-OAuth-Handoff-Secret", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Oauth-Handoff-Secret"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OAuthHandoffRequest"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/saebooks__api__v1__login__TokenResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/principal/auth/webauthn/authenticate/begin": {"post": {"tags": ["principal-auth"], "summary": "Authenticate Begin", "operationId": "authenticate_begin_api_v1_principal_auth_webauthn_authenticate_begin_post", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/WebauthnBeginResponse"}}}}}}}, "/api/v1/principal/auth/webauthn/authenticate/finish": {"post": {"tags": ["principal-auth"], "summary": "Authenticate Finish", "description": "Verify the assertion and mint an UNBOUND principal session.\n\n``principal_id`` is the value returned by ``complete_authentication`` \u2014\nderived from the verified assertion. It is the ONLY source of the id; the\nrequest carries no principal identifier.", "operationId": "authenticate_finish_api_v1_principal_auth_webauthn_authenticate_finish_post", "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/AuthenticateFinishRequest"}}}, "required": true}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PrincipalSessionResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/auth/signup": {"post": {"tags": ["auth"], "summary": "Signup", "description": "Create a fresh tenant + owner user and email a verification\nlink. No JWT is returned \u2014 the client must verify their email\nfirst.", "operationId": "signup_api_v1_auth_signup_post", "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/SignupRequest"}}}, "required": true}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/MessageResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/auth/verify-email": {"post": {"tags": ["auth"], "summary": "Verify Email", "description": "Consume a verification token, mark the user as verified, and\nreturn a JWT so the client can drop straight into the app\nwithout bouncing through /auth/login.", "operationId": "verify_email_api_v1_auth_verify_email_post", "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/VerifyEmailRequest"}}}, "required": true}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/saebooks__api__v1__signup__TokenResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/auth/resend-verification": {"post": {"tags": ["auth"], "summary": "Resend Verification", "description": "Issue a fresh verification token for the supplied email.\n\nAlways returns 200 to avoid leaking whether an account exists.\nSilently no-ops if the email is unknown or already verified.", "operationId": "resend_verification_api_v1_auth_resend_verification_post", "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/EmailOnlyRequest"}}}, "required": true}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/MessageResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/auth/password-reset/request": {"post": {"tags": ["auth"], "summary": "Password Reset Request", "description": "Issue a password-reset token. Always 200, regardless of\nwhether the email is on file.", "operationId": "password_reset_request_api_v1_auth_password_reset_request_post", "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/EmailOnlyRequest"}}}, "required": true}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/MessageResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/auth/password-reset/confirm": {"post": {"tags": ["auth"], "summary": "Password Reset Confirm", "description": "Verify the reset token, set a new password, bump password_version\n(invalidating every existing JWT), and return a fresh JWT.", "operationId": "password_reset_confirm_api_v1_auth_password_reset_confirm_post", "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/PasswordResetConfirmRequest"}}}, "required": true}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/saebooks__api__v1__signup__TokenResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/auth/magic-link/request": {"post": {"tags": ["auth"], "summary": "Magic Link Request", "description": "Email a one-time login link to ``body.email``. Always 200.", "operationId": "magic_link_request_api_v1_auth_magic_link_request_post", "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/EmailOnlyRequest"}}}, "required": true}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/MessageResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/auth/magic-link/consume": {"post": {"tags": ["auth"], "summary": "Magic Link Consume", "description": "Single-use magic-link redemption. Returns a JWT and clears the\ntoken (replay protection).", "operationId": "magic_link_consume_api_v1_auth_magic_link_consume_post", "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/TokenOnlyRequest"}}}, "required": true}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/saebooks__api__v1__signup__TokenResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/billing/checkout-session": {"post": {"tags": ["billing"], "summary": "Checkout Session", "description": "Mint a Stripe Checkout Session URL for the authenticated user.", "operationId": "checkout_session_api_v1_billing_checkout_session_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CheckoutRequest"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CheckoutResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/billing/portal-session": {"post": {"tags": ["billing"], "summary": "Portal Session", "description": "Mint a Stripe Customer Portal session for the authenticated tenant.", "operationId": "portal_session_api_v1_billing_portal_session_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PortalResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/billing/webhook": {"post": {"tags": ["billing"], "summary": "Stripe Webhook", "description": "Stripe-signed webhook receiver.\n\nReturns 200 on every well-handled event so Stripe doesn't retry.\nNon-2xx for signature failures, 503 if not configured. Unknown\nevent types ack with ``{ignored: true}``.", "operationId": "stripe_webhook_api_v1_billing_webhook_post", "parameters": [{"name": "Stripe-Signature", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Stripe-Signature"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response Stripe Webhook Api V1 Billing Webhook Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/license/snapshot": {"get": {"tags": ["license"], "summary": "Get Snapshot", "description": "Return the current resolved licence snapshot.", "operationId": "get_snapshot_api_v1_license_snapshot_get", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/_SnapshotResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/license/upload": {"post": {"tags": ["license"], "summary": "Upload Token", "description": "Accept a portal JWT, verify, persist, force resolver reload.", "operationId": "upload_token_api_v1_license_upload_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/_UploadRequest"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/_SnapshotResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/license/refresh": {"post": {"tags": ["license"], "summary": "Refresh Token", "description": "Call upstream license-server /refresh, persist the new token.\n\nNo-op (returns current snapshot, ``refreshed=false``) when no\ncached token is present \u2014 there is nothing to refresh.", "operationId": "refresh_token_api_v1_license_refresh_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/_RefreshResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/license/promo-stats": {"get": {"tags": ["license"], "summary": "Promo Stats", "description": "Public endpoint \u2014 no auth required.\n\nReturns ``{\"enabled\":bool,\"issued\":int,\"limit\":int,\"remaining\":int}``.", "operationId": "promo_stats_api_v1_license_promo_stats_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"additionalProperties": true, "type": "object", "title": "Response Promo Stats Api V1 License Promo Stats Get"}}}}}}}, "/api/v1/lodgement/probe": {"get": {"tags": ["lodgement"], "summary": "Probe", "description": "Smoke test: ``my_audit_log(limit=1)`` against lodge-server.\n\nShape:\n\n* ``ok: true``, ``impl: \"remote\"``, ``recent: [...]`` on success.\n* 402 with detail string when the active licence has no\n  ``ato_sbr`` flag (NullLodgementService refused).\n* 401 / 403 / 502 propagated from the relay errors.", "operationId": "probe_api_v1_lodgement_probe_get", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response Probe Api V1 Lodgement Probe Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/contact/submit": {"post": {"tags": ["contact"], "summary": "Contact Submit", "description": "Accept a public contact form submission.\n\n* Honeypot check: if ``website`` is non-empty, return 200 silently.\n* Rate limit: 5/hour per client IP (hourly fixed-window via Postgres).\n* Insert into contact_messages.\n* Fire-and-forget Telegram notification.", "operationId": "contact_submit_api_v1_contact_submit_post", "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ContactRequest"}}}, "required": true}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/modules": {"get": {"tags": ["modules"], "summary": "List Modules", "description": "Unauthenticated, static-only module catalogue.\n\nSafe pre-login: every field here is edition-independent metadata\n(what modules exist, what tier they first turn on at, what the\nper-edition cap limits are) -- never per-user entitlement, never\nper-tenant health. See ``GET /api/v1/modules/usage`` for those.", "operationId": "list_modules_api_v1_modules_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"additionalProperties": true, "type": "object", "title": "Response List Modules Api V1 Modules Get"}}}}}}}, "/api/v1/modules/usage": {"get": {"tags": ["modules"], "summary": "Modules Usage", "description": "Bearer-gated, tenant-scoped module usage / entitlement.\n\n``require_bearer`` stamps ``request.state.user`` (see\n``saebooks/api/v1/auth.py``), which is the prerequisite M2 \u00a75 step 1\ncloses: ``_effective_edition_for_request`` can only resolve a\nper-user launch-promo-JWT override on a route that carries this\ndependency, which this route does (unlike the unauthenticated\n``GET /api/v1/modules``).\n\nResponse shape::\n\n    {\n      \"edition\": \"community\",             # process-wide singleton\n      \"effective_edition\": \"pro\",         # per-request resolved\n      \"bookkeeping_mode\": \"full\" | \"cashbook\" | null,\n      \"modules\": [\n        {\"id\": ..., \"kind\": ..., \"entitled\": bool, \"health\": str},\n        ...\n      ],\n      \"caps\": {\n        \"admin_seats\": {\"outcome\", \"limit\", \"current\", \"reason\"},\n        \"employee_seats\": {...},\n        \"companies\": {...},\n      }\n    }\n\nRLS: every query runs through ``get_session``'s tenant-bound\nsession (``app.current_tenant`` set per request), and the active\ncompany is additionally scoped to ``Company.tenant_id`` -- a\ncaller can never resolve, and therefore never see cap usage or\nbank-feeds health for, another tenant's company via\n``X-Company-Id``.", "operationId": "modules_usage_api_v1_modules_usage_get", "parameters": [{"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response Modules Usage Api V1 Modules Usage Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/jurisdictions/{code}/presentation": {"get": {"tags": ["jurisdictions"], "summary": "Jurisdiction Presentation", "description": "The presentation contract for a jurisdiction code (e.g. ``AU``, ``EE``).\n\nAlways returns a contract: an unknown code or one whose module declares no\npresentation degrades to the neutral contract (generic labels), so the web\nalways has something to render and never has to special-case.", "operationId": "jurisdiction_presentation_api_v1_jurisdictions__code__presentation_get", "parameters": [{"name": "code", "in": "path", "required": true, "schema": {"type": "string", "title": "Code"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response Jurisdiction Presentation Api V1 Jurisdictions  Code  Presentation Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/contacts": {"get": {"tags": ["contacts"], "summary": "List Contacts", "description": "List contacts.\n\n``q`` searches name, email, ABN and aliases; ``role`` narrows to\ncustomers or suppliers; ``sort`` = name, type, email, phone, abn, city or\ncreated_at (default name, A to Z). ``format=csv`` downloads every\nmatching contact.", "operationId": "list_contacts_api_v1_contacts_get", "parameters": [{"name": "type", "in": "query", "required": false, "schema": {"anyOf": [{"$ref": "#/components/schemas/ContactType"}, {"type": "null"}], "title": "Type"}}, {"name": "role", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "customer or supplier: every contact type that can sit on that side of a document (supplier includes contractors, sub-contractors and contacts who are both).", "title": "Role"}, "description": "customer or supplier: every contact type that can sit on that side of a document (supplier includes contractors, sub-contractors and contacts who are both)."}, {"name": "id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "array", "items": {"type": "string", "format": "uuid"}}, {"type": "null"}], "description": "Only these contacts (repeat ?id= up to 500 times). Lets a list screen fetch the names for exactly the rows on its page.", "title": "Id"}, "description": "Only these contacts (repeat ?id= up to 500 times). Lets a list screen fetch the names for exactly the rows on its page."}, {"name": "include_balances", "in": "query", "required": false, "schema": {"type": "boolean", "description": "Opt-in: attach a 'balances' object (receivable/payable unpaid+overdue, last_transaction_date) to each contact. Defaults to false to protect list performance \u2014 when true, balances are computed via a constant number of grouped queries over the page's contact ids, never one query per contact.", "default": false, "title": "Include Balances"}, "description": "Opt-in: attach a 'balances' object (receivable/payable unpaid+overdue, last_transaction_date) to each contact. Defaults to false to protect list performance \u2014 when true, balances are computed via a constant number of grouped queries over the page's contact ids, never one query per contact."}, {"name": "owing", "in": "query", "required": false, "schema": {"type": "boolean", "description": "Only contacts with something open either way: an unpaid posted invoice or bill, unused credit, or money on account (0227).", "default": false, "title": "Owing"}, "description": "Only contacts with something open either way: an unpaid posted invoice or bill, unused credit, or money on account (0227)."}, {"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 500, "minimum": 1, "default": 100, "title": "Limit"}}, {"name": "offset", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 0, "default": 0, "title": "Offset"}}, {"name": "q", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "maxLength": 200}, {"type": "null"}], "description": "Search name, email, ABN and known aliases.", "title": "Q"}, "description": "Search name, email, ABN and known aliases."}, {"name": "sort", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "One of: name, type, email, phone, abn, city, created_at.", "title": "Sort"}, "description": "One of: name, type, email, phone, abn, city, created_at."}, {"name": "direction", "in": "query", "required": false, "schema": {"enum": ["asc", "desc"], "type": "string", "description": "Sort order.", "default": "asc", "title": "Direction"}, "description": "Sort order."}, {"name": "format", "in": "query", "required": false, "schema": {"enum": ["json", "csv"], "type": "string", "description": "csv returns every matching row (no paging) as a spreadsheet download, in the same order.", "default": "json", "title": "Format"}, "description": "csv returns every matching row (no paging) as a spreadsheet download, in the same order."}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ContactListWithBalancesOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "post": {"tags": ["contacts"], "summary": "Create Contact", "operationId": "create_contact_api_v1_contacts_post", "parameters": [{"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ContactCreate"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ContactOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/contacts/bulk-tag-one-off": {"post": {"tags": ["contacts"], "summary": "Bulk Tag One Off", "description": "Flip ``is_one_off`` on the given contacts. Returns ``{\"flipped\": N}``\ncounting only contacts whose flag actually changed (idempotent). Defined\nbefore /{contact_id} so the literal path wins the route match.", "operationId": "bulk_tag_one_off_api_v1_contacts_bulk_tag_one_off_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/_BulkTagOneOffIn"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": {"type": "integer"}, "title": "Response Bulk Tag One Off Api V1 Contacts Bulk Tag One Off Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/contacts/{contact_id}": {"get": {"tags": ["contacts"], "summary": "Get Contact", "operationId": "get_contact_api_v1_contacts__contact_id__get", "parameters": [{"name": "contact_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Contact Id"}}, {"name": "include_balances", "in": "query", "required": false, "schema": {"type": "boolean", "description": "Opt-in: attach a 'balances' object (receivable/payable unpaid+overdue, last_transaction_date) to the response. Defaults to false \u2014 see GET /contacts for the same param on the list route.", "default": false, "title": "Include Balances"}, "description": "Opt-in: attach a 'balances' object (receivable/payable unpaid+overdue, last_transaction_date) to the response. Defaults to false \u2014 see GET /contacts for the same param on the list route."}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ContactWithBalancesOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "patch": {"tags": ["contacts"], "summary": "Update Contact", "operationId": "update_contact_api_v1_contacts__contact_id__patch", "parameters": [{"name": "contact_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Contact Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ContactUpdate"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Update Contact Api V1 Contacts  Contact Id  Patch", "$ref": "#/components/schemas/ContactOut"}}}}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "delete": {"tags": ["contacts"], "summary": "Archive Contact", "operationId": "archive_contact_api_v1_contacts__contact_id__delete", "parameters": [{"name": "contact_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Contact Id"}}, {"name": "hard", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Hard"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Admin", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Admin"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Archive Contact Api V1 Contacts  Contact Id  Delete"}}}}, "204": {"description": "Archived"}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/contacts/{contact_id}/transactions": {"get": {"tags": ["contacts"], "summary": "Get Contact Transactions", "description": "A contact's whole history as customer AND supplier, with a running\nbalance (positive = they owe us, negative = we owe them).\n\nRows: invoices, bills, receipts, supplier payments, refunds, customer\nand supplier credit notes, bad-debt write-offs, credit applications\n(zero effect \u2014 which document each credit settled), and expenses /\nmoney-in records naming the contact (zero effect). ``position`` is the\nlive open position; ``open_credits`` lists every credit note, supplier\ncredit and on-account payment with something left on it. See\n``services/contact_ledger.py`` for the sign table.", "operationId": "get_contact_transactions_api_v1_contacts__contact_id__transactions_get", "parameters": [{"name": "contact_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Contact Id"}}, {"name": "from", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "From"}}, {"name": "to", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "To"}}, {"name": "include_unposted", "in": "query", "required": false, "schema": {"type": "boolean", "description": "Also list DRAFT / VOIDED documents (zero balance effect).", "default": false, "title": "Include Unposted"}, "description": "Also list DRAFT / VOIDED documents (zero balance effect)."}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/contacts/{contact_id}/statement": {"get": {"tags": ["contacts"], "summary": "Get Contact Statement", "description": "Return a statement as JSON for the given period \u2014 the customer side\nby default, or the supplier side with ``side=payable`` (0227).", "operationId": "get_contact_statement_api_v1_contacts__contact_id__statement_get", "parameters": [{"name": "contact_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Contact Id"}}, {"name": "from", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "description": "Statement period start (YYYY-MM-DD)", "title": "From"}, "description": "Statement period start (YYYY-MM-DD)"}, {"name": "to", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "description": "Statement period end (YYYY-MM-DD)", "title": "To"}, "description": "Statement period end (YYYY-MM-DD)"}, {"name": "side", "in": "query", "required": false, "schema": {"enum": ["receivable", "payable"], "type": "string", "description": "receivable = customer statement (default); payable = supplier side", "default": "receivable", "title": "Side"}, "description": "receivable = customer statement (default); payable = supplier side"}, {"name": "currency", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "minLength": 3, "maxLength": 3}, {"type": "null"}], "description": "One statement per currency; defaults to the customer's currency", "title": "Currency"}, "description": "One statement per currency; defaults to the customer's currency"}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/contacts/{contact_id}/statement.pdf": {"get": {"tags": ["contacts"], "summary": "Get Contact Statement Pdf", "description": "Return the customer statement as a PDF (engineering-style document).", "operationId": "get_contact_statement_pdf_api_v1_contacts__contact_id__statement_pdf_get", "parameters": [{"name": "contact_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Contact Id"}}, {"name": "from", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "From"}}, {"name": "to", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "To"}}, {"name": "currency", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "minLength": 3, "maxLength": 3}, {"type": "null"}], "title": "Currency"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/contacts/{contact_id}/statement/send-email": {"post": {"tags": ["contacts"], "summary": "Post Contact Statement Send Email", "description": "Email this customer their statement as a PDF (b11, P1-6).\n\nJSON body: ``{\"from\": \"YYYY-MM-DD\", \"to\": \"YYYY-MM-DD\"}`` (the period)\nplus optional ``recipients`` (comma-separated, default the contact's\nemail), ``subject``, ``body_html`` and ``from_addr`` (default: Getting\npaid settings, else the company email). Goes through the same\ncustomer-email kill switch and send log as invoices.", "operationId": "post_contact_statement_send_email_api_v1_contacts__contact_id__statement_send_email_post", "parameters": [{"name": "contact_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Contact Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/contacts/{contact_id}/aliases": {"get": {"tags": ["contacts"], "summary": "List Contact Aliases", "operationId": "list_contact_aliases_api_v1_contacts__contact_id__aliases_get", "parameters": [{"name": "contact_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Contact Id"}}, {"name": "include_inactive", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Include Inactive"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response 200 List Contact Aliases Api V1 Contacts  Contact Id  Aliases Get", "type": "array", "items": {"$ref": "#/components/schemas/ContactAliasOut"}}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "post": {"tags": ["contacts"], "summary": "Add Contact Alias", "operationId": "add_contact_alias_api_v1_contacts__contact_id__aliases_post", "parameters": [{"name": "contact_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Contact Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ContactAliasIn"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Add Contact Alias Api V1 Contacts  Contact Id  Aliases Post", "$ref": "#/components/schemas/ContactAliasOut"}}}}, "409": {"description": "Alias already resolves to a different contact"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/contacts/{contact_id}/aliases/{alias_id}": {"delete": {"tags": ["contacts"], "summary": "Deactivate Contact Alias", "description": "Soft-delete \u2014 frees the key for re-use, keeps the provenance.", "operationId": "deactivate_contact_alias_api_v1_contacts__contact_id__aliases__alias_id__delete", "parameters": [{"name": "contact_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Contact Id"}}, {"name": "alias_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Alias Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"204": {"description": "Successful Response"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/one-off-vendors": {"get": {"tags": ["one-off-vendors"], "summary": "List One Off Vendors", "operationId": "list_one_off_vendors_api_v1_one_off_vendors_get", "parameters": [{"name": "q", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Q"}}, {"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 500, "minimum": 1, "default": 100, "title": "Limit"}}, {"name": "offset", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 0, "default": 0, "title": "Offset"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OneOffVendorListOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "post": {"tags": ["one-off-vendors"], "summary": "Create One Off Vendor", "operationId": "create_one_off_vendor_api_v1_one_off_vendors_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OneOffVendorCreate"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OneOffVendorOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/one-off-vendors/{vendor_id}": {"get": {"tags": ["one-off-vendors"], "summary": "Get One Off Vendor", "operationId": "get_one_off_vendor_api_v1_one_off_vendors__vendor_id__get", "parameters": [{"name": "vendor_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Vendor Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OneOffVendorOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "patch": {"tags": ["one-off-vendors"], "summary": "Update One Off Vendor", "operationId": "update_one_off_vendor_api_v1_one_off_vendors__vendor_id__patch", "parameters": [{"name": "vendor_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Vendor Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OneOffVendorUpdate"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Update One Off Vendor Api V1 One Off Vendors  Vendor Id  Patch", "$ref": "#/components/schemas/OneOffVendorOut"}}}}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OneOffVendorConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "delete": {"tags": ["one-off-vendors"], "summary": "Archive One Off Vendor", "operationId": "archive_one_off_vendor_api_v1_one_off_vendors__vendor_id__delete", "parameters": [{"name": "vendor_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Vendor Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Archive One Off Vendor Api V1 One Off Vendors  Vendor Id  Delete"}}}}, "204": {"description": "Archived"}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OneOffVendorConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/one-off-customers": {"get": {"tags": ["one-off-customers"], "summary": "List One Off Customers", "operationId": "list_one_off_customers_api_v1_one_off_customers_get", "parameters": [{"name": "q", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Q"}}, {"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 500, "minimum": 1, "default": 100, "title": "Limit"}}, {"name": "offset", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 0, "default": 0, "title": "Offset"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OneOffCustomerListOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "post": {"tags": ["one-off-customers"], "summary": "Create One Off Customer", "operationId": "create_one_off_customer_api_v1_one_off_customers_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OneOffCustomerCreate"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OneOffCustomerOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/one-off-customers/{customer_id}": {"get": {"tags": ["one-off-customers"], "summary": "Get One Off Customer", "operationId": "get_one_off_customer_api_v1_one_off_customers__customer_id__get", "parameters": [{"name": "customer_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Customer Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OneOffCustomerOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "patch": {"tags": ["one-off-customers"], "summary": "Update One Off Customer", "operationId": "update_one_off_customer_api_v1_one_off_customers__customer_id__patch", "parameters": [{"name": "customer_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Customer Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OneOffCustomerUpdate"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Update One Off Customer Api V1 One Off Customers  Customer Id  Patch", "$ref": "#/components/schemas/OneOffCustomerOut"}}}}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OneOffCustomerConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "delete": {"tags": ["one-off-customers"], "summary": "Archive One Off Customer", "operationId": "archive_one_off_customer_api_v1_one_off_customers__customer_id__delete", "parameters": [{"name": "customer_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Customer Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Archive One Off Customer Api V1 One Off Customers  Customer Id  Delete"}}}}, "204": {"description": "Archived"}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OneOffCustomerConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/account_ranges/prefix_mode": {"get": {"tags": ["account_ranges"], "summary": "Get Prefix Mode", "description": "Return the current account-range prefix mode (classic | extended).", "operationId": "get_prefix_mode_api_v1_account_ranges_prefix_mode_get", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PrefixModeOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "patch": {"tags": ["account_ranges"], "summary": "Update Prefix Mode", "description": "Update the prefix mode setting.\n\nValid values: ``classic`` (single-digit prefixes 1-9) or\n``extended`` (multi-digit prefixes of any width).", "operationId": "update_prefix_mode_api_v1_account_ranges_prefix_mode_patch", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PrefixModeUpdate"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PrefixModeOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/account_ranges": {"get": {"tags": ["account_ranges"], "summary": "List Account Ranges", "operationId": "list_account_ranges_api_v1_account_ranges_get", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AccountRangeListOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "post": {"tags": ["account_ranges"], "summary": "Create Account Range", "operationId": "create_account_range_api_v1_account_ranges_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AccountRangeCreate"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AccountRangeOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/account_ranges/{range_id}": {"patch": {"tags": ["account_ranges"], "summary": "Update Account Range", "operationId": "update_account_range_api_v1_account_ranges__range_id__patch", "parameters": [{"name": "range_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Range Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AccountRangeUpdate"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AccountRangeOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "delete": {"tags": ["account_ranges"], "summary": "Delete Account Range", "operationId": "delete_account_range_api_v1_account_ranges__range_id__delete", "parameters": [{"name": "range_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Range Id"}}, {"name": "hard", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Hard"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Admin", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Admin"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Delete Account Range Api V1 Account Ranges  Range Id  Delete"}}}}, "204": {"description": "Deleted"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/accounts": {"get": {"tags": ["accounts"], "summary": "List Accounts", "operationId": "list_accounts_api_v1_accounts_get", "parameters": [{"name": "account_type", "in": "query", "required": false, "schema": {"anyOf": [{"$ref": "#/components/schemas/AccountType"}, {"type": "null"}], "title": "Account Type"}}, {"name": "include_balance", "in": "query", "required": false, "schema": {"type": "boolean", "description": "Include current balance per account (POSTED journal lines).", "default": false, "title": "Include Balance"}, "description": "Include current balance per account (POSTED journal lines)."}, {"name": "include_archived", "in": "query", "required": false, "schema": {"type": "boolean", "description": "Include accounts whose archived_at is set (historical lookups).", "default": false, "title": "Include Archived"}, "description": "Include accounts whose archived_at is set (historical lookups)."}, {"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 1000, "minimum": 1, "default": 200, "title": "Limit"}}, {"name": "offset", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 0, "default": 0, "title": "Offset"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AccountListOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "post": {"tags": ["accounts"], "summary": "Create Account", "operationId": "create_account_api_v1_accounts_post", "parameters": [{"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AccountCreate"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AccountOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/accounts/{account_id}": {"get": {"tags": ["accounts"], "summary": "Get Account", "operationId": "get_account_api_v1_accounts__account_id__get", "parameters": [{"name": "account_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Account Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AccountOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "patch": {"tags": ["accounts"], "summary": "Update Account", "operationId": "update_account_api_v1_accounts__account_id__patch", "parameters": [{"name": "account_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Account Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AccountUpdate"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Update Account Api V1 Accounts  Account Id  Patch", "$ref": "#/components/schemas/AccountOut"}}}}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AccountConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "delete": {"tags": ["accounts"], "summary": "Archive Account", "operationId": "archive_account_api_v1_accounts__account_id__delete", "parameters": [{"name": "account_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Account Id"}}, {"name": "hard", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Hard"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Admin", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Admin"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Archive Account Api V1 Accounts  Account Id  Delete"}}}}, "204": {"description": "Archived"}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AccountConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/accounts/{account_id}/ledger": {"get": {"tags": ["accounts"], "summary": "Get Account Ledger", "description": "Return posted journal lines for this account with running balance.\n\n``opening_balance`` reflects everything before ``date_from`` (zero\nif no date floor). Running balance follows debit/credit normality\n(credit-normal: LIABILITY/EQUITY/INCOME accumulates credit-debit;\neverything else accumulates debit-credit).\n\nWhen ``sort`` is anything other than ``date``, the running ``balance``\nfield is set to ``null`` on every row \u2014 it only carries meaning when\nrows are ordered chronologically.\n\nWhen any of ``source_type``/``description``/``contact_id`` is supplied,\nboth ``balance`` (every row) and ``opening_balance`` are set to ``null``\ntoo: those filters drop rows out of the account's real running total, so\na computed balance would silently misrepresent the account. The\n``total``/``limit``/``offset`` pagination and ``total_debit``/\n``total_credit`` for the filtered page remain accurate.\n\nEvery row also carries ``source_type`` and ``source_id`` (both copied\nfrom the owning ``JournalEntry``). ``contact_name`` is opt-in via\n``include_contact_name=true`` \u2014 omitted from every row when false\n(default), to protect list performance. When enabled it's resolved via\none grouped query per source_type present on the page (never per-row);\n``null`` when the source has no contact or no contact linkage exists for\nthat source_type.", "operationId": "get_account_ledger_api_v1_accounts__account_id__ledger_get", "parameters": [{"name": "account_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Account Id"}}, {"name": "date_from", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "ISO date (YYYY-MM-DD)", "title": "Date From"}, "description": "ISO date (YYYY-MM-DD)"}, {"name": "date_to", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "ISO date (YYYY-MM-DD)", "title": "Date To"}, "description": "ISO date (YYYY-MM-DD)"}, {"name": "sort", "in": "query", "required": false, "schema": {"type": "string", "description": "One of: date, ref, description, debit, credit", "default": "date", "title": "Sort"}, "description": "One of: date, ref, description, debit, credit"}, {"name": "direction", "in": "query", "required": false, "schema": {"type": "string", "pattern": "^(asc|desc)$", "default": "desc", "title": "Direction"}}, {"name": "source_type", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Filter to entries stamped with this JournalEntry.source_type (e.g. 'invoice', 'bill', 'payment'). 400 on an unrecognised value.", "title": "Source Type"}, "description": "Filter to entries stamped with this JournalEntry.source_type (e.g. 'invoice', 'bill', 'payment'). 400 on an unrecognised value."}, {"name": "description", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Case-insensitive substring match on JournalLine.description.", "title": "Description"}, "description": "Case-insensitive substring match on JournalLine.description."}, {"name": "contact_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "description": "Filter to entries whose source record (invoice/bill/expense/payment/credit_note/supplier_credit_note/receipt) belongs to this contact. source_types with no single-contact linkage (transfers, pay runs, trust distributions, etc.) never match.", "title": "Contact Id"}, "description": "Filter to entries whose source record (invoice/bill/expense/payment/credit_note/supplier_credit_note/receipt) belongs to this contact. source_types with no single-contact linkage (transfers, pay runs, trust distributions, etc.) never match."}, {"name": "include_contact_name", "in": "query", "required": false, "schema": {"type": "boolean", "description": "Opt-in: attach a 'contact_name' field to each row, resolved from the source record's contact for source_types that carry one. Defaults to false to protect list performance \u2014 when true, resolved via one grouped query per source_type present on the page, never one query per row.", "default": false, "title": "Include Contact Name"}, "description": "Opt-in: attach a 'contact_name' field to each row, resolved from the source record's contact for source_types that carry one. Defaults to false to protect list performance \u2014 when true, resolved via one grouped query per source_type present on the page, never one query per row."}, {"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 1000, "minimum": 1, "default": 200, "title": "Limit"}}, {"name": "offset", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 0, "default": 0, "title": "Offset"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/accounts/{account_id}/gl-movement": {"get": {"tags": ["accounts"], "summary": "Get Account Gl Movement", "description": "Summed posted journal movement (``debit - credit``) on this account.\n\nThis is precisely the aggregation the bank-feeds reconcile sweep needs\nto compute feed-vs-GL variance: ``SUM(debit - credit)`` over journal\nentries in status POSTED or REVERSED (so a void and its reversal\ncancel), optionally bounded by ``date_from`` / ``date_to`` on the entry\ndate. The endpoint and ``services.bank_feeds.reconcile.sweep`` call the\nsame ``reconcile.gl_movement`` function, so the number can't drift.\n\nReturns ``{account_id, date_from, date_to, movement}`` where\n``movement`` is a decimal string (bank-statement sign convention:\npositive = money into the account).", "operationId": "get_account_gl_movement_api_v1_accounts__account_id__gl_movement_get", "parameters": [{"name": "account_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Account Id"}}, {"name": "date_from", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "ISO date (YYYY-MM-DD), inclusive", "title": "Date From"}, "description": "ISO date (YYYY-MM-DD), inclusive"}, {"name": "date_to", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "ISO date (YYYY-MM-DD), inclusive", "title": "Date To"}, "description": "ISO date (YYYY-MM-DD), inclusive"}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/ato_sbr/keystore": {"post": {"tags": ["ato_sbr"], "summary": "Upload Keystore", "description": "Upload a RAM Machine Credential PFX/keystore file.\n\nMultipart form fields:\n- ``file``:     The keystore file (PFX or ATO XML format).\n- ``password``: Decryption password.\n- ``label``:    Optional human-readable label (defaults to subject CN).\n\nThe file is parsed, cert metadata extracted, then the raw bytes and\npassword are encrypted at rest via ``saebooks.services.crypto``.\nReturns 201 with the keystore entry on success.", "operationId": "upload_keystore_api_v1_ato_sbr_keystore_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "requestBody": {"required": true, "content": {"multipart/form-data": {"schema": {"$ref": "#/components/schemas/Body_upload_keystore_api_v1_ato_sbr_keystore_post"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "get": {"tags": ["ato_sbr"], "summary": "List Keystore", "description": "List keystore entries for the tenant.\n\nReturns a list of keystore entry objects.  Entries without an\nuploaded keystore (``keystore_encrypted IS NULL``) are excluded.", "operationId": "list_keystore_api_v1_ato_sbr_keystore_get", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/ato_sbr/keystore/{entry_id}": {"delete": {"tags": ["ato_sbr"], "summary": "Delete Keystore", "description": "Soft-delete a keystore entry (clears keystore fields, keeps config row).\n\nReturns 404 if the entry doesn't exist for this tenant, or 409 if\nit has already been cleared (no active keystore to delete).", "operationId": "delete_keystore_api_v1_ato_sbr_keystore__entry_id__delete", "parameters": [{"name": "entry_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Entry Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "responses": {"204": {"description": "Successful Response"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/ato_sbr/onboarding/wizards": {"post": {"tags": ["ato_sbr"], "summary": "Start Wizard", "description": "Start a new ATO SBR onboarding wizard session.\n\nRequest body::\n\n    {\"flow\": \"machine_credential\" | \"ssid_link\"}\n\nReturns ``{wizard_id, status, flow, step_index, current_step}``\ndescribing the first step.", "operationId": "start_wizard_api_v1_ato_sbr_onboarding_wizards_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Body"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/ato_sbr/onboarding/wizards/{wizard_id}/step": {"post": {"tags": ["ato_sbr"], "summary": "Advance Wizard", "description": "Submit answers for the current step and advance the wizard.\n\nRequest body::\n\n    {\"answers\": {\"<field>\": <value>, ...}}\n\nValidates the current step's required fields server-side.\n\nOptimistic locking via ``If-Match: <step_index>``.  If the client's\nstep index doesn't match the stored step the server returns 409.\n\nReturns the next step's questions, or ``{status: \"complete\"}`` when\nall steps are done.", "operationId": "advance_wizard_api_v1_ato_sbr_onboarding_wizards__wizard_id__step_post", "parameters": [{"name": "wizard_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Wizard Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Body"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/ato_sbr/ping": {"post": {"tags": ["ato_sbr"], "summary": "Ping Lodge Server", "description": "Test the lodge-server connection using a chosen keystore entry.\n\nRequest body::\n\n    {\"keystore_id\": \"<uuid>\"}\n\nThe ``keystore_id`` is the ``ato_sbr_configs.id`` UUID.  We verify\nit belongs to the requesting tenant before attempting the ping.\n\nReturns::\n\n    {\n      \"ok\": true | false,\n      \"lodge_server_version\": \"...\",\n      \"latency_ms\": 123,\n      \"server_time\": \"2026-05-04T12:00:00+00:00\"\n    }\n\nWhen the lodge-server is in stub mode (returns 501)::\n\n    {\"ok\": false, \"reason\": \"lodge_server_stub_mode\"}", "operationId": "ping_lodge_server_api_v1_ato_sbr_ping_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Body"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/ato_sbr/prepare-bas": {"post": {"tags": ["ato_sbr"], "summary": "Prepare Bas", "description": "Not implemented. See ``_BAS_NOT_CONFIGURED_DETAIL``.\n\nWould generate an SBR BAS draft from ``period_from``/``period_to``.", "operationId": "prepare_bas_api_v1_ato_sbr_prepare_bas_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "requestBody": {"content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "default": {}, "title": "Body"}}}}, "responses": {"501": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/ato_sbr/lodge-bas": {"post": {"tags": ["ato_sbr"], "summary": "Lodge Bas", "description": "Not implemented. See ``_BAS_NOT_CONFIGURED_DETAIL``.\n\nWould lodge a previously-prepared BAS draft (``bas_draft_id``) with\nthe ATO SBR gateway.", "operationId": "lodge_bas_api_v1_ato_sbr_lodge_bas_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "requestBody": {"content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "default": {}, "title": "Body"}}}}, "responses": {"501": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/bank_accounts": {"get": {"tags": ["bank_accounts"], "summary": "List Bank Accounts", "operationId": "list_bank_accounts_api_v1_bank_accounts_get", "parameters": [{"name": "page", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 1, "default": 1, "title": "Page"}}, {"name": "page_size", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 500, "minimum": 1, "default": 50, "title": "Page Size"}}, {"name": "include_balance", "in": "query", "required": false, "schema": {"type": "boolean", "description": "Include GL balance (POSTED journal lines, debit \u2212 credit) per account.", "default": false, "title": "Include Balance"}, "description": "Include GL balance (POSTED journal lines, debit \u2212 credit) per account."}, {"name": "include_statement_balance", "in": "query", "required": false, "schema": {"type": "boolean", "description": "Include bank-statement running balance (cumulative SUM(amount) of non-archived bsls) per account.", "default": false, "title": "Include Statement Balance"}, "description": "Include bank-statement running balance (cumulative SUM(amount) of non-archived bsls) per account."}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BankAccountListOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "post": {"tags": ["bank_accounts"], "summary": "Create Bank Account", "operationId": "create_bank_account_api_v1_bank_accounts_post", "parameters": [{"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BankAccountCreate"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BankAccountOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/bank_accounts/{bank_account_id}": {"get": {"tags": ["bank_accounts"], "summary": "Get Bank Account", "operationId": "get_bank_account_api_v1_bank_accounts__bank_account_id__get", "parameters": [{"name": "bank_account_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Bank Account Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BankAccountOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "patch": {"tags": ["bank_accounts"], "summary": "Update Bank Account", "operationId": "update_bank_account_api_v1_bank_accounts__bank_account_id__patch", "parameters": [{"name": "bank_account_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Bank Account Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BankAccountUpdate"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Update Bank Account Api V1 Bank Accounts  Bank Account Id  Patch", "$ref": "#/components/schemas/BankAccountOut"}}}}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BankAccountConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "delete": {"tags": ["bank_accounts"], "summary": "Delete Bank Account", "operationId": "delete_bank_account_api_v1_bank_accounts__bank_account_id__delete", "parameters": [{"name": "bank_account_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Bank Account Id"}}, {"name": "hard", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Hard"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Admin", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Admin"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Delete Bank Account Api V1 Bank Accounts  Bank Account Id  Delete"}}}}, "204": {"description": "Archived"}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BankAccountConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/bank_accounts/{bank_account_id}/register": {"get": {"tags": ["bank_accounts"], "summary": "Bank Account Register", "description": "Every posted entry on the account with a running balance, what it is,\nwho it was with and whether the bank has cleared it; plus book balance,\nimported statement balance, lines still to match and the last\nreconciliation. A recorded transfer shows on both accounts here.", "operationId": "bank_account_register_api_v1_bank_accounts__bank_account_id__register_get", "parameters": [{"name": "bank_account_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Bank Account Id"}}, {"name": "date_from", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Date From"}}, {"name": "date_to", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Date To"}}, {"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 1000, "minimum": 1, "default": 100, "title": "Limit"}}, {"name": "offset", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 0, "default": 0, "title": "Offset"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Bank Account Register Api V1 Bank Accounts  Bank Account Id  Register Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/bank-feeds/connections": {"post": {"tags": ["bank-feeds"], "summary": "Create Connection", "description": "Initiate a consent flow + persist the local mirror row.\n\nThe relay returns either a live ``201`` with a ``consent_url`` or a\nstub-mode ``501`` with a deterministic stub body. Both cases land a\nlocal row with status ``pending_consent`` so the UI's \"in flight\"\nlist works in stub-mode too. The stub body's ``stub_connection_id``\nis persisted as ``siss_client_id`` so the row has a stable handle.", "operationId": "create_connection_api_v1_bank_feeds_connections_post", "parameters": [{"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreateConnectionIn"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreateConnectionOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "get": {"tags": ["bank-feeds"], "summary": "List Connections", "description": "List local mirror rows for this tenant.\n\nWe **do not** call the relay's ``GET /connections`` here on every\nlist page. The relay's view is authoritative for state transitions\nbut querying it on every page render trades latency for currency\nwe don't need \u2014 local rows are updated by the create/delete/sync\npaths. A future \"Refresh\" button can call the relay explicitly.\nKeeping the list endpoint local-only also makes it usable when the\nrelay is briefly unreachable, which matters for Community-tier\nupgrade upsells (they should still see their pending connections).", "operationId": "list_connections_api_v1_bank_feeds_connections_get", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "array", "items": {"$ref": "#/components/schemas/ConnectionRowOut"}, "title": "Response List Connections Api V1 Bank Feeds Connections Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/bank-feeds/connections/{connection_id}": {"get": {"tags": ["bank-feeds"], "summary": "Get Connection", "operationId": "get_connection_api_v1_bank_feeds_connections__connection_id__get", "parameters": [{"name": "connection_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Connection Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ConnectionRowOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "delete": {"tags": ["bank-feeds"], "summary": "Delete Connection", "description": "Revoke upstream + mark local row revoked.\n\nStub-mode: the relay returns 501 here per contract. We treat that\nas \"the relay accepted intent but couldn't actually revoke\" \u2014 the\nlocal row goes to ``revoked`` because the customer's intent is\nclear, but we surface ``stub: true`` so the UI can show \"the\nupstream wasn't actually told to revoke; we'll catch up when\nfeeds-server goes live\".", "operationId": "delete_connection_api_v1_bank_feeds_connections__connection_id__delete", "parameters": [{"name": "connection_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Connection Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response Delete Connection Api V1 Bank Feeds Connections  Connection Id  Delete"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/bank-feeds/sync": {"post": {"tags": ["bank-feeds"], "summary": "Sync Transactions", "description": "Trigger a sync via the relay; persist returned txns locally.\n\nPeriod-lock guard: refuses to sync if the tenant has any company\nlocked past the current date and the caller didn't supply\n``override_reason``. The intent is to prevent silently inserting\nstatement lines that would later require a locked-period override\non the journal-posting side.", "operationId": "sync_transactions_api_v1_bank_feeds_sync_post", "parameters": [{"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SyncIn"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SyncOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/bank_rules": {"get": {"tags": ["bank_rules"], "summary": "List Bank Rules", "operationId": "list_bank_rules_api_v1_bank_rules_get", "parameters": [{"name": "active_only", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Active Only"}}, {"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 1000, "minimum": 1, "default": 200, "title": "Limit"}}, {"name": "offset", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 0, "default": 0, "title": "Offset"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BankRuleListOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "post": {"tags": ["bank_rules"], "summary": "Create Bank Rule", "operationId": "create_bank_rule_api_v1_bank_rules_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BankRuleCreate"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BankRuleOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/bank_rules/{rule_id}": {"get": {"tags": ["bank_rules"], "summary": "Get Bank Rule", "operationId": "get_bank_rule_api_v1_bank_rules__rule_id__get", "parameters": [{"name": "rule_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Rule Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BankRuleOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "patch": {"tags": ["bank_rules"], "summary": "Update Bank Rule", "operationId": "update_bank_rule_api_v1_bank_rules__rule_id__patch", "parameters": [{"name": "rule_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Rule Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BankRuleUpdate"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BankRuleOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "delete": {"tags": ["bank_rules"], "summary": "Delete Bank Rule", "operationId": "delete_bank_rule_api_v1_bank_rules__rule_id__delete", "parameters": [{"name": "rule_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Rule Id"}}, {"name": "hard", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Hard"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Admin", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Admin"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Delete Bank Rule Api V1 Bank Rules  Rule Id  Delete"}}}}, "204": {"description": "Deleted"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/bank_rules/apply": {"post": {"tags": ["bank_rules"], "summary": "Apply All Bank Rules", "description": "Apply all active auto_create rules to unmatched bank statement lines.\n\nReturns ``{\"applied\": N}`` where N is the number of lines matched\nand journal entries created.", "operationId": "apply_all_bank_rules_api_v1_bank_rules_apply_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BankRuleApplyOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/bank_rules/{rule_id}/apply": {"post": {"tags": ["bank_rules"], "summary": "Apply Single Bank Rule", "description": "Apply one rule to all matching unmatched bank statement lines.\n\nReturns ``{\"applied\": N}`` where N is the number of lines matched\nand journal entries created.", "operationId": "apply_single_bank_rule_api_v1_bank_rules__rule_id__apply_post", "parameters": [{"name": "rule_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Rule Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BankRuleApplyOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/bank_statement_lines": {"get": {"tags": ["bank_statement_lines"], "summary": "List Bank Statement Lines", "operationId": "list_bank_statement_lines_api_v1_bank_statement_lines_get", "parameters": [{"name": "bank_account_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Bank Account Id"}}, {"name": "status", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Status"}}, {"name": "date_from", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Date From"}}, {"name": "date_to", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Date To"}}, {"name": "sort", "in": "query", "required": false, "schema": {"type": "string", "description": "One of: date, description, amount, balance, status, reference", "default": "date", "title": "Sort"}, "description": "One of: date, description, amount, balance, status, reference"}, {"name": "direction", "in": "query", "required": false, "schema": {"type": "string", "pattern": "^(asc|desc)$", "default": "desc", "title": "Direction"}}, {"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 500, "minimum": 1, "default": 50, "title": "Limit"}}, {"name": "offset", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 0, "default": 0, "title": "Offset"}}, {"name": "q", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "maxLength": 200}, {"type": "null"}], "description": "Search description, reference and contact name. Text that reads as an amount also matches the line amount, money in or out.", "title": "Q"}, "description": "Search description, reference and contact name. Text that reads as an amount also matches the line amount, money in or out."}, {"name": "amount_min", "in": "query", "required": false, "schema": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "description": "Smallest line size (money in or out).", "title": "Amount Min"}, "description": "Smallest line size (money in or out)."}, {"name": "amount_max", "in": "query", "required": false, "schema": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "description": "Largest line size (money in or out).", "title": "Amount Max"}, "description": "Largest line size (money in or out)."}, {"name": "format", "in": "query", "required": false, "schema": {"enum": ["json", "csv"], "type": "string", "description": "csv downloads every matching line (no paging).", "default": "json", "title": "Format"}, "description": "csv downloads every matching line (no paging)."}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BankStatementLineListOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "post": {"tags": ["bank_statement_lines"], "summary": "Create Bank Statement Line", "operationId": "create_bank_statement_line_api_v1_bank_statement_lines_post", "parameters": [{"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BankStatementLineCreate"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BankStatementLineOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/bank_statement_lines/{line_id}": {"get": {"tags": ["bank_statement_lines"], "summary": "Get Bank Statement Line", "operationId": "get_bank_statement_line_api_v1_bank_statement_lines__line_id__get", "parameters": [{"name": "line_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Line Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BankStatementLineOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "patch": {"tags": ["bank_statement_lines"], "summary": "Update Bank Statement Line", "operationId": "update_bank_statement_line_api_v1_bank_statement_lines__line_id__patch", "parameters": [{"name": "line_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Line Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BankStatementLineUpdate"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Update Bank Statement Line Api V1 Bank Statement Lines  Line Id  Patch", "$ref": "#/components/schemas/BankStatementLineOut"}}}}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BankStatementLineConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "delete": {"tags": ["bank_statement_lines"], "summary": "Delete Bank Statement Line", "operationId": "delete_bank_statement_line_api_v1_bank_statement_lines__line_id__delete", "parameters": [{"name": "line_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Line Id"}}, {"name": "hard", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Hard"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Admin", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Admin"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Delete Bank Statement Line Api V1 Bank Statement Lines  Line Id  Delete"}}}}, "204": {"description": "Archived"}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BankStatementLineConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/bank_statement_lines/bulk": {"post": {"tags": ["bank_statement_lines"], "summary": "Bulk Create Bank Statement Lines", "description": "Bulk-create statement lines with dedup \u2014 the capture fact API.\n\nRuns the exact same shared implementation the in-process writers use\n(``services.statement_lines_bulk``), so semantics can't drift:\n\n* No ``bank_feed_account_id`` \u2192 FINGERPRINT dedup (CSV / OFX): a\n  deterministic hash + intra-batch occurrence index. Re-posting the\n  same file returns ``created=0``; genuinely-distinct rows that share a\n  base fingerprint all survive.\n* ``bank_feed_account_id`` set \u2192 EXTERNAL_ID dedup (aggregator feed):\n  ON CONFLICT DO NOTHING on ``(bank_feed_account_id, external_id)``.\n  Every line MUST carry ``external_id``.\n\nReturns ``{created, deduped, ids}`` (``created + deduped == len(lines)``).\nSame bearer auth + tenant scoping as the single-row POST.", "operationId": "bulk_create_bank_statement_lines_api_v1_bank_statement_lines_bulk_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BankStatementLineBulkCreate"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BankStatementLineBulkResult"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/bank_statement_lines/{line_id}/match": {"post": {"tags": ["bank_statement_lines"], "summary": "Match Bank Statement Line", "description": "Match a bank statement line to a payment or journal entry.\n\nSets status=MATCHED, records matched_to_type, matched_to_id, matched_at,\nand bumps the version.\n\nDEPRECATED (R8d, contract-level only \u2014 not removed): prefer\n``POST /api/v1/reconciliation/match``, the canonical matching-workflow\nsurface. This route stays functional and answers with a\n``Deprecation`` + ``Link`` header pair (RFC 8594).", "operationId": "match_bank_statement_line_api_v1_bank_statement_lines__line_id__match_post", "parameters": [{"name": "line_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Line Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BankStatementLineMatchRequest"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BankStatementLineOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/bank_statement_lines/{line_id}/unmatch": {"post": {"tags": ["bank_statement_lines"], "summary": "Unmatch Bank Statement Line", "description": "Clear the reconciliation match on a bank statement line.\n\nSets status=UNMATCHED and clears matched_to_type, matched_to_id,\nmatched_entry_id, matched_at, matched_by.", "operationId": "unmatch_bank_statement_line_api_v1_bank_statement_lines__line_id__unmatch_post", "parameters": [{"name": "line_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Line Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BankStatementLineOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/bank_statement_lines/{line_id}/split_match": {"post": {"tags": ["bank_statement_lines"], "summary": "Split Match Bank Statement Line", "description": "Match a bank statement line via a new split journal entry.\n\nCreates a balanced journal entry whose bank-account side equals the BSL\namount and whose allocation side is provided by the caller, then posts the\nentry and marks the BSL as MATCHED.\n\nThe allocations list must satisfy:\n  sum(credit) - sum(debit) == bank_line.amount\n\nExample \u2014 $970 Stripe net payout:\n  allocations = [\n    {\"account_id\": \"<AR>\",           \"credit\": 1000, \"debit\": 0},\n    {\"account_id\": \"<StripeFees>\",   \"debit\": 30,    \"credit\": 0}\n  ]", "operationId": "split_match_bank_statement_line_api_v1_bank_statement_lines__line_id__split_match_post", "parameters": [{"name": "line_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Line Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BankStatementLineSplitMatchRequest"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BankStatementLineOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/budgets": {"get": {"tags": ["budgets"], "summary": "List Budgets", "operationId": "list_budgets_api_v1_budgets_get", "parameters": [{"name": "page", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 1, "default": 1, "title": "Page"}}, {"name": "page_size", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 500, "minimum": 1, "default": 50, "title": "Page Size"}}, {"name": "year", "in": "query", "required": false, "schema": {"anyOf": [{"type": "integer"}, {"type": "null"}], "title": "Year"}}, {"name": "month", "in": "query", "required": false, "schema": {"anyOf": [{"type": "integer"}, {"type": "null"}], "title": "Month"}}, {"name": "account_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Account Id"}}, {"name": "archived", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Archived"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BudgetListOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "post": {"tags": ["budgets"], "summary": "Create Budget", "operationId": "create_budget_api_v1_budgets_post", "parameters": [{"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BudgetCreate"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BudgetOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/budgets/{budget_id}": {"get": {"tags": ["budgets"], "summary": "Get Budget", "operationId": "get_budget_api_v1_budgets__budget_id__get", "parameters": [{"name": "budget_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Budget Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BudgetOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "patch": {"tags": ["budgets"], "summary": "Update Budget", "operationId": "update_budget_api_v1_budgets__budget_id__patch", "parameters": [{"name": "budget_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Budget Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BudgetUpdate"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Update Budget Api V1 Budgets  Budget Id  Patch", "$ref": "#/components/schemas/BudgetOut"}}}}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BudgetConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "delete": {"tags": ["budgets"], "summary": "Delete Budget", "operationId": "delete_budget_api_v1_budgets__budget_id__delete", "parameters": [{"name": "budget_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Budget Id"}}, {"name": "hard", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Hard"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Admin", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Admin"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Delete Budget Api V1 Budgets  Budget Id  Delete"}}}}, "204": {"description": "Archived"}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BudgetConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/companies": {"get": {"tags": ["companies"], "summary": "List Companies", "operationId": "list_companies_api_v1_companies_get", "parameters": [{"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 500, "minimum": 1, "default": 100, "title": "Limit"}}, {"name": "offset", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 0, "default": 0, "title": "Offset"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompanyListOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "post": {"tags": ["companies"], "summary": "Create Company", "description": "Create a new company under the active tenant.\n\nGated on ``FLAG_MULTI_COMPANY`` so Community / Offline editions\nreturn 404 (the route is invisible at lower tiers). Service-layer\n``create_company`` enforces the per-edition company cap via the\nlicence resolver and raises ``CompanyCapExceeded`` when the\nrequest would push the active edition over its limit \u2014 translated\nhere to HTTP 409.", "operationId": "create_company_api_v1_companies_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompanyCreate"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompanyOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/companies/{company_id}": {"get": {"tags": ["companies"], "summary": "Get Company", "operationId": "get_company_api_v1_companies__company_id__get", "parameters": [{"name": "company_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Company Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompanyOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "patch": {"tags": ["companies"], "summary": "Update Company", "operationId": "update_company_api_v1_companies__company_id__patch", "parameters": [{"name": "company_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Company Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompanyUpdate"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Update Company Api V1 Companies  Company Id  Patch", "$ref": "#/components/schemas/CompanyOut"}}}}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompanyConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "delete": {"tags": ["companies"], "summary": "Hard Delete Company", "operationId": "hard_delete_company_api_v1_companies__company_id__delete", "parameters": [{"name": "company_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Company Id"}}, {"name": "hard", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Hard"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Admin", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Admin"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Hard Delete Company Api V1 Companies  Company Id  Delete"}}}}, "204": {"description": "Deleted"}, "409": {"description": "Company has linked rows; hard-delete the rows first."}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/companies/{company_id}/gst-backdate-preview": {"get": {"tags": ["companies"], "summary": "Gst Backdate Preview", "description": "Return the count of invoices issued on or after effective_date that carry no GST.\n\nThese are the invoices an operator would need to retroactively amend when\nbackdating their GST registration (ATO: up to 4 years).  The response is\ninformational only \u2014 no data is mutated.", "operationId": "gst_backdate_preview_api_v1_companies__company_id__gst_backdate_preview_get", "parameters": [{"name": "company_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Company Id"}}, {"name": "effective_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "Effective Date"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/companies/{company_id}/bookkeeping-mode": {"post": {"tags": ["companies"], "summary": "Set Bookkeeping Mode", "description": "Flip a company between cashbook and full bookkeeping modes.\n\nRound-2 audit fix #10. Bidirectional per\n[[cashbook-upgrade-downgrade-policy]] \u2014 *no* \"you cannot go back\".\n\n* cashbook \u2192 full: lossless (cashbook entries are real journals).\n* full \u2192 cashbook: refused if AR > 0 (schema invariant \u2014 list of\n  offending invoices in the error body). Historical journal\n  entries are preserved; the user's cashbook view starts from the\n  flip date.", "operationId": "set_bookkeeping_mode_api_v1_companies__company_id__bookkeeping_mode_post", "parameters": [{"name": "company_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Company Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BookkeepingModeChange"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BookkeepingModeOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/tax_codes": {"get": {"tags": ["tax_codes"], "summary": "List Tax Codes", "operationId": "list_tax_codes_api_v1_tax_codes_get", "parameters": [{"name": "tax_system", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Tax System"}}, {"name": "jurisdiction", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Filter by jurisdiction. Defaults to the requesting company's own jurisdiction (Company.jurisdiction) so the international reference codes stay hidden; pass an empty string to return all jurisdictions, or an explicit code to override.", "title": "Jurisdiction"}, "description": "Filter by jurisdiction. Defaults to the requesting company's own jurisdiction (Company.jurisdiction) so the international reference codes stay hidden; pass an empty string to return all jurisdictions, or an explicit code to override."}, {"name": "usage", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "pattern": "^(sales|purchases)$"}, {"type": "null"}], "description": "Only codes usable on this side of the books: 'purchases' for bills and expenses (drops export and margin-scheme codes), 'sales' for invoices (drops capital, reverse-charge and import codes). Omit for every code.", "title": "Usage"}, "description": "Only codes usable on this side of the books: 'purchases' for bills and expenses (drops export and margin-scheme codes), 'sales' for invoices (drops capital, reverse-charge and import codes). Omit for every code."}, {"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 1000, "minimum": 1, "default": 200, "title": "Limit"}}, {"name": "offset", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 0, "default": 0, "title": "Offset"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TaxCodeListOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "post": {"tags": ["tax_codes"], "summary": "Create Tax Code", "operationId": "create_tax_code_api_v1_tax_codes_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TaxCodeCreate"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TaxCodeOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/tax_codes/{tax_code_id}": {"get": {"tags": ["tax_codes"], "summary": "Get Tax Code", "operationId": "get_tax_code_api_v1_tax_codes__tax_code_id__get", "parameters": [{"name": "tax_code_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Tax Code Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TaxCodeOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "patch": {"tags": ["tax_codes"], "summary": "Update Tax Code", "operationId": "update_tax_code_api_v1_tax_codes__tax_code_id__patch", "parameters": [{"name": "tax_code_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Tax Code Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TaxCodeUpdate"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Update Tax Code Api V1 Tax Codes  Tax Code Id  Patch", "$ref": "#/components/schemas/TaxCodeOut"}}}}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TaxCodeConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "delete": {"tags": ["tax_codes"], "summary": "Archive Tax Code", "operationId": "archive_tax_code_api_v1_tax_codes__tax_code_id__delete", "parameters": [{"name": "tax_code_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Tax Code Id"}}, {"name": "hard", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Hard"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Admin", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Admin"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Archive Tax Code Api V1 Tax Codes  Tax Code Id  Delete"}}}}, "204": {"description": "Archived"}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TaxCodeConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/items": {"get": {"tags": ["items"], "summary": "List Items", "description": "List items. P2-16: filter by type, stock level and archived state;\nthe response carries the total stock value of every matching item.", "operationId": "list_items_api_v1_items_get", "parameters": [{"name": "item_type", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Item Type"}}, {"name": "search", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "maxLength": 100}, {"type": "null"}], "title": "Search"}}, {"name": "stock", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "in_stock | out_of_stock | low_stock", "title": "Stock"}, "description": "in_stock | out_of_stock | low_stock"}, {"name": "archived", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "active (default) | archived | all", "title": "Archived"}, "description": "active (default) | archived | all"}, {"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 1000, "minimum": 1, "default": 200, "title": "Limit"}}, {"name": "offset", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 0, "default": 0, "title": "Offset"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ItemListOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "post": {"tags": ["items"], "summary": "Create Item", "operationId": "create_item_api_v1_items_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ItemCreate"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ItemOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/items/{item_id}": {"get": {"tags": ["items"], "summary": "Get Item", "operationId": "get_item_api_v1_items__item_id__get", "parameters": [{"name": "item_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Item Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ItemOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "patch": {"tags": ["items"], "summary": "Update Item", "operationId": "update_item_api_v1_items__item_id__patch", "parameters": [{"name": "item_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Item Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ItemUpdate"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Update Item Api V1 Items  Item Id  Patch", "$ref": "#/components/schemas/ItemOut"}}}}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ItemConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "delete": {"tags": ["items"], "summary": "Archive Item", "operationId": "archive_item_api_v1_items__item_id__delete", "parameters": [{"name": "item_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Item Id"}}, {"name": "hard", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Hard"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Admin", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Admin"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Archive Item Api V1 Items  Item Id  Delete"}}}}, "204": {"description": "Archived"}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ItemConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/items/{item_id}/stock": {"get": {"tags": ["items"], "summary": "Get Item Stock", "description": "Return current stock levels for an inventory-type item.\n\nReturns 404 if the item is service-type (no stock tracking).\nAlso returns 404 if the item does not exist or is archived.", "operationId": "get_item_stock_api_v1_items__item_id__stock_get", "parameters": [{"name": "item_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Item Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/StockOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/items/{item_id}/restore": {"post": {"tags": ["items"], "summary": "Restore Item", "operationId": "restore_item_api_v1_items__item_id__restore_post", "parameters": [{"name": "item_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Item Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Restore Item Api V1 Items  Item Id  Restore Post", "$ref": "#/components/schemas/ItemOut"}}}}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ItemConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/stock/valuation": {"get": {"tags": ["stock"], "summary": "Stock Valuation", "operationId": "stock_valuation_api_v1_stock_valuation_get", "parameters": [{"name": "as_of", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "As Of"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/stock/movements": {"get": {"tags": ["stock"], "summary": "Stock Movements", "operationId": "stock_movements_api_v1_stock_movements_get", "parameters": [{"name": "item_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Item Id"}}, {"name": "date_from", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Date From"}}, {"name": "date_to", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Date To"}}, {"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 1000, "minimum": 1, "default": 200, "title": "Limit"}}, {"name": "offset", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 0, "default": 0, "title": "Offset"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/stock/adjustments": {"get": {"tags": ["stock"], "summary": "List Adjustments", "operationId": "list_adjustments_api_v1_stock_adjustments_get", "parameters": [{"name": "status", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Status"}}, {"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 500, "minimum": 1, "default": 100, "title": "Limit"}}, {"name": "offset", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 0, "default": 0, "title": "Offset"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "post": {"tags": ["stock"], "summary": "Create Adjustment", "operationId": "create_adjustment_api_v1_stock_adjustments_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/StockAdjustmentCreate"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/stock/adjustments/{adjustment_id}": {"get": {"tags": ["stock"], "summary": "Get Adjustment", "operationId": "get_adjustment_api_v1_stock_adjustments__adjustment_id__get", "parameters": [{"name": "adjustment_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Adjustment Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "patch": {"tags": ["stock"], "summary": "Update Adjustment", "operationId": "update_adjustment_api_v1_stock_adjustments__adjustment_id__patch", "parameters": [{"name": "adjustment_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Adjustment Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/StockAdjustmentUpdate"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "delete": {"tags": ["stock"], "summary": "Delete Adjustment", "operationId": "delete_adjustment_api_v1_stock_adjustments__adjustment_id__delete", "parameters": [{"name": "adjustment_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Adjustment Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"204": {"description": "Successful Response"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/stock/adjustments/{adjustment_id}/post": {"post": {"tags": ["stock"], "summary": "Post Adjustment", "operationId": "post_adjustment_api_v1_stock_adjustments__adjustment_id__post_post", "parameters": [{"name": "adjustment_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Adjustment Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/stock/adjustments/{adjustment_id}/void": {"post": {"tags": ["stock"], "summary": "Void Adjustment", "operationId": "void_adjustment_api_v1_stock_adjustments__adjustment_id__void_post", "parameters": [{"name": "adjustment_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Adjustment Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/stock/reports/sales-by-item": {"get": {"tags": ["stock"], "summary": "Sales By Item", "operationId": "sales_by_item_api_v1_stock_reports_sales_by_item_get", "parameters": [{"name": "date_from", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Date From"}}, {"name": "date_to", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Date To"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/stock/reports/purchases-by-item": {"get": {"tags": ["stock"], "summary": "Purchases By Item", "operationId": "purchases_by_item_api_v1_stock_reports_purchases_by_item_get", "parameters": [{"name": "date_from", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Date From"}}, {"name": "date_to", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Date To"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/users": {"get": {"tags": ["users"], "summary": "List Users", "operationId": "list_users_api_v1_users_get", "parameters": [{"name": "role", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Role"}}, {"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 1000, "minimum": 1, "default": 200, "title": "Limit"}}, {"name": "offset", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 0, "default": 0, "title": "Offset"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/UserListOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "post": {"tags": ["users"], "summary": "Create User", "operationId": "create_user_api_v1_users_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/UserCreate"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/UserOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/users/{user_id}": {"get": {"tags": ["users"], "summary": "Get User", "operationId": "get_user_api_v1_users__user_id__get", "parameters": [{"name": "user_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "User Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/UserOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "patch": {"tags": ["users"], "summary": "Update User", "operationId": "update_user_api_v1_users__user_id__patch", "parameters": [{"name": "user_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "User Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "X-Admin", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Admin"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/UserUpdate"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Update User Api V1 Users  User Id  Patch", "$ref": "#/components/schemas/UserOut"}}}}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/UserConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "delete": {"tags": ["users"], "summary": "Archive User", "operationId": "archive_user_api_v1_users__user_id__delete", "parameters": [{"name": "user_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "User Id"}}, {"name": "hard", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Hard"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Admin", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Admin"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Archive User Api V1 Users  User Id  Delete"}}}}, "204": {"description": "Archived"}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/UserConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/users/invite": {"post": {"tags": ["users"], "summary": "Invite User", "operationId": "invite_user_api_v1_users_invite_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/UserInviteIn"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Invite User Api V1 Users Invite Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/users/{user_id}/resend-invite": {"post": {"tags": ["users"], "summary": "Resend Invite", "operationId": "resend_invite_api_v1_users__user_id__resend_invite_post", "parameters": [{"name": "user_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "User Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Resend Invite Api V1 Users  User Id  Resend Invite Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/users/{user_id}/permissions": {"get": {"tags": ["users"], "summary": "Get User Permissions", "description": "Return the resolved permission set for a user.\n\nEach entry shows whether the permission is currently granted (True)\nor not (False), accounting for role grants and per-user overrides.", "operationId": "get_user_permissions_api_v1_users__user_id__permissions_get", "parameters": [{"name": "user_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "User Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "array", "items": {"$ref": "#/components/schemas/UserPermissionOut"}, "title": "Response Get User Permissions Api V1 Users  User Id  Permissions Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "put": {"tags": ["users"], "summary": "Replace User Permissions", "description": "Replace the per-user permission overrides (admin only).\n\n``grants`` and ``revokes`` replace the existing ``user_permissions``\nrows for this user. Any code not in either list falls back to the\nrole-based grant.", "operationId": "replace_user_permissions_api_v1_users__user_id__permissions_put", "parameters": [{"name": "user_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "User Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/UserPermissionsBody"}}}}, "responses": {"204": {"description": "Successful Response"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/permissions": {"get": {"tags": ["permissions"], "summary": "List Permissions", "description": "Return the full permission catalogue (code + description).", "operationId": "list_permissions_api_v1_permissions_get", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "array", "items": {"$ref": "#/components/schemas/PermissionOut"}, "title": "Response List Permissions Api V1 Permissions Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/roles": {"get": {"tags": ["roles"], "summary": "List Roles", "operationId": "list_roles_api_v1_roles_get", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Admin", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Admin"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "array", "items": {"$ref": "#/components/schemas/RoleOut"}, "title": "Response List Roles Api V1 Roles Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "post": {"tags": ["roles"], "summary": "Create Role", "operationId": "create_role_api_v1_roles_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Admin", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Admin"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RoleCreate"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RoleOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/roles/{role_id}": {"get": {"tags": ["roles"], "summary": "Get Role", "operationId": "get_role_api_v1_roles__role_id__get", "parameters": [{"name": "role_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Role Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Admin", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Admin"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RoleWithGrantsOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "patch": {"tags": ["roles"], "summary": "Rename Role", "operationId": "rename_role_api_v1_roles__role_id__patch", "parameters": [{"name": "role_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Role Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Admin", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Admin"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RoleRename"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RoleOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "delete": {"tags": ["roles"], "summary": "Delete Role", "operationId": "delete_role_api_v1_roles__role_id__delete", "parameters": [{"name": "role_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Role Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Admin", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Admin"}}], "responses": {"204": {"description": "Successful Response"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/roles/from-template": {"post": {"tags": ["roles"], "summary": "Create Role From Template", "description": "b06 (P0-32): one-click starter role for an outside accountant.", "operationId": "create_role_from_template_api_v1_roles_from_template_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Admin", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Admin"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RoleFromTemplate"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RoleOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/roles/{role_id}/grants": {"put": {"tags": ["roles"], "summary": "Set Role Grants", "description": "Replace a role's grant set. Works for starter roles too \u2014 D2\ntreats the starter grid as an editable default, not a floor.", "operationId": "set_role_grants_api_v1_roles__role_id__grants_put", "parameters": [{"name": "role_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Role Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Admin", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Admin"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RoleGrantsBody"}}}}, "responses": {"204": {"description": "Successful Response"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/themes": {"get": {"tags": ["themes"], "summary": "List Themes", "description": "Return the full theme catalogue as ``[{\"id\": ..., \"label\": ...}]``.", "operationId": "list_themes_api_v1_themes_get", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "array", "items": {"type": "object", "additionalProperties": {"type": "string"}}, "title": "Response List Themes Api V1 Themes Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/journal_entries": {"get": {"tags": ["journal_entries"], "summary": "List Journal Entries", "operationId": "list_journal_entries_api_v1_journal_entries_get", "parameters": [{"name": "date_from", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Date From"}}, {"name": "date_to", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Date To"}}, {"name": "status", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Status"}}, {"name": "ref", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Case-insensitive substring on journal_entries.ref", "title": "Ref"}, "description": "Case-insensitive substring on journal_entries.ref"}, {"name": "description", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Case-insensitive substring on description", "title": "Description"}, "description": "Case-insensitive substring on description"}, {"name": "posted_by", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Case-insensitive substring on posted_by", "title": "Posted By"}, "description": "Case-insensitive substring on posted_by"}, {"name": "account_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "description": "Only entries with a line on this account", "title": "Account Id"}, "description": "Only entries with a line on this account"}, {"name": "account_code", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Convenience: resolves to account_id by Account.code", "title": "Account Code"}, "description": "Convenience: resolves to account_id by Account.code"}, {"name": "flagged", "in": "query", "required": false, "schema": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "description": "Filter by flagged_for_review", "title": "Flagged"}, "description": "Filter by flagged_for_review"}, {"name": "sort", "in": "query", "required": false, "schema": {"type": "string", "description": "Sort column: date | ref | total_debit | status", "default": "date", "title": "Sort"}, "description": "Sort column: date | ref | total_debit | status"}, {"name": "dir", "in": "query", "required": false, "schema": {"type": "string", "description": "Sort direction: asc | desc", "default": "desc", "title": "Dir"}, "description": "Sort direction: asc | desc"}, {"name": "page", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 1, "default": 1, "title": "Page"}}, {"name": "page_size", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 500, "minimum": 1, "default": 50, "title": "Page Size"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/JournalEntryListOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "post": {"tags": ["journal_entries"], "summary": "Create Journal Entry", "operationId": "create_journal_entry_api_v1_journal_entries_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/JournalEntryCreate"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/JournalEntryOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/journal_entries/{entry_id}/review-flag": {"post": {"tags": ["journal_entries"], "summary": "Set Journal Entry Review Flag", "operationId": "set_journal_entry_review_flag_api_v1_journal_entries__entry_id__review_flag_post", "parameters": [{"name": "entry_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Entry Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ReviewFlagBody"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/JournalEntryOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/journal_entries/_filter_options": {"get": {"tags": ["journal_entries"], "summary": "Journal Entry Filter Options", "description": "Return values for populating the JE list filter dropdowns.\n\n* ``posted_by`` \u2014 distinct non-null posted_by values, alphabetical\n* ``ref_prefixes`` \u2014 distinct ref prefixes (chars before first digit run),\n  top 30 by frequency, then alphabetical\n\nAll results are RLS-gated via the existing tenant binding on the\nsession connection.", "operationId": "journal_entry_filter_options_api_v1_journal_entries__filter_options_get", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": {"type": "array", "items": {"type": "string"}}, "title": "Response Journal Entry Filter Options Api V1 Journal Entries  Filter Options Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/journal_entries/{entry_id}": {"get": {"tags": ["journal_entries"], "summary": "Get Journal Entry", "operationId": "get_journal_entry_api_v1_journal_entries__entry_id__get", "parameters": [{"name": "entry_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Entry Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/JournalEntryOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "patch": {"tags": ["journal_entries"], "summary": "Update Journal Entry", "operationId": "update_journal_entry_api_v1_journal_entries__entry_id__patch", "parameters": [{"name": "entry_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Entry Id"}}, {"name": "force", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Force"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/JournalEntryUpdate"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Update Journal Entry Api V1 Journal Entries  Entry Id  Patch", "$ref": "#/components/schemas/JournalEntryOut"}}}}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/JournalEntryConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "delete": {"tags": ["journal_entries"], "summary": "Void Journal Entry", "operationId": "void_journal_entry_api_v1_journal_entries__entry_id__delete", "parameters": [{"name": "entry_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Entry Id"}}, {"name": "hard", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Hard"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Admin", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Admin"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Void Journal Entry Api V1 Journal Entries  Entry Id  Delete"}}}}, "204": {"description": "Voided"}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/JournalEntryConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/journal_entries/{entry_id}/source": {"get": {"tags": ["journal_entries"], "summary": "Get Journal Entry Source", "description": "Return the source document linked to this JE, or nulls.\n\nThe five candidate tables (invoices, bills, credit_notes, expenses,\npayments) each hold a journal_entry_id FK; the first hit (by table\npriority order) is returned.", "operationId": "get_journal_entry_source_api_v1_journal_entries__entry_id__source_get", "parameters": [{"name": "entry_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Entry Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": {"anyOf": [{"type": "string"}, {"type": "null"}]}, "title": "Response Get Journal Entry Source Api V1 Journal Entries  Entry Id  Source Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/journal_entries/{entry_id}/post": {"post": {"tags": ["journal_entries"], "summary": "Post Journal Entry", "description": "Transition journal entry DRAFT \u2192 POSTED.\n\nChecks period lock, auto-posts GST lines, verifies balance.\nReturns 422 if the entry is already POSTED or REVERSED.\nReturns 422 with \"Period is locked\" if entry_date falls in a locked period\nand no override_reason is supplied in the request body.", "operationId": "post_journal_entry_api_v1_journal_entries__entry_id__post_post", "parameters": [{"name": "entry_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Entry Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/JournalEntryPostBody"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Post Journal Entry Api V1 Journal Entries  Entry Id  Post Post", "$ref": "#/components/schemas/JournalEntryOut"}}}}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/JournalEntryConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/journal_entries/{entry_id}/reverse": {"post": {"tags": ["journal_entries"], "summary": "Reverse Journal Entry", "description": "Create a reversal of a POSTED journal entry (POSTED \u2192 REVERSED).\n\nCreates a new JournalEntry with all debit/credit lines swapped,\nauto-posts it, and marks the original entry as REVERSED. The new\nreversal entry is returned. Only POSTED entries can be reversed;\nreturns 422 for any other status.", "operationId": "reverse_journal_entry_api_v1_journal_entries__entry_id__reverse_post", "parameters": [{"name": "entry_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Entry Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/JournalEntryReverseBody"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Reverse Journal Entry Api V1 Journal Entries  Entry Id  Reverse Post", "$ref": "#/components/schemas/JournalEntryOut"}}}}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/JournalEntryConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/invoices": {"get": {"tags": ["invoices"], "summary": "List Invoices", "description": "List invoices.\n\nSearch with ``q`` (number, customer name, or an amount), narrow with\n``amount_min``/``amount_max`` and ``payment_status``, and sort on the\nserver with ``sort`` = number, issue_date, due_date, contact, total,\namount_due or status. ``format=csv`` downloads every matching row.", "operationId": "list_invoices_api_v1_invoices_get", "parameters": [{"name": "contact_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Contact Id"}}, {"name": "project_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Project Id"}}, {"name": "status", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Status"}}, {"name": "payment_status", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "unpaid | overdue | due_soon | open | part_paid | paid | draft | voided (server-side; amounts owed count applied credits)", "title": "Payment Status"}, "description": "unpaid | overdue | due_soon | open | part_paid | paid | draft | voided (server-side; amounts owed count applied credits)"}, {"name": "flagged", "in": "query", "required": false, "schema": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "description": "Filter by flagged_for_review", "title": "Flagged"}, "description": "Filter by flagged_for_review"}, {"name": "date_from", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Date From"}}, {"name": "date_to", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Date To"}}, {"name": "page", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 1, "default": 1, "title": "Page"}}, {"name": "page_size", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 500, "minimum": 1, "default": 50, "title": "Page Size"}}, {"name": "q", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "maxLength": 200}, {"type": "null"}], "description": "Free-text search: number, reference and contact name. Text that reads as an amount (e.g. 1513.59 or $1,513.59) also matches the document total.", "title": "Q"}, "description": "Free-text search: number, reference and contact name. Text that reads as an amount (e.g. 1513.59 or $1,513.59) also matches the document total."}, {"name": "amount_min", "in": "query", "required": false, "schema": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "description": "Smallest total to include (inclusive).", "title": "Amount Min"}, "description": "Smallest total to include (inclusive)."}, {"name": "amount_max", "in": "query", "required": false, "schema": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "description": "Largest total to include (inclusive).", "title": "Amount Max"}, "description": "Largest total to include (inclusive)."}, {"name": "sort", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Sort key; see the endpoint description.", "title": "Sort"}, "description": "Sort key; see the endpoint description."}, {"name": "direction", "in": "query", "required": false, "schema": {"enum": ["asc", "desc"], "type": "string", "description": "Sort order.", "default": "desc", "title": "Direction"}, "description": "Sort order."}, {"name": "format", "in": "query", "required": false, "schema": {"enum": ["json", "csv"], "type": "string", "description": "csv returns every matching row (no paging) as a spreadsheet download, in the same order.", "default": "json", "title": "Format"}, "description": "csv returns every matching row (no paging) as a spreadsheet download, in the same order."}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/InvoiceListOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "post": {"tags": ["invoices"], "summary": "Create Invoice", "operationId": "create_invoice_api_v1_invoices_post", "parameters": [{"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/InvoiceCreate"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/InvoiceOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/invoices/{invoice_id}": {"get": {"tags": ["invoices"], "summary": "Get Invoice", "operationId": "get_invoice_api_v1_invoices__invoice_id__get", "parameters": [{"name": "invoice_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Invoice Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/InvoiceOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "patch": {"tags": ["invoices"], "summary": "Update Invoice", "operationId": "update_invoice_api_v1_invoices__invoice_id__patch", "parameters": [{"name": "invoice_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Invoice Id"}}, {"name": "force", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Force"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/InvoiceUpdate"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Update Invoice Api V1 Invoices  Invoice Id  Patch", "$ref": "#/components/schemas/InvoiceOut"}}}}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/InvoiceConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "delete": {"tags": ["invoices"], "summary": "Void Invoice", "operationId": "void_invoice_api_v1_invoices__invoice_id__delete", "parameters": [{"name": "invoice_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Invoice Id"}}, {"name": "hard", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Hard"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Admin", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Admin"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Void Invoice Api V1 Invoices  Invoice Id  Delete"}}}}, "204": {"description": "Voided"}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/InvoiceConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/invoices/{invoice_id}/review-flag": {"post": {"tags": ["invoices"], "summary": "Set Invoice Review Flag", "operationId": "set_invoice_review_flag_api_v1_invoices__invoice_id__review_flag_post", "parameters": [{"name": "invoice_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Invoice Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ReviewFlagBody"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/InvoiceOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/invoices/{invoice_id}/lines": {"post": {"tags": ["invoices"], "summary": "Append Invoice Line", "description": "Append one line to a DRAFT invoice, returning the created line (incl id).\n\nDRAFT-only, optimistic-locked (``If-Match: <version>``), version-bumped\nand change_log'd like every other edit. Preserves the invoice's existing\nlines \u2014 unlike PATCH, which replaces them wholesale. Built for the\ntime-entries \u2192 invoice-line hand-off, which needs the new line's id to\nwrite back into ``time_entries.invoice_line_id`` without clobbering the\nids of lines earlier converted onto the same DRAFT.", "operationId": "append_invoice_line_api_v1_invoices__invoice_id__lines_post", "parameters": [{"name": "invoice_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Invoice Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/InvoiceLineCreate"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Append Invoice Line Api V1 Invoices  Invoice Id  Lines Post", "$ref": "#/components/schemas/InvoiceLineAppendOut"}}}}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/InvoiceConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/invoices/{invoice_id}/post": {"post": {"tags": ["invoices"], "summary": "Post Invoice", "description": "Transition invoice DRAFT \u2192 POSTED, generating journal entry lines.", "operationId": "post_invoice_api_v1_invoices__invoice_id__post_post", "parameters": [{"name": "invoice_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Invoice Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Post Invoice Api V1 Invoices  Invoice Id  Post Post", "$ref": "#/components/schemas/InvoiceOut"}}}}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/InvoiceConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/invoices/{invoice_id}/void": {"post": {"tags": ["invoices"], "summary": "Void Invoice Transition", "description": "Transition any non-VOIDED invoice \u2192 VOIDED, reversing JE if POSTED.", "operationId": "void_invoice_transition_api_v1_invoices__invoice_id__void_post", "parameters": [{"name": "invoice_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Invoice Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Void Invoice Transition Api V1 Invoices  Invoice Id  Void Post", "$ref": "#/components/schemas/InvoiceOut"}}}}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/InvoiceConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/invoices/{invoice_id}/write-off": {"post": {"tags": ["invoices"], "summary": "Write Off Invoice Endpoint", "description": "Write off a POSTED invoice's unpaid balance as a bad debt.\n\nReclaims GST on taxable lines (decreasing adjustment), settles the invoice\n(WRITTEN_OFF), and removes it from aged receivables. 409 if the invoice is\nalready written off / has nothing unpaid; 404 if not found; 422 otherwise.", "operationId": "write_off_invoice_endpoint_api_v1_invoices__invoice_id__write_off_post", "parameters": [{"name": "invoice_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Invoice Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"content": {"application/json": {"schema": {"anyOf": [{"$ref": "#/components/schemas/InvoiceWriteOffBody"}, {"type": "null"}], "title": "Body"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Write Off Invoice Endpoint Api V1 Invoices  Invoice Id  Write Off Post", "$ref": "#/components/schemas/InvoiceOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/invoices/{invoice_id}/record-recovery": {"post": {"tags": ["invoices"], "summary": "Record Recovery Endpoint", "description": "Record money received against a written-off debt as Other Income (no GST).\n\nPosts Dr <bank> / Cr 4-1290 Bad Debt Recovery. 409 if the invoice is not\nwritten off; 404 if invoice / bank account not found; 422 otherwise.", "operationId": "record_recovery_endpoint_api_v1_invoices__invoice_id__record_recovery_post", "parameters": [{"name": "invoice_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Invoice Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/InvoiceRecoveryBody"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Record Recovery Endpoint Api V1 Invoices  Invoice Id  Record Recovery Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/invoices/{invoice_id}/stripe-payment-link": {"post": {"tags": ["invoices"], "summary": "Create Stripe Payment Link", "description": "Return the invoice's stable \"Pay now\" link (b11).\n\nUsed to return a raw Stripe Checkout URL, which expires within a day and\ncharged the full line totals even on a part-paid invoice. Now it mints\n(once) the stable ``{public_base_url}/pay/{token}`` link: each click\nmakes a fresh Checkout session for whatever is still owing.", "operationId": "create_stripe_payment_link_api_v1_invoices__invoice_id__stripe_payment_link_post", "parameters": [{"name": "invoice_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Invoice Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/invoices/{invoice_id}/online-payment": {"get": {"tags": ["invoices"], "summary": "Get Invoice Online Payment", "description": "Online payment state for the invoice page (b11): is \"Pay now\" on,\nthe link if one exists, and card payments recorded from Stripe.", "operationId": "get_invoice_online_payment_api_v1_invoices__invoice_id__online_payment_get", "parameters": [{"name": "invoice_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Invoice Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/invoices/{invoice_id}/send-reminder": {"post": {"tags": ["invoices"], "summary": "Post Invoice Send Reminder", "description": "Email a payment reminder for this invoice now (b11, P1-7).\n\nOptional JSON body: ``{\"to\": \"a@b.com, c@d.com\", \"subject\": ..,\n\"body_html\": .., \"from_addr\": ..}`` \u2014 anything left out uses the\nstandard reminder wording, the contact's email and the company's\nsending address. Works even when the customer opted out of automatic\nreminders (opt-out covers the scheduled ones only).", "operationId": "post_invoice_send_reminder_api_v1_invoices__invoice_id__send_reminder_post", "parameters": [{"name": "invoice_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Invoice Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/invoices/{invoice_id}/render-context": {"get": {"tags": ["invoices"], "summary": "Get Invoice Render Context", "description": "Return the fact context the app render service needs to build the PDF.\n\nEngine = accountant (facts); app = bookkeeper (presentation). This is the\nexact ``_build_invoice_ctx`` dict \u2014 including the show_on_invoice bank\nresolution \u2014 that the /pdf route feeds to the render service, exposed so\nthe app can own rendering. ``kind`` is returned alongside ``ctx`` (the\n/pdf route injects it into ctx before rendering).", "operationId": "get_invoice_render_context_api_v1_invoices__invoice_id__render_context_get", "parameters": [{"name": "invoice_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Invoice Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/invoices/{invoice_id}/pdf": {"get": {"tags": ["invoices"], "summary": "Get Invoice Pdf", "description": "Render an invoice as PDF (Tax Invoice layout). Always regenerated; never stored.", "operationId": "get_invoice_pdf_api_v1_invoices__invoice_id__pdf_get", "parameters": [{"name": "invoice_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Invoice Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/invoices/{invoice_id}/einvoice.xml": {"get": {"tags": ["invoices"], "summary": "Get Invoice Einvoice Xml", "description": "Generate the EN 16931 / Peppol BIS Billing 3.0 UBL Invoice XML for a\nPOSTED, EUR-denominated invoice. Always regenerated; never stored.\n\nSeller identity: the generator resolves the seller's primary registry\nnumber (BT-30) from the company's business identifiers; this route takes\nthe seller country (BT-40) from ``Company.jurisdiction`` and resolves the\nseller VAT number (BT-31) from the company's ``<juris>_vat`` business\nidentifier (e.g. ``ee_vat``) \u2014 the same identifier registry the regcode\ncomes from. BT-31 is mandatory for a Standard-rated line under EN 16931\n(BR-S-02); if the company has not recorded a VAT identifier, the\ngenerator refuses (422) rather than emit a standard-rate e-invoice with\nno VAT id on it. The engine has no structured street-address column, so\nstreet/city/postal are omitted \u2014 EN 16931 permits a country-only address.\n\nErrors mirror the generator's own refusals rather than 500-ing:\n* invoice not found / RLS-invisible / foreign tenant \u2192 404\n* DRAFT, non-EUR, missing statutory identity (e.g. no resolvable seller\n  registrikood, seller VAT id, or buyer country) \u2192 422 with the\n  generator's message.", "operationId": "get_invoice_einvoice_xml_api_v1_invoices__invoice_id__einvoice_xml_get", "parameters": [{"name": "invoice_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Invoice Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/invoices/{invoice_id}/send-email": {"post": {"tags": ["invoices"], "summary": "Post Invoice Send Email", "description": "Render the invoice PDF and send (or block) via customer_email.\n\nRequest JSON:\n    {\n        \"from_addr\": \"billing@yourbiz.com.au\",\n        \"to\":   [\"customer@example.com\"],\n        \"cc\":   [],                              // optional\n        \"bcc\":  [],                              // optional\n        \"subject\": \"Tax Invoice 1234 from ...\",\n        \"body_html\": \"<p>Please find attached\u2026</p>\"\n    }\nResponse: { mode, log_id, message_id?, reason?, outbox_path? }", "operationId": "post_invoice_send_email_api_v1_invoices__invoice_id__send_email_post", "parameters": [{"name": "invoice_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Invoice Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/journal_templates": {"get": {"tags": ["journal_templates"], "summary": "List Journal Templates", "operationId": "list_journal_templates_api_v1_journal_templates_get", "parameters": [{"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 1000, "minimum": 1, "default": 200, "title": "Limit"}}, {"name": "offset", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 0, "default": 0, "title": "Offset"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/JournalTemplateListOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "post": {"tags": ["journal_templates"], "summary": "Create Journal Template", "operationId": "create_journal_template_api_v1_journal_templates_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/JournalTemplateCreate"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/JournalTemplateOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/journal_templates/{template_id}": {"get": {"tags": ["journal_templates"], "summary": "Get Journal Template", "operationId": "get_journal_template_api_v1_journal_templates__template_id__get", "parameters": [{"name": "template_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Template Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/JournalTemplateOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "patch": {"tags": ["journal_templates"], "summary": "Update Journal Template", "operationId": "update_journal_template_api_v1_journal_templates__template_id__patch", "parameters": [{"name": "template_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Template Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/JournalTemplateUpdate"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/JournalTemplateOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "delete": {"tags": ["journal_templates"], "summary": "Archive Journal Template", "operationId": "archive_journal_template_api_v1_journal_templates__template_id__delete", "parameters": [{"name": "template_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Template Id"}}, {"name": "hard", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Hard"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Admin", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Admin"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Archive Journal Template Api V1 Journal Templates  Template Id  Delete"}}}}, "204": {"description": "Archived"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/journal_templates/{template_id}/apply": {"post": {"tags": ["journal_templates"], "summary": "Apply Journal Template", "description": "Return a template's lines as suggested JE lines.\n\nThe caller uses the returned ``suggested_lines`` as the ``lines`` array\nwhen POSTing to ``/api/v1/journal_entries``.  No journal entry is created\nby this endpoint.", "operationId": "apply_journal_template_api_v1_journal_templates__template_id__apply_post", "parameters": [{"name": "template_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Template Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/JournalTemplateApplyOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/bills": {"get": {"tags": ["bills"], "summary": "List Bills", "description": "List bills.\n\nSearch with ``q`` (our number, the supplier's invoice number, supplier\nname, or an amount), narrow with ``amount_min``/``amount_max`` and\n``payment_status``, and sort on the server with ``sort`` = number,\nsupplier_reference, issue_date, due_date, contact, total, amount_due or\nstatus. ``format=csv`` downloads every matching row.", "operationId": "list_bills_api_v1_bills_get", "parameters": [{"name": "contact_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Contact Id"}}, {"name": "project_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Project Id"}}, {"name": "status", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Status"}}, {"name": "payment_status", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "unpaid | overdue | due_soon | open | part_paid | paid | draft | voided (server-side; amounts owed count applied credits)", "title": "Payment Status"}, "description": "unpaid | overdue | due_soon | open | part_paid | paid | draft | voided (server-side; amounts owed count applied credits)"}, {"name": "date_from", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Date From"}}, {"name": "date_to", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Date To"}}, {"name": "page", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 1, "default": 1, "title": "Page"}}, {"name": "page_size", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 500, "minimum": 1, "default": 50, "title": "Page Size"}}, {"name": "q", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "maxLength": 200}, {"type": "null"}], "description": "Free-text search: number, reference and contact name. Text that reads as an amount (e.g. 1513.59 or $1,513.59) also matches the document total.", "title": "Q"}, "description": "Free-text search: number, reference and contact name. Text that reads as an amount (e.g. 1513.59 or $1,513.59) also matches the document total."}, {"name": "amount_min", "in": "query", "required": false, "schema": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "description": "Smallest total to include (inclusive).", "title": "Amount Min"}, "description": "Smallest total to include (inclusive)."}, {"name": "amount_max", "in": "query", "required": false, "schema": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "description": "Largest total to include (inclusive).", "title": "Amount Max"}, "description": "Largest total to include (inclusive)."}, {"name": "sort", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Sort key; see the endpoint description.", "title": "Sort"}, "description": "Sort key; see the endpoint description."}, {"name": "direction", "in": "query", "required": false, "schema": {"enum": ["asc", "desc"], "type": "string", "description": "Sort order.", "default": "desc", "title": "Direction"}, "description": "Sort order."}, {"name": "format", "in": "query", "required": false, "schema": {"enum": ["json", "csv"], "type": "string", "description": "csv returns every matching row (no paging) as a spreadsheet download, in the same order.", "default": "json", "title": "Format"}, "description": "csv returns every matching row (no paging) as a spreadsheet download, in the same order."}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BillListOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "post": {"tags": ["bills"], "summary": "Create Bill", "operationId": "create_bill_api_v1_bills_post", "parameters": [{"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BillCreate"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BillOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/bills/{bill_id}": {"get": {"tags": ["bills"], "summary": "Get Bill", "operationId": "get_bill_api_v1_bills__bill_id__get", "parameters": [{"name": "bill_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Bill Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BillOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "patch": {"tags": ["bills"], "summary": "Update Bill", "operationId": "update_bill_api_v1_bills__bill_id__patch", "parameters": [{"name": "bill_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Bill Id"}}, {"name": "force", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Force"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BillUpdate"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Update Bill Api V1 Bills  Bill Id  Patch", "$ref": "#/components/schemas/BillOut"}}}}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BillConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "delete": {"tags": ["bills"], "summary": "Void Bill", "operationId": "void_bill_api_v1_bills__bill_id__delete", "parameters": [{"name": "bill_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Bill Id"}}, {"name": "hard", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Hard"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Admin", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Admin"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Void Bill Api V1 Bills  Bill Id  Delete"}}}}, "204": {"description": "Voided"}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BillConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/bills/{bill_id}/post": {"post": {"tags": ["bills"], "summary": "Post Bill", "description": "Transition bill DRAFT \u2192 POSTED, generating journal entry lines.", "operationId": "post_bill_api_v1_bills__bill_id__post_post", "parameters": [{"name": "bill_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Bill Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Post Bill Api V1 Bills  Bill Id  Post Post", "$ref": "#/components/schemas/BillOut"}}}}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BillConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/bills/{bill_id}/void": {"post": {"tags": ["bills"], "summary": "Void Bill Transition", "description": "Transition any non-VOIDED bill \u2192 VOIDED, reversing JE if POSTED.", "operationId": "void_bill_transition_api_v1_bills__bill_id__void_post", "parameters": [{"name": "bill_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Bill Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Void Bill Transition Api V1 Bills  Bill Id  Void Post", "$ref": "#/components/schemas/BillOut"}}}}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BillConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/bills/{bill_id}/render-context": {"get": {"tags": ["bills"], "summary": "Get Bill Render Context", "description": "Return the fact context the app render service needs to build the bill PDF.\n\nExact ``_build_bill_ctx`` dict fed to the render service by the /pdf route.\nBills carry NO bank_details (a bill is money the company owes). ``kind`` is\nreturned alongside ``ctx``.", "operationId": "get_bill_render_context_api_v1_bills__bill_id__render_context_get", "parameters": [{"name": "bill_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Bill Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/bills/{bill_id}/pdf": {"get": {"tags": ["bills"], "summary": "Get Bill Pdf", "description": "Render a bill as PDF (Bill layout). Always regenerated; never stored.", "operationId": "get_bill_pdf_api_v1_bills__bill_id__pdf_get", "parameters": [{"name": "bill_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Bill Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/bills/{bill_id}/send-email": {"post": {"tags": ["bills"], "summary": "Post Bill Send Email", "description": "Render the bill PDF and send via customer_email (kill-switch gated).", "operationId": "post_bill_send_email_api_v1_bills__bill_id__send_email_post", "parameters": [{"name": "bill_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Bill Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/branches": {"get": {"tags": ["branches"], "summary": "List Branches", "operationId": "list_branches_api_v1_branches_get", "parameters": [{"name": "include_archived", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Include Archived"}}, {"name": "page", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 1, "default": 1, "title": "Page"}}, {"name": "page_size", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 500, "minimum": 1, "default": 50, "title": "Page Size"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BranchListOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "post": {"tags": ["branches"], "summary": "Create Branch", "operationId": "create_branch_api_v1_branches_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BranchCreate"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/branches/{branch_id}": {"get": {"tags": ["branches"], "summary": "Get Branch", "operationId": "get_branch_api_v1_branches__branch_id__get", "parameters": [{"name": "branch_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Branch Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BranchOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "patch": {"tags": ["branches"], "summary": "Update Branch", "operationId": "update_branch_api_v1_branches__branch_id__patch", "parameters": [{"name": "branch_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Branch Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BranchUpdate"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BranchOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "delete": {"tags": ["branches"], "summary": "Archive Branch", "operationId": "archive_branch_api_v1_branches__branch_id__delete", "parameters": [{"name": "branch_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Branch Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"204": {"description": "Successful Response"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/expenses": {"get": {"tags": ["expenses"], "summary": "List Expenses", "description": "List expenses. ``q`` searches number, reference, supplier name or an\namount; ``sort`` = number, expense_date, contact, reference, total or\nstatus; ``format=csv`` downloads every matching row.", "operationId": "list_expenses_api_v1_expenses_get", "parameters": [{"name": "contact_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Contact Id"}}, {"name": "project_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Project Id"}}, {"name": "payment_account_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Payment Account Id"}}, {"name": "status", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Status"}}, {"name": "flagged", "in": "query", "required": false, "schema": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "description": "Filter by flagged_for_review", "title": "Flagged"}, "description": "Filter by flagged_for_review"}, {"name": "date_from", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Date From"}}, {"name": "date_to", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Date To"}}, {"name": "page", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 1, "default": 1, "title": "Page"}}, {"name": "page_size", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 500, "minimum": 1, "default": 50, "title": "Page Size"}}, {"name": "q", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "maxLength": 200}, {"type": "null"}], "description": "Free-text search: number, reference and contact name. Text that reads as an amount (e.g. 1513.59 or $1,513.59) also matches the document total.", "title": "Q"}, "description": "Free-text search: number, reference and contact name. Text that reads as an amount (e.g. 1513.59 or $1,513.59) also matches the document total."}, {"name": "amount_min", "in": "query", "required": false, "schema": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "description": "Smallest total to include (inclusive).", "title": "Amount Min"}, "description": "Smallest total to include (inclusive)."}, {"name": "amount_max", "in": "query", "required": false, "schema": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "description": "Largest total to include (inclusive).", "title": "Amount Max"}, "description": "Largest total to include (inclusive)."}, {"name": "sort", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Sort key; see the endpoint description.", "title": "Sort"}, "description": "Sort key; see the endpoint description."}, {"name": "direction", "in": "query", "required": false, "schema": {"enum": ["asc", "desc"], "type": "string", "description": "Sort order.", "default": "desc", "title": "Direction"}, "description": "Sort order."}, {"name": "format", "in": "query", "required": false, "schema": {"enum": ["json", "csv"], "type": "string", "description": "csv returns every matching row (no paging) as a spreadsheet download, in the same order.", "default": "json", "title": "Format"}, "description": "csv returns every matching row (no paging) as a spreadsheet download, in the same order."}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ExpenseListOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "post": {"tags": ["expenses"], "summary": "Create Expense", "operationId": "create_expense_api_v1_expenses_post", "parameters": [{"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ExpenseCreate"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ExpenseOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/expenses/{expense_id}": {"get": {"tags": ["expenses"], "summary": "Get Expense", "operationId": "get_expense_api_v1_expenses__expense_id__get", "parameters": [{"name": "expense_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Expense Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ExpenseOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "patch": {"tags": ["expenses"], "summary": "Update Expense", "operationId": "update_expense_api_v1_expenses__expense_id__patch", "parameters": [{"name": "expense_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Expense Id"}}, {"name": "force", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Force"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ExpenseUpdate"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Update Expense Api V1 Expenses  Expense Id  Patch", "$ref": "#/components/schemas/ExpenseOut"}}}}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ExpenseConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "delete": {"tags": ["expenses"], "summary": "Archive Expense", "operationId": "archive_expense_api_v1_expenses__expense_id__delete", "parameters": [{"name": "expense_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Expense Id"}}, {"name": "hard", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Hard"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Admin", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Admin"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Archive Expense Api V1 Expenses  Expense Id  Delete"}}}}, "204": {"description": "Archived"}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ExpenseConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/expenses/{expense_id}/review-flag": {"post": {"tags": ["expenses"], "summary": "Set Expense Review Flag", "operationId": "set_expense_review_flag_api_v1_expenses__expense_id__review_flag_post", "parameters": [{"name": "expense_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Expense Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ReviewFlagBody"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ExpenseOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/expenses/{expense_id}/post": {"post": {"tags": ["expenses"], "summary": "Post Expense", "operationId": "post_expense_api_v1_expenses__expense_id__post_post", "parameters": [{"name": "expense_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Expense Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Post Expense Api V1 Expenses  Expense Id  Post Post", "$ref": "#/components/schemas/ExpenseOut"}}}}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ExpenseConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/expenses/{expense_id}/void": {"post": {"tags": ["expenses"], "summary": "Void Expense Transition", "operationId": "void_expense_transition_api_v1_expenses__expense_id__void_post", "parameters": [{"name": "expense_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Expense Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Void Expense Transition Api V1 Expenses  Expense Id  Void Post", "$ref": "#/components/schemas/ExpenseOut"}}}}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ExpenseConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/time-entries": {"get": {"tags": ["time-entries"], "summary": "List Time Entries", "operationId": "list_time_entries_api_v1_time_entries_get", "parameters": [{"name": "user_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "User Id"}}, {"name": "contact_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Contact Id"}}, {"name": "project_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Project Id"}}, {"name": "approval_status", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Approval Status"}}, {"name": "billable_only", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Billable Only"}}, {"name": "uninvoiced_only", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Uninvoiced Only"}}, {"name": "date_from", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Date From"}}, {"name": "date_to", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Date To"}}, {"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 500, "minimum": 1, "default": 100, "title": "Limit"}}, {"name": "offset", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 0, "default": 0, "title": "Offset"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TimeEntryListOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "post": {"tags": ["time-entries"], "summary": "Create Time Entry", "operationId": "create_time_entry_api_v1_time_entries_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TimeEntryCreate"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TimeEntryOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/time-entries/week": {"get": {"tags": ["time-entries"], "summary": "List Week", "description": "Return one week of entries for the weekly-grid view.\n\nDefaults to the authenticated user; admins can pass ``user_id``\nto view someone else's week.", "operationId": "list_week_api_v1_time_entries_week_get", "parameters": [{"name": "week_start", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "Week Start"}}, {"name": "user_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "User Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "array", "items": {"$ref": "#/components/schemas/TimeEntryOut"}, "title": "Response List Week Api V1 Time Entries Week Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/time-entries/{entry_id}": {"get": {"tags": ["time-entries"], "summary": "Get Time Entry", "operationId": "get_time_entry_api_v1_time_entries__entry_id__get", "parameters": [{"name": "entry_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Entry Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TimeEntryOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "patch": {"tags": ["time-entries"], "summary": "Update Time Entry", "operationId": "update_time_entry_api_v1_time_entries__entry_id__patch", "parameters": [{"name": "entry_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Entry Id"}}, {"name": "force", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Force"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TimeEntryUpdate"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TimeEntryOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "delete": {"tags": ["time-entries"], "summary": "Archive Time Entry", "operationId": "archive_time_entry_api_v1_time_entries__entry_id__delete", "parameters": [{"name": "entry_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Entry Id"}}, {"name": "hard", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Hard"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}, {"name": "X-Admin", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Admin"}}], "responses": {"204": {"description": "Successful Response"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/time-entries/{entry_id}/submit": {"post": {"tags": ["time-entries"], "summary": "Submit Time Entry", "operationId": "submit_time_entry_api_v1_time_entries__entry_id__submit_post", "parameters": [{"name": "entry_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Entry Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TimeEntryOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/time-entries/{entry_id}/approve": {"post": {"tags": ["time-entries"], "summary": "Approve Time Entry", "operationId": "approve_time_entry_api_v1_time_entries__entry_id__approve_post", "parameters": [{"name": "entry_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Entry Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TimeEntryOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/time-entries/{entry_id}/reject": {"post": {"tags": ["time-entries"], "summary": "Reject Time Entry", "operationId": "reject_time_entry_api_v1_time_entries__entry_id__reject_post", "parameters": [{"name": "entry_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Entry Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Body_reject_time_entry_api_v1_time_entries__entry_id__reject_post"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TimeEntryOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/time-entries/{entry_id}/revert": {"post": {"tags": ["time-entries"], "summary": "Revert Time Entry", "description": "Revert APPROVED -> DRAFT so the entry can be edited or archived.", "operationId": "revert_time_entry_api_v1_time_entries__entry_id__revert_post", "parameters": [{"name": "entry_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Entry Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TimeEntryOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/time-entries/convert-to-invoice": {"post": {"tags": ["time-entries"], "summary": "Convert To Invoice", "operationId": "convert_to_invoice_api_v1_time_entries_convert_to_invoice_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TimeEntryConvertToInvoiceLineRequest"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TimeEntryConvertToInvoiceLineResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/super-funds": {"get": {"tags": ["super-funds"], "summary": "List Super Funds", "operationId": "list_super_funds_api_v1_super_funds_get", "parameters": [{"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 500, "minimum": 1, "default": 100, "title": "Limit"}}, {"name": "offset", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 0, "default": 0, "title": "Offset"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SuperFundListOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "post": {"tags": ["super-funds"], "summary": "Create Super Fund", "operationId": "create_super_fund_api_v1_super_funds_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SuperFundCreate"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SuperFundOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/super-funds/{fund_id}": {"get": {"tags": ["super-funds"], "summary": "Get Super Fund", "operationId": "get_super_fund_api_v1_super_funds__fund_id__get", "parameters": [{"name": "fund_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Fund Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SuperFundOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "patch": {"tags": ["super-funds"], "summary": "Update Super Fund", "operationId": "update_super_fund_api_v1_super_funds__fund_id__patch", "parameters": [{"name": "fund_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Fund Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SuperFundUpdate"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SuperFundOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "delete": {"tags": ["super-funds"], "summary": "Archive Super Fund", "operationId": "archive_super_fund_api_v1_super_funds__fund_id__delete", "parameters": [{"name": "fund_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Fund Id"}}, {"name": "hard", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Hard"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}, {"name": "X-Admin", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Admin"}}], "responses": {"204": {"description": "Successful Response"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/super-funds/{fund_id}/set-default": {"post": {"tags": ["super-funds"], "summary": "Set Default Super Fund", "operationId": "set_default_super_fund_api_v1_super_funds__fund_id__set_default_post", "parameters": [{"name": "fund_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Fund Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SuperFundOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/employees": {"get": {"tags": ["employees"], "summary": "List Employees", "operationId": "list_employees_api_v1_employees_get", "parameters": [{"name": "employment_basis", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Employment Basis"}}, {"name": "super_fund_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Super Fund Id"}}, {"name": "only_active", "in": "query", "required": false, "schema": {"type": "boolean", "default": true, "title": "Only Active"}}, {"name": "search", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Search"}}, {"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 500, "minimum": 1, "default": 100, "title": "Limit"}}, {"name": "offset", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 0, "default": 0, "title": "Offset"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/EmployeeListOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "post": {"tags": ["employees"], "summary": "Create Employee", "operationId": "create_employee_api_v1_employees_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/EmployeeCreate"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/EmployeeOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/employees/{employee_id}": {"get": {"tags": ["employees"], "summary": "Get Employee", "operationId": "get_employee_api_v1_employees__employee_id__get", "parameters": [{"name": "employee_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Employee Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/EmployeeOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "patch": {"tags": ["employees"], "summary": "Update Employee", "operationId": "update_employee_api_v1_employees__employee_id__patch", "parameters": [{"name": "employee_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Employee Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/EmployeeUpdate"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/EmployeeOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "delete": {"tags": ["employees"], "summary": "Archive Employee", "operationId": "archive_employee_api_v1_employees__employee_id__delete", "parameters": [{"name": "employee_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Employee Id"}}, {"name": "hard", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Hard"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}, {"name": "X-Admin", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Admin"}}], "responses": {"204": {"description": "Successful Response"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/employees/{employee_id}/terminate": {"post": {"tags": ["employees"], "summary": "Terminate Employee", "operationId": "terminate_employee_api_v1_employees__employee_id__terminate_post", "parameters": [{"name": "employee_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Employee Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/EmployeeTerminateRequest"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/EmployeeOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/employees/{employee_id}/tfn": {"get": {"tags": ["employees"], "summary": "Reveal Tfn", "description": "Return the plaintext TFN, and audit-log the read (who, when, which\nemployee -- never the value). Not cached.", "operationId": "reveal_tfn_api_v1_employees__employee_id__tfn_get", "parameters": [{"name": "employee_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Employee Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/EmployeeTfnRevealOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/stp-submissions": {"get": {"tags": ["stp-submissions"], "summary": "List Submissions", "operationId": "list_submissions_api_v1_stp_submissions_get", "parameters": [{"name": "pay_run_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Pay Run Id"}}, {"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 200, "minimum": 1, "default": 50, "title": "Limit"}}, {"name": "offset", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 0, "default": 0, "title": "Offset"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response List Submissions Api V1 Stp Submissions Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/stp-submissions/{submission_id}": {"get": {"tags": ["stp-submissions"], "summary": "Get Submission", "operationId": "get_submission_api_v1_stp_submissions__submission_id__get", "parameters": [{"name": "submission_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Submission Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response Get Submission Api V1 Stp Submissions  Submission Id  Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/leave/balances/{employee_id}": {"get": {"tags": ["leave"], "summary": "Get Balances", "operationId": "get_balances_api_v1_leave_balances__employee_id__get", "parameters": [{"name": "employee_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Employee Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "array", "items": {"$ref": "#/components/schemas/LeaveBalanceOut"}, "title": "Response Get Balances Api V1 Leave Balances  Employee Id  Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/leave/balances/{employee_id}/adjust": {"post": {"tags": ["leave"], "summary": "Adjust Balance", "operationId": "adjust_balance_api_v1_leave_balances__employee_id__adjust_post", "parameters": [{"name": "employee_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Employee Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/LeaveAdjustIn"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/LeaveBalanceOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/leave/balances/{employee_id}/opening": {"post": {"tags": ["leave"], "summary": "Set Opening Balance", "operationId": "set_opening_balance_api_v1_leave_balances__employee_id__opening_post", "parameters": [{"name": "employee_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Employee Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/LeaveOpeningBalanceIn"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/LeaveBalanceOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/leave/history/{employee_id}": {"get": {"tags": ["leave"], "summary": "Get History", "description": "Every accrual, leave taken and adjustment for one employee, newest\nfirst (the leave tab on the employee screen).", "operationId": "get_history_api_v1_leave_history__employee_id__get", "parameters": [{"name": "employee_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Employee Id"}}, {"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "default": 100, "title": "Limit"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response Get History Api V1 Leave History  Employee Id  Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/payroll/stp": {"get": {"tags": ["payroll"], "summary": "List Stp", "operationId": "list_stp_api_v1_payroll_stp_get", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response List Stp Api V1 Payroll Stp Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/payroll/stp/{submission_id}/check": {"post": {"tags": ["payroll"], "summary": "Check Stp", "operationId": "check_stp_api_v1_payroll_stp__submission_id__check_post", "parameters": [{"name": "submission_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Submission Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response Check Stp Api V1 Payroll Stp  Submission Id  Check Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/payroll/stp/{submission_id}/lodge": {"post": {"tags": ["payroll"], "summary": "Lodge Stp", "operationId": "lodge_stp_api_v1_payroll_stp__submission_id__lodge_post", "parameters": [{"name": "submission_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Submission Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/StpLodgeIn"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response Lodge Stp Api V1 Payroll Stp  Submission Id  Lodge Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/payroll/stp/{submission_id}/refresh": {"post": {"tags": ["payroll"], "summary": "Refresh Stp", "operationId": "refresh_stp_api_v1_payroll_stp__submission_id__refresh_post", "parameters": [{"name": "submission_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Submission Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response Refresh Stp Api V1 Payroll Stp  Submission Id  Refresh Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/payroll/stp/{submission_id}/lodged-elsewhere": {"post": {"tags": ["payroll"], "summary": "Stp Lodged Elsewhere", "operationId": "stp_lodged_elsewhere_api_v1_payroll_stp__submission_id__lodged_elsewhere_post", "parameters": [{"name": "submission_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Submission Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/LodgedElsewhereIn"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response Stp Lodged Elsewhere Api V1 Payroll Stp  Submission Id  Lodged Elsewhere Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/payroll/pay-runs/{pay_run_id}/stp-event": {"post": {"tags": ["payroll"], "summary": "Rebuild Stp Event", "operationId": "rebuild_stp_event_api_v1_payroll_pay_runs__pay_run_id__stp_event_post", "parameters": [{"name": "pay_run_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Pay Run Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/payroll/year-end/{year}": {"get": {"tags": ["payroll"], "summary": "Year End", "operationId": "year_end_api_v1_payroll_year_end__year__get", "parameters": [{"name": "year", "in": "path", "required": true, "schema": {"type": "integer", "title": "Year"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response Year End Api V1 Payroll Year End  Year  Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/payroll/year-end/{year}/finalise": {"post": {"tags": ["payroll"], "summary": "Finalise Year", "operationId": "finalise_year_api_v1_payroll_year_end__year__finalise_post", "parameters": [{"name": "year", "in": "path", "required": true, "schema": {"type": "integer", "title": "Year"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/FinaliseYearIn"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/payroll/year-end/{year}/income-statements/{employee_id}": {"get": {"tags": ["payroll"], "summary": "Get Income Statement", "operationId": "get_income_statement_api_v1_payroll_year_end__year__income_statements__employee_id__get", "parameters": [{"name": "year", "in": "path", "required": true, "schema": {"type": "integer", "title": "Year"}}, {"name": "employee_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Employee Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response Get Income Statement Api V1 Payroll Year End  Year  Income Statements  Employee Id  Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/payroll/super": {"get": {"tags": ["payroll"], "summary": "Super Due", "operationId": "super_due_api_v1_payroll_super_get", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response Super Due Api V1 Payroll Super Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/payroll/pay-runs/{pay_run_id}/super": {"post": {"tags": ["payroll"], "summary": "Build Super", "operationId": "build_super_api_v1_payroll_pay_runs__pay_run_id__super_post", "parameters": [{"name": "pay_run_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Pay Run Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response Build Super Api V1 Payroll Pay Runs  Pay Run Id  Super Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/payroll/super/{run_id}/mark-paid": {"post": {"tags": ["payroll"], "summary": "Mark Super Paid", "operationId": "mark_super_paid_api_v1_payroll_super__run_id__mark_paid_post", "parameters": [{"name": "run_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Run Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/MarkSuperPaidIn"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response Mark Super Paid Api V1 Payroll Super  Run Id  Mark Paid Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/payroll/pay-runs/{pay_run_id}/bank-file": {"get": {"tags": ["payroll"], "summary": "Wages Bank File", "operationId": "wages_bank_file_api_v1_payroll_pay_runs__pay_run_id__bank_file_get", "parameters": [{"name": "pay_run_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Pay Run Id"}}, {"name": "bank_account_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Bank Account Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/payroll/pay-runs/{pay_run_id}/payslips/email": {"post": {"tags": ["payroll"], "summary": "Email Payslips", "operationId": "email_payslips_api_v1_payroll_pay_runs__pay_run_id__payslips_email_post", "parameters": [{"name": "pay_run_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Pay Run Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/EmailPayslipsIn"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response Email Payslips Api V1 Payroll Pay Runs  Pay Run Id  Payslips Email Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/payroll/settings": {"get": {"tags": ["payroll"], "summary": "Get Settings", "operationId": "get_settings_api_v1_payroll_settings_get", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response Get Settings Api V1 Payroll Settings Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "put": {"tags": ["payroll"], "summary": "Put Settings", "operationId": "put_settings_api_v1_payroll_settings_put", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PayrollSettingsIn"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response Put Settings Api V1 Payroll Settings Put"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/purchase_orders": {"get": {"tags": ["purchase_orders"], "summary": "List Purchase Orders", "description": "List purchase orders. ``q`` searches number, supplier name or an\namount; ``sort`` = number, issue_date, expected_date, contact, total or\nstatus; ``format=csv`` downloads every matching row.", "operationId": "list_purchase_orders_api_v1_purchase_orders_get", "parameters": [{"name": "contact_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Contact Id"}}, {"name": "status", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Status"}}, {"name": "date_from", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Date From"}}, {"name": "date_to", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Date To"}}, {"name": "page", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 1, "default": 1, "title": "Page"}}, {"name": "page_size", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 500, "minimum": 1, "default": 50, "title": "Page Size"}}, {"name": "q", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "maxLength": 200}, {"type": "null"}], "description": "Free-text search: number, reference and contact name. Text that reads as an amount (e.g. 1513.59 or $1,513.59) also matches the document total.", "title": "Q"}, "description": "Free-text search: number, reference and contact name. Text that reads as an amount (e.g. 1513.59 or $1,513.59) also matches the document total."}, {"name": "amount_min", "in": "query", "required": false, "schema": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "description": "Smallest total to include (inclusive).", "title": "Amount Min"}, "description": "Smallest total to include (inclusive)."}, {"name": "amount_max", "in": "query", "required": false, "schema": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "description": "Largest total to include (inclusive).", "title": "Amount Max"}, "description": "Largest total to include (inclusive)."}, {"name": "sort", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Sort key; see the endpoint description.", "title": "Sort"}, "description": "Sort key; see the endpoint description."}, {"name": "direction", "in": "query", "required": false, "schema": {"enum": ["asc", "desc"], "type": "string", "description": "Sort order.", "default": "desc", "title": "Direction"}, "description": "Sort order."}, {"name": "format", "in": "query", "required": false, "schema": {"enum": ["json", "csv"], "type": "string", "description": "csv returns every matching row (no paging) as a spreadsheet download, in the same order.", "default": "json", "title": "Format"}, "description": "csv returns every matching row (no paging) as a spreadsheet download, in the same order."}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PurchaseOrderListOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "post": {"tags": ["purchase_orders"], "summary": "Create Purchase Order", "operationId": "create_purchase_order_api_v1_purchase_orders_post", "parameters": [{"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PurchaseOrderCreate"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PurchaseOrderOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/purchase_orders/{po_id}": {"get": {"tags": ["purchase_orders"], "summary": "Get Purchase Order", "operationId": "get_purchase_order_api_v1_purchase_orders__po_id__get", "parameters": [{"name": "po_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Po Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PurchaseOrderOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "patch": {"tags": ["purchase_orders"], "summary": "Update Purchase Order", "operationId": "update_purchase_order_api_v1_purchase_orders__po_id__patch", "parameters": [{"name": "po_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Po Id"}}, {"name": "force", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Force"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PurchaseOrderUpdate"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Update Purchase Order Api V1 Purchase Orders  Po Id  Patch", "$ref": "#/components/schemas/PurchaseOrderOut"}}}}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PurchaseOrderConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "delete": {"tags": ["purchase_orders"], "summary": "Archive Purchase Order", "operationId": "archive_purchase_order_api_v1_purchase_orders__po_id__delete", "parameters": [{"name": "po_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Po Id"}}, {"name": "hard", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Hard"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Admin", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Admin"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Archive Purchase Order Api V1 Purchase Orders  Po Id  Delete"}}}}, "204": {"description": "Archived"}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PurchaseOrderConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/purchase_orders/{po_id}/send": {"post": {"tags": ["purchase_orders"], "summary": "Handler", "operationId": "handler_api_v1_purchase_orders__po_id__send_post", "parameters": [{"name": "po_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Po Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Handler Api V1 Purchase Orders  Po Id  Send Post", "$ref": "#/components/schemas/PurchaseOrderOut"}}}}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PurchaseOrderConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/purchase_orders/{po_id}/cancel": {"post": {"tags": ["purchase_orders"], "summary": "Handler", "operationId": "handler_api_v1_purchase_orders__po_id__cancel_post", "parameters": [{"name": "po_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Po Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Handler Api V1 Purchase Orders  Po Id  Cancel Post", "$ref": "#/components/schemas/PurchaseOrderOut"}}}}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PurchaseOrderConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/purchase_orders/{po_id}/close": {"post": {"tags": ["purchase_orders"], "summary": "Handler", "operationId": "handler_api_v1_purchase_orders__po_id__close_post", "parameters": [{"name": "po_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Po Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Handler Api V1 Purchase Orders  Po Id  Close Post", "$ref": "#/components/schemas/PurchaseOrderOut"}}}}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PurchaseOrderConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/purchase_orders/{po_id}/convert-to-bill": {"post": {"tags": ["purchase_orders"], "summary": "Convert To Bill", "operationId": "convert_to_bill_api_v1_purchase_orders__po_id__convert_to_bill_post", "parameters": [{"name": "po_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Po Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PurchaseOrderConvertBody"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Convert To Bill Api V1 Purchase Orders  Po Id  Convert To Bill Post", "$ref": "#/components/schemas/PurchaseOrderConvertOut"}}}}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PurchaseOrderConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/purchase_orders/{po_id}/render-context": {"get": {"tags": ["purchase_orders"], "summary": "Get Purchase Order Render Context", "description": "Return the fact context the app render service needs to build the PO PDF.\n\nExact ``_build_po_pdf_ctx`` dict fed to the render service by the /pdf route.", "operationId": "get_purchase_order_render_context_api_v1_purchase_orders__po_id__render_context_get", "parameters": [{"name": "po_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Po Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/purchase_orders/{po_id}/pdf": {"get": {"tags": ["purchase_orders"], "summary": "Get Purchase Order Pdf", "description": "Render a purchase order as PDF (branded letterhead layout).", "operationId": "get_purchase_order_pdf_api_v1_purchase_orders__po_id__pdf_get", "parameters": [{"name": "po_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Po Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/purchase_orders/{po_id}/bills": {"get": {"tags": ["purchase_orders"], "summary": "Get Purchase Order Bills", "description": "Bills made from this order, billed to date per line, and price\ndifferences between the order and the supplier's bills.", "operationId": "get_purchase_order_bills_api_v1_purchase_orders__po_id__bills_get", "parameters": [{"name": "po_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Po Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/purchase_orders/{po_id}/send-email": {"post": {"tags": ["purchase_orders"], "summary": "Post Purchase Order Send Email", "description": "Email the purchase order PDF to the supplier.\n\nA DRAFT order is sent first (number minted, status OPEN) so the PDF\ncarries its number. Same delivery pipeline and kill switch as bills\nand invoices (``customer_email``).", "operationId": "post_purchase_order_send_email_api_v1_purchase_orders__po_id__send_email_post", "parameters": [{"name": "po_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Po Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/quotes": {"get": {"tags": ["quotes"], "summary": "List Quotes", "description": "List quotes. ``q`` searches number, title, customer name or an amount;\n``sort`` = number, issue_date, expiry_date, contact, total or status;\n``format=csv`` downloads every matching row.", "operationId": "list_quotes_api_v1_quotes_get", "parameters": [{"name": "customer_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Customer Id"}}, {"name": "status", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Status"}}, {"name": "since", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Since"}}, {"name": "expiry_before", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Expiry Before"}}, {"name": "page", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 1, "default": 1, "title": "Page"}}, {"name": "page_size", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 500, "minimum": 1, "default": 50, "title": "Page Size"}}, {"name": "q", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "maxLength": 200}, {"type": "null"}], "description": "Free-text search: number, reference and contact name. Text that reads as an amount (e.g. 1513.59 or $1,513.59) also matches the document total.", "title": "Q"}, "description": "Free-text search: number, reference and contact name. Text that reads as an amount (e.g. 1513.59 or $1,513.59) also matches the document total."}, {"name": "amount_min", "in": "query", "required": false, "schema": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "description": "Smallest total to include (inclusive).", "title": "Amount Min"}, "description": "Smallest total to include (inclusive)."}, {"name": "amount_max", "in": "query", "required": false, "schema": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "description": "Largest total to include (inclusive).", "title": "Amount Max"}, "description": "Largest total to include (inclusive)."}, {"name": "sort", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Sort key; see the endpoint description.", "title": "Sort"}, "description": "Sort key; see the endpoint description."}, {"name": "direction", "in": "query", "required": false, "schema": {"enum": ["asc", "desc"], "type": "string", "description": "Sort order.", "default": "desc", "title": "Direction"}, "description": "Sort order."}, {"name": "format", "in": "query", "required": false, "schema": {"enum": ["json", "csv"], "type": "string", "description": "csv returns every matching row (no paging) as a spreadsheet download, in the same order.", "default": "json", "title": "Format"}, "description": "csv returns every matching row (no paging) as a spreadsheet download, in the same order."}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/QuoteListOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "post": {"tags": ["quotes"], "summary": "Create Quote", "operationId": "create_quote_api_v1_quotes_post", "parameters": [{"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/QuoteCreate"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/QuoteOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/quotes/{quote_id}": {"get": {"tags": ["quotes"], "summary": "Get Quote", "operationId": "get_quote_api_v1_quotes__quote_id__get", "parameters": [{"name": "quote_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Quote Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/QuoteOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "patch": {"tags": ["quotes"], "summary": "Update Quote", "operationId": "update_quote_api_v1_quotes__quote_id__patch", "parameters": [{"name": "quote_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Quote Id"}}, {"name": "force", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Force"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/QuoteUpdate"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Update Quote Api V1 Quotes  Quote Id  Patch", "$ref": "#/components/schemas/QuoteOut"}}}}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/QuoteConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "delete": {"tags": ["quotes"], "summary": "Delete Quote", "operationId": "delete_quote_api_v1_quotes__quote_id__delete", "parameters": [{"name": "quote_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Quote Id"}}, {"name": "hard", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Hard"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Admin", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Admin"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Delete Quote Api V1 Quotes  Quote Id  Delete"}}}}, "204": {"description": "Deleted"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/quotes/{quote_id}/pdf": {"get": {"tags": ["quotes"], "summary": "Get Quote Pdf", "description": "Render a quote as PDF \u2014 engineering-style ESTIMATE matching the Overleaf template.\n\nAlways regenerated from current quote state; never stored. The \"send\" flow\n(Phase 1) will snapshot bytes from this same renderer into saebooks-vault.", "operationId": "get_quote_pdf_api_v1_quotes__quote_id__pdf_get", "parameters": [{"name": "quote_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Quote Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/quotes/{quote_id}/send-email": {"post": {"tags": ["quotes"], "summary": "Post Quote Send Email", "description": "Render the quote PDF + send (or block) via customer_email.\n\nRequest JSON body:\n    {\n        \"from_addr\": \"quotes@yourbiz.com.au\",\n        \"to\":   [\"customer@example.com\"],\n        \"cc\":   [\"other@example.com\"],          // optional\n        \"bcc\":  [\"accounts@yourbiz.com.au\"],    // optional\n        \"subject\": \"Quote Q-001019 from Your Business\",\n        \"body_html\": \"<p>Please find attached\u2026</p>\",\n        \"reply_to\": \"office@yourbiz.com.au\",    // optional (b06) \u2014 default from email settings\n        \"from_name\": \"Your Business\"            // optional (b06) \u2014 default from email settings\n    }\n\nResponse: { mode, log_id, message_id?, reason?, outbox_path? }", "operationId": "post_quote_send_email_api_v1_quotes__quote_id__send_email_post", "parameters": [{"name": "quote_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Quote Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/quotes/{quote_id}/send": {"post": {"tags": ["quotes"], "summary": "Handler", "operationId": "handler_api_v1_quotes__quote_id__send_post", "parameters": [{"name": "quote_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Quote Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Handler Api V1 Quotes  Quote Id  Send Post", "$ref": "#/components/schemas/QuoteOut"}}}}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/QuoteConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/quotes/{quote_id}/accept": {"post": {"tags": ["quotes"], "summary": "Handler", "operationId": "handler_api_v1_quotes__quote_id__accept_post", "parameters": [{"name": "quote_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Quote Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Handler Api V1 Quotes  Quote Id  Accept Post", "$ref": "#/components/schemas/QuoteOut"}}}}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/QuoteConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/quotes/{quote_id}/decline": {"post": {"tags": ["quotes"], "summary": "Handler", "operationId": "handler_api_v1_quotes__quote_id__decline_post", "parameters": [{"name": "quote_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Quote Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Handler Api V1 Quotes  Quote Id  Decline Post", "$ref": "#/components/schemas/QuoteOut"}}}}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/QuoteConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/quotes/{quote_id}/archive": {"post": {"tags": ["quotes"], "summary": "Handler", "operationId": "handler_api_v1_quotes__quote_id__archive_post", "parameters": [{"name": "quote_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Quote Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Handler Api V1 Quotes  Quote Id  Archive Post", "$ref": "#/components/schemas/QuoteOut"}}}}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/QuoteConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/quotes/{quote_id}/convert-to-invoice": {"post": {"tags": ["quotes"], "summary": "Convert To Invoice", "operationId": "convert_to_invoice_api_v1_quotes__quote_id__convert_to_invoice_post", "parameters": [{"name": "quote_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Quote Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"content": {"application/json": {"schema": {"anyOf": [{"$ref": "#/components/schemas/QuoteInvoiceRequest"}, {"type": "null"}], "title": "Payload"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Convert To Invoice Api V1 Quotes  Quote Id  Convert To Invoice Post", "$ref": "#/components/schemas/QuoteConvertOut"}}}}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/QuoteConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/quotes/{quote_id}/billing": {"get": {"tags": ["quotes"], "summary": "Quote Billing", "description": "Invoiced so far, left to invoice, and each claim (ex GST).", "operationId": "quote_billing_api_v1_quotes__quote_id__billing_get", "parameters": [{"name": "quote_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Quote Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/QuoteBillingOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/quotes/{quote_id}/duplicate": {"post": {"tags": ["quotes"], "summary": "Duplicate Quote", "description": "Copy a quote into a new draft.", "operationId": "duplicate_quote_api_v1_quotes__quote_id__duplicate_post", "parameters": [{"name": "quote_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Quote Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/QuoteOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/quotes/{quote_id}/revise": {"post": {"tags": ["quotes"], "summary": "Revise Quote", "description": "Make the next revision of a quote; the original is archived.", "operationId": "revise_quote_api_v1_quotes__quote_id__revise_post", "parameters": [{"name": "quote_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Quote Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/QuoteOut"}}}}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/QuoteConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/email-log": {"get": {"tags": ["email-log"], "summary": "List Email Log", "description": "Paginated list with optional filters.", "operationId": "list_email_log_api_v1_email_log_get", "parameters": [{"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 200, "minimum": 1, "default": 50, "title": "Limit"}}, {"name": "offset", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 0, "default": 0, "title": "Offset"}}, {"name": "doc_type", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Doc Type"}}, {"name": "status", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Status"}}, {"name": "doc_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Doc Id"}}, {"name": "since", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Since"}}, {"name": "until", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Until"}}, {"name": "delivery", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "bounced | complained | failed | blocked | drafted | opened | delivered | sent | queued | problem (bounced, complained, failed or blocked)", "title": "Delivery"}, "description": "bounced | complained | failed | blocked | drafted | opened | delivered | sent | queued | problem (bounced, complained, failed or blocked)"}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response List Email Log Api V1 Email Log Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/email-log/by-doc/{doc_type}/{doc_id}": {"get": {"tags": ["email-log"], "summary": "List Email Log For Doc", "description": "All send attempts for a single document, newest first.", "operationId": "list_email_log_for_doc_api_v1_email_log_by_doc__doc_type___doc_id__get", "parameters": [{"name": "doc_type", "in": "path", "required": true, "schema": {"type": "string", "title": "Doc Type"}}, {"name": "doc_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Doc Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response List Email Log For Doc Api V1 Email Log By Doc  Doc Type   Doc Id  Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/email-log/export.csv": {"get": {"tags": ["email-log"], "summary": "Export Email Log Csv", "description": "Stream the audit log as CSV for compliance / handover.\n\nTenant-scoped. Optional filters mirror the list endpoint. NO row\nlimit \u2014 exports everything matching the filter. At SAE's volume\n(10-100 sends/month) this is trivial; if it ever isn't, switch to\npaginated cursor + server-side gzip.", "operationId": "export_email_log_csv_api_v1_email_log_export_csv_get", "parameters": [{"name": "doc_type", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Doc Type"}}, {"name": "status", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Status"}}, {"name": "since", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Since"}}, {"name": "until", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Until"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/email-log/{log_id}": {"get": {"tags": ["email-log"], "summary": "Get Email Log Entry", "description": "Single log row \u2014 includes body_html + body_text (heavy fields not in list view).", "operationId": "get_email_log_entry_api_v1_email_log__log_id__get", "parameters": [{"name": "log_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Log Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response Get Email Log Entry Api V1 Email Log  Log Id  Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/email-log/{log_id}/attachment/{idx}": {"get": {"tags": ["email-log"], "summary": "Download Email Log Attachment", "description": "Stream the exact attachment bytes that were sent (or would have been).\n\nTenant-scoped via the WHERE clause + RLS. The PDF is stored in the same\ntransaction as the audit row, so this answers \"what exact attachment\nwent out on {sent_at}?\" \u2014 even years later, even after the source quote\nis re-rendered or edited.", "operationId": "download_email_log_attachment_api_v1_email_log__log_id__attachment__idx__get", "parameters": [{"name": "log_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Log Id"}}, {"name": "idx", "in": "path", "required": true, "schema": {"type": "integer", "title": "Idx"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/webhooks/resend": {"post": {"tags": ["webhooks"], "summary": "Receive Resend Webhook", "description": "Receive + verify + persist a Resend webhook event.\n\nNOTE: opens its own DB session (does NOT use get_session) because the\ntenant filter on every other endpoint would block lookup-by-\nmessage-id here. After matching the row we SET LOCAL app.current_tenant\nfrom the row's tenant_id before any UPDATE \u2014 RLS still satisfied.", "operationId": "receive_resend_webhook_api_v1_webhooks_resend_post", "parameters": [{"name": "svix-id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Svix-Id"}}, {"name": "svix-timestamp", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Svix-Timestamp"}}, {"name": "svix-signature", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Svix-Signature"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response Receive Resend Webhook Api V1 Webhooks Resend Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/payments": {"get": {"tags": ["payments"], "summary": "List Payments", "description": "List payments.\n\n``direction`` is money in or out (INCOMING / OUTGOING). Search with ``q``\n(number, reference, contact name, or an amount), narrow with\n``amount_min``/``amount_max``, and sort on the server with ``sort`` =\nnumber, payment_date, contact, amount, reference, direction, method or\nstatus, in ``sort_direction`` order. ``format=csv`` downloads every\nmatching row.", "operationId": "list_payments_api_v1_payments_get", "parameters": [{"name": "contact_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Contact Id"}}, {"name": "direction", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Direction"}}, {"name": "date_from", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Date From"}}, {"name": "date_to", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Date To"}}, {"name": "page", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 1, "default": 1, "title": "Page"}}, {"name": "page_size", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 500, "minimum": 1, "default": 50, "title": "Page Size"}}, {"name": "q", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "maxLength": 200}, {"type": "null"}], "description": "Free-text search: number, reference and contact name. Text that reads as an amount (e.g. 1513.59 or $1,513.59) also matches the document total.", "title": "Q"}, "description": "Free-text search: number, reference and contact name. Text that reads as an amount (e.g. 1513.59 or $1,513.59) also matches the document total."}, {"name": "amount_min", "in": "query", "required": false, "schema": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "description": "Smallest amount to include (inclusive).", "title": "Amount Min"}, "description": "Smallest amount to include (inclusive)."}, {"name": "amount_max", "in": "query", "required": false, "schema": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "description": "Largest amount to include (inclusive).", "title": "Amount Max"}, "description": "Largest amount to include (inclusive)."}, {"name": "sort", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Sort key; see the endpoint description.", "title": "Sort"}, "description": "Sort key; see the endpoint description."}, {"name": "sort_direction", "in": "query", "required": false, "schema": {"enum": ["asc", "desc"], "type": "string", "description": "Sort order.", "default": "desc", "title": "Sort Direction"}, "description": "Sort order."}, {"name": "format", "in": "query", "required": false, "schema": {"enum": ["json", "csv"], "type": "string", "description": "csv returns every matching row (no paging) as a spreadsheet download, in the same order.", "default": "json", "title": "Format"}, "description": "csv returns every matching row (no paging) as a spreadsheet download, in the same order."}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PaymentListOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "post": {"tags": ["payments"], "summary": "Create Payment", "operationId": "create_payment_api_v1_payments_post", "parameters": [{"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PaymentCreate"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PaymentOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/payments/{payment_id}": {"get": {"tags": ["payments"], "summary": "Get Payment", "operationId": "get_payment_api_v1_payments__payment_id__get", "parameters": [{"name": "payment_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Payment Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PaymentOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "patch": {"tags": ["payments"], "summary": "Update Payment", "operationId": "update_payment_api_v1_payments__payment_id__patch", "parameters": [{"name": "payment_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Payment Id"}}, {"name": "force", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Force"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PaymentUpdate"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Update Payment Api V1 Payments  Payment Id  Patch", "$ref": "#/components/schemas/PaymentOut"}}}}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PaymentConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "delete": {"tags": ["payments"], "summary": "Void Payment", "operationId": "void_payment_api_v1_payments__payment_id__delete", "parameters": [{"name": "payment_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Payment Id"}}, {"name": "void_date", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "description": "Date for the reversing entry (default: the payment's own date).", "title": "Void Date"}, "description": "Date for the reversing entry (default: the payment's own date)."}, {"name": "reason", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "maxLength": 1000}, {"type": "null"}], "description": "Why the payment is being voided (kept in its history).", "title": "Reason"}, "description": "Why the payment is being voided (kept in its history)."}, {"name": "override_reason", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "maxLength": 1000}, {"type": "null"}], "description": "Reason for changing a locked period. Only needed when the payment's entry is in a locked period; an admin, accountant or owner may then go ahead.", "title": "Override Reason"}, "description": "Reason for changing a locked period. Only needed when the payment's entry is in a locked period; an admin, accountant or owner may then go ahead."}, {"name": "hard", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Hard"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Admin", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Admin"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Void Payment Api V1 Payments  Payment Id  Delete"}}}}, "204": {"description": "Voided"}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PaymentConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/payments/{payment_id}/post": {"post": {"tags": ["payments"], "summary": "Post Payment Endpoint", "description": "Transition payment DRAFT \u2192 POSTED, generating the GL journal entry.\n\nSymmetric with POST /api/v1/invoices/{id}/post and\nPOST /api/v1/bills/{id}/post.\n\n* Requires If-Match: <version> for optimistic locking.\n* Supports X-Idempotency-Key for at-most-once semantics.\n* 200 \u2192 posted payment body.\n* 409 \u2192 version mismatch (current state in body).\n* 422 \u2192 payment already posted/voided, or PostingError from the\n    journal layer (e.g. cross-company account reference).\n* 404 \u2192 payment not found.", "operationId": "post_payment_endpoint_api_v1_payments__payment_id__post_post", "parameters": [{"name": "payment_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Payment Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Post Payment Endpoint Api V1 Payments  Payment Id  Post Post", "$ref": "#/components/schemas/PaymentOut"}}}}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PaymentConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/payments/{payment_id}/remittance-context": {"get": {"tags": ["payments"], "summary": "Get Payment Remittance Context", "description": "Return the fact context the render service gets for the remittance PDF.", "operationId": "get_payment_remittance_context_api_v1_payments__payment_id__remittance_context_get", "parameters": [{"name": "payment_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Payment Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/payments/{payment_id}/remittance.pdf": {"get": {"tags": ["payments"], "summary": "Get Payment Remittance Pdf", "description": "Render a supplier payment as a Remittance Advice PDF. Never stored.", "operationId": "get_payment_remittance_pdf_api_v1_payments__payment_id__remittance_pdf_get", "parameters": [{"name": "payment_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Payment Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/payments/{payment_id}/allocations": {"post": {"tags": ["payments"], "summary": "Allocate Posted Payment", "operationId": "allocate_posted_payment_api_v1_payments__payment_id__allocations_post", "parameters": [{"name": "payment_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Payment Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PaymentAllocateIn"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PaymentOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/payments/{payment_id}/allocations/{allocation_id}": {"delete": {"tags": ["payments"], "summary": "Unallocate Posted Payment", "operationId": "unallocate_posted_payment_api_v1_payments__payment_id__allocations__allocation_id__delete", "parameters": [{"name": "payment_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Payment Id"}}, {"name": "allocation_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Allocation Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PaymentOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/payments/{payment_id}/remittance/send-email": {"post": {"tags": ["payments"], "summary": "Post Payment Remittance Send Email", "description": "Email the remittance advice PDF to the supplier (gap P0-13).\n\nSame contract and the same two-key kill switch as\n``POST /bills/{id}/send-email``: JSON body ``from_addr``, ``to`` (list),\noptional ``cc`` / ``bcc``, ``subject``, ``body_html``, optional\n``sent_by_user_id``. Returns ``mode`` (``sent`` / ``blocked`` / \u2026) \u2014 a\nblocked send is HTTP 200 with ``mode=\"blocked\"``, so callers must read it.\nRefuses drafts and voided payments (422) exactly like the PDF route.", "operationId": "post_payment_remittance_send_email_api_v1_payments__payment_id__remittance_send_email_post", "parameters": [{"name": "payment_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Payment Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/settlement/open-documents": {"get": {"tags": ["settlement"], "summary": "Get Open Documents", "operationId": "get_open_documents_api_v1_settlement_open_documents_get", "parameters": [{"name": "contact_id", "in": "query", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Contact Id"}}, {"name": "direction", "in": "query", "required": true, "schema": {"type": "string", "description": "INCOMING (invoices) or OUTGOING (bills)", "title": "Direction"}, "description": "INCOMING (invoices) or OUTGOING (bills)"}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response Get Open Documents Api V1 Settlement Open Documents Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/settlement/bills/{bill_id}": {"get": {"tags": ["settlement"], "summary": "Get Bill Settlement", "operationId": "get_bill_settlement_api_v1_settlement_bills__bill_id__get", "parameters": [{"name": "bill_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Bill Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response Get Bill Settlement Api V1 Settlement Bills  Bill Id  Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/settlement/invoices/{invoice_id}": {"get": {"tags": ["settlement"], "summary": "Get Invoice Settlement", "operationId": "get_invoice_settlement_api_v1_settlement_invoices__invoice_id__get", "parameters": [{"name": "invoice_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Invoice Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response Get Invoice Settlement Api V1 Settlement Invoices  Invoice Id  Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/settlement/payments/{payment_id}": {"get": {"tags": ["settlement"], "summary": "Get Payment Settlement", "operationId": "get_payment_settlement_api_v1_settlement_payments__payment_id__get", "parameters": [{"name": "payment_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Payment Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response Get Payment Settlement Api V1 Settlement Payments  Payment Id  Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/settlement/due-date": {"get": {"tags": ["settlement"], "summary": "Get Due Date", "operationId": "get_due_date_api_v1_settlement_due_date_get", "parameters": [{"name": "contact_id", "in": "query", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Contact Id"}}, {"name": "issue_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "Issue Date"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response Get Due Date Api V1 Settlement Due Date Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/transfers": {"post": {"tags": ["transfers"], "summary": "Create Transfer", "description": "Create + post a transfer.\n\nHonours ``X-Idempotency-Key`` (P1-50, batch 14): the web form sends one\nkey per form render, so a double-click replays the first transfer\ninstead of posting a second one. Same key with a different body is a\n422; a retry while the first is still posting is a 503 with\n``Retry-After``.", "operationId": "create_transfer_api_v1_transfers_post", "parameters": [{"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TransferCreate"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TransferOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "get": {"tags": ["transfers"], "summary": "List Transfers", "operationId": "list_transfers_api_v1_transfers_get", "parameters": [{"name": "account_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Account Id"}}, {"name": "date_from", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Date From"}}, {"name": "date_to", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Date To"}}, {"name": "page", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 1, "default": 1, "title": "Page"}}, {"name": "page_size", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 500, "minimum": 1, "default": 50, "title": "Page Size"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TransferListOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/transfers/{transfer_id}": {"get": {"tags": ["transfers"], "summary": "Get Transfer", "operationId": "get_transfer_api_v1_transfers__transfer_id__get", "parameters": [{"name": "transfer_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Transfer Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TransferOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/transfers/{transfer_id}/reverse": {"post": {"tags": ["transfers"], "summary": "Reverse Transfer", "operationId": "reverse_transfer_api_v1_transfers__transfer_id__reverse_post", "parameters": [{"name": "transfer_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Transfer Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"content": {"application/json": {"schema": {"anyOf": [{"$ref": "#/components/schemas/TransferReverse"}, {"type": "null"}], "title": "Payload"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TransferOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/loans": {"get": {"tags": ["loans"], "summary": "List Loans", "operationId": "list_loans_api_v1_loans_get", "parameters": [{"name": "status", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Status"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response List Loans Api V1 Loans Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "post": {"tags": ["loans"], "summary": "Create Loan", "operationId": "create_loan_api_v1_loans_post", "parameters": [{"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/LoanCreate"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Create Loan Api V1 Loans Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/loans/preview": {"post": {"tags": ["loans"], "summary": "Preview Loan", "description": "Work out the repayment and schedule without recording anything.", "operationId": "preview_loan_api_v1_loans_preview_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/LoanPreviewIn"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Preview Loan Api V1 Loans Preview Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/loans/{loan_id}": {"get": {"tags": ["loans"], "summary": "Get Loan", "operationId": "get_loan_api_v1_loans__loan_id__get", "parameters": [{"name": "loan_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Loan Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Get Loan Api V1 Loans  Loan Id  Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "patch": {"tags": ["loans"], "summary": "Update Loan", "operationId": "update_loan_api_v1_loans__loan_id__patch", "parameters": [{"name": "loan_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Loan Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/LoanUpdate"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Update Loan Api V1 Loans  Loan Id  Patch"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/loans/{loan_id}/cancel": {"post": {"tags": ["loans"], "summary": "Cancel Loan", "operationId": "cancel_loan_api_v1_loans__loan_id__cancel_post", "parameters": [{"name": "loan_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Loan Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Cancel Loan Api V1 Loans  Loan Id  Cancel Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/loans/{loan_id}/repayment_split": {"get": {"tags": ["loans"], "summary": "Repayment Split", "operationId": "repayment_split_api_v1_loans__loan_id__repayment_split_get", "parameters": [{"name": "loan_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Loan Id"}}, {"name": "amount", "in": "query", "required": true, "schema": {"anyOf": [{"type": "number", "exclusiveMinimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Amount"}}, {"name": "fees", "in": "query", "required": false, "schema": {"anyOf": [{"type": "number", "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "default": "0", "title": "Fees"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Repayment Split Api V1 Loans  Loan Id  Repayment Split Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/loans/{loan_id}/repayments": {"post": {"tags": ["loans"], "summary": "Record Repayment", "operationId": "record_repayment_api_v1_loans__loan_id__repayments_post", "parameters": [{"name": "loan_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Loan Id"}}, {"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RepaymentIn"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Record Repayment Api V1 Loans  Loan Id  Repayments Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/loans/{loan_id}/repayments/{repayment_id}/reverse": {"post": {"tags": ["loans"], "summary": "Reverse Repayment", "operationId": "reverse_repayment_api_v1_loans__loan_id__repayments__repayment_id__reverse_post", "parameters": [{"name": "loan_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Loan Id"}}, {"name": "repayment_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Repayment Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Reverse Repayment Api V1 Loans  Loan Id  Repayments  Repayment Id  Reverse Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/owner_money/settings": {"get": {"tags": ["owner_money"], "summary": "Get Settings", "operationId": "get_settings_api_v1_owner_money_settings_get", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Get Settings Api V1 Owner Money Settings Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "put": {"tags": ["owner_money"], "summary": "Put Settings", "operationId": "put_settings_api_v1_owner_money_settings_put", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OwnerMoneySettingsIn"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Put Settings Api V1 Owner Money Settings Put"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/owner_money/setup_accounts": {"post": {"tags": ["owner_money"], "summary": "Post Setup Accounts", "operationId": "post_setup_accounts_api_v1_owner_money_setup_accounts_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Post Setup Accounts Api V1 Owner Money Setup Accounts Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/owner_money/reimbursements": {"get": {"tags": ["owner_money"], "summary": "Get Reimbursements", "operationId": "get_reimbursements_api_v1_owner_money_reimbursements_get", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Get Reimbursements Api V1 Owner Money Reimbursements Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/owner_money/reimburse": {"post": {"tags": ["owner_money"], "summary": "Post Reimburse", "description": "Pay the owner back for the selected expenses (one transfer).\n\nHonours ``X-Idempotency-Key`` so a double-click cannot pay twice (the\nsecond call also fails on its own: the expenses are no longer owing).", "operationId": "post_reimburse_api_v1_owner_money_reimburse_post", "parameters": [{"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ReimburseIn"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Post Reimburse Api V1 Owner Money Reimburse Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/owner_money/owner_loan_report": {"get": {"tags": ["owner_money"], "summary": "Get Owner Loan Report", "operationId": "get_owner_loan_report_api_v1_owner_money_owner_loan_report_get", "parameters": [{"name": "date_from", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Date From"}}, {"name": "date_to", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Date To"}}, {"name": "account_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Account Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Get Owner Loan Report Api V1 Owner Money Owner Loan Report Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/intercompany": {"post": {"tags": ["intercompany"], "summary": "Create Intercompany", "operationId": "create_intercompany_api_v1_intercompany_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/IntercompanyCreate"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/IntercompanyOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "get": {"tags": ["intercompany"], "summary": "List Intercompany", "operationId": "list_intercompany_api_v1_intercompany_get", "parameters": [{"name": "page", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 1, "default": 1, "title": "Page"}}, {"name": "page_size", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 500, "minimum": 1, "default": 50, "title": "Page Size"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/IntercompanyListOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/intercompany/reconciliation": {"get": {"tags": ["intercompany"], "summary": "Reconcile Intercompany", "description": "Read-only intercompany position for the active company.\n\nLists every IC txn the active company participates in, each with its legs, a\n``matched`` flag, and any in-flight relay state. SELECT-only \u2014 posts nothing,\nmutates nothing. Tenant- and company-scoped (runs under the caller's own\nFORCE-RLS; no cross-tenant data path).", "operationId": "reconcile_intercompany_api_v1_intercompany_reconciliation_get", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/IntercompanyReconOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/intercompany/{ic_txn_id}": {"get": {"tags": ["intercompany"], "summary": "Get Intercompany", "operationId": "get_intercompany_api_v1_intercompany__ic_txn_id__get", "parameters": [{"name": "ic_txn_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Ic Txn Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/IntercompanyOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/intercompany/{ic_txn_id}/reverse": {"post": {"tags": ["intercompany"], "summary": "Reverse Intercompany", "operationId": "reverse_intercompany_api_v1_intercompany__ic_txn_id__reverse_post", "parameters": [{"name": "ic_txn_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Ic Txn Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"content": {"application/json": {"schema": {"anyOf": [{"$ref": "#/components/schemas/IntercompanyReverse"}, {"type": "null"}], "title": "Payload"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/IntercompanyOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/intercompany/accept": {"post": {"tags": ["intercompany"], "summary": "Inbound intercompany REMOTE relay (per-edge token + Ed25519)", "description": "Accept a relayed intercompany event and post the reciprocal leg.\n\nReturns 200 ``{\"ic_txn_id\": ..., \"status\": \"POSTED\"}`` on a fresh post or on\nan idempotent re-delivery (the prior ack). 503 when the relay flag is off;\n400/401/404 on the fail-closed checks above. NEVER posts to any tenant but\nthe bound (receiver) one, and only to the receiver's OWN edge-declared\naccounts \u2014 no account id from the wire is ever trusted.", "operationId": "accept_relay_api_v1_intercompany_accept_post", "parameters": [{"name": "X-Tenant-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Tenant-Id"}}, {"name": "Authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/_RelayAccept"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reclassifications": {"post": {"tags": ["reclassifications"], "summary": "Create Reclassification", "operationId": "create_reclassification_api_v1_reclassifications_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ReclassificationCreate"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ReclassificationOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "get": {"tags": ["reclassifications"], "summary": "List Reclassifications", "operationId": "list_reclassifications_api_v1_reclassifications_get", "parameters": [{"name": "account_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Account Id"}}, {"name": "date_from", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Date From"}}, {"name": "date_to", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Date To"}}, {"name": "page", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 1, "default": 1, "title": "Page"}}, {"name": "page_size", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 500, "minimum": 1, "default": 50, "title": "Page Size"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ReclassificationListOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reclassifications/{reclassification_id}": {"get": {"tags": ["reclassifications"], "summary": "Get Reclassification", "operationId": "get_reclassification_api_v1_reclassifications__reclassification_id__get", "parameters": [{"name": "reclassification_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Reclassification Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ReclassificationOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reclassifications/{reclassification_id}/reverse": {"post": {"tags": ["reclassifications"], "summary": "Reverse Reclassification", "operationId": "reverse_reclassification_api_v1_reclassifications__reclassification_id__reverse_post", "parameters": [{"name": "reclassification_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Reclassification Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"content": {"application/json": {"schema": {"anyOf": [{"$ref": "#/components/schemas/ReclassificationReverse"}, {"type": "null"}], "title": "Payload"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ReclassificationOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/invoices/{invoice_id}/duplicate": {"post": {"tags": ["corrections"], "summary": "Duplicate Invoice", "operationId": "duplicate_invoice_api_v1_invoices__invoice_id__duplicate_post", "parameters": [{"name": "invoice_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Invoice Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"content": {"application/json": {"schema": {"anyOf": [{"$ref": "#/components/schemas/DuplicateBody"}, {"type": "null"}], "title": "Body"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Duplicate Invoice Api V1 Invoices  Invoice Id  Duplicate Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/bills/{bill_id}/duplicate": {"post": {"tags": ["corrections"], "summary": "Duplicate Bill", "operationId": "duplicate_bill_api_v1_bills__bill_id__duplicate_post", "parameters": [{"name": "bill_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Bill Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"content": {"application/json": {"schema": {"anyOf": [{"$ref": "#/components/schemas/DuplicateBody"}, {"type": "null"}], "title": "Body"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Duplicate Bill Api V1 Bills  Bill Id  Duplicate Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/invoices/{invoice_id}/credit-and-reissue": {"post": {"tags": ["corrections"], "summary": "Credit And Reissue Invoice", "operationId": "credit_and_reissue_invoice_api_v1_invoices__invoice_id__credit_and_reissue_post", "parameters": [{"name": "invoice_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Invoice Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreditReissueBody"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Credit And Reissue Invoice Api V1 Invoices  Invoice Id  Credit And Reissue Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/invoices/{invoice_id}/void-and-copy": {"post": {"tags": ["corrections"], "summary": "Void And Copy Invoice", "operationId": "void_and_copy_invoice_api_v1_invoices__invoice_id__void_and_copy_post", "parameters": [{"name": "invoice_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Invoice Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/VoidAndCopyBody"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Void And Copy Invoice Api V1 Invoices  Invoice Id  Void And Copy Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/bills/{bill_id}/void-and-copy": {"post": {"tags": ["corrections"], "summary": "Void And Copy Bill", "operationId": "void_and_copy_bill_api_v1_bills__bill_id__void_and_copy_post", "parameters": [{"name": "bill_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Bill Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/VoidAndCopyBody"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Void And Copy Bill Api V1 Bills  Bill Id  Void And Copy Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/invoices/{invoice_id}/change-contact": {"post": {"tags": ["corrections"], "summary": "Change Invoice Contact", "operationId": "change_invoice_contact_api_v1_invoices__invoice_id__change_contact_post", "parameters": [{"name": "invoice_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Invoice Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ChangeContactBody"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Change Invoice Contact Api V1 Invoices  Invoice Id  Change Contact Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/bills/{bill_id}/change-contact": {"post": {"tags": ["corrections"], "summary": "Change Bill Contact", "operationId": "change_bill_contact_api_v1_bills__bill_id__change_contact_post", "parameters": [{"name": "bill_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Bill Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ChangeContactBody"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Change Bill Contact Api V1 Bills  Bill Id  Change Contact Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/invoices/{invoice_id}/line-accounts": {"get": {"tags": ["corrections"], "summary": "Invoice Line Accounts", "operationId": "invoice_line_accounts_api_v1_invoices__invoice_id__line_accounts_get", "parameters": [{"name": "invoice_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Invoice Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Invoice Line Accounts Api V1 Invoices  Invoice Id  Line Accounts Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/bills/{bill_id}/line-accounts": {"get": {"tags": ["corrections"], "summary": "Bill Line Accounts", "operationId": "bill_line_accounts_api_v1_bills__bill_id__line_accounts_get", "parameters": [{"name": "bill_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Bill Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Bill Line Accounts Api V1 Bills  Bill Id  Line Accounts Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/invoices/{invoice_id}/lines/{line_id}/reclassify": {"post": {"tags": ["corrections"], "summary": "Reclassify Invoice Line", "operationId": "reclassify_invoice_line_api_v1_invoices__invoice_id__lines__line_id__reclassify_post", "parameters": [{"name": "invoice_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Invoice Id"}}, {"name": "line_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Line Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ReclassifyLineBody"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Reclassify Invoice Line Api V1 Invoices  Invoice Id  Lines  Line Id  Reclassify Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/bills/{bill_id}/lines/{line_id}/reclassify": {"post": {"tags": ["corrections"], "summary": "Reclassify Bill Line", "operationId": "reclassify_bill_line_api_v1_bills__bill_id__lines__line_id__reclassify_post", "parameters": [{"name": "bill_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Bill Id"}}, {"name": "line_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Line Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ReclassifyLineBody"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Reclassify Bill Line Api V1 Bills  Bill Id  Lines  Line Id  Reclassify Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/bills/{bill_id}/approval": {"post": {"tags": ["corrections"], "summary": "Bill Approval", "operationId": "bill_approval_api_v1_bills__bill_id__approval_post", "parameters": [{"name": "bill_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Bill Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ApprovalBody"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Bill Approval Api V1 Bills  Bill Id  Approval Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/payments/{payment_id}/approval": {"post": {"tags": ["corrections"], "summary": "Payment Approval", "operationId": "payment_approval_api_v1_payments__payment_id__approval_post", "parameters": [{"name": "payment_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Payment Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ApprovalBody"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Payment Approval Api V1 Payments  Payment Id  Approval Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/bills/{bill_id}/planned-pay-date": {"put": {"tags": ["corrections"], "summary": "Bill Planned Pay Date", "operationId": "bill_planned_pay_date_api_v1_bills__bill_id__planned_pay_date_put", "parameters": [{"name": "bill_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Bill Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PlannedPayDateBody"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Bill Planned Pay Date Api V1 Bills  Bill Id  Planned Pay Date Put"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/history/{entity}/{entity_id}": {"get": {"tags": ["history"], "summary": "Document History", "operationId": "document_history_api_v1_history__entity___entity_id__get", "parameters": [{"name": "entity", "in": "path", "required": true, "schema": {"type": "string", "title": "Entity"}}, {"name": "entity_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Entity Id"}}, {"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 1000, "minimum": 1, "default": 200, "title": "Limit"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HistoryOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/approvals": {"get": {"tags": ["approvals"], "summary": "Approvals Queue", "operationId": "approvals_queue_api_v1_approvals_get", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/QueueOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/approvals/settings": {"get": {"tags": ["approvals"], "summary": "Get Approval Settings", "operationId": "get_approval_settings_api_v1_approvals_settings_get", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SettingsOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "put": {"tags": ["approvals"], "summary": "Put Approval Settings", "operationId": "put_approval_settings_api_v1_approvals_settings_put", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Admin", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Admin"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SettingsIn"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SettingsOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/credit_notes": {"get": {"tags": ["credit_notes"], "summary": "List Credit Notes", "description": "List customer credit notes. ``q`` searches number, reason, customer\nname or an amount; ``sort`` = number, issue_date, contact, total or\nstatus; ``format=csv`` downloads every matching row.", "operationId": "list_credit_notes_api_v1_credit_notes_get", "parameters": [{"name": "contact_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Contact Id"}}, {"name": "status", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Status"}}, {"name": "date_from", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Date From"}}, {"name": "date_to", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Date To"}}, {"name": "unapplied", "in": "query", "required": false, "schema": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "description": "Only posted credit notes with credit left (0227)", "title": "Unapplied"}, "description": "Only posted credit notes with credit left (0227)"}, {"name": "page", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 1, "default": 1, "title": "Page"}}, {"name": "page_size", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 500, "minimum": 1, "default": 50, "title": "Page Size"}}, {"name": "q", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "maxLength": 200}, {"type": "null"}], "description": "Free-text search: number, reference and contact name. Text that reads as an amount (e.g. 1513.59 or $1,513.59) also matches the document total.", "title": "Q"}, "description": "Free-text search: number, reference and contact name. Text that reads as an amount (e.g. 1513.59 or $1,513.59) also matches the document total."}, {"name": "amount_min", "in": "query", "required": false, "schema": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "description": "Smallest total to include (inclusive).", "title": "Amount Min"}, "description": "Smallest total to include (inclusive)."}, {"name": "amount_max", "in": "query", "required": false, "schema": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "description": "Largest total to include (inclusive).", "title": "Amount Max"}, "description": "Largest total to include (inclusive)."}, {"name": "sort", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Sort key; see the endpoint description.", "title": "Sort"}, "description": "Sort key; see the endpoint description."}, {"name": "direction", "in": "query", "required": false, "schema": {"enum": ["asc", "desc"], "type": "string", "description": "Sort order.", "default": "desc", "title": "Direction"}, "description": "Sort order."}, {"name": "format", "in": "query", "required": false, "schema": {"enum": ["json", "csv"], "type": "string", "description": "csv returns every matching row (no paging) as a spreadsheet download, in the same order.", "default": "json", "title": "Format"}, "description": "csv returns every matching row (no paging) as a spreadsheet download, in the same order."}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreditNoteListOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "post": {"tags": ["credit_notes"], "summary": "Create Credit Note", "operationId": "create_credit_note_api_v1_credit_notes_post", "parameters": [{"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreditNoteCreate"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreditNoteOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/credit_notes/{credit_note_id}": {"get": {"tags": ["credit_notes"], "summary": "Get Credit Note", "operationId": "get_credit_note_api_v1_credit_notes__credit_note_id__get", "parameters": [{"name": "credit_note_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Credit Note Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreditNoteOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "patch": {"tags": ["credit_notes"], "summary": "Update Credit Note", "operationId": "update_credit_note_api_v1_credit_notes__credit_note_id__patch", "parameters": [{"name": "credit_note_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Credit Note Id"}}, {"name": "force", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Force"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreditNoteUpdate"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Update Credit Note Api V1 Credit Notes  Credit Note Id  Patch", "$ref": "#/components/schemas/CreditNoteOut"}}}}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreditNoteConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "delete": {"tags": ["credit_notes"], "summary": "Void Credit Note", "operationId": "void_credit_note_api_v1_credit_notes__credit_note_id__delete", "parameters": [{"name": "credit_note_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Credit Note Id"}}, {"name": "hard", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Hard"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Admin", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Admin"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Void Credit Note Api V1 Credit Notes  Credit Note Id  Delete"}}}}, "204": {"description": "Voided"}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreditNoteConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/credit_notes/{credit_note_id}/post": {"post": {"tags": ["credit_notes"], "summary": "Post Credit Note", "description": "Transition credit note DRAFT \u2192 POSTED, generating journal entry lines.", "operationId": "post_credit_note_api_v1_credit_notes__credit_note_id__post_post", "parameters": [{"name": "credit_note_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Credit Note Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Post Credit Note Api V1 Credit Notes  Credit Note Id  Post Post", "$ref": "#/components/schemas/CreditNoteOut"}}}}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreditNoteConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/credit_notes/{credit_note_id}/void": {"post": {"tags": ["credit_notes"], "summary": "Void Credit Note Transition", "description": "Transition POSTED credit note \u2192 VOIDED, reversing the journal entry.", "operationId": "void_credit_note_transition_api_v1_credit_notes__credit_note_id__void_post", "parameters": [{"name": "credit_note_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Credit Note Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Void Credit Note Transition Api V1 Credit Notes  Credit Note Id  Void Post"}}}}, "204": {"description": "Voided"}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreditNoteConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/credit_notes/{credit_note_id}/render-context": {"get": {"tags": ["credit_notes"], "summary": "Get Credit Note Render Context", "description": "Return the fact context the app render service needs to build the CN PDF.\n\nExact ``_build_credit_note_ctx`` dict (including the show_on_invoice bank\nresolution) fed to the render service by the /pdf route. The builder already\nsets ``kind`` = \"Credit Note\" inside ctx; it is also returned at top level.", "operationId": "get_credit_note_render_context_api_v1_credit_notes__credit_note_id__render_context_get", "parameters": [{"name": "credit_note_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Credit Note Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/credit_notes/{credit_note_id}/pdf": {"get": {"tags": ["credit_notes"], "summary": "Get Credit Note Pdf", "description": "Render a credit note as PDF via the LaTeX engine. Always regenerated; never stored.", "operationId": "get_credit_note_pdf_api_v1_credit_notes__credit_note_id__pdf_get", "parameters": [{"name": "credit_note_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Credit Note Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/credit_notes/{credit_note_id}/applications": {"get": {"tags": ["credit_notes"], "summary": "List Credit Note Applications", "operationId": "list_credit_note_applications_api_v1_credit_notes__credit_note_id__applications_get", "parameters": [{"name": "credit_note_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Credit Note Id"}}, {"name": "include_reversed", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Include Reversed"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "array", "items": {"$ref": "#/components/schemas/CreditApplicationOut"}, "title": "Response List Credit Note Applications Api V1 Credit Notes  Credit Note Id  Applications Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "post": {"tags": ["credit_notes"], "summary": "Apply Credit Note", "description": "Apply this posted credit note to one or more of the customer's open\ninvoices. Requires If-Match (credit note version); honours\nX-Idempotency-Key.", "operationId": "apply_credit_note_api_v1_credit_notes__credit_note_id__applications_post", "parameters": [{"name": "credit_note_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Credit Note Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreditNoteApplyIn"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreditNoteOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/credit_notes/{credit_note_id}/applications/{application_id}": {"delete": {"tags": ["credit_notes"], "summary": "Unapply Credit Note", "description": "Un-apply one application; the invoice re-opens by that amount.", "operationId": "unapply_credit_note_api_v1_credit_notes__credit_note_id__applications__application_id__delete", "parameters": [{"name": "credit_note_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Credit Note Id"}}, {"name": "application_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Application Id"}}, {"name": "reason", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "maxLength": 500}, {"type": "null"}], "title": "Reason"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreditNoteOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/credit_notes/{credit_note_id}/send-email": {"post": {"tags": ["credit_notes"], "summary": "Post Credit Note Send Email", "description": "Email the credit note PDF to the customer (b11, P1-6).\n\nOptional JSON body: ``to`` (comma-separated, default the contact's\nemail), ``cc``, ``bcc``, ``subject``, ``body_html``, ``from_addr``\n(default: Getting paid settings, else the company email). Only POSTED\ncredit notes are sent \u2014 a draft is not a finished document.", "operationId": "post_credit_note_send_email_api_v1_credit_notes__credit_note_id__send_email_post", "parameters": [{"name": "credit_note_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Credit Note Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/supplier_credit_notes": {"post": {"tags": ["supplier_credit_notes"], "summary": "Create Scn", "operationId": "create_scn_api_v1_supplier_credit_notes_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SCNCreate"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SCNOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "get": {"tags": ["supplier_credit_notes"], "summary": "List Scn", "description": "List supplier credit notes. ``q`` searches number, the supplier's\ncredit note number, supplier name or an amount; ``sort`` = number,\nsupplier_reference, issue_date, contact, total or status;\n``format=csv`` downloads every matching row.", "operationId": "list_scn_api_v1_supplier_credit_notes_get", "parameters": [{"name": "contact_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Contact Id"}}, {"name": "status", "in": "query", "required": false, "schema": {"anyOf": [{"$ref": "#/components/schemas/SupplierCreditNoteStatus"}, {"type": "null"}], "title": "Status"}}, {"name": "date_from", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Date From"}}, {"name": "date_to", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Date To"}}, {"name": "unapplied", "in": "query", "required": false, "schema": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "description": "Only posted credits with credit left (0227)", "title": "Unapplied"}, "description": "Only posted credits with credit left (0227)"}, {"name": "page", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 1, "default": 1, "title": "Page"}}, {"name": "page_size", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 500, "minimum": 1, "default": 50, "title": "Page Size"}}, {"name": "q", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "maxLength": 200}, {"type": "null"}], "description": "Free-text search: number, reference and contact name. Text that reads as an amount (e.g. 1513.59 or $1,513.59) also matches the document total.", "title": "Q"}, "description": "Free-text search: number, reference and contact name. Text that reads as an amount (e.g. 1513.59 or $1,513.59) also matches the document total."}, {"name": "amount_min", "in": "query", "required": false, "schema": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "description": "Smallest total to include (inclusive).", "title": "Amount Min"}, "description": "Smallest total to include (inclusive)."}, {"name": "amount_max", "in": "query", "required": false, "schema": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "description": "Largest total to include (inclusive).", "title": "Amount Max"}, "description": "Largest total to include (inclusive)."}, {"name": "sort", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Sort key; see the endpoint description.", "title": "Sort"}, "description": "Sort key; see the endpoint description."}, {"name": "direction", "in": "query", "required": false, "schema": {"enum": ["asc", "desc"], "type": "string", "description": "Sort order.", "default": "desc", "title": "Direction"}, "description": "Sort order."}, {"name": "format", "in": "query", "required": false, "schema": {"enum": ["json", "csv"], "type": "string", "description": "csv returns every matching row (no paging) as a spreadsheet download, in the same order.", "default": "json", "title": "Format"}, "description": "csv returns every matching row (no paging) as a spreadsheet download, in the same order."}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SCNListOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/supplier_credit_notes/{scn_id}": {"get": {"tags": ["supplier_credit_notes"], "summary": "Get Scn", "operationId": "get_scn_api_v1_supplier_credit_notes__scn_id__get", "parameters": [{"name": "scn_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Scn Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SCNOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "patch": {"tags": ["supplier_credit_notes"], "summary": "Update Scn", "operationId": "update_scn_api_v1_supplier_credit_notes__scn_id__patch", "parameters": [{"name": "scn_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Scn Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SCNUpdate"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SCNOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/supplier_credit_notes/{scn_id}/post": {"post": {"tags": ["supplier_credit_notes"], "summary": "Post Scn", "operationId": "post_scn_api_v1_supplier_credit_notes__scn_id__post_post", "parameters": [{"name": "scn_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Scn Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SCNOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/supplier_credit_notes/{scn_id}/void": {"post": {"tags": ["supplier_credit_notes"], "summary": "Void Scn", "operationId": "void_scn_api_v1_supplier_credit_notes__scn_id__void_post", "parameters": [{"name": "scn_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Scn Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SCNOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/supplier_credit_notes/{scn_id}/applications": {"get": {"tags": ["supplier_credit_notes"], "summary": "List Scn Applications", "operationId": "list_scn_applications_api_v1_supplier_credit_notes__scn_id__applications_get", "parameters": [{"name": "scn_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Scn Id"}}, {"name": "include_reversed", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Include Reversed"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "array", "items": {"$ref": "#/components/schemas/CreditApplicationOut"}, "title": "Response List Scn Applications Api V1 Supplier Credit Notes  Scn Id  Applications Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "post": {"tags": ["supplier_credit_notes"], "summary": "Apply Scn", "description": "Apply this posted supplier credit note to one or more open bills of\nthe same supplier. No journal is posted \u2014 the credit note's own journal\nalready reduced Trade Creditors; this records which bills it settled.\n\nEach amount must be at most that bill's outstanding balance and the\ntotal at most the credit remaining. ``applied_date`` (default today)\nmust be on or after both documents' dates and outside a locked period.", "operationId": "apply_scn_api_v1_supplier_credit_notes__scn_id__applications_post", "parameters": [{"name": "scn_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Scn Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SupplierCreditApplyIn"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SCNOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/supplier_credit_notes/{scn_id}/applications/{application_id}": {"delete": {"tags": ["supplier_credit_notes"], "summary": "Unapply Scn", "description": "Un-apply one application. The bill re-opens by that amount and the\ncredit gets it back. The application row is kept, marked reversed.", "operationId": "unapply_scn_api_v1_supplier_credit_notes__scn_id__applications__application_id__delete", "parameters": [{"name": "scn_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Scn Id"}}, {"name": "application_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Application Id"}}, {"name": "reason", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "maxLength": 500}, {"type": "null"}], "title": "Reason"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SCNOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/receipts": {"post": {"tags": ["receipts"], "summary": "Create Receipt", "operationId": "create_receipt_api_v1_receipts_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ReceiptCreate"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ReceiptOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "get": {"tags": ["receipts"], "summary": "List Receipts", "description": "List receipts. ``q`` searches number, reference, contact name or an\namount; ``sort`` = number, receipt_date, contact, total, reference or\nstatus; ``format=csv`` downloads every matching row.", "operationId": "list_receipts_api_v1_receipts_get", "parameters": [{"name": "contact_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Contact Id"}}, {"name": "status", "in": "query", "required": false, "schema": {"anyOf": [{"$ref": "#/components/schemas/ReceiptStatus"}, {"type": "null"}], "title": "Status"}}, {"name": "date_from", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Date From"}}, {"name": "date_to", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Date To"}}, {"name": "page", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 1, "default": 1, "title": "Page"}}, {"name": "page_size", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 500, "minimum": 1, "default": 50, "title": "Page Size"}}, {"name": "q", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "maxLength": 200}, {"type": "null"}], "description": "Free-text search: number, reference and contact name. Text that reads as an amount (e.g. 1513.59 or $1,513.59) also matches the document total.", "title": "Q"}, "description": "Free-text search: number, reference and contact name. Text that reads as an amount (e.g. 1513.59 or $1,513.59) also matches the document total."}, {"name": "amount_min", "in": "query", "required": false, "schema": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "description": "Smallest total to include (inclusive).", "title": "Amount Min"}, "description": "Smallest total to include (inclusive)."}, {"name": "amount_max", "in": "query", "required": false, "schema": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "description": "Largest total to include (inclusive).", "title": "Amount Max"}, "description": "Largest total to include (inclusive)."}, {"name": "sort", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Sort key; see the endpoint description.", "title": "Sort"}, "description": "Sort key; see the endpoint description."}, {"name": "direction", "in": "query", "required": false, "schema": {"enum": ["asc", "desc"], "type": "string", "description": "Sort order.", "default": "desc", "title": "Direction"}, "description": "Sort order."}, {"name": "format", "in": "query", "required": false, "schema": {"enum": ["json", "csv"], "type": "string", "description": "csv returns every matching row (no paging) as a spreadsheet download, in the same order.", "default": "json", "title": "Format"}, "description": "csv returns every matching row (no paging) as a spreadsheet download, in the same order."}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ReceiptListOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/receipts/{receipt_id}": {"get": {"tags": ["receipts"], "summary": "Get Receipt", "operationId": "get_receipt_api_v1_receipts__receipt_id__get", "parameters": [{"name": "receipt_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Receipt Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ReceiptOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "patch": {"tags": ["receipts"], "summary": "Update Receipt", "operationId": "update_receipt_api_v1_receipts__receipt_id__patch", "parameters": [{"name": "receipt_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Receipt Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ReceiptUpdate"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ReceiptOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/receipts/{receipt_id}/post": {"post": {"tags": ["receipts"], "summary": "Post Receipt", "operationId": "post_receipt_api_v1_receipts__receipt_id__post_post", "parameters": [{"name": "receipt_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Receipt Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ReceiptOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/receipts/{receipt_id}/void": {"post": {"tags": ["receipts"], "summary": "Void Receipt", "operationId": "void_receipt_api_v1_receipts__receipt_id__void_post", "parameters": [{"name": "receipt_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Receipt Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ReceiptOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/projects": {"get": {"tags": ["projects"], "summary": "List Projects", "operationId": "list_projects_api_v1_projects_get", "parameters": [{"name": "page", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 1, "default": 1, "title": "Page"}}, {"name": "page_size", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 500, "minimum": 1, "default": 50, "title": "Page Size"}}, {"name": "status", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Status"}}, {"name": "archived", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Archived"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ProjectListOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "post": {"tags": ["projects"], "summary": "Create Project", "operationId": "create_project_api_v1_projects_post", "parameters": [{"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ProjectCreate"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ProjectOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/projects/{project_id}": {"get": {"tags": ["projects"], "summary": "Get Project", "operationId": "get_project_api_v1_projects__project_id__get", "parameters": [{"name": "project_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Project Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ProjectOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "patch": {"tags": ["projects"], "summary": "Update Project", "operationId": "update_project_api_v1_projects__project_id__patch", "parameters": [{"name": "project_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Project Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ProjectUpdate"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Update Project Api V1 Projects  Project Id  Patch", "$ref": "#/components/schemas/ProjectOut"}}}}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ProjectConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "delete": {"tags": ["projects"], "summary": "Delete Project", "operationId": "delete_project_api_v1_projects__project_id__delete", "parameters": [{"name": "project_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Project Id"}}, {"name": "hard", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Hard"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Admin", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Admin"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Delete Project Api V1 Projects  Project Id  Delete"}}}}, "204": {"description": "Archived"}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ProjectConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/projects/{project_id}/summary": {"get": {"tags": ["projects"], "summary": "Project Summary", "description": "Income, costs, profit, budget, time and the documents on a job.", "operationId": "project_summary_api_v1_projects__project_id__summary_get", "parameters": [{"name": "project_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Project Id"}}, {"name": "date_from", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Date From"}}, {"name": "date_to", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Date To"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Project Summary Api V1 Projects  Project Id  Summary Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/projects/{project_id}/unbilled": {"get": {"tags": ["projects"], "summary": "Project Unbilled", "description": "Billable time and costs on the job that are not invoiced yet.", "operationId": "project_unbilled_api_v1_projects__project_id__unbilled_get", "parameters": [{"name": "project_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Project Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Project Unbilled Api V1 Projects  Project Id  Unbilled Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/projects/{project_id}/bill-unbilled": {"post": {"tags": ["projects"], "summary": "Project Bill Unbilled", "description": "Put the job's unbilled time and costs on one draft invoice.", "operationId": "project_bill_unbilled_api_v1_projects__project_id__bill_unbilled_post", "parameters": [{"name": "project_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Project Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ProjectBillUnbilledRequest"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Project Bill Unbilled Api V1 Projects  Project Id  Bill Unbilled Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/fixed_assets": {"get": {"tags": ["fixed_assets"], "summary": "List Fixed Assets", "operationId": "list_fixed_assets_api_v1_fixed_assets_get", "parameters": [{"name": "page", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 1, "default": 1, "title": "Page"}}, {"name": "page_size", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 500, "minimum": 1, "default": 50, "title": "Page Size"}}, {"name": "status", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Status"}}, {"name": "depreciation_model_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Depreciation Model Id"}}, {"name": "archived", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Archived"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/FixedAssetListOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "post": {"tags": ["fixed_assets"], "summary": "Create Fixed Asset", "operationId": "create_fixed_asset_api_v1_fixed_assets_post", "parameters": [{"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/FixedAssetCreate"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/FixedAssetOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/fixed_assets/depreciation_run_all": {"post": {"tags": ["fixed_assets"], "summary": "Depreciation Run All", "description": "Run depreciation for all active, non-disposed assets up to ``through``.\n\nIterates every active asset for the company. Calls\n``legacy_assets_svc.post_depreciation`` for each one and collects\nresults. Per-asset errors are caught and added to the ``errors`` list\nrather than aborting the whole batch.\n\nReturns 200 with a :class:`DepreciationRunAllResponse` regardless of\nwhether any assets had errors \u2014 the caller inspects the ``errors``\nfield to handle partial failures.", "operationId": "depreciation_run_all_api_v1_fixed_assets_depreciation_run_all_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/DepreciationRunAllRequest"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/DepreciationRunAllResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/fixed_assets/tie_out": {"get": {"tags": ["fixed_assets"], "summary": "Fixed Assets Tie Out", "description": "Asset register vs ledger, per cost account (P1-73, batch 14).\n\n``in_step`` is false when any cost or accumulated depreciation account\ndiffers from the register, or any asset is not linked to the purchase\nthat put it on the balance sheet.", "operationId": "fixed_assets_tie_out_api_v1_fixed_assets_tie_out_get", "parameters": [{"name": "as_at", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "As At"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Fixed Assets Tie Out Api V1 Fixed Assets Tie Out Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/fixed_assets/{asset_id}/link_purchase": {"post": {"tags": ["fixed_assets"], "summary": "Link Fixed Asset Purchase", "description": "Tie an asset to its purchase: link a posted bill, or post the payment.", "operationId": "link_fixed_asset_purchase_api_v1_fixed_assets__asset_id__link_purchase_post", "parameters": [{"name": "asset_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Asset Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/FixedAssetLinkPurchase"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Link Fixed Asset Purchase Api V1 Fixed Assets  Asset Id  Link Purchase Post", "$ref": "#/components/schemas/FixedAssetOut"}}}}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/FixedAssetConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/fixed_assets/{asset_id}": {"get": {"tags": ["fixed_assets"], "summary": "Get Fixed Asset", "operationId": "get_fixed_asset_api_v1_fixed_assets__asset_id__get", "parameters": [{"name": "asset_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Asset Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/FixedAssetOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "patch": {"tags": ["fixed_assets"], "summary": "Update Fixed Asset", "operationId": "update_fixed_asset_api_v1_fixed_assets__asset_id__patch", "parameters": [{"name": "asset_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Asset Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/FixedAssetUpdate"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Update Fixed Asset Api V1 Fixed Assets  Asset Id  Patch", "$ref": "#/components/schemas/FixedAssetOut"}}}}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/FixedAssetConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "delete": {"tags": ["fixed_assets"], "summary": "Delete Fixed Asset", "operationId": "delete_fixed_asset_api_v1_fixed_assets__asset_id__delete", "parameters": [{"name": "asset_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Asset Id"}}, {"name": "hard", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Hard"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Admin", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Admin"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Delete Fixed Asset Api V1 Fixed Assets  Asset Id  Delete"}}}}, "204": {"description": "Archived"}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/FixedAssetConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/fixed_assets/{asset_id}/dispose": {"post": {"tags": ["fixed_assets"], "summary": "Dispose Fixed Asset", "description": "Dispose a fixed asset.\n\nPosts the disposal journal (catch-up depreciation, cost and\naccumulated depreciation cleared, proceeds, GST when it applies, the\nGST decreasing adjustment for a partly private asset, gain or loss on\nthe price excluding GST), marks the asset ``disposed``,\nstamps disposal_date and proceeds, and bumps the version. The figures\nmatch ``GET /{asset_id}/disposal-preview`` for the same date, price and\n``gst_applies``. Requires ``If-Match: <version>`` for optimistic locking.\n\nReturns 422 if the asset is already disposed.\nReturns 409 on version conflict (with current state in body).", "operationId": "dispose_fixed_asset_api_v1_fixed_assets__asset_id__dispose_post", "parameters": [{"name": "asset_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Asset Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/FixedAssetDispose"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Dispose Fixed Asset Api V1 Fixed Assets  Asset Id  Dispose Post", "$ref": "#/components/schemas/FixedAssetOut"}}}}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/FixedAssetConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/fixed_assets/{asset_id}/post_depreciation": {"post": {"tags": ["fixed_assets"], "summary": "Post Depreciation", "description": "Run a depreciation posting for a fixed asset up to ``through``.\n\nComputes the incremental depreciation from\n``last_depreciation_posted_through`` to ``through``, creates and\nposts a GL journal entry (Dr dep_expense, Cr accum_dep), advances\nthe cursor, and bumps the asset version.\n\nReturns 422 if the asset is not ``active`` or if the service raises\na ValueError (e.g. asset not found, bad model config).\nReturns 409 on version mismatch (with current state in body).", "operationId": "post_depreciation_api_v1_fixed_assets__asset_id__post_depreciation_post", "parameters": [{"name": "asset_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Asset Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/FixedAssetDepreciationRunRequest"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Post Depreciation Api V1 Fixed Assets  Asset Id  Post Depreciation Post", "$ref": "#/components/schemas/FixedAssetDepreciationRunResponse"}}}}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/FixedAssetConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/fixed_assets/{asset_id}/convert_to_inventory": {"post": {"tags": ["fixed_assets"], "summary": "Convert To Inventory", "description": "Convert an active FA demonstrator to used-inventory stock.\n\nCatches depreciation up to conversion_date, posts a balanced conversion\njournal (DR Inventory / DR Accum Dep / CR FA Cost), creates an inventory\nItem with on_hand_qty=1 at NBV, and marks the FA disposed at NBV proceeds.\n\nRequires If-Match: <version> for optimistic locking.\nReturns 201 with the disposed asset, new item id/sku, NBV, and journal id.\nReturns 409 on version conflict (current state in body).\nReturns 422 if asset is not ACTIVE or inputs are invalid.", "operationId": "convert_to_inventory_api_v1_fixed_assets__asset_id__convert_to_inventory_post", "parameters": [{"name": "asset_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Asset Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/FixedAssetConvertToInventory"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Convert To Inventory Api V1 Fixed Assets  Asset Id  Convert To Inventory Post", "$ref": "#/components/schemas/FixedAssetConvertToInventoryResponse"}}}}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/FixedAssetConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/fixed_assets/{asset_id}/disposal-preview": {"get": {"tags": ["fixed_assets"], "summary": "Disposal Preview", "description": "Book value, depreciation to catch up, GST on the sale, the GST\ndecreasing adjustment (``gst_decreasing_adjustment``, BAS 1B, for a\npartly private asset), ``net_gst`` and the gain or loss for a proposed\ndisposal. Returns 422 with a plain reason when the disposal could not be\nrecorded (already disposed, backdated).", "operationId": "disposal_preview_api_v1_fixed_assets__asset_id__disposal_preview_get", "parameters": [{"name": "asset_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Asset Id"}}, {"name": "disposal_date", "in": "query", "required": true, "schema": {"type": "string", "description": "Date the asset is sold or scrapped (YYYY-MM-DD).", "title": "Disposal Date"}, "description": "Date the asset is sold or scrapped (YYYY-MM-DD)."}, {"name": "sale_price", "in": "query", "required": false, "schema": {"anyOf": [{"type": "number", "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "description": "What the buyer pays.", "default": "0", "title": "Sale Price"}, "description": "What the buyer pays."}, {"name": "gst_applies", "in": "query", "required": false, "schema": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "description": "Treat the sale price as GST-inclusive. Defaults to the company's GST registration. false = not a business asset: no GST, not reported on the BAS.", "title": "Gst Applies"}, "description": "Treat the sale price as GST-inclusive. Defaults to the company's GST registration. false = not a business asset: no GST, not reported on the BAS."}, {"name": "motor_vehicle", "in": "query", "required": false, "schema": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "description": "Preview as if the asset is (true) or is not (false) a motor vehicle, trailer or vehicle body, before the dispose form saves it. Omitted = the asset's own flag.", "title": "Motor Vehicle"}, "description": "Preview as if the asset is (true) or is not (false) a motor vehicle, trailer or vehicle body, before the dispose form saves it. Omitted = the asset's own flag."}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Disposal Preview Api V1 Fixed Assets  Asset Id  Disposal Preview Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/depreciation_models": {"get": {"tags": ["depreciation_models"], "summary": "List Depreciation Models", "description": "Return all depreciation models ordered by id.\n\nThe catalogue is seeded and stable; no filtering is needed beyond\npagination.  All rows are returned \u2014 there is no archived_at column\non this table.", "operationId": "list_depreciation_models_api_v1_depreciation_models_get", "parameters": [{"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 1000, "minimum": 1, "default": 100, "title": "Limit"}}, {"name": "offset", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 0, "default": 0, "title": "Offset"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/DepreciationModelListOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/inbox/documents": {"post": {"tags": ["document_inbox"], "summary": "Upload Document", "description": "Capture a document into the inbox.\n\nDuplicate content (same bytes already live in this tenant's inbox)\nreturns **200 with the existing row + ``\"duplicate\": true``** \u2014 a\nmobile double-tap must not read as failure. Otherwise 201.", "operationId": "upload_document_api_v1_inbox_documents_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "requestBody": {"required": true, "content": {"multipart/form-data": {"schema": {"$ref": "#/components/schemas/Body_upload_document_api_v1_inbox_documents_post"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "get": {"tags": ["document_inbox"], "summary": "List Documents", "description": "Paginated inbox list \u2014 newest first; terminal states excluded\nunless explicitly requested via ``status=``.", "operationId": "list_documents_api_v1_inbox_documents_get", "parameters": [{"name": "status", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Status"}}, {"name": "source", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Source"}}, {"name": "company_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Company Id"}}, {"name": "page", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 1, "default": 1, "title": "Page"}}, {"name": "page_size", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 200, "minimum": 1, "default": 50, "title": "Page Size"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response List Documents Api V1 Inbox Documents Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/inbox/stats": {"get": {"tags": ["document_inbox"], "summary": "Inbox Stats", "description": "Badge + alerting numbers (spec \u00a73).", "operationId": "inbox_stats_api_v1_inbox_stats_get", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response Inbox Stats Api V1 Inbox Stats Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/inbox/documents/{document_id}": {"get": {"tags": ["document_inbox"], "summary": "Get Document", "operationId": "get_document_api_v1_inbox_documents__document_id__get", "parameters": [{"name": "document_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Document Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response Get Document Api V1 Inbox Documents  Document Id  Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "patch": {"tags": ["document_inbox"], "summary": "Patch Document", "description": "Reviewer edits. ``extract`` is never mutated; writes go to\n``extraction_override`` (and ``company_id`` routing). Requires the\ncurrent ``version`` \u2014 409 on mismatch. Recomputes NEEDS_REVIEW \u2194\nREADY completeness after the write.", "operationId": "patch_document_api_v1_inbox_documents__document_id__patch", "parameters": [{"name": "document_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Document Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/InboxDocumentPatch"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response Patch Document Api V1 Inbox Documents  Document Id  Patch"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/inbox/documents/{document_id}/download": {"get": {"tags": ["document_inbox"], "summary": "Download Document", "description": "Stream the source blob through the engine (no presigned URLs).", "operationId": "download_document_api_v1_inbox_documents__document_id__download_get", "parameters": [{"name": "document_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Document Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/inbox/supplier-rules": {"get": {"tags": ["document_inbox"], "summary": "List Supplier Rules", "description": "Tenant's supplier rules, newest first; inactive (soft-deleted)\nrules hidden unless requested. No vault gate \u2014 rules are pure DB.", "operationId": "list_supplier_rules_api_v1_inbox_supplier_rules_get", "parameters": [{"name": "include_inactive", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Include Inactive"}}, {"name": "company_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Company Id"}}, {"name": "page", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 1, "default": 1, "title": "Page"}}, {"name": "page_size", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 200, "minimum": 1, "default": 50, "title": "Page Size"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response List Supplier Rules Api V1 Inbox Supplier Rules Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "post": {"tags": ["document_inbox"], "summary": "Create Supplier Rule", "operationId": "create_supplier_rule_api_v1_inbox_supplier_rules_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SupplierRuleCreate"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response Create Supplier Rule Api V1 Inbox Supplier Rules Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/inbox/supplier-rules/{rule_id}": {"patch": {"tags": ["document_inbox"], "summary": "Patch Supplier Rule", "description": "Partial update; ``{\"active\": false}`` is the soft delete,\n``{\"active\": true}`` re-activates (409 if the vendor slot has been\nre-taken by a newer active rule).", "operationId": "patch_supplier_rule_api_v1_inbox_supplier_rules__rule_id__patch", "parameters": [{"name": "rule_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Rule Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SupplierRulePatch"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response Patch Supplier Rule Api V1 Inbox Supplier Rules  Rule Id  Patch"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/inbox/email-addresses": {"get": {"tags": ["document_inbox"], "summary": "List Email Addresses", "operationId": "list_email_addresses_api_v1_inbox_email_addresses_get", "parameters": [{"name": "include_revoked", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Include Revoked"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response List Email Addresses Api V1 Inbox Email Addresses Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "post": {"tags": ["document_inbox"], "summary": "Create Email Address", "description": "Mint a new ingestion address (server-minted token \u2014 the address\nis the credential). Multiple active addresses per tenant, one per\ncompany on a multi-entity tenant.", "operationId": "create_email_address_api_v1_inbox_email_addresses_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/EmailAddressCreate"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response Create Email Address Api V1 Inbox Email Addresses Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/inbox/email-addresses/{address_id}/revoke": {"post": {"tags": ["document_inbox"], "summary": "Revoke Email Address", "description": "Kill a (leaked/retired) address. Idempotent; the row stays as\nthe audit record and the token stops routing on the next poll.", "operationId": "revoke_email_address_api_v1_inbox_email_addresses__address_id__revoke_post", "parameters": [{"name": "address_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Address Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response Revoke Email Address Api V1 Inbox Email Addresses  Address Id  Revoke Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/inbox/email-addresses/ensure": {"post": {"tags": ["document_inbox"], "summary": "Ensure Email Address", "description": "The company's email-in address, minted on first use (b15, gap P2-24).\n\nIdempotent: returns the newest ACTIVE address for ``company_id`` (or the\ntenant-wide one when no company is given) and only mints when there is\nnone, so the inbox screen can always show \"email your receipts to \u2026\"\nwithout anyone finding and pressing a create button. 200 when it\nalready existed, 201 when it was minted now.", "operationId": "ensure_email_address_api_v1_inbox_email_addresses_ensure_post", "parameters": [{"name": "company_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Company Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/inbox/documents/{document_id}/extract": {"post": {"tags": ["document_inbox"], "summary": "Retry Extraction", "description": "Re-run extraction now (resets the sweep attempt counters).\n\nLegal from RECEIVED / NEEDS_REVIEW / READY / FAILED; terminal\ndocuments 409. Extraction is idempotent \u2014 a re-run replaces\n``extract`` wholesale and leaves ``extraction_override`` untouched.", "operationId": "retry_extraction_api_v1_inbox_documents__document_id__extract_post", "parameters": [{"name": "document_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Document Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response Retry Extraction Api V1 Inbox Documents  Document Id  Extract Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/inbox/documents/{document_id}/publish": {"post": {"tags": ["document_inbox"], "summary": "Publish Document", "description": "Publish the reviewed document as a **DRAFT** record.\n\nPhase 2: ``record_kind`` accepts EXPENSE, BILL, CREDIT_NOTE (a credit\nWE give a customer) and, since 0227, SUPPLIER_CREDIT_NOTE (a credit a\nsupplier gives us \u2014 routed to the supplier credit note service)\n(anything else 422). The DRAFT record is created through the same\nservice functions behind ``POST /api/v1/expenses`` / ``/bills`` /\n``/credit-notes`` (``api_create`` in each service) \u2014 never a manual\njournal entry, never auto-posted. The source blob is vault-linked to\nthe new record, supplier-rule learning runs on the confirmed values\n(spec \u00a76), provenance lands in ``change_log``, and the document\nbecomes PUBLISHED (terminal, immutable provenance).", "operationId": "publish_document_api_v1_inbox_documents__document_id__publish_post", "parameters": [{"name": "document_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Document Id"}}, {"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PublishBody"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Publish Document Api V1 Inbox Documents  Document Id  Publish Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/inbox/documents/{document_id}/reject": {"post": {"tags": ["document_inbox"], "summary": "Reject Document", "description": "Reject a reviewable document. The blob is vault soft-deleted\n(``archived_at`` \u2014 never hard-deleted); the row stays as the audit\nrecord and its content hash frees up for a future re-upload (the\ndedupe unique excludes REJECTED).", "operationId": "reject_document_api_v1_inbox_documents__document_id__reject_post", "parameters": [{"name": "document_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Document Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RejectBody"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response Reject Document Api V1 Inbox Documents  Document Id  Reject Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reconciliation/accounts": {"get": {"tags": ["reconciliation"], "summary": "List Reconciliation Accounts", "description": "List bank/cash accounts eligible for reconciliation.\n\nReturns accounts where account_type=ASSET and reconcile=True.", "operationId": "list_reconciliation_accounts_api_v1_reconciliation_accounts_get", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response List Reconciliation Accounts Api V1 Reconciliation Accounts Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reconciliation/unmatched": {"get": {"tags": ["reconciliation"], "summary": "List Unmatched Lines", "description": "List unmatched bank statement lines for an account.\n\nWithout ``limit`` the full unmatched set is returned (legacy shape).\nThe response body stays a bare array either way; ``X-Total-Count``\ncarries the unpaginated total for pagination UIs.", "operationId": "list_unmatched_lines_api_v1_reconciliation_unmatched_get", "parameters": [{"name": "account_id", "in": "query", "required": true, "schema": {"type": "string", "format": "uuid", "description": "Bank account UUID to list unmatched lines for", "title": "Account Id"}, "description": "Bank account UUID to list unmatched lines for"}, {"name": "limit", "in": "query", "required": false, "schema": {"anyOf": [{"type": "integer", "maximum": 500, "minimum": 1}, {"type": "null"}], "title": "Limit"}}, {"name": "offset", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 0, "default": 0, "title": "Offset"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response List Unmatched Lines Api V1 Reconciliation Unmatched Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reconciliation/suggest/{bsl_id}": {"get": {"tags": ["reconciliation"], "summary": "Suggest Matches", "description": "Suggest candidate posted journal entries that could match a BSL.\n\nUses exact-amount matching against the bank account: a deposit (positive)\nlooks for an entry with a debit of that amount to the bank account; a\nwithdrawal (negative) looks for a credit.", "operationId": "suggest_matches_api_v1_reconciliation_suggest__bsl_id__get", "parameters": [{"name": "bsl_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Bsl Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Suggest Matches Api V1 Reconciliation Suggest  Bsl Id  Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reconciliation/match": {"post": {"tags": ["reconciliation"], "summary": "Match Line", "description": "Match a bank statement line to a posted journal entry.\n\nSets the BSL status to MATCHED and records the matched_entry_id.", "operationId": "match_line_api_v1_reconciliation_match_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/MatchRequest"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Match Line Api V1 Reconciliation Match Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reconciliation/unmatch/{bsl_id}": {"post": {"tags": ["reconciliation"], "summary": "Unmatch Line", "description": "Remove a match from a bank statement line, returning it to UNMATCHED.\n\nOptional body ``{\"void_created\": true}`` also voids every record that\nwas CREATED from this line (expense, payment, money received, transfer,\nsplit or rule journal) so matching the line again cannot double-book it\n(P1-22). Refused for a line inside a finished reconciliation. The\nresponse carries ``voided`` \u2014 what was voided, in plain words.", "operationId": "unmatch_line_api_v1_reconciliation_unmatch__bsl_id__post", "parameters": [{"name": "bsl_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Bsl Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"content": {"application/json": {"schema": {"anyOf": [{"$ref": "#/components/schemas/UnmatchRequest"}, {"type": "null"}], "title": "Payload"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Unmatch Line Api V1 Reconciliation Unmatch  Bsl Id  Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reconciliation/auto_match": {"post": {"tags": ["reconciliation"], "summary": "Auto Match", "description": "Run \"honest\" automatic matching for all unmatched BSLs in an account (R8d).\n\nFor each unmatched line, candidates are scored (see\n``services/reconciliation.score_candidate``) and a link is made ONLY\nwhen exactly one candidate scores HIGH confidence \u2014 ambiguous lines\n(2+ HIGH candidates) are skipped and counted, not guessed at. Never\nposts anything \u2014 only links already-POSTED entries (unchanged\ninvariant from before R8).\n\nReturns ``{\"matched\": N, \"skipped_ambiguous\": M, \"skipped_no_candidate\": K}``.", "operationId": "auto_match_api_v1_reconciliation_auto_match_post", "parameters": [{"name": "account_id", "in": "query", "required": true, "schema": {"type": "string", "format": "uuid", "description": "Bank account UUID to auto-match", "title": "Account Id"}, "description": "Bank account UUID to auto-match"}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Auto Match Api V1 Reconciliation Auto Match Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reconciliation/create_and_match": {"post": {"tags": ["reconciliation"], "summary": "Create And Match", "description": "Compound op (R8c): create a record, post it, and match it to a BSL.\n\n``record_type`` selects which record-type engine creates the record \u2014\n``expense`` (a withdrawal only) or ``payment`` (either direction).\nThe record's account/amount/direction are always derived from the bank\nstatement line itself, never accepted from the caller, so the created\nrecord and the resulting match can never disagree.\n\nSee ``services/reconciliation.create_and_match`` for exactly what is\nand isn't atomic across the create \u2192 post \u2192 match pipeline.", "operationId": "create_and_match_api_v1_reconciliation_create_and_match_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreateAndMatchRequest"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Create And Match Api V1 Reconciliation Create And Match Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reconciliation/lines": {"get": {"tags": ["reconciliation"], "summary": "List Lines With Details", "description": "Bank lines for one account and tab, each with what it is matched to\n(label, contact, amount), its ignore reason, lock state and rule\nsuggestion (P1-17). ``X-Total-Count`` carries the unpaginated total.", "operationId": "list_lines_with_details_api_v1_reconciliation_lines_get", "parameters": [{"name": "account_id", "in": "query", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Account Id"}}, {"name": "status", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "UNMATCHED, PARTIAL, MATCHED, IGNORED, or TO_MATCH (unmatched + partial)", "title": "Status"}, "description": "UNMATCHED, PARTIAL, MATCHED, IGNORED, or TO_MATCH (unmatched + partial)"}, {"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 500, "minimum": 1, "default": 50, "title": "Limit"}}, {"name": "offset", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 0, "default": 0, "title": "Offset"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response List Lines With Details Api V1 Reconciliation Lines Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reconciliation/line_detail/{bsl_id}": {"get": {"tags": ["reconciliation"], "summary": "Line Detail", "description": "One bank line with what it is matched to and what is left.", "operationId": "line_detail_api_v1_reconciliation_line_detail__bsl_id__get", "parameters": [{"name": "bsl_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Bsl Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Line Detail Api V1 Reconciliation Line Detail  Bsl Id  Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reconciliation/candidates/{bsl_id}": {"get": {"tags": ["reconciliation"], "summary": "Search Match Candidates", "description": "The match picker: payments, expenses, money received, transfers and\njournals on this bank account that are not yet cleared, searchable by\ntext, date and amount (P1-17).", "operationId": "search_match_candidates_api_v1_reconciliation_candidates__bsl_id__get", "parameters": [{"name": "bsl_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Bsl Id"}}, {"name": "q", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "maxLength": 200}, {"type": "null"}], "title": "Q"}}, {"name": "date_from", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Date From"}}, {"name": "date_to", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Date To"}}, {"name": "amount", "in": "query", "required": false, "schema": {"anyOf": [{"type": "number", "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Amount"}}, {"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 200, "minimum": 1, "default": 50, "title": "Limit"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Search Match Candidates Api V1 Reconciliation Candidates  Bsl Id  Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reconciliation/match_many": {"post": {"tags": ["reconciliation"], "summary": "Match Many", "description": "Match one bank line to one or several existing records (a customer\npaying three invoices in one transfer). All or nothing.", "operationId": "match_many_api_v1_reconciliation_match_many_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/MatchManyRequest"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Match Many Api V1 Reconciliation Match Many Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reconciliation/split_create": {"post": {"tags": ["reconciliation"], "summary": "Split Create", "description": "Split one bank line across several new records (P0-16).", "operationId": "split_create_api_v1_reconciliation_split_create_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SplitCreateRequest"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Split Create Api V1 Reconciliation Split Create Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reconciliation/ignore/{bsl_id}": {"post": {"tags": ["reconciliation"], "summary": "Ignore Line", "description": "Set a bank line aside: a duplicate import or a line not on the real\nstatement (P1-17). It stays listed on the Ignored tab and on the\nreconciliation report.", "operationId": "ignore_line_api_v1_reconciliation_ignore__bsl_id__post", "parameters": [{"name": "bsl_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Bsl Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"content": {"application/json": {"schema": {"anyOf": [{"$ref": "#/components/schemas/IgnoreRequest"}, {"type": "null"}], "title": "Payload"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Ignore Line Api V1 Reconciliation Ignore  Bsl Id  Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reconciliation/unignore/{bsl_id}": {"post": {"tags": ["reconciliation"], "summary": "Unignore Line", "description": "Put an ignored bank line back to be matched.", "operationId": "unignore_line_api_v1_reconciliation_unignore__bsl_id__post", "parameters": [{"name": "bsl_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Bsl Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Unignore Line Api V1 Reconciliation Unignore  Bsl Id  Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reconciliation/unmatch_preview/{bsl_id}": {"get": {"tags": ["reconciliation"], "summary": "Unmatch Preview", "description": "What unmatching would touch: the records created from this line (the\nones ``void_created`` would void) and whether the line is locked.", "operationId": "unmatch_preview_api_v1_reconciliation_unmatch_preview__bsl_id__get", "parameters": [{"name": "bsl_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Bsl Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Unmatch Preview Api V1 Reconciliation Unmatch Preview  Bsl Id  Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reconciliation/accept_rule/{bsl_id}": {"post": {"tags": ["reconciliation"], "summary": "Accept Rule Suggestion", "description": "Accept the bank rule suggested for this line on import (P1-18).", "operationId": "accept_rule_suggestion_api_v1_reconciliation_accept_rule__bsl_id__post", "parameters": [{"name": "bsl_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Bsl Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Accept Rule Suggestion Api V1 Reconciliation Accept Rule  Bsl Id  Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reconciliation/transfer_counterpart/{bsl_id}": {"get": {"tags": ["reconciliation"], "summary": "Transfer Counterpart", "description": "The other account's unmatched bank line for this transfer, if there\nis exactly one (same amount the other way, within a few days).", "operationId": "transfer_counterpart_api_v1_reconciliation_transfer_counterpart__bsl_id__get", "parameters": [{"name": "bsl_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Bsl Id"}}, {"name": "other_account_id", "in": "query", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Other Account Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Transfer Counterpart Api V1 Reconciliation Transfer Counterpart  Bsl Id  Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reconciliation/statements": {"get": {"tags": ["reconciliation"], "summary": "List Statements", "description": "Reconciliation history for an account, newest first.", "operationId": "list_statements_api_v1_reconciliation_statements_get", "parameters": [{"name": "account_id", "in": "query", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Account Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response List Statements Api V1 Reconciliation Statements Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "post": {"tags": ["reconciliation"], "summary": "Start Statement", "description": "Start the reconciliation for a statement (or update the one in\nprogress) with the statement date and closing balance.", "operationId": "start_statement_api_v1_reconciliation_statements_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/StatementStartRequest"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Start Statement Api V1 Reconciliation Statements Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reconciliation/preview": {"get": {"tags": ["reconciliation"], "summary": "Preview Statement", "description": "Live difference for a statement date and balance, saving nothing \u2014\nfor the \"difference\" figure that updates as the user types.", "operationId": "preview_statement_api_v1_reconciliation_preview_get", "parameters": [{"name": "account_id", "in": "query", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Account Id"}}, {"name": "statement_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "Statement Date"}}, {"name": "statement_balance", "in": "query", "required": true, "schema": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "description": "As printed on the statement", "title": "Statement Balance"}, "description": "As printed on the statement"}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Preview Statement Api V1 Reconciliation Preview Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reconciliation/statements/{rec_id}": {"get": {"tags": ["reconciliation"], "summary": "Get Statement Report", "description": "The reconciliation report \u2014 frozen once finished, live while open.", "operationId": "get_statement_report_api_v1_reconciliation_statements__rec_id__get", "parameters": [{"name": "rec_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Rec Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Get Statement Report Api V1 Reconciliation Statements  Rec Id  Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "delete": {"tags": ["reconciliation"], "summary": "Cancel Statement", "description": "Throw away a reconciliation that is still in progress.", "operationId": "cancel_statement_api_v1_reconciliation_statements__rec_id__delete", "parameters": [{"name": "rec_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Rec Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Cancel Statement Api V1 Reconciliation Statements  Rec Id  Delete"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reconciliation/statements/{rec_id}/report.csv": {"get": {"tags": ["reconciliation"], "summary": "Statement Report Csv", "description": "The reconciliation report as a spreadsheet file for the accountant.", "operationId": "statement_report_csv_api_v1_reconciliation_statements__rec_id__report_csv_get", "parameters": [{"name": "rec_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Rec Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Statement Report Csv Api V1 Reconciliation Statements  Rec Id  Report Csv Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reconciliation/statements/{rec_id}/finish": {"post": {"tags": ["reconciliation"], "summary": "Finish Statement", "description": "Finish: refuses unless the difference is nil and every bank line up\nto the statement date is matched or set aside; then freezes the report\nand locks the lines.", "operationId": "finish_statement_api_v1_reconciliation_statements__rec_id__finish_post", "parameters": [{"name": "rec_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Rec Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Finish Statement Api V1 Reconciliation Statements  Rec Id  Finish Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reconciliation/statements/{rec_id}/reopen": {"post": {"tags": ["reconciliation"], "summary": "Reopen Statement", "description": "Reopen the latest finished reconciliation (unlocks its lines).", "operationId": "reopen_statement_api_v1_reconciliation_statements__rec_id__reopen_post", "parameters": [{"name": "rec_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Rec Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ReopenRequest"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Reopen Statement Api V1 Reconciliation Statements  Rec Id  Reopen Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/recurring_invoices": {"get": {"tags": ["recurring_invoices"], "summary": "List Recurring Invoices", "operationId": "list_recurring_invoices_api_v1_recurring_invoices_get", "parameters": [{"name": "page", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 1, "default": 1, "title": "Page"}}, {"name": "page_size", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 500, "minimum": 1, "default": 50, "title": "Page Size"}}, {"name": "status", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Status"}}, {"name": "contact_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Contact Id"}}, {"name": "frequency", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Frequency"}}, {"name": "archived", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Archived"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RecurringInvoiceListOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "post": {"tags": ["recurring_invoices"], "summary": "Create Recurring Invoice", "operationId": "create_recurring_invoice_api_v1_recurring_invoices_post", "parameters": [{"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RecurringInvoiceCreate"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RecurringInvoiceOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/recurring_invoices/{ri_id}": {"get": {"tags": ["recurring_invoices"], "summary": "Get Recurring Invoice", "operationId": "get_recurring_invoice_api_v1_recurring_invoices__ri_id__get", "parameters": [{"name": "ri_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Ri Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RecurringInvoiceOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "patch": {"tags": ["recurring_invoices"], "summary": "Update Recurring Invoice", "operationId": "update_recurring_invoice_api_v1_recurring_invoices__ri_id__patch", "parameters": [{"name": "ri_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Ri Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RecurringInvoiceUpdate"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Update Recurring Invoice Api V1 Recurring Invoices  Ri Id  Patch", "$ref": "#/components/schemas/RecurringInvoiceOut"}}}}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RecurringInvoiceConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "delete": {"tags": ["recurring_invoices"], "summary": "Delete Recurring Invoice", "operationId": "delete_recurring_invoice_api_v1_recurring_invoices__ri_id__delete", "parameters": [{"name": "ri_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Ri Id"}}, {"name": "hard", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Hard"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Admin", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Admin"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Delete Recurring Invoice Api V1 Recurring Invoices  Ri Id  Delete"}}}}, "204": {"description": "Archived"}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RecurringInvoiceConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/recurring_invoices/{ri_id}/pause": {"post": {"tags": ["recurring_invoices"], "summary": "Pause Recurring Invoice", "description": "Transition ACTIVE \u2192 PAUSED.", "operationId": "pause_recurring_invoice_api_v1_recurring_invoices__ri_id__pause_post", "parameters": [{"name": "ri_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Ri Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Pause Recurring Invoice Api V1 Recurring Invoices  Ri Id  Pause Post", "$ref": "#/components/schemas/RecurringInvoiceOut"}}}}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RecurringInvoiceConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/recurring_invoices/{ri_id}/resume": {"post": {"tags": ["recurring_invoices"], "summary": "Resume Recurring Invoice", "description": "Transition PAUSED \u2192 ACTIVE.", "operationId": "resume_recurring_invoice_api_v1_recurring_invoices__ri_id__resume_post", "parameters": [{"name": "ri_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Ri Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Resume Recurring Invoice Api V1 Recurring Invoices  Ri Id  Resume Post", "$ref": "#/components/schemas/RecurringInvoiceOut"}}}}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RecurringInvoiceConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/recurring_invoices/{ri_id}/end": {"post": {"tags": ["recurring_invoices"], "summary": "End Recurring Invoice", "description": "Transition any non-ENDED status \u2192 ENDED (terminal).", "operationId": "end_recurring_invoice_api_v1_recurring_invoices__ri_id__end_post", "parameters": [{"name": "ri_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Ri Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response End Recurring Invoice Api V1 Recurring Invoices  Ri Id  End Post", "$ref": "#/components/schemas/RecurringInvoiceOut"}}}}, "409": {"description": "Version mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RecurringInvoiceConflictBody"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/recurring_invoices/{ri_id}/generate": {"post": {"tags": ["recurring_invoices"], "summary": "Generate Invoice", "description": "Manually materialise one invoice from an ACTIVE recurring template.\n\nRequires ``If-Match: <version>`` for optimistic locking \u2014 if the\ntemplate has been modified since the client last fetched it, 409 is\nreturned. Provide ``X-Idempotency-Key`` to make the call retry-safe.\n\nOnly ACTIVE templates may be triggered. PAUSED, ENDED, or archived\ntemplates return 422. Generation uses the template's ``next_run`` as\nthe issue date so the cadence advances correctly.", "operationId": "generate_invoice_api_v1_recurring_invoices__ri_id__generate_post", "parameters": [{"name": "ri_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Ri Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RecurringInvoiceGenerateResponse"}}}}, "409": {"description": "Version mismatch (stale If-Match)"}, "422": {"description": "Template not ACTIVE or generation error"}}}}, "/api/v1/recurring_bills": {"get": {"tags": ["recurring_bills"], "summary": "List Recurring Bills", "operationId": "list_recurring_bills_api_v1_recurring_bills_get", "parameters": [{"name": "page", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 1, "default": 1, "title": "Page"}}, {"name": "page_size", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 500, "minimum": 1, "default": 50, "title": "Page Size"}}, {"name": "status", "in": "query", "required": false, "schema": {"anyOf": [{"$ref": "#/components/schemas/RecurrenceStatus"}, {"type": "null"}], "title": "Status"}}, {"name": "contact_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Contact Id"}}, {"name": "archived", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Archived"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response List Recurring Bills Api V1 Recurring Bills Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "post": {"tags": ["recurring_bills"], "summary": "Create Recurring Bill", "operationId": "create_recurring_bill_api_v1_recurring_bills_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RecurringBillCreate"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/recurring_bills/{rb_id}": {"get": {"tags": ["recurring_bills"], "summary": "Get Recurring Bill", "operationId": "get_recurring_bill_api_v1_recurring_bills__rb_id__get", "parameters": [{"name": "rb_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Rb Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response Get Recurring Bill Api V1 Recurring Bills  Rb Id  Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "patch": {"tags": ["recurring_bills"], "summary": "Update Recurring Bill", "operationId": "update_recurring_bill_api_v1_recurring_bills__rb_id__patch", "parameters": [{"name": "rb_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Rb Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RecurringBillUpdate"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Update Recurring Bill Api V1 Recurring Bills  Rb Id  Patch"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "delete": {"tags": ["recurring_bills"], "summary": "Archive Recurring Bill", "operationId": "archive_recurring_bill_api_v1_recurring_bills__rb_id__delete", "parameters": [{"name": "rb_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Rb Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Archive Recurring Bill Api V1 Recurring Bills  Rb Id  Delete"}}}}, "204": {"description": "Archived"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/recurring_bills/{rb_id}/pause": {"post": {"tags": ["recurring_bills"], "summary": "Pause Recurring Bill", "operationId": "pause_recurring_bill_api_v1_recurring_bills__rb_id__pause_post", "parameters": [{"name": "rb_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Rb Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Pause Recurring Bill Api V1 Recurring Bills  Rb Id  Pause Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/recurring_bills/{rb_id}/resume": {"post": {"tags": ["recurring_bills"], "summary": "Resume Recurring Bill", "operationId": "resume_recurring_bill_api_v1_recurring_bills__rb_id__resume_post", "parameters": [{"name": "rb_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Rb Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Resume Recurring Bill Api V1 Recurring Bills  Rb Id  Resume Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/recurring_bills/{rb_id}/end": {"post": {"tags": ["recurring_bills"], "summary": "End Recurring Bill", "operationId": "end_recurring_bill_api_v1_recurring_bills__rb_id__end_post", "parameters": [{"name": "rb_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Rb Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response End Recurring Bill Api V1 Recurring Bills  Rb Id  End Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/recurring_bills/{rb_id}/generate": {"post": {"tags": ["recurring_bills"], "summary": "Generate Bill", "description": "Make the next bill now (dated the template's next run date).", "operationId": "generate_bill_api_v1_recurring_bills__rb_id__generate_post", "parameters": [{"name": "rb_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Rb Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/collections/settings": {"get": {"tags": ["collections"], "summary": "Get Settings", "operationId": "get_settings_api_v1_collections_settings_get", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response Get Settings Api V1 Collections Settings Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "put": {"tags": ["collections"], "summary": "Put Settings", "operationId": "put_settings_api_v1_collections_settings_put", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CollectionSettingsIn"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response Put Settings Api V1 Collections Settings Put"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/collections/status": {"get": {"tags": ["collections"], "summary": "Get Status", "operationId": "get_status_api_v1_collections_status_get", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response Get Status Api V1 Collections Status Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/collections/run": {"post": {"tags": ["collections"], "summary": "Run Now", "description": "Run today's recurring and reminder jobs for this company now.\n\nSame code as the daily scheduler and just as repeatable: anything\nalready done today is not done again.", "operationId": "run_now_api_v1_collections_run_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response Run Now Api V1 Collections Run Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/collections/reminders": {"get": {"tags": ["collections"], "summary": "List Reminders", "operationId": "list_reminders_api_v1_collections_reminders_get", "parameters": [{"name": "invoice_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Invoice Id"}}, {"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 500, "minimum": 1, "default": 100, "title": "Limit"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response List Reminders Api V1 Collections Reminders Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/collections/statement-candidates": {"get": {"tags": ["collections"], "summary": "Statement Candidates", "description": "Customers with money owing as at ``as_of`` (default today).\n\nUses the aged receivables read (``reports.aged_ar``), the same figure\nthe aged report shows \u2014 batch 2 makes that the single balance read per\ncontact; this route follows it automatically.", "operationId": "statement_candidates_api_v1_collections_statement_candidates_get", "parameters": [{"name": "as_of", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "As Of"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response Statement Candidates Api V1 Collections Statement Candidates Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/collections/statements/send-bulk": {"post": {"tags": ["collections"], "summary": "Send Bulk Statements", "description": "Email a statement to each chosen customer (default: everyone with a\nbalance at ``period_to``). One failure never stops the rest.", "operationId": "send_bulk_statements_api_v1_collections_statements_send_bulk_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BulkStatementIn"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response Send Bulk Statements Api V1 Collections Statements Send Bulk Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/pay/{token}": {"get": {"tags": ["pay"], "summary": "Pay Summary", "operationId": "pay_summary_api_v1_pay__token__get", "parameters": [{"name": "token", "in": "path", "required": true, "schema": {"type": "string", "title": "Token"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response Pay Summary Api V1 Pay  Token  Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/pay/{token}/checkout": {"post": {"tags": ["pay"], "summary": "Pay Checkout", "operationId": "pay_checkout_api_v1_pay__token__checkout_post", "parameters": [{"name": "token", "in": "path", "required": true, "schema": {"type": "string", "title": "Token"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reports/aged_receivables": {"get": {"tags": ["reports"], "summary": "Aged Receivables", "description": "Aged receivables as at ``as_of_date`` (default today).\n\nReturns open POSTED invoices grouped by contact, bucketed by\ndays overdue.  Outstanding balance = ``total - amount_paid``.\n\nOpen AR status: ``InvoiceStatus.POSTED`` \u2014 the only status that has\na GL impact and an unpaid balance.  DRAFT invoices are uncommitted;\nVOIDED invoices have no balance.", "operationId": "aged_receivables_api_v1_reports_aged_receivables_get", "parameters": [{"name": "as_of_date", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "As Of Date"}}, {"name": "bucket_days", "in": "query", "required": false, "schema": {"type": "array", "items": {"type": "integer"}, "default": [0, 30, 60, 90], "title": "Bucket Days"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AgedReport"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reports/aged_payables": {"get": {"tags": ["reports"], "summary": "Aged Payables", "description": "Aged payables as at ``as_of_date`` (default today).\n\nReturns open POSTED bills grouped by contact (supplier), bucketed by\ndays overdue.  Outstanding balance = ``total - amount_paid``.\n\nOpen AP status: ``BillStatus.POSTED`` \u2014 the only status that has a\nGL impact and an unpaid balance.", "operationId": "aged_payables_api_v1_reports_aged_payables_get", "parameters": [{"name": "as_of_date", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "As Of Date"}}, {"name": "bucket_days", "in": "query", "required": false, "schema": {"type": "array", "items": {"type": "integer"}, "default": [0, 30, 60, 90], "title": "Bucket Days"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AgedReport"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reports/aged_receivables.csv": {"get": {"tags": ["reports"], "summary": "Aged Receivables Csv", "description": "Aged receivables as at ``as_of_date`` (default today), CSV export.\n\nOne row per open invoice; see ``reports_svc.aged_ar_csv`` for columns.\nBucketing is FIXED (Current / 1-30 / 31-60 / 61-90 / 90+ days) -- unlike\nthe JSON ``/aged_receivables`` route, this endpoint has no\n``bucket_days`` override.", "operationId": "aged_receivables_csv_api_v1_reports_aged_receivables_csv_get", "parameters": [{"name": "as_of_date", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "As Of Date"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reports/aged_payables.csv": {"get": {"tags": ["reports"], "summary": "Aged Payables Csv", "description": "Aged payables as at ``as_of_date`` (default today), CSV export.\n\nOne row per open bill; see ``reports_svc.aged_ap_csv`` for columns.\nBucketing is FIXED (Current / 1-30 / 31-60 / 61-90 / 90+ days) -- unlike\nthe JSON ``/aged_payables`` route, this endpoint has no ``bucket_days``\noverride.", "operationId": "aged_payables_csv_api_v1_reports_aged_payables_csv_get", "parameters": [{"name": "as_of_date", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "As Of Date"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reports/profit_loss": {"get": {"tags": ["reports"], "summary": "Profit Loss", "description": "Profit & Loss for a date range. See ``_assemble_profit_loss``.", "operationId": "profit_loss_api_v1_reports_profit_loss_get", "parameters": [{"name": "from_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "From Date"}}, {"name": "to_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "To Date"}}, {"name": "include_draft", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Include Draft"}}, {"name": "compare", "in": "query", "required": false, "schema": {"anyOf": [{"enum": ["previous_period", "previous_year"], "type": "string"}, {"type": "null"}], "description": "Opt-in comparative period (R7). 'previous_period' = the immediately-preceding period of equal length; 'previous_year' = the same date range shifted back one year. Omitted (default) leaves the response shape unchanged.", "title": "Compare"}, "description": "Opt-in comparative period (R7). 'previous_period' = the immediately-preceding period of equal length; 'previous_year' = the same date range shifted back one year. Omitted (default) leaves the response shape unchanged."}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PnLReport"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reports/profit_loss.csv": {"get": {"tags": ["reports"], "summary": "Profit Loss Csv", "description": "Profit & Loss for a date range, CSV export. See ``_profit_loss_csv``.", "operationId": "profit_loss_csv_api_v1_reports_profit_loss_csv_get", "parameters": [{"name": "from_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "From Date"}}, {"name": "to_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "To Date"}}, {"name": "include_draft", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Include Draft"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reports/balance_sheet": {"get": {"tags": ["reports"], "summary": "Balance Sheet", "description": "Balance sheet as at ``as_of_date``. See ``_assemble_balance_sheet``.", "operationId": "balance_sheet_api_v1_reports_balance_sheet_get", "parameters": [{"name": "as_of_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "As Of Date"}}, {"name": "compare", "in": "query", "required": false, "schema": {"anyOf": [{"enum": ["previous_period", "previous_year"], "type": "string"}, {"type": "null"}], "description": "Opt-in comparative as-at date (R7). 'previous_year' = as_of_date shifted back one year; 'previous_period' = the prior financial-year close. Omitted (default) leaves the response shape unchanged.", "title": "Compare"}, "description": "Opt-in comparative as-at date (R7). 'previous_year' = as_of_date shifted back one year; 'previous_period' = the prior financial-year close. Omitted (default) leaves the response shape unchanged."}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BSReport"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reports/balance_sheet.csv": {"get": {"tags": ["reports"], "summary": "Balance Sheet Csv", "description": "Balance sheet as at ``as_of_date``, CSV export. See ``_balance_sheet_csv``.", "operationId": "balance_sheet_csv_api_v1_reports_balance_sheet_csv_get", "parameters": [{"name": "as_of_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "As Of Date"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reports/bas_summary": {"get": {"tags": ["reports"], "summary": "Bas Summary", "description": "Australian BAS for a date range \u2014 see ``bas_service.compute_bas``.", "operationId": "bas_summary_api_v1_reports_bas_summary_get", "parameters": [{"name": "from_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "From Date"}}, {"name": "to_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "To Date"}}, {"name": "registration_effective_date", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "description": "Override the GST registration date. Omitted: the company's own gst_effective_date is used (only when it falls inside the period).", "title": "Registration Effective Date"}, "description": "Override the GST registration date. Omitted: the company's own gst_effective_date is used (only when it falls inside the period)."}, {"name": "basis", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "pattern": "^(accrual|cash)$"}, {"type": "null"}], "description": "accrual or cash. Omitted: the company's GST accounting basis.", "title": "Basis"}, "description": "accrual or cash. Omitted: the company's GST accounting basis."}, {"name": "payg_instalment", "in": "query", "required": false, "schema": {"anyOf": [{"type": "number", "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "description": "PAYG instalment (T7 / 5A) from the ATO notice, if any.", "default": "0", "title": "Payg Instalment"}, "description": "PAYG instalment (T7 / 5A) from the ATO notice, if any."}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BASSummary"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reports/cashflow": {"get": {"tags": ["reports"], "summary": "Cashflow", "description": "Indirect-method cash flow statement for a date range (P0-22).\n\nCash is the company's bank and cash accounts; every other balance-sheet\nmovement is classified into operating (working capital and non-cash\nadjustments), investing or financing. See\n``saebooks.services.cashflow_statement`` for the rules.", "operationId": "cashflow_api_v1_reports_cashflow_get", "parameters": [{"name": "from_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "From Date"}}, {"name": "to_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "To Date"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CashflowStatement"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reports/cashflow_forecast": {"get": {"tags": ["reports"], "summary": "Cashflow Forecast", "description": "Project cash in/out over the next ``horizon_days`` days from ``as_of``.\n\nThin wrapper around ``reports_svc.cashflow_forecast`` \u2014 see that\nfunction's docstring for the three projection sources (open invoices,\nopen bills, active recurring-invoice templates) and the opening-balance\ncomputation. Decimal fields are converted to float, matching how the\nsibling report routes (P&L, balance sheet, trial balance) serialize.", "operationId": "cashflow_forecast_api_v1_reports_cashflow_forecast_get", "parameters": [{"name": "horizon_days", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 365, "minimum": 7, "default": 90, "title": "Horizon Days"}}, {"name": "as_of", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "As Of"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CashflowForecastReport"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reports/depreciation_schedule": {"get": {"tags": ["reports"], "summary": "Depreciation Schedule", "description": "Depreciation schedule for all active (non-disposed, non-archived) assets.\n\n``as_of_date`` defaults to today.  ``method`` optionally filters to a\nspecific depreciation method; accepted values are ``STRAIGHT_LINE``,\n``DECLINING_BALANCE``, ``linear``, or ``diminishing_value``.\n\nFor each asset the report computes:\n\n* ``accumulated_depreciation`` \u2014 total depreciation from in_service_date\n  to ``as_of_date`` via the same math used for GL posting.\n* ``current_book_value`` \u2014 ``cost - accumulated_depreciation``.\n* ``next_month_depreciation`` \u2014 one month's charge at the current\n  book value; zero when ``fully_depreciated``.", "operationId": "depreciation_schedule_api_v1_reports_depreciation_schedule_get", "parameters": [{"name": "as_of_date", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "As Of Date"}}, {"name": "method", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Method"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/DepreciationSchedule"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reports/fx_revaluation": {"get": {"tags": ["reports"], "summary": "Fx Revaluation", "description": "FX revaluation report as at ``as_of_date``.\n\nReturns all POSTED invoices and bills whose document currency differs\nfrom the company currency (``base_currency`` overrides it), showing the\noutstanding foreign balance, its value at the booked rate, its value at\nthe rate for ``as_of_date`` (company rate, else the Reserve Bank of\nAustralia rate) and the unrealised gain or loss. Batch 10 (P1-51):\nbefore this the company-currency columns were always empty.\n\nOnly POSTED documents are included (DRAFT uncommitted; VOIDED reversed).\nDocuments with zero outstanding balance (fully paid) are included so\nthe operator can confirm no residual exposure.", "operationId": "fx_revaluation_api_v1_reports_fx_revaluation_get", "parameters": [{"name": "as_of_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "As Of Date"}}, {"name": "base_currency", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Base Currency"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/FXRevaluationReport"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reports/trial_balance": {"get": {"tags": ["reports"], "summary": "Trial Balance", "description": "Trial balance as at ``as_of_date`` (default today). See ``_assemble_trial_balance``.", "operationId": "trial_balance_api_v1_reports_trial_balance_get", "parameters": [{"name": "as_of_date", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "As Of Date"}}, {"name": "include_zero_balance", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Include Zero Balance"}}, {"name": "compare", "in": "query", "required": false, "schema": {"anyOf": [{"enum": ["previous_period", "previous_year"], "type": "string"}, {"type": "null"}], "description": "Opt-in comparative as-at date (R7). 'previous_year' = as_of_date shifted back one year; 'previous_period' = the prior financial-year close. Omitted (default) leaves the response shape unchanged.", "title": "Compare"}, "description": "Opt-in comparative as-at date (R7). 'previous_year' = as_of_date shifted back one year; 'previous_period' = the prior financial-year close. Omitted (default) leaves the response shape unchanged."}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TrialBalanceReport"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reports/trial_balance.csv": {"get": {"tags": ["reports"], "summary": "Trial Balance Csv", "description": "Trial balance as at ``as_of_date``, CSV export. See ``_trial_balance_csv``.", "operationId": "trial_balance_csv_api_v1_reports_trial_balance_csv_get", "parameters": [{"name": "as_of_date", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "As Of Date"}}, {"name": "include_zero_balance", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Include Zero Balance"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reports/budget_vs_actual": {"get": {"tags": ["reports"], "summary": "Budget Vs Actual", "description": "Budget vs actual for a year (or a single month within that year).\n\nWhen ``month`` is omitted the full year is aggregated (budget and\nactual are summed across all 12 months).  When ``month`` is supplied\nonly that calendar month is compared.\n\nAccounts that have a budget row or GL activity for the period are\nincluded (outer join logic).  Variance = actual - budget.\n``variance_pct`` is null when the budget is zero.", "operationId": "budget_vs_actual_api_v1_reports_budget_vs_actual_get", "parameters": [{"name": "year", "in": "query", "required": true, "schema": {"type": "integer", "title": "Year"}}, {"name": "month", "in": "query", "required": false, "schema": {"anyOf": [{"type": "integer"}, {"type": "null"}], "title": "Month"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BudgetVsActualReport"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reports/pl_by_segment": {"get": {"tags": ["reports"], "summary": "Pl By Segment", "description": "P&L by segment for a date range.\n\nSupported ``segment_type`` values: ``project``, ``department``,\n``cost_centre``.  JournalLine is grouped by the matching dimension\ncolumn; lines with no tag appear under the \"Unassigned\" segment.\n\nReturns HTTP 422 if an unsupported segment_type is requested.", "operationId": "pl_by_segment_api_v1_reports_pl_by_segment_get", "parameters": [{"name": "from_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "From Date"}}, {"name": "to_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "To Date"}}, {"name": "segment_type", "in": "query", "required": false, "schema": {"type": "string", "default": "project", "title": "Segment Type"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PLBySegmentReport"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reports/revenue_by_customer": {"get": {"tags": ["reports"], "summary": "Revenue By Customer", "description": "Revenue (ex-GST) broken down by customer for a date range.\n\nUses POSTED invoices (issue_date within the window).  Returns rows\nsorted by revenue descending plus a concentration_warning flag that\nfires when the top customer accounts for >= 80 % of total revenue\n(the ATO 80/20 PSI rule threshold).", "operationId": "revenue_by_customer_api_v1_reports_revenue_by_customer_get", "parameters": [{"name": "from_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "From Date"}}, {"name": "to_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "To Date"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RevenueByCustomerReport"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reports/ytd_turnover": {"get": {"tags": ["reports"], "summary": "Ytd Turnover", "description": "YTD gross turnover for the current Australian financial year.\n\nSums all INCOME and OTHER_INCOME journal credits (net of debits) for\nPOSTED journal entries whose entry_date falls within the current\nAustralian FY (1 July - 30 June).  Used by the dashboard to display\nthe $75k GST registration threshold banner.\n\nIncome accounts are credit-normal, so turnover = credit - debit for\neach matching journal line.  The result is always >= 0 (net credits\ncannot go negative for normal business income).\n\nThe ``threshold_crossed`` / ``threshold_approaching`` flags only fire\nwhen the company is **not** already GST-registered. The 21-day-to-\nregister obligation in the ATO rules only applies to businesses that\nhave crossed the threshold without yet being registered; an already-\nregistered business showing $75k+ in revenue is the normal case and\nmust not be nagged. Suppressing both flags here is the correct fix \u2014\nthe flags drive the dashboard banners and the profit-and-loss\nthreshold callout, none of which are relevant to a registered entity.", "operationId": "ytd_turnover_api_v1_reports_ytd_turnover_get", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/YTDTurnoverReport"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reports/profit_loss.xlsx": {"get": {"tags": ["reports"], "summary": "Profit Loss Xlsx", "description": "Profit & Loss for a date range, XLSX export (same columns as .csv).", "operationId": "profit_loss_xlsx_api_v1_reports_profit_loss_xlsx_get", "parameters": [{"name": "from_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "From Date"}}, {"name": "to_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "To Date"}}, {"name": "include_draft", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Include Draft"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reports/balance_sheet.xlsx": {"get": {"tags": ["reports"], "summary": "Balance Sheet Xlsx", "description": "Balance sheet as at ``as_of_date``, XLSX export (same columns as .csv).", "operationId": "balance_sheet_xlsx_api_v1_reports_balance_sheet_xlsx_get", "parameters": [{"name": "as_of_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "As Of Date"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reports/trial_balance.xlsx": {"get": {"tags": ["reports"], "summary": "Trial Balance Xlsx", "description": "Trial balance as at ``as_of_date``, XLSX export (same columns as .csv).", "operationId": "trial_balance_xlsx_api_v1_reports_trial_balance_xlsx_get", "parameters": [{"name": "as_of_date", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "As Of Date"}}, {"name": "include_zero_balance", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Include Zero Balance"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reports/aged_receivables.xlsx": {"get": {"tags": ["reports"], "summary": "Aged Receivables Xlsx", "description": "Aged receivables as at ``as_of_date``, XLSX export (same columns as .csv).", "operationId": "aged_receivables_xlsx_api_v1_reports_aged_receivables_xlsx_get", "parameters": [{"name": "as_of_date", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "As Of Date"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reports/aged_payables.xlsx": {"get": {"tags": ["reports"], "summary": "Aged Payables Xlsx", "description": "Aged payables as at ``as_of_date``, XLSX export (same columns as .csv).", "operationId": "aged_payables_xlsx_api_v1_reports_aged_payables_xlsx_get", "parameters": [{"name": "as_of_date", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "As Of Date"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reports/cashflow.csv": {"get": {"tags": ["reports"], "summary": "Cashflow Csv", "description": "Indirect-method cashflow statement for a date range, CSV export.", "operationId": "cashflow_csv_api_v1_reports_cashflow_csv_get", "parameters": [{"name": "from_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "From Date"}}, {"name": "to_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "To Date"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reports/cashflow.xlsx": {"get": {"tags": ["reports"], "summary": "Cashflow Xlsx", "description": "Indirect-method cashflow statement for a date range, XLSX export.", "operationId": "cashflow_xlsx_api_v1_reports_cashflow_xlsx_get", "parameters": [{"name": "from_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "From Date"}}, {"name": "to_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "To Date"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reports/pl_by_segment.csv": {"get": {"tags": ["reports"], "summary": "Pl By Segment Csv", "description": "P&L by segment for a date range, CSV export.", "operationId": "pl_by_segment_csv_api_v1_reports_pl_by_segment_csv_get", "parameters": [{"name": "from_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "From Date"}}, {"name": "to_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "To Date"}}, {"name": "segment_type", "in": "query", "required": false, "schema": {"type": "string", "default": "project", "title": "Segment Type"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reports/pl_by_segment.xlsx": {"get": {"tags": ["reports"], "summary": "Pl By Segment Xlsx", "description": "P&L by segment for a date range, XLSX export.", "operationId": "pl_by_segment_xlsx_api_v1_reports_pl_by_segment_xlsx_get", "parameters": [{"name": "from_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "From Date"}}, {"name": "to_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "To Date"}}, {"name": "segment_type", "in": "query", "required": false, "schema": {"type": "string", "default": "project", "title": "Segment Type"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reports/revenue_by_customer.csv": {"get": {"tags": ["reports"], "summary": "Revenue By Customer Csv", "description": "Revenue by customer for a date range, CSV export.", "operationId": "revenue_by_customer_csv_api_v1_reports_revenue_by_customer_csv_get", "parameters": [{"name": "from_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "From Date"}}, {"name": "to_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "To Date"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reports/revenue_by_customer.xlsx": {"get": {"tags": ["reports"], "summary": "Revenue By Customer Xlsx", "description": "Revenue by customer for a date range, XLSX export.", "operationId": "revenue_by_customer_xlsx_api_v1_reports_revenue_by_customer_xlsx_get", "parameters": [{"name": "from_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "From Date"}}, {"name": "to_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "To Date"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reports/bas_summary.csv": {"get": {"tags": ["reports"], "summary": "Bas Summary Csv", "description": "Australian BAS summary for a date range, CSV export.\n\nThe BAS-specific column mapping lives in the AU jurisdiction module\n(``jurisdictions.au.bas_export``); serialization is the neutral core.", "operationId": "bas_summary_csv_api_v1_reports_bas_summary_csv_get", "parameters": [{"name": "from_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "From Date"}}, {"name": "to_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "To Date"}}, {"name": "registration_effective_date", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Registration Effective Date"}}, {"name": "basis", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "pattern": "^(accrual|cash)$"}, {"type": "null"}], "title": "Basis"}}, {"name": "payg_instalment", "in": "query", "required": false, "schema": {"anyOf": [{"type": "number", "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "default": "0", "title": "Payg Instalment"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reports/bas_summary.xlsx": {"get": {"tags": ["reports"], "summary": "Bas Summary Xlsx", "description": "Australian BAS summary for a date range, XLSX export.", "operationId": "bas_summary_xlsx_api_v1_reports_bas_summary_xlsx_get", "parameters": [{"name": "from_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "From Date"}}, {"name": "to_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "To Date"}}, {"name": "registration_effective_date", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Registration Effective Date"}}, {"name": "basis", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "pattern": "^(accrual|cash)$"}, {"type": "null"}], "title": "Basis"}}, {"name": "payg_instalment", "in": "query", "required": false, "schema": {"anyOf": [{"type": "number", "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "default": "0", "title": "Payg Instalment"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reports/statement_pack.pdf": {"get": {"tags": ["reports"], "summary": "Statement Pack Pdf", "description": "Render a financial statement pack (P&L + Balance Sheet + Trial Balance)\nas a PDF via the LaTeX engine.\n\nDefaults to the current Australian financial year (1 Jul \u2192 today).\nWith ``comparative=true`` (default) a prior-year column is included.\n\nThe ctx is assembled entirely from service-layer functions \u2014 no HTTP\nself-calls.  Returns ``application/pdf`` with ``Content-Disposition: inline``.", "operationId": "statement_pack_pdf_api_v1_reports_statement_pack_pdf_get", "parameters": [{"name": "as_of_date", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "As Of Date"}}, {"name": "from_date", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "From Date"}}, {"name": "to_date", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "To Date"}}, {"name": "comparative", "in": "query", "required": false, "schema": {"type": "boolean", "default": true, "title": "Comparative"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reports/profit_loss.pdf": {"get": {"tags": ["reports"], "summary": "Profit Loss Pdf", "description": "Profit & Loss for a date range as a single-report PDF.", "operationId": "profit_loss_pdf_api_v1_reports_profit_loss_pdf_get", "parameters": [{"name": "from_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "From Date"}}, {"name": "to_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "To Date"}}, {"name": "include_draft", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Include Draft"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reports/balance_sheet.pdf": {"get": {"tags": ["reports"], "summary": "Balance Sheet Pdf", "description": "Balance sheet as at ``as_of_date`` as a single-report PDF.", "operationId": "balance_sheet_pdf_api_v1_reports_balance_sheet_pdf_get", "parameters": [{"name": "as_of_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "As Of Date"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reports/trial_balance.pdf": {"get": {"tags": ["reports"], "summary": "Trial Balance Pdf", "description": "Trial balance as at ``as_of_date`` as a single-report PDF.", "operationId": "trial_balance_pdf_api_v1_reports_trial_balance_pdf_get", "parameters": [{"name": "as_of_date", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "As Of Date"}}, {"name": "include_zero_balance", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Include Zero Balance"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reports/dashboard_summary": {"get": {"tags": ["reports"], "summary": "Dashboard Summary", "description": "One read for the dashboard money tiles, built from the same aged\nreports the reports pages show (so a tile and its report agree) plus\nledger bank balances.\n\n``receivables`` / ``payables``: documents outstanding, the part overdue,\ncredit held on account, net, the control-account balance and the\ntie-out difference. ``bank_accounts``: each active bank / card account's\nledger balance as at the date (debit-positive; a card shows negative\nwhen owing). ``links`` gives the report URLs a tile should open.", "operationId": "dashboard_summary_api_v1_reports_dashboard_summary_get", "parameters": [{"name": "as_of_date", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "As Of Date"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response Dashboard Summary Api V1 Reports Dashboard Summary Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reports/general_ledger": {"get": {"tags": ["reports"], "summary": "General Ledger", "description": "General ledger (account transactions) for a date range.", "operationId": "general_ledger_api_v1_reports_general_ledger_get", "parameters": [{"name": "from_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "From Date"}}, {"name": "to_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "To Date"}}, {"name": "account_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "array", "items": {"type": "string", "format": "uuid"}}, {"type": "null"}], "title": "Account Id"}}, {"name": "include_empty", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Include Empty"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GeneralLedgerReport"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reports/general_ledger.csv": {"get": {"tags": ["reports"], "summary": "General Ledger Csv", "operationId": "general_ledger_csv_api_v1_reports_general_ledger_csv_get", "parameters": [{"name": "from_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "From Date"}}, {"name": "to_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "To Date"}}, {"name": "account_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "array", "items": {"type": "string", "format": "uuid"}}, {"type": "null"}], "title": "Account Id"}}, {"name": "include_empty", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Include Empty"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reports/general_ledger.xlsx": {"get": {"tags": ["reports"], "summary": "General Ledger Xlsx", "operationId": "general_ledger_xlsx_api_v1_reports_general_ledger_xlsx_get", "parameters": [{"name": "from_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "From Date"}}, {"name": "to_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "To Date"}}, {"name": "account_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "array", "items": {"type": "string", "format": "uuid"}}, {"type": "null"}], "title": "Account Id"}}, {"name": "include_empty", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Include Empty"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reports/general_ledger.pdf": {"get": {"tags": ["reports"], "summary": "General Ledger Pdf", "operationId": "general_ledger_pdf_api_v1_reports_general_ledger_pdf_get", "parameters": [{"name": "from_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "From Date"}}, {"name": "to_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "To Date"}}, {"name": "account_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "array", "items": {"type": "string", "format": "uuid"}}, {"type": "null"}], "title": "Account Id"}}, {"name": "include_empty", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Include Empty"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reports/journal": {"get": {"tags": ["reports"], "summary": "Journal", "description": "Every posted journal entry in the period, with its lines (paged).", "operationId": "journal_api_v1_reports_journal_get", "parameters": [{"name": "from_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "From Date"}}, {"name": "to_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "To Date"}}, {"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 1000, "minimum": 1, "default": 200, "title": "Limit"}}, {"name": "offset", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 0, "default": 0, "title": "Offset"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/JournalListingReport"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reports/journal.csv": {"get": {"tags": ["reports"], "summary": "Journal Csv", "operationId": "journal_csv_api_v1_reports_journal_csv_get", "parameters": [{"name": "from_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "From Date"}}, {"name": "to_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "To Date"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reports/journal.xlsx": {"get": {"tags": ["reports"], "summary": "Journal Xlsx", "operationId": "journal_xlsx_api_v1_reports_journal_xlsx_get", "parameters": [{"name": "from_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "From Date"}}, {"name": "to_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "To Date"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reports/fixed_asset_register.csv": {"get": {"tags": ["reports"], "summary": "Fixed Asset Register Csv", "operationId": "fixed_asset_register_csv_api_v1_reports_fixed_asset_register_csv_get", "parameters": [{"name": "as_of_date", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "As Of Date"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reports/fixed_asset_register.xlsx": {"get": {"tags": ["reports"], "summary": "Fixed Asset Register Xlsx", "operationId": "fixed_asset_register_xlsx_api_v1_reports_fixed_asset_register_xlsx_get", "parameters": [{"name": "as_of_date", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "As Of Date"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reports/profit_loss_columns": {"get": {"tags": ["reports"], "summary": "Profit Loss Columns", "description": "Profit and loss in month, quarter or year columns.", "operationId": "profit_loss_columns_api_v1_reports_profit_loss_columns_get", "parameters": [{"name": "from_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "From Date"}}, {"name": "to_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "To Date"}}, {"name": "period", "in": "query", "required": false, "schema": {"enum": ["month", "quarter", "year"], "type": "string", "default": "month", "title": "Period"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ColumnsReport"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reports/balance_sheet_columns": {"get": {"tags": ["reports"], "summary": "Balance Sheet Columns", "description": "Balance sheet as at the end of each month, quarter or year.", "operationId": "balance_sheet_columns_api_v1_reports_balance_sheet_columns_get", "parameters": [{"name": "from_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "From Date"}}, {"name": "to_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "To Date"}}, {"name": "period", "in": "query", "required": false, "schema": {"enum": ["month", "quarter", "year"], "type": "string", "default": "month", "title": "Period"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ColumnsReport"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reports/profit_loss_columns.csv": {"get": {"tags": ["reports"], "summary": "Profit Loss Columns Csv", "operationId": "profit_loss_columns_csv_api_v1_reports_profit_loss_columns_csv_get", "parameters": [{"name": "from_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "From Date"}}, {"name": "to_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "To Date"}}, {"name": "period", "in": "query", "required": false, "schema": {"enum": ["month", "quarter", "year"], "type": "string", "default": "month", "title": "Period"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reports/profit_loss_columns.xlsx": {"get": {"tags": ["reports"], "summary": "Profit Loss Columns Xlsx", "operationId": "profit_loss_columns_xlsx_api_v1_reports_profit_loss_columns_xlsx_get", "parameters": [{"name": "from_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "From Date"}}, {"name": "to_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "To Date"}}, {"name": "period", "in": "query", "required": false, "schema": {"enum": ["month", "quarter", "year"], "type": "string", "default": "month", "title": "Period"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reports/balance_sheet_columns.csv": {"get": {"tags": ["reports"], "summary": "Balance Sheet Columns Csv", "operationId": "balance_sheet_columns_csv_api_v1_reports_balance_sheet_columns_csv_get", "parameters": [{"name": "from_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "From Date"}}, {"name": "to_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "To Date"}}, {"name": "period", "in": "query", "required": false, "schema": {"enum": ["month", "quarter", "year"], "type": "string", "default": "month", "title": "Period"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reports/balance_sheet_columns.xlsx": {"get": {"tags": ["reports"], "summary": "Balance Sheet Columns Xlsx", "operationId": "balance_sheet_columns_xlsx_api_v1_reports_balance_sheet_columns_xlsx_get", "parameters": [{"name": "from_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "From Date"}}, {"name": "to_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "To Date"}}, {"name": "period", "in": "query", "required": false, "schema": {"enum": ["month", "quarter", "year"], "type": "string", "default": "month", "title": "Period"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reports/aged_receivables.pdf": {"get": {"tags": ["reports"], "summary": "Aged Receivables Pdf", "operationId": "aged_receivables_pdf_api_v1_reports_aged_receivables_pdf_get", "parameters": [{"name": "as_of_date", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "As Of Date"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reports/aged_payables.pdf": {"get": {"tags": ["reports"], "summary": "Aged Payables Pdf", "operationId": "aged_payables_pdf_api_v1_reports_aged_payables_pdf_get", "parameters": [{"name": "as_of_date", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "As Of Date"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reports/cashflow.pdf": {"get": {"tags": ["reports"], "summary": "Cashflow Pdf", "operationId": "cashflow_pdf_api_v1_reports_cashflow_pdf_get", "parameters": [{"name": "from_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "From Date"}}, {"name": "to_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "To Date"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reports/bas_summary.pdf": {"get": {"tags": ["reports"], "summary": "Bas Summary Pdf", "operationId": "bas_summary_pdf_api_v1_reports_bas_summary_pdf_get", "parameters": [{"name": "from_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "From Date"}}, {"name": "to_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "To Date"}}, {"name": "registration_effective_date", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Registration Effective Date"}}, {"name": "basis", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "pattern": "^(accrual|cash)$"}, {"type": "null"}], "title": "Basis"}}, {"name": "payg_instalment", "in": "query", "required": false, "schema": {"anyOf": [{"type": "number", "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "default": "0", "title": "Payg Instalment"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reports/accountant_pack.zip": {"get": {"tags": ["reports"], "summary": "Accountant Pack", "description": "Everything an accountant asks for at year end, in one ZIP.\n\nEach file is produced by the same route the screen uses, so the pack can\nnever disagree with what the user sees. A report that fails is listed in\nthe README rather than failing the whole pack.", "operationId": "accountant_pack_api_v1_reports_accountant_pack_zip_get", "parameters": [{"name": "from_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "From Date"}}, {"name": "to_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "To Date"}}, {"name": "include_pdf", "in": "query", "required": false, "schema": {"type": "boolean", "default": true, "title": "Include Pdf"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reports/data_export.zip": {"get": {"tags": ["reports"], "summary": "Data Export", "description": "Everything held for the active company, readable without this system.", "operationId": "data_export_api_v1_reports_data_export_zip_get", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/fx/currencies": {"get": {"tags": ["fx"], "summary": "List Currencies", "operationId": "list_currencies_api_v1_fx_currencies_get", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CurrencyListOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/fx/rate": {"get": {"tags": ["fx"], "summary": "Get Rate", "operationId": "get_rate_api_v1_fx_rate_get", "parameters": [{"name": "currency", "in": "query", "required": true, "schema": {"type": "string", "minLength": 3, "maxLength": 3, "title": "Currency"}}, {"name": "date", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Date"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RateOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/fx/rates": {"get": {"tags": ["fx"], "summary": "List Company Rates", "operationId": "list_company_rates_api_v1_fx_rates_get", "parameters": [{"name": "currency", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "minLength": 3, "maxLength": 3}, {"type": "null"}], "title": "Currency"}}, {"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 1000, "minimum": 1, "default": 200, "title": "Limit"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompanyRateListOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "post": {"tags": ["fx"], "summary": "Save Company Rate", "operationId": "save_company_rate_api_v1_fx_rates_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompanyRateIn"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompanyRateOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/fx/rates/{rate_id}": {"delete": {"tags": ["fx"], "summary": "Delete Company Rate", "operationId": "delete_company_rate_api_v1_fx_rates__rate_id__delete", "parameters": [{"name": "rate_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Rate Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"204": {"description": "Successful Response"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/fx/rates/refresh": {"post": {"tags": ["fx"], "summary": "Refresh Published Rates", "description": "Download the Reserve Bank of Australia's rates now.", "operationId": "refresh_published_rates_api_v1_fx_rates_refresh_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RefreshOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/fx/revaluation": {"get": {"tags": ["fx"], "summary": "Revaluation Preview", "operationId": "revaluation_preview_api_v1_fx_revaluation_get", "parameters": [{"name": "through_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "Through Date"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RevalPreviewOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "post": {"tags": ["fx"], "summary": "Revaluation Post", "operationId": "revaluation_post_api_v1_fx_revaluation_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RevalPostIn"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RevalPostOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reports/purchases-by-supplier": {"get": {"tags": ["reports"], "summary": "Purchases By Supplier", "operationId": "purchases_by_supplier_api_v1_reports_purchases_by_supplier_get", "parameters": [{"name": "date_from", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Date From"}}, {"name": "date_to", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Date To"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/period-close/preview": {"get": {"tags": ["period-close"], "summary": "Preview Close Year", "description": "Preview the year-end close (no state change).", "operationId": "preview_close_year_api_v1_period_close_preview_get", "parameters": [{"name": "through_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "Through Date"}}, {"name": "retained_earnings_account_id", "in": "query", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Retained Earnings Account Id"}}, {"name": "from_date", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "From Date"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ClosePreviewOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/period-close/close-year": {"post": {"tags": ["period-close"], "summary": "Close Year", "description": "Post the year-end close journal and lock the period.\n\nReturns ``closed=False`` when there is nothing to close (every P&L\naccount already zero). 422 if ``through_date`` is in a locked range\nand no/insufficient override is supplied.", "operationId": "close_year_api_v1_period_close_close_year_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CloseYearRequest"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CloseYearResult"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/period-close/locks": {"post": {"tags": ["period-close"], "summary": "Create Period Lock", "description": "Lock the company through ``locked_through`` (admin-only).\n\n409 if ``locked_through`` does not extend beyond the company's current\n``max(locked_through)`` \u2014 a lock that doesn't move the effective\nboundary forward is a confusing no-op for enforcement, so it is\nrejected rather than silently accepted.\n\nThe monotonicity check and the insert run in the same transaction,\nwith the company's existing ``PeriodLock`` rows locked ``FOR UPDATE``\nfirst \u2014 otherwise two concurrent non-advancing POSTs can each read the\nsame stale ``current`` before either commits, and both pass the 409\nguard.", "operationId": "create_period_lock_api_v1_period_close_locks_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Admin", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Admin"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PeriodLockCreate"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PeriodLockOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "get": {"tags": ["period-close"], "summary": "List Period Locks", "description": "List the company's lock history newest-first (admin-only).\n\n``effective_locked_through`` is the max ``locked_through`` across all\nlock rows (or ``null`` if there are none) \u2014 the date posting is\nactually enforced against right now.", "operationId": "list_period_locks_api_v1_period_close_locks_get", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Admin", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Admin"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PeriodLockListOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/period-close/locks/{lock_id}": {"delete": {"tags": ["period-close"], "summary": "Delete Period Lock", "description": "Remove a period-lock row (admin-only).\n\nEnforcement recedes to the remaining ``max(locked_through)`` (or fully\nopen if this was the last lock) \u2014 a shorter/older lock elsewhere is\nNOT re-applied, the boundary simply moves to whatever locks remain.\n\nA ``reason`` query parameter is required (422 if missing or blank) and\nis written, together with a full snapshot of the removed row, to\n``audit_log`` (action ``period_lock.delete``) in the SAME transaction\nas the delete \u2014 this is a forensic record of \"who unlocked what and\nwhy\", not a routine list/read.\n\n404 if the lock doesn't exist or belongs to another company.", "operationId": "delete_period_lock_api_v1_period_close_locks__lock_id__delete", "parameters": [{"name": "lock_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Lock Id"}}, {"name": "reason", "in": "query", "required": true, "schema": {"type": "string", "description": "Required forensic reason for removing this lock", "title": "Reason"}, "description": "Required forensic reason for removing this lock"}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Admin", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Admin"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"204": {"description": "Successful Response"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/proration/preview": {"post": {"tags": ["proration"], "summary": "Preview Prorate", "operationId": "preview_prorate_api_v1_proration_preview_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ProratePreviewBody"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ProratePreviewOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/proration/first-period-preview": {"post": {"tags": ["proration"], "summary": "Preview First Period", "operationId": "preview_first_period_api_v1_proration_first_period_preview_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/FirstPeriodPreviewBody"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/FirstPeriodPreviewOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/proration/plan-change-preview": {"post": {"tags": ["proration"], "summary": "Preview Plan Change", "operationId": "preview_plan_change_api_v1_proration_plan_change_preview_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PlanChangePreviewBody"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PlanChangePreviewOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/proration/deferred-revenue/preview": {"post": {"tags": ["proration"], "summary": "Preview Deferred Revenue", "operationId": "preview_deferred_revenue_api_v1_proration_deferred_revenue_preview_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/DeferredRevenuePreviewBody"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/DeferredRevenuePreviewOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/proration/deferred-revenue/recognize": {"post": {"tags": ["proration"], "summary": "Recognize Deferred Revenue", "operationId": "recognize_deferred_revenue_api_v1_proration_deferred_revenue_recognize_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/DeferredRevenueRecognizeBody"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/DeferredRevenueRecognizeOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/search": {"get": {"tags": ["search"], "summary": "Search", "description": "Search every kind of record by number, reference, contact or amount.\n\nThe active company is resolved by ``get_active_company_id`` \u2014\ncallers may pin a specific company via the ``X-Company-Id`` header;\notherwise the first active company for the tenant is used.", "operationId": "search_api_v1_search_get", "parameters": [{"name": "q", "in": "query", "required": false, "schema": {"type": "string", "maxLength": 200, "description": "Search query string", "default": "", "title": "Q"}, "description": "Search query string"}, {"name": "kind", "in": "query", "required": false, "schema": {"anyOf": [{"type": "array", "items": {"type": "string"}}, {"type": "null"}], "description": "Only these kinds (repeatable): contact, invoice, bill, payment, receipt, credit_note, supplier_credit_note, quote, purchase_order, expense, account. Default: all.", "title": "Kind"}, "description": "Only these kinds (repeatable): contact, invoice, bill, payment, receipt, credit_note, supplier_credit_note, quote, purchase_order, expense, account. Default: all."}, {"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 200, "minimum": 1, "description": "Hits per kind.", "default": 10, "title": "Limit"}, "description": "Hits per kind."}, {"name": "offset", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 0, "description": "Skip this many hits per kind.", "default": 0, "title": "Offset"}, "description": "Skip this many hits per kind."}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SearchResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/changes": {"get": {"tags": ["sync"], "summary": "Stream Changes", "operationId": "stream_changes_api_v1_changes_get", "parameters": [{"name": "since", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 0, "default": 0, "title": "Since"}}, {"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 5000, "minimum": 1, "default": 500, "title": "Limit"}}, {"name": "entity", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Entity"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/snapshot": {"get": {"tags": ["sync"], "summary": "Snapshot", "operationId": "snapshot_api_v1_snapshot_get", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/attention": {"get": {"tags": ["attention"], "summary": "Needs Attention", "description": "What needs doing now, as counts and amounts owing.", "operationId": "needs_attention_api_v1_attention_get", "parameters": [{"name": "as_at", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "description": "Date to count from. Defaults to today in the company's own time zone.", "title": "As At"}, "description": "Date to count from. Defaults to today in the company's own time zone."}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/NeedsAttentionOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/attention/year-end": {"get": {"tags": ["attention"], "summary": "Year End Checklist", "description": "Drafts, unreconciled bank lines, depreciation not run and draft pay\nruns inside the period \u2014 the things to finish before closing it\n(gap P2-3). Read-only; the close itself stays at\n``POST /api/v1/period-close/close-year``.", "operationId": "year_end_checklist_api_v1_attention_year_end_get", "parameters": [{"name": "through_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "description": "Last day of the period being closed.", "title": "Through Date"}, "description": "Last day of the period being closed."}, {"name": "from_date", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "description": "First day of the period (optional).", "title": "From Date"}, "description": "First day of the period (optional)."}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/YearEndChecklistOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/reports/aged_detail": {"get": {"tags": ["reports"], "summary": "Aged Detail", "description": "Aged receivables or payables with every open document listed.", "operationId": "aged_detail_api_v1_reports_aged_detail_get", "parameters": [{"name": "side", "in": "query", "required": false, "schema": {"enum": ["receivables", "payables"], "type": "string", "description": "receivables (customers) or payables (suppliers)", "default": "receivables", "title": "Side"}, "description": "receivables (customers) or payables (suppliers)"}, {"name": "as_at", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "description": "Report date. Defaults to today in the company's time zone.", "title": "As At"}, "description": "Report date. Defaults to today in the company's time zone."}, {"name": "age_by", "in": "query", "required": false, "schema": {"enum": ["due", "issue"], "type": "string", "description": "Age by due date (days overdue) or by invoice date (days old).", "default": "due", "title": "Age By"}, "description": "Age by due date (days overdue) or by invoice date (days old)."}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response Aged Detail Api V1 Reports Aged Detail Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/bill-checks/duplicates": {"get": {"tags": ["bills"], "summary": "Duplicate Bills", "description": "Possible duplicates of a supplier invoice. Empty list = none found.", "operationId": "duplicate_bills_api_v1_bill_checks_duplicates_get", "parameters": [{"name": "contact_id", "in": "query", "required": true, "schema": {"type": "string", "format": "uuid", "description": "The supplier.", "title": "Contact Id"}, "description": "The supplier."}, {"name": "supplier_reference", "in": "query", "required": true, "schema": {"type": "string", "maxLength": 64, "description": "The supplier's invoice number.", "title": "Supplier Reference"}, "description": "The supplier's invoice number."}, {"name": "exclude_bill_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "description": "The bill being edited, if any.", "title": "Exclude Bill Id"}, "description": "The bill being edited, if any."}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response Duplicate Bills Api V1 Bill Checks Duplicates Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/payroll-setup/accounts": {"get": {"tags": ["payroll"], "summary": "Payroll Accounts", "operationId": "payroll_accounts_api_v1_payroll_setup_accounts_get", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response Payroll Accounts Api V1 Payroll Setup Accounts Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "post": {"tags": ["payroll"], "summary": "Create Payroll Accounts", "operationId": "create_payroll_accounts_api_v1_payroll_setup_accounts_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response Create Payroll Accounts Api V1 Payroll Setup Accounts Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/payroll-setup/employees/{employee_id}/readiness": {"get": {"tags": ["payroll"], "summary": "Employee Readiness", "operationId": "employee_readiness_api_v1_payroll_setup_employees__employee_id__readiness_get", "parameters": [{"name": "employee_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Employee Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response Employee Readiness Api V1 Payroll Setup Employees  Employee Id  Readiness Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/contact-records/{contact_id}/people": {"get": {"tags": ["contacts"], "summary": "List People", "operationId": "list_people_api_v1_contact_records__contact_id__people_get", "parameters": [{"name": "contact_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Contact Id"}}, {"name": "include_inactive", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Include Inactive"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response List People Api V1 Contact Records  Contact Id  People Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "post": {"tags": ["contacts"], "summary": "Add Person", "operationId": "add_person_api_v1_contact_records__contact_id__people_post", "parameters": [{"name": "contact_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Contact Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PersonIn"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/contact-records/{contact_id}/people/{person_id}": {"patch": {"tags": ["contacts"], "summary": "Update Person", "operationId": "update_person_api_v1_contact_records__contact_id__people__person_id__patch", "parameters": [{"name": "contact_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Contact Id"}}, {"name": "person_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Person Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PersonPatch"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response Update Person Api V1 Contact Records  Contact Id  People  Person Id  Patch"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "delete": {"tags": ["contacts"], "summary": "Deactivate Person", "operationId": "deactivate_person_api_v1_contact_records__contact_id__people__person_id__delete", "parameters": [{"name": "contact_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Contact Id"}}, {"name": "person_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Person Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"204": {"description": "Successful Response"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/contact-records/{contact_id}/notes": {"get": {"tags": ["contacts"], "summary": "List Notes", "operationId": "list_notes_api_v1_contact_records__contact_id__notes_get", "parameters": [{"name": "contact_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Contact Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response List Notes Api V1 Contact Records  Contact Id  Notes Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "post": {"tags": ["contacts"], "summary": "Add Note", "operationId": "add_note_api_v1_contact_records__contact_id__notes_post", "parameters": [{"name": "contact_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Contact Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/NoteIn"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/contact-records/{contact_id}/notes/{note_id}": {"delete": {"tags": ["contacts"], "summary": "Delete Note", "operationId": "delete_note_api_v1_contact_records__contact_id__notes__note_id__delete", "parameters": [{"name": "contact_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Contact Id"}}, {"name": "note_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Note Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"204": {"description": "Successful Response"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/contact-records/{contact_id}/communications": {"get": {"tags": ["contacts"], "summary": "Communications", "operationId": "communications_api_v1_contact_records__contact_id__communications_get", "parameters": [{"name": "contact_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Contact Id"}}, {"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 200, "minimum": 1, "default": 50, "title": "Limit"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response Communications Api V1 Contact Records  Contact Id  Communications Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/contact-records/{contact_id}/document-recipients": {"get": {"tags": ["contacts"], "summary": "Document Recipients", "operationId": "document_recipients_api_v1_contact_records__contact_id__document_recipients_get", "parameters": [{"name": "contact_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Contact Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response Document Recipients Api V1 Contact Records  Contact Id  Document Recipients Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/documents/extract": {"post": {"tags": ["ai_extraction"], "summary": "Extract structured data from a document (receipt / invoice / statement)", "description": "Upload a document and receive pre-filled accounting form fields.\n\nReturns a JSON object with:\n\n* ``vendor_name``, ``invoice_number``, ``date``, ``due_date``\n* ``subtotal``, ``tax_amount``, ``total``, ``currency``\n* ``line_items`` \u2014 list of ``{description, qty, unit_price, amount, tax_code}``\n* ``notes``\n* ``extraction_confidence`` \u2014 ``\"ok\"`` on success, ``\"partial\"`` on API error\n* ``extraction_error`` \u2014 error message string on partial result, else ``null``", "operationId": "extract_api_v1_documents_extract_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "requestBody": {"required": true, "content": {"multipart/form-data": {"schema": {"$ref": "#/components/schemas/Body_extract_api_v1_documents_extract_post"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Extract Api V1 Documents Extract Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/allocation_rules": {"get": {"tags": ["allocation_rules"], "summary": "List Allocation Rules", "operationId": "list_allocation_rules_api_v1_allocation_rules_get", "parameters": [{"name": "page", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 1, "default": 1, "title": "Page"}}, {"name": "page_size", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 500, "minimum": 1, "default": 50, "title": "Page Size"}}, {"name": "archived", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Archived"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AllocationRuleListOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "post": {"tags": ["allocation_rules"], "summary": "Create Allocation Rule", "operationId": "create_allocation_rule_api_v1_allocation_rules_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AllocationRuleCreate"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AllocationRuleOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/allocation_rules/{rule_id}": {"get": {"tags": ["allocation_rules"], "summary": "Get Allocation Rule", "operationId": "get_allocation_rule_api_v1_allocation_rules__rule_id__get", "parameters": [{"name": "rule_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Rule Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AllocationRuleOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "patch": {"tags": ["allocation_rules"], "summary": "Update Allocation Rule", "operationId": "update_allocation_rule_api_v1_allocation_rules__rule_id__patch", "parameters": [{"name": "rule_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Rule Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AllocationRuleUpdate"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AllocationRuleOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "delete": {"tags": ["allocation_rules"], "summary": "Delete Allocation Rule", "operationId": "delete_allocation_rule_api_v1_allocation_rules__rule_id__delete", "parameters": [{"name": "rule_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Rule Id"}}, {"name": "hard", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Hard"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Admin", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Admin"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"204": {"description": "Successful Response"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/allocation_rules/{rule_id}/apply": {"post": {"tags": ["allocation_rules"], "summary": "Apply Allocation Rule", "description": "Generate and post a journal entry for this allocation rule.\n\nDebits each target account for its share and credits the source\naccount for the full amount. The entry is immediately posted.", "operationId": "apply_allocation_rule_api_v1_allocation_rules__rule_id__apply_post", "parameters": [{"name": "rule_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Rule Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AllocationApplyIn"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AllocationApplyOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/attachments": {"post": {"tags": ["attachments"], "summary": "Upload Attachment", "description": "Upload a blob, link it to the given saebooks entity.\n\nTwo upstream calls: ``POST /files`` (upload) then\n``POST /files/{id}/links`` (link). If the link fails after the\nupload succeeded, we surface the link error but the blob is left\nin the vault \u2014 the UI can re-link or the operator can clean up\nvia the vault directly. We prefer \"leaked blob, surfaced error\"\nover \"lost blob, hidden error\".", "operationId": "upload_attachment_api_v1_attachments_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"multipart/form-data": {"schema": {"$ref": "#/components/schemas/Body_upload_attachment_api_v1_attachments_post"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "get": {"tags": ["attachments"], "summary": "List Attachments", "description": "List attachments linked to the given saebooks entity.\n\nBoth filters are required \u2014 listing every blob in the tenant from\nhere would just be a wrapper around the vault's own list endpoint.", "operationId": "list_attachments_api_v1_attachments_get", "parameters": [{"name": "entity_kind", "in": "query", "required": true, "schema": {"type": "string", "title": "Entity Kind"}}, {"name": "entity_id", "in": "query", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Entity Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "array", "items": {"type": "object", "additionalProperties": true}, "title": "Response List Attachments Api V1 Attachments Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/attachments/{file_id}": {"get": {"tags": ["attachments"], "summary": "Get Attachment", "description": "Fetch metadata for a single attachment (no blob).", "operationId": "get_attachment_api_v1_attachments__file_id__get", "parameters": [{"name": "file_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "File Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response Get Attachment Api V1 Attachments  File Id  Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "delete": {"tags": ["attachments"], "summary": "Delete Attachment", "description": "Soft-delete an attachment (vault sets ``archived_at``).\n\nIdempotent \u2014 deleting an already-archived file still returns 204.", "operationId": "delete_attachment_api_v1_attachments__file_id__delete", "parameters": [{"name": "file_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "File Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "responses": {"204": {"description": "Successful Response"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/attachments/{file_id}/download": {"get": {"tags": ["attachments"], "summary": "Download Attachment", "description": "Stream the blob bytes from the vault to the client.\n\nWe don't buffer the whole blob in saebooks memory \u2014 chunks are\nrelayed as they arrive. Vault enforces the upload size cap, so\nthe on-the-wire footprint is bounded.", "operationId": "download_attachment_api_v1_attachments__file_id__download_get", "parameters": [{"name": "file_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "File Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/audit-log": {"get": {"tags": ["audit-log"], "summary": "Read the real audit_log table (admin-only, tenant-scoped)", "description": "List ``audit_log`` rows newest-first, filtered by ``row_id`` / ``table``.\n\nAlso filterable by an ``at`` date-range (``at_from``/``at_to``,\ninclusive both ends) and by ``actor_user_id``.\n\nTenant scoping is enforced both by the FORCE-RLS ``tenant_isolation``\npolicy on ``audit_log`` and, defence-in-depth, by an explicit\n``tenant_id`` predicate here.", "operationId": "get_audit_log_api_v1_audit_log_get", "parameters": [{"name": "row_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Filter to this affected row id", "title": "Row Id"}, "description": "Filter to this affected row id"}, {"name": "table", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Filter to this table_name", "title": "Table"}, "description": "Filter to this table_name"}, {"name": "action", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Filter to this action value", "title": "Action"}, "description": "Filter to this action value"}, {"name": "at_from", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "description": "Filter to at >= this instant", "title": "At From"}, "description": "Filter to at >= this instant"}, {"name": "at_to", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "description": "Filter to at <= this instant", "title": "At To"}, "description": "Filter to at <= this instant"}, {"name": "actor_user_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "description": "Filter to this actor", "title": "Actor User Id"}, "description": "Filter to this actor"}, {"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 500, "minimum": 1, "default": 50, "title": "Limit"}}, {"name": "offset", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 0, "default": 0, "title": "Offset"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Admin", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Admin"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/saebooks__api__v1__audit_log__AuditLogPage"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/audit-log.csv": {"get": {"tags": ["audit-log"], "summary": "CSV export of the real audit_log table (admin-only, tenant-scoped)", "description": "CSV export of ``audit_log`` rows, same filters as the JSON list route.\n\nNo ``limit``/``offset`` \u2014 instead a hard cap of ``_CSV_ROW_CAP``\n(10,000) rows, newest-first (``ORDER BY at DESC``), so an export can\nnever run away on an unbounded query. Columns are\n``at,actor_user_id,action,table_name,row_id,reason`` \u2014 ``row_snapshot``\nis deliberately excluded: it's a JSON blob and doesn't belong in a CSV\ncell. Free-text cells are guarded against CSV formula injection (see\n``_csv_guard``).\n\nTwo response headers surface the truncation, since the body shape\nitself (a bare CSV) has nowhere to carry it: ``X-Total-Count`` is the\nreal count of matching rows (same ``func.count()`` query the JSON\nroute uses) regardless of whether it exceeds the cap, and\n``X-Truncated: true`` is set additionally when the export is capped\nshort of that total.", "operationId": "get_audit_log_csv_api_v1_audit_log_csv_get", "parameters": [{"name": "row_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Filter to this affected row id", "title": "Row Id"}, "description": "Filter to this affected row id"}, {"name": "table", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Filter to this table_name", "title": "Table"}, "description": "Filter to this table_name"}, {"name": "action", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "description": "Filter to this action value", "title": "Action"}, "description": "Filter to this action value"}, {"name": "at_from", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "description": "Filter to at >= this instant", "title": "At From"}, "description": "Filter to at >= this instant"}, {"name": "at_to", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "description": "Filter to at <= this instant", "title": "At To"}, "description": "Filter to at <= this instant"}, {"name": "actor_user_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "description": "Filter to this actor", "title": "Actor User Id"}, "description": "Filter to this actor"}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Admin", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Admin"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/api-tokens": {"post": {"tags": ["api-tokens"], "summary": "Create Api Token", "operationId": "create_api_token_api_v1_api_tokens_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreateApiTokenRequest"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response Create Api Token Api V1 Api Tokens Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "get": {"tags": ["api-tokens"], "summary": "List Api Tokens", "operationId": "list_api_tokens_api_v1_api_tokens_get", "parameters": [{"name": "include_revoked", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Include Revoked"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "array", "items": {"type": "object", "additionalProperties": true}, "title": "Response List Api Tokens Api V1 Api Tokens Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/api-tokens/{token_id}": {"delete": {"tags": ["api-tokens"], "summary": "Revoke Api Token", "operationId": "revoke_api_token_api_v1_api_tokens__token_id__delete", "parameters": [{"name": "token_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Token Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response Revoke Api Token Api V1 Api Tokens  Token Id  Delete"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/scheduled-backups/config": {"get": {"tags": ["scheduled-backups"], "summary": "Get Config", "operationId": "get_config_api_v1_scheduled_backups_config_get", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Admin", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Admin"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"anyOf": [{"$ref": "#/components/schemas/ConfigOut"}, {"type": "null"}], "title": "Response Get Config Api V1 Scheduled Backups Config Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "put": {"tags": ["scheduled-backups"], "summary": "Put Config", "operationId": "put_config_api_v1_scheduled_backups_config_put", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Admin", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Admin"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ConfigIn"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ConfigOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/scheduled-backups/export": {"post": {"tags": ["scheduled-backups"], "summary": "Post Export", "operationId": "post_export_api_v1_scheduled_backups_export_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Admin", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Admin"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ExportRequest"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RunOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/scheduled-backups/runs": {"get": {"tags": ["scheduled-backups"], "summary": "List Runs", "operationId": "list_runs_api_v1_scheduled_backups_runs_get", "parameters": [{"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 200, "minimum": 1, "default": 50, "title": "Limit"}}, {"name": "offset", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 0, "default": 0, "title": "Offset"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Admin", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Admin"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RunListOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/scheduled-backups/runs/{run_id}": {"get": {"tags": ["scheduled-backups"], "summary": "Get Run", "operationId": "get_run_api_v1_scheduled_backups_runs__run_id__get", "parameters": [{"name": "run_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Run Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Admin", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Admin"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RunOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/scheduled-backups/runs/{run_id}/download": {"get": {"tags": ["scheduled-backups"], "summary": "Download Run", "description": "Stream back the ENCRYPTED artifact verbatim.\n\nTasur does not decrypt this \u2014 the passphrase that encrypted it\nwas never stored (see services/scheduled_backups.py). The client\ndecrypts locally with ``services/backup_crypto.decrypt_export``'s\ndocumented envelope format (SAEBKX01: magic + salt + nonce +\nAES-256-GCM ciphertext, scrypt-derived key) or their own compatible\ntooling.", "operationId": "download_run_api_v1_scheduled_backups_runs__run_id__download_get", "parameters": [{"name": "run_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Run Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Admin", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Admin"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/imports/wizards": {"post": {"tags": ["imports"], "summary": "Start Wizard", "description": "Start a new import wizard session.\n\nReturns ``{wizard_id, step, state}`` (201).  Idempotent when\n``X-Idempotency-Key`` is supplied \u2014 replays the original 201.", "operationId": "start_wizard_api_v1_imports_wizards_post", "parameters": [{"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/WizardStartBody"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Start Wizard Api V1 Imports Wizards Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "get": {"tags": ["imports"], "summary": "List Wizards", "description": "List the tenant's non-expired import wizards and their state.\n\nRLS scopes the result to the calling tenant. Optional ``kind`` filters\nto one import kind. Returns ``{wizards: [...], total: N}``.", "operationId": "list_wizards_api_v1_imports_wizards_get", "parameters": [{"name": "kind", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Kind"}}, {"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "default": 50, "title": "Limit"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response List Wizards Api V1 Imports Wizards Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/imports/wizards/{wizard_id}/step": {"post": {"tags": ["imports"], "summary": "Advance Wizard Step", "description": "Apply a partial state patch and advance the step counter.\n\nReturns ``{step, state, completed}`` (200).  ``completed`` is ``true``\nwhen the state contains a ``\"_completed\": true`` sentinel (set by the\nclient on the final step) \u2014 the wizard can then be committed.", "operationId": "advance_wizard_step_api_v1_imports_wizards__wizard_id__step_post", "parameters": [{"name": "wizard_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Wizard Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/WizardStepBody"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Advance Wizard Step Api V1 Imports Wizards  Wizard Id  Step Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/imports/wizards/{wizard_id}": {"get": {"tags": ["imports"], "summary": "Get Wizard", "description": "Return the current wizard state (without mutating it).\n\nReturns 404 when the wizard is missing or has expired.", "operationId": "get_wizard_api_v1_imports_wizards__wizard_id__get", "parameters": [{"name": "wizard_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Wizard Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Get Wizard Api V1 Imports Wizards  Wizard Id  Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/imports/wizards/{wizard_id}/commit": {"post": {"tags": ["imports"], "summary": "Commit Wizard", "description": "Run the import and persist the results.\n\nDispatches to the appropriate service based on the wizard's ``kind``.\n\n- ``bank_csv`` / ``bank_ofx``: calls ``persist_svc.persist_bank_lines``.\n- ``coa``: calls ``coa_svc.apply_coa_diff``.\n- ``qbo``: calls QBO contacts + accounts persistence (requires FLAG_QBO_IMPORT).\n\nPeriodLock: bank line imports do not create journal entries, so they\nskip the lock check.  CoA and QBO imports do not post journal entries\neither (they only insert/update accounts and contacts), so the period\nlock check is enforced as a future-proof gate only when the import\nkind would post journal entries.  Currently all four kinds are exempt\nfrom the period lock \u2014 the check is here as scaffolding so downstream\njournal-posting imports (e.g. open-balance JE imports) can simply\ncall ``_assert_not_period_locked``.\n\nReturns an import-result dict.", "operationId": "commit_wizard_api_v1_imports_wizards__wizard_id__commit_post", "parameters": [{"name": "wizard_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Wizard Id"}}, {"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Commit Wizard Api V1 Imports Wizards  Wizard Id  Commit Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/imports/bank/formats": {"get": {"tags": ["imports"], "summary": "Bank Formats", "description": "The statement formats the importer reads, in plain words.", "operationId": "bank_formats_api_v1_imports_bank_formats_get", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Bank Formats Api V1 Imports Bank Formats Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/imports/bank/preview": {"post": {"tags": ["imports"], "summary": "Bank Preview", "description": "Parse the file and report what importing it would do. Writes nothing:\nline count, date range, money in and out, which lines are already\nimported (exactly what the commit will skip), a sample, and a warning\nwhen a card file looks like its signs are the wrong way round.", "operationId": "bank_preview_api_v1_imports_bank_preview_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BankPreviewBody"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Bank Preview Api V1 Imports Bank Preview Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/imports/csv/{kind}/template": {"get": {"tags": ["imports"], "summary": "Template", "operationId": "template_api_v1_imports_csv__kind__template_get", "parameters": [{"name": "kind", "in": "path", "required": true, "schema": {"enum": ["contacts", "items", "bills"], "type": "string", "title": "Kind"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/imports/csv/{kind}/preview": {"post": {"tags": ["imports"], "summary": "Preview", "operationId": "preview_api_v1_imports_csv__kind__preview_post", "parameters": [{"name": "kind", "in": "path", "required": true, "schema": {"enum": ["contacts", "items", "bills"], "type": "string", "title": "Kind"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CsvImportIn"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Preview Api V1 Imports Csv  Kind  Preview Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/imports/csv/{kind}/commit": {"post": {"tags": ["imports"], "summary": "Commit", "operationId": "commit_api_v1_imports_csv__kind__commit_post", "parameters": [{"name": "kind", "in": "path", "required": true, "schema": {"enum": ["contacts", "items", "bills"], "type": "string", "title": "Kind"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CsvImportIn"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Commit Api V1 Imports Csv  Kind  Commit Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/opening-balances": {"get": {"tags": ["opening-balances"], "summary": "Get Status", "operationId": "get_status_api_v1_opening_balances_get", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Get Status Api V1 Opening Balances Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "post": {"tags": ["opening-balances"], "summary": "Post Save", "operationId": "post_save_api_v1_opening_balances_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TrialBalanceIn"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Post Save Api V1 Opening Balances Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/opening-balances/conversion-date": {"put": {"tags": ["opening-balances"], "summary": "Put Conversion Date", "operationId": "put_conversion_date_api_v1_opening_balances_conversion_date_put", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ConversionDateIn"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Put Conversion Date Api V1 Opening Balances Conversion Date Put"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/opening-balances/preview": {"post": {"tags": ["opening-balances"], "summary": "Post Preview", "operationId": "post_preview_api_v1_opening_balances_preview_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TrialBalanceIn"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Post Preview Api V1 Opening Balances Preview Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/opening-balances/check": {"get": {"tags": ["opening-balances"], "summary": "Get Check", "operationId": "get_check_api_v1_opening_balances_check_get", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Get Check Api V1 Opening Balances Check Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/opening-balances/template.csv": {"get": {"tags": ["opening-balances"], "summary": "Get Template", "operationId": "get_template_api_v1_opening_balances_template_csv_get", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/opening-balances/documents/preview": {"post": {"tags": ["opening-balances"], "summary": "Post Docs Preview", "operationId": "post_docs_preview_api_v1_opening_balances_documents_preview_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OpenDocsIn"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Post Docs Preview Api V1 Opening Balances Documents Preview Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/opening-balances/documents": {"post": {"tags": ["opening-balances"], "summary": "Post Docs Commit", "operationId": "post_docs_commit_api_v1_opening_balances_documents_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OpenDocsIn"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Post Docs Commit Api V1 Opening Balances Documents Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/setup/checklist": {"get": {"tags": ["setup"], "summary": "Checklist", "operationId": "checklist_api_v1_setup_checklist_get", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Checklist Api V1 Setup Checklist Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/setup/numbering": {"get": {"tags": ["setup"], "summary": "Get Numbering", "operationId": "get_numbering_api_v1_setup_numbering_get", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Get Numbering Api V1 Setup Numbering Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/setup/numbering/{kind}": {"put": {"tags": ["setup"], "summary": "Put Numbering", "operationId": "put_numbering_api_v1_setup_numbering__kind__put", "parameters": [{"name": "kind", "in": "path", "required": true, "schema": {"type": "string", "title": "Kind"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CounterIn"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Put Numbering Api V1 Setup Numbering  Kind  Put"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/setup/document-settings": {"get": {"tags": ["setup"], "summary": "Get Document Settings", "operationId": "get_document_settings_api_v1_setup_document_settings_get", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Get Document Settings Api V1 Setup Document Settings Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "patch": {"tags": ["setup"], "summary": "Patch Document Settings", "operationId": "patch_document_settings_api_v1_setup_document_settings_patch", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Body"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Patch Document Settings Api V1 Setup Document Settings Patch"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/setup/logo": {"get": {"tags": ["setup"], "summary": "Get Logo", "operationId": "get_logo_api_v1_setup_logo_get", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Get Logo Api V1 Setup Logo Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "put": {"tags": ["setup"], "summary": "Put Logo", "operationId": "put_logo_api_v1_setup_logo_put", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/LogoIn"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Put Logo Api V1 Setup Logo Put"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "delete": {"tags": ["setup"], "summary": "Delete Logo", "operationId": "delete_logo_api_v1_setup_logo_delete", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"204": {"description": "Successful Response"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/setup/logo/image": {"get": {"tags": ["setup"], "summary": "Get Logo Image", "operationId": "get_logo_image_api_v1_setup_logo_image_get", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/integrations/stripe/customer/connect": {"post": {"tags": ["integrations"], "summary": "Initiate customer Stripe Connect OAuth", "description": "Return the Stripe Connect authorisation URL and a CSRF state token.\n\nThe caller should redirect the user's browser to ``authorize_url``.\nThe ``state`` value must be stored and validated when Stripe calls\nback to the registered redirect URI.\n\nReturns:\n    200 ``{\"authorize_url\": \"<url>\", \"state\": \"<hex>\"}``", "operationId": "stripe_customer_connect_api_v1_integrations_stripe_customer_connect_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/integrations/stripe/customer": {"get": {"tags": ["integrations"], "summary": "Customer Stripe Connect status", "description": "Return the current Stripe Connect status for the authenticated tenant.\n\nReads the ``stripe_account_id`` stored on the tenant row (if any)\nand fetches live account metadata from Stripe's API.\n\nReturns:\n    200 ``{\"connected\": bool, \"account_id\": str|null, \"charges_enabled\":\n    bool, \"payouts_enabled\": bool, \"details_submitted\": bool}``", "operationId": "stripe_customer_status_api_v1_integrations_stripe_customer_get", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/integrations/lei/lookup": {"post": {"tags": ["integrations"], "summary": "Look up an LEI from GLEIF", "description": "Look up an LEI (Legal Entity Identifier) from the GLEIF registry.\n\nBody: ``{search: \"<lei or name>\"}``\n\nReturns the matching entity's name, address, jurisdiction, and\nregistration status.\n\nRaises:\n    404 when no entity matches the search term.\n    400 on upstream LEI API error.\n    503 when GLEIF is unreachable.", "operationId": "lei_lookup_api_v1_integrations_lei_lookup_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/LeiLookupRequest"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/integrations/companies-house/search": {"post": {"tags": ["integrations"], "summary": "Search UK Companies House", "description": "Search the UK Companies House register.\n\nBody: ``{query: \"<company name or number>\"}``\n\nReturns a list of matching companies with registration number,\nname, address, and status.\n\nRaises:\n    404 when no company matches the query.\n    503 when CH_API_KEY is not configured.\n    400 on upstream Companies House API error.", "operationId": "companies_house_search_api_v1_integrations_companies_house_search_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompaniesHouseSearchRequest"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/integrations/abr/lookup": {"post": {"tags": ["integrations"], "summary": "Look up an ABN from the Australian Business Register", "description": "Look up an ABN (Australian Business Number) via the ABR.\n\nBody: ``{abn: \"<11-digit ABN>\", contact_id?: <uuid>,\noverwrite?: bool, expected_version?: int}``\n\nWithout ``contact_id``, returns the parsed ABR envelope only\n(entity name, ABN status, GST registration, address state /\npostcode).\n\nWith ``contact_id``, additionally merges matched fields (name,\nstate, postcode, canonically-formatted ABN) onto that contact.\nEmpty contact fields are filled in by default; pass\n``overwrite=true`` to replace non-empty fields too. The merge is\ncomputed by the same ``apply_to_contact`` logic used everywhere\nelse ABR enrichment happens, then persisted through the existing\nversioned/audited ``contacts`` service \u2014 this endpoint does not\nwrite to the contact row directly.\n\nRaises:\n    404 when the ABN has no ABR record (or is well-formed but\n    unknown), or when ``contact_id`` doesn't resolve for this\n    tenant/company.\n    400 on a malformed ABN (not 11 digits) or another upstream\n    ABR error.\n    503 when ``ABR_API_GUID`` is not configured.\n    409 when ``expected_version`` doesn't match the contact's\n    current version (If-Match semantics).", "operationId": "abr_lookup_api_v1_integrations_abr_lookup_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AbrLookupRequest"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/integrations/ato/prefill": {"post": {"tags": ["integrations"], "summary": "ATO BAS prefill (stub \u2014 Batch KK)", "description": "Prefill BAS data from ATO's SBR endpoint.\n\nCurrently a stub \u2014 returns 501 until the Machine Credential\nonboarding (Batch KK) is complete.  No feature flag is required\nbecause the stub is harmless to expose at any tier; the live\nimplementation will enforce FLAG_ATO_SBR.\n\nBody: ``{period_start: \"YYYY-MM-DD\", period_end: \"YYYY-MM-DD\"}``", "operationId": "ato_prefill_api_v1_integrations_ato_prefill_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AtoPrefillRequest"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/integrations/paperless/webhook": {"post": {"tags": ["integrations"], "summary": "Inbound Paperless-ngx webhook (HMAC-validated)", "description": "Accept an inbound Paperless-ngx document-created webhook.\n\nAuthentication model\n--------------------\nPaperless supports a configurable ``PAPERLESS_CONSUMER_WEBHOOK``\nsecret that is sent as ``X-Paperless-Signature: sha256=<hex>``\non each event (HMAC-SHA256 of the raw body with the shared secret).\nThe secret is stored per-tenant in ``paperless_webhook_secrets``.\n\nTenant routing\n--------------\nThe inbound tenant is identified by the ``X-Tenant-Id`` header,\nwhich the operator must configure in their Paperless webhook URL\n(e.g. as a custom header). The handler loads the matching secret\nfrom the RLS-protected table and validates the signature.\n\nDocument-type routing\n---------------------\nAfter auth, the handler reads ``document_type`` from the JSON body\nand routes:\n\n* ``_STATEMENT_TYPES`` \u2192 statement reconciliation (``ingest_statement``).\n* ``_BILL_TYPES`` \u2192 draft bill creation (``ingest_document``).\n* unknown / empty type \u2192 skipped (no draft created \u2014 noise fix).\n* missing ``doc_id`` \u2192 skipped regardless of type (unchanged behaviour).\n\nReturns:\n    200 ``{\"received\": true, \"tenant_id\": \"<uuid>\"}`` on success.\n    400 on signature mismatch.\n    404 when no secret is configured for the tenant.\n    503 when field encryption is not configured.", "operationId": "paperless_webhook_api_v1_integrations_paperless_webhook_post", "parameters": [{"name": "X-Paperless-Signature", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Paperless-Signature"}}, {"name": "X-Tenant-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Tenant-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/pay-runs": {"post": {"tags": ["pay_runs"], "summary": "Create Pay Run", "operationId": "create_pay_run_api_v1_pay_runs_post", "parameters": [{"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PayRunCreate"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PayRunOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "get": {"tags": ["pay_runs"], "summary": "List Pay Runs", "operationId": "list_pay_runs_api_v1_pay_runs_get", "parameters": [{"name": "status", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Status"}}, {"name": "period", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Period"}}, {"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 500, "minimum": 1, "default": 50, "title": "Limit"}}, {"name": "offset", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 0, "default": 0, "title": "Offset"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PayRunListOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/pay-runs/{pay_run_id}": {"get": {"tags": ["pay_runs"], "summary": "Get Pay Run", "operationId": "get_pay_run_api_v1_pay_runs__pay_run_id__get", "parameters": [{"name": "pay_run_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Pay Run Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PayRunOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/pay-runs/{pay_run_id}/lines": {"post": {"tags": ["pay_runs"], "summary": "Add Line", "operationId": "add_line_api_v1_pay_runs__pay_run_id__lines_post", "parameters": [{"name": "pay_run_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Pay Run Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PayRunLineCreate"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PayRunLineOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/pay-runs/{pay_run_id}/lines/{line_id}": {"delete": {"tags": ["pay_runs"], "summary": "Delete Line", "operationId": "delete_line_api_v1_pay_runs__pay_run_id__lines__line_id__delete", "parameters": [{"name": "pay_run_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Pay Run Id"}}, {"name": "line_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Line Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"204": {"description": "Successful Response"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/pay-runs/{pay_run_id}/export-aba": {"post": {"tags": ["pay_runs"], "summary": "Export Aba", "operationId": "export_aba_api_v1_pay_runs__pay_run_id__export_aba_post", "parameters": [{"name": "pay_run_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Pay Run Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ExportAbaOut"}}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/PayRunConflictBody"}}}, "description": "Conflict"}, "428": {"description": "If-Match required"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/pay-runs/{pay_run_id}/finalize": {"put": {"tags": ["pay_runs"], "summary": "Finalize Pay Run", "operationId": "finalize_pay_run_api_v1_pay_runs__pay_run_id__finalize_put", "parameters": [{"name": "pay_run_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Pay Run Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PayRunOut"}}}}, "409": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/PayRunConflictBody"}}}, "description": "Conflict"}, "428": {"description": "If-Match required"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/pay-runs/{pay_run_id}/void": {"post": {"tags": ["pay_runs"], "summary": "Void Pay Run", "description": "Void a FINALIZED pay run: reverse its wages journal and undo what\nfinalise did outside the journal (``pay_runs_v2.void_pay_run``).\n\nRefused with 409 and a ``code`` when the ATO pay event was lodged\n(``stp_lodged``), the super was paid or sent (``super_paid``), a later\nfinalised run in the year includes one of its employees\n(``later_pay_run``), or the journal cannot be reversed (``journal_refused``:\nlocked period, reconciled bank line). A DRAFT run is not voided (422):\nremove its lines instead.", "operationId": "void_pay_run_api_v1_pay_runs__pay_run_id__void_post", "parameters": [{"name": "pay_run_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Pay Run Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"content": {"application/json": {"schema": {"anyOf": [{"$ref": "#/components/schemas/PayRunVoidIn"}, {"type": "null"}], "title": "Body"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PayRunOut"}}}}, "409": {"description": "Version mismatch, or the run cannot be voided (STP lodged, super paid, later run, locked period)"}, "428": {"description": "If-Match required"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/pay-runs/{pay_run_id}/wages": {"get": {"tags": ["pay_runs"], "summary": "Get Wage Run", "operationId": "get_wage_run_api_v1_pay_runs__pay_run_id__wages_get", "parameters": [{"name": "pay_run_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Pay Run Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/WageRunOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/pay-runs/{pay_run_id}/wage-lines": {"post": {"tags": ["pay_runs"], "summary": "Add Wage Line", "operationId": "add_wage_line_api_v1_pay_runs__pay_run_id__wage_lines_post", "parameters": [{"name": "pay_run_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Pay Run Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/WageLineCreate"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/WageRunOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/pay-runs/{pay_run_id}/finalize-wages": {"post": {"tags": ["pay_runs"], "summary": "Finalize Wage Run", "operationId": "finalize_wage_run_api_v1_pay_runs__pay_run_id__finalize_wages_post", "parameters": [{"name": "pay_run_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Pay Run Id"}}, {"name": "If-Match", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "If-Match"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/WageFinalizeIn"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/WageRunOut"}}}}, "409": {"description": "Version mismatch or amounts changed"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/pay-runs/{pay_run_id}/payslips/{employee_id}": {"get": {"tags": ["pay_runs"], "summary": "Get Payslip", "operationId": "get_payslip_api_v1_pay_runs__pay_run_id__payslips__employee_id__get", "parameters": [{"name": "pay_run_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Pay Run Id"}}, {"name": "employee_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Employee Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PayslipOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/cashbook/entries": {"post": {"tags": ["cashbook"], "summary": "Create Entry", "description": "Record a cashbook entry.\n\nRequires ``X-Idempotency-Key``: same key + same body returns the\nsame JE id; same key + different body returns the originally-\ncreated JE (the service is amount-of-truth, not the request body)\n\u2014 see ``services.cashbook.record_cashbook_entry`` for the exact\ncontract.", "operationId": "create_entry_api_v1_cashbook_entries_post", "parameters": [{"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CashbookEntryCreate"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CashbookEntryOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "get": {"tags": ["cashbook"], "summary": "List Entries", "description": "List cashbook entries for the active company.\n\nFilters: date range (``from``/``to``), direction\n(income/expense), category code. ``limit`` caps the page; the\ncursor is the ``created_at`` ISO string of the last item \u2014 sole\ntraders rarely have enough volume for the cursor to matter, but\nit keeps the contract honest.", "operationId": "list_entries_api_v1_cashbook_entries_get", "parameters": [{"name": "from", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "From"}}, {"name": "to", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "To"}}, {"name": "direction", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "pattern": "^(income|expense)$"}, {"type": "null"}], "title": "Direction"}}, {"name": "category", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Category"}}, {"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 200, "minimum": 1, "default": 50, "title": "Limit"}}, {"name": "cursor", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Cursor"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CashbookEntryListOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/cashbook/entries/{entry_id}": {"get": {"tags": ["cashbook"], "summary": "Get Entry", "operationId": "get_entry_api_v1_cashbook_entries__entry_id__get", "parameters": [{"name": "entry_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Entry Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CashbookEntryOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "delete": {"tags": ["cashbook"], "summary": "Delete Entry", "description": "Soft-delete a cashbook entry by posting a reversing JE.\n\nThe original entry's status flips to ``REVERSED`` and it disappears\nfrom the cashbook list/get/summary surfaces. The audit trail stays\nintact at the ``journal_entries`` layer.\n\nIdempotent: re-deleting an already-voided entry returns 204 without\nre-posting a reversal.", "operationId": "delete_entry_api_v1_cashbook_entries__entry_id__delete", "parameters": [{"name": "entry_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Entry Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"204": {"description": "Successful Response"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "patch": {"tags": ["cashbook"], "summary": "Replace Entry", "description": "Replace a cashbook entry \u2014 voids the original and creates a new\nJE with the new payload.\n\nCashbook PATCH is \"void & re-create, never in-place\" \u2014 the original\nJE gets a reversal entry; the new JE is the surface answer for\nlist/get/summary. The new entry's ``cashbook_meta.replaces_id``\npoints back at the original for audit walk-through.\n\nRequires ``X-Idempotency-Key`` (the key tags the *new* entry; same\nkey + same body returns the same replacement).", "operationId": "replace_entry_api_v1_cashbook_entries__entry_id__patch", "parameters": [{"name": "entry_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Entry Id"}}, {"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CashbookEntryCreate"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CashbookEntryOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/cashbook/categories": {"get": {"tags": ["cashbook"], "summary": "List Categories", "description": "Return the picker-ready category list for the active company.\n\nPer-company overrides (``companies.cashbook_categories.overrides``)\nare applied. A ``hidden: true`` override drops the category from\nthe list.", "operationId": "list_categories_api_v1_cashbook_categories_get", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "array", "items": {"$ref": "#/components/schemas/CashbookCategoryOut"}, "title": "Response List Categories Api V1 Cashbook Categories Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/cashbook/summary": {"get": {"tags": ["cashbook"], "summary": "Get Summary", "description": "P&L-shaped summary collapsed into cashbook categories.\n\nThe summary reads cashbook-tagged JEs only. Income is the sum of\ncredits to income accounts (which equal debits to bank for\ncashbook entries); expense is the sum of debits to expense\naccounts. GST totals are read from the cashbook_meta blob, not\nthe GST account lines, because cashbook_meta is canonical.", "operationId": "get_summary_api_v1_cashbook_summary_get", "parameters": [{"name": "from", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "From"}}, {"name": "to", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "To"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CashbookSummaryOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/cashbook/summary.csv": {"get": {"tags": ["cashbook"], "summary": "Get Summary Csv", "description": "Cashbook summary for a date range, CSV export.", "operationId": "get_summary_csv_api_v1_cashbook_summary_csv_get", "parameters": [{"name": "from", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "From"}}, {"name": "to", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "To"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/cashbook/summary.xlsx": {"get": {"tags": ["cashbook"], "summary": "Get Summary Xlsx", "description": "Cashbook summary for a date range, XLSX export.", "operationId": "get_summary_xlsx_api_v1_cashbook_summary_xlsx_get", "parameters": [{"name": "from", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "From"}}, {"name": "to", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "To"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/cashbook/setup": {"post": {"tags": ["cashbook"], "summary": "Setup Cashbook", "description": "Flip the active company into cashbook mode.\n\nIdempotent for already-cashbook companies (re-pinning the bank\naccount). Refuses if the company has any existing journal entries\n(mid-life full\u2192cashbook is unsupported by design).\n\nThe ``bank_account_id`` must be an existing account on this\ncompany's chart of accounts. Create the account first via\n``POST /api/v1/accounts`` if needed.", "operationId": "setup_cashbook_api_v1_cashbook_setup_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CashbookSetupBody"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CashbookModeOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/cashbook/upgrade-to-full": {"post": {"tags": ["cashbook"], "summary": "Upgrade To Full", "description": "Flip the active company from cashbook \u2192 full edition.\n\nCashbook entries are real journal entries, so the upgrade is\npurely a UX flag flip \u2014 no data migration runs.\n\nRound-2 audit fix #10: the reverse direction (full \u2192 cashbook)\n*is* supported now via\n``POST /api/v1/companies/{id}/bookkeeping-mode`` per\n``[[cashbook-upgrade-downgrade-policy]]``. Downgrade refuses\nwhen AR > 0 and lists the offending invoices.\n\nReturns 409 if the company is already in 'full' mode.", "operationId": "upgrade_to_full_api_v1_cashbook_upgrade_to_full_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CashbookModeOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/auth/webauthn/register/begin": {"post": {"tags": ["webauthn"], "summary": "Register Begin", "operationId": "register_begin_api_v1_auth_webauthn_register_begin_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RegisterBeginResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/auth/webauthn/register/finish": {"post": {"tags": ["webauthn"], "summary": "Register Finish", "operationId": "register_finish_api_v1_auth_webauthn_register_finish_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RegisterFinishRequest"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RegisterFinishResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/auth/webauthn/authenticate/begin": {"post": {"tags": ["webauthn"], "summary": "Authenticate Begin", "operationId": "authenticate_begin_api_v1_auth_webauthn_authenticate_begin_post", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AuthenticateBeginResponse"}}}}}}}, "/api/v1/auth/webauthn/authenticate/finish": {"post": {"tags": ["webauthn"], "summary": "Authenticate Finish", "operationId": "authenticate_finish_api_v1_auth_webauthn_authenticate_finish_post", "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/AuthenticateFinishRequest"}}}, "required": true}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AuthenticateFinishResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/auth/webauthn/credentials": {"get": {"tags": ["webauthn"], "summary": "List Credentials", "operationId": "list_credentials_api_v1_auth_webauthn_credentials_get", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "array", "items": {"$ref": "#/components/schemas/CredentialOut"}, "title": "Response List Credentials Api V1 Auth Webauthn Credentials Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/auth/webauthn/credentials/{cred_id}": {"delete": {"tags": ["webauthn"], "summary": "Delete Credential", "operationId": "delete_credential_api_v1_auth_webauthn_credentials__cred_id__delete", "parameters": [{"name": "cred_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Cred Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "responses": {"204": {"description": "Successful Response"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/principal/auth/webauthn/register/begin": {"post": {"tags": ["principal"], "summary": "Register Begin", "operationId": "register_begin_api_v1_principal_auth_webauthn_register_begin_post", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/WebauthnBeginResponse"}}}}}}}, "/api/v1/principal/auth/webauthn/register/finish": {"post": {"tags": ["principal"], "summary": "Register Finish", "operationId": "register_finish_api_v1_principal_auth_webauthn_register_finish_post", "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/RegisterFinishRequest"}}}, "required": true}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RegisterFinishResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/principal/tenants": {"get": {"tags": ["principal"], "summary": "List Tenants", "description": "Return the tenants this principal may act as (its own active grants).\n\nReads via ``list_actable_tenants`` -> ``principal_visible_grants`` (the\nSECURITY DEFINER resolver) with the AUTHENTICATED principal's id. A\nprincipal can never enumerate another principal's grants \u2014 the id is taken\nfrom the session, never the request.", "operationId": "list_tenants_api_v1_principal_tenants_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"items": {"$ref": "#/components/schemas/ActableTenantOut"}, "type": "array", "title": "Response List Tenants Api V1 Principal Tenants Get"}}}}}}}, "/api/v1/principal/act-as": {"post": {"tags": ["principal"], "summary": "Act As", "description": "Bind the principal to ``tenant_id`` after verifying an active grant.\n\nVerifies the grant via ``resolve_grant_role`` under the app role; on\nsuccess mints a TENANT-BOUND principal token. No active grant -> 403, no\ntoken, no binding. The bound token's subsequent queries run under the\nSAME FORCE-RLS path as a native user (``deps.get_session`` binds\n``app.current_tenant`` from the claim \u2014 see that wiring).", "operationId": "act_as_api_v1_principal_act_as_post", "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ActAsRequest"}}}, "required": true}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PrincipalSessionResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/principal/acting/contacts": {"get": {"tags": ["principal"], "summary": "Acting Contacts", "operationId": "acting_contacts_api_v1_principal_acting_contacts_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"items": {"$ref": "#/components/schemas/BoundContactOut"}, "type": "array", "title": "Response Acting Contacts Api V1 Principal Acting Contacts Get"}}}}}}}, "/api/v1/principal-grants": {"get": {"tags": ["principal-grants"], "summary": "List Grants", "operationId": "list_grants_api_v1_principal_grants_get", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Admin", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Admin"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "array", "items": {"$ref": "#/components/schemas/GrantOut"}, "title": "Response List Grants Api V1 Principal Grants Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "post": {"tags": ["principal-grants"], "summary": "Create Grant", "description": "Create an active grant for the AUTHENTICATED tenant.\n\nThe ``tenant_id`` is taken from the authenticated session\n(``resolve_tenant_id``), NOT from the request body \u2014 a tenant cannot ask\nto grant on behalf of another tenant. Even if the value were forged, the\n``tenant_isolation`` WITH CHECK would reject an INSERT whose tenant_id !=\napp.current_tenant. The role is validated app-side (and the DB coherence\ntrigger fails closed on an unknown role).", "operationId": "create_grant_api_v1_principal_grants_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Admin", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Admin"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GrantCreate"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GrantOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/principal-grants/{grant_id}": {"delete": {"tags": ["principal-grants"], "summary": "Revoke Grant", "description": "Revoke an active grant. Access is removed immediately for new act-as.\n\nThe UPDATE runs under ``app.current_tenant`` = the caller's tenant, so the\n``tenant_isolation`` policy means a tenant can only revoke its OWN grants \u2014\na grant id belonging to another tenant simply matches zero rows (404). We\nsoft-delete (status='revoked') to keep the audit trail; the partial unique\nindex is on active rows only, so a fresh grant can be re-issued later.", "operationId": "revoke_grant_api_v1_principal_grants__grant_id__delete", "parameters": [{"name": "grant_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Grant Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Admin", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Admin"}}], "responses": {"204": {"description": "Successful Response"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/tpar": {"get": {"tags": ["tpar"], "summary": "List Tpar Runs", "operationId": "list_tpar_runs_api_v1_tpar_get", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "post": {"tags": ["tpar"], "summary": "Create Tpar Run", "description": "Generate (or regenerate) a TPAR run for the given FY.\n\nBody:\n    {\n      \"fy_start\": \"2025-07-01\",     // optional, defaults to current FY start\n      \"fy_end\":   \"2026-06-30\",     // optional, fy_start + 1 year - 1 day\n      \"notes\":    \"\u2026\"\n    }", "operationId": "create_tpar_run_api_v1_tpar_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Payload"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/tpar/{run_id}": {"get": {"tags": ["tpar"], "summary": "Get Tpar Run", "operationId": "get_tpar_run_api_v1_tpar__run_id__get", "parameters": [{"name": "run_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Run Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/tpar/{run_id}/lines": {"get": {"tags": ["tpar"], "summary": "Get Tpar Run Lines", "operationId": "get_tpar_run_lines_api_v1_tpar__run_id__lines_get", "parameters": [{"name": "run_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Run Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/tpar/{run_id}/lines.csv": {"get": {"tags": ["tpar"], "summary": "Get Tpar Run Csv", "operationId": "get_tpar_run_csv_api_v1_tpar__run_id__lines_csv_get", "parameters": [{"name": "run_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Run Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/tpar/{run_id}/lines.bde": {"get": {"tags": ["tpar"], "summary": "Get Tpar Run Bde", "description": "Download the run as an ATO BDE (FPAIVV03.0) flat file for OS4B upload.\n\nDefaults to a **test-facility** file (Run type T); pass ``?production=true``\nfor the production file once self-testing passes. 422s (naming the missing\nfield) if the ledger lacks something the flat file mandates.", "operationId": "get_tpar_run_bde_api_v1_tpar__run_id__lines_bde_get", "parameters": [{"name": "run_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Run Id"}}, {"name": "production", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Production"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/tpar/{run_id}/finalise": {"post": {"tags": ["tpar"], "summary": "Finalise Tpar Run", "operationId": "finalise_tpar_run_api_v1_tpar__run_id__finalise_post", "parameters": [{"name": "run_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Run Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/super_lodgements": {"get": {"tags": ["super_lodgements"], "summary": "List Super Lodgements", "operationId": "list_super_lodgements_api_v1_super_lodgements_get", "parameters": [{"name": "pay_run_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Pay Run Id"}}, {"name": "status", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Status"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "post": {"tags": ["super_lodgements"], "summary": "Create Super Lodgement", "description": "Generate a super lodgement run for a pay run.\n\nBody::\n\n    {\"pay_run_id\": \"...\", \"notes\": \"optional\"}", "operationId": "create_super_lodgement_api_v1_super_lodgements_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Payload"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/super_lodgements/{run_id}": {"get": {"tags": ["super_lodgements"], "summary": "Get Super Lodgement", "operationId": "get_super_lodgement_api_v1_super_lodgements__run_id__get", "parameters": [{"name": "run_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Run Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/super_lodgements/{run_id}/lines": {"get": {"tags": ["super_lodgements"], "summary": "Get Super Lodgement Lines", "operationId": "get_super_lodgement_lines_api_v1_super_lodgements__run_id__lines_get", "parameters": [{"name": "run_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Run Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/super_lodgements/{run_id}/lines.csv": {"get": {"tags": ["super_lodgements"], "summary": "Get Super Lodgement Csv", "description": "The run's contributions in the ATO SuperStream alternative file\nformat v1.0 (``services.super_saff``), TFNs included. Never cached.\n409 with the reasons when a quoted TFN is missing or unreadable.", "operationId": "get_super_lodgement_csv_api_v1_super_lodgements__run_id__lines_csv_get", "parameters": [{"name": "run_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Run Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/super_lodgements/{run_id}/finalise": {"post": {"tags": ["super_lodgements"], "summary": "Finalise Super Lodgement", "operationId": "finalise_super_lodgement_api_v1_super_lodgements__run_id__finalise_post", "parameters": [{"name": "run_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Run Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/super_lodgements/{run_id}/mark-submitted": {"post": {"tags": ["super_lodgements"], "summary": "Mark Super Lodgement Submitted Route", "description": "Operator confirms they've uploaded the SAFF + got a receipt.\n\nBody::\n\n    {\"reference\": \"clearing-house receipt id\"}", "operationId": "mark_super_lodgement_submitted_route_api_v1_super_lodgements__run_id__mark_submitted_post", "parameters": [{"name": "run_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Run Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Payload"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/tax_returns": {"get": {"tags": ["tax_returns"], "summary": "List Tax Returns", "operationId": "list_tax_returns_api_v1_tax_returns_get", "parameters": [{"name": "period_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Period Id"}}, {"name": "return_type", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Return Type"}}, {"name": "status", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Status"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "post": {"tags": ["tax_returns"], "summary": "Create Tax Return", "description": "Create a new DRAFT tax return.\n\nBody:\n    {\n        \"jurisdiction\": \"AU\",\n        \"period_id\":    \"<UUID of tax_periods row>\",\n        \"return_type\":  \"BAS\" | \"IAS\" | \"TPAR\" | \"STP_PAYEVENT\",\n        \"figures\":      { \"G1\": \"...\" }\n    }", "operationId": "create_tax_return_api_v1_tax_returns_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Payload"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/tax_returns/{return_id}": {"get": {"tags": ["tax_returns"], "summary": "Get Tax Return", "operationId": "get_tax_return_api_v1_tax_returns__return_id__get", "parameters": [{"name": "return_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Return Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/tax_returns/generate": {"post": {"tags": ["tax_returns"], "summary": "Generate Tax Return", "description": "Compute a real return from the ledger and persist it (status READY).\n\nUnlike ``POST /tax_returns`` (a bare DRAFT shell for hand-built\nfigures), this actually aggregates the company's ledger against the\njurisdiction/return_type's box definitions via\n``tax_return_generator.generate_return`` + ``persist_return`` \u2014 the\nsame path ``reports.bas_summary`` uses for AU BAS, generalised to\nany box-vector return type (e.g. EE's KMD).\n\nBody:\n    {\n        \"jurisdiction\": \"EE\",\n        \"period_id\":    \"<UUID of tax_periods row>\",\n        \"return_type\":  \"KMD\" | \"BAS\" | \"IAS\" | ...\n    }\n\nBox-vector return types (with ``tax_return_box_definitions`` rows)\nplus the Estonian TSD (``return_type == \"TSD\"``, dispatched to\n``_generate_tsd_return`` \u2014 its own pay-run-listing generator) are\nsupported. The remaining list-shaped types (KMD-INF, KMD-2027) raise\n422 here; use their own dedicated generator functions directly.", "operationId": "generate_tax_return_api_v1_tax_returns_generate_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Payload"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/tax_returns/{return_id}/export": {"get": {"tags": ["tax_returns"], "summary": "Export Tax Return", "description": "Render the persisted return's filable document (XML/CSV bytes).\n\nDispatches by (jurisdiction, return_type) to the matching document\nbuilder:\n\n* AU BAS/IAS   -> ``services.lodgement.sbr.build_bas_document``\n  (same builder ``/lodge`` uses, reused here for a plain download \u2014\n  no lodge-server round trip).\n* EE KMD       -> ``services.lodgement.kmd.serializer.build_kmd_xml_document``,\n  reconstructing ``KmdFigures`` from the persisted ``figures`` JSONB\n  (the exact round-trip ``persist_return``'s docstring documents).\n* EE TSD       -> ``_build_tsd_envelope`` (``services.lodgement.tsd.\n  build_tsd_xml_document``), RE-GENERATED from the source FINALIZED\n  pay runs rather than the persisted ``figures`` \u2014 the JSONB copy masks\n  the isikukood, which the filed XML needs in full (see that helper).\n\nAny other (jurisdiction, return_type) \u2014 including the remaining\nlist-shaped types (KMD-INF, KMD-2027) that have no\n``figures``->typed-object reconstruction today \u2014 raises 501, not a\nbest-effort guess.", "operationId": "export_tax_return_api_v1_tax_returns__return_id__export_get", "parameters": [{"name": "return_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Return Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/tax_returns/{return_id}/file": {"post": {"tags": ["tax_returns"], "summary": "File Tax Return", "description": "Mark a persisted return FILED \u2014 the manual file-and-confirm path.\n\nDistinct from ``/lodge`` (which dispatches to the automated SBR/\nX-Road rail and sets status ``lodged``): this is for a return the\naccountant filed themselves outside any automated rail (e.g. via\nEMTA's e-service portal for a KMD/TSD the engine doesn't yet lodge\nautomatically). Stamps ``filed_at`` and sets ``status='filed'``.\n\nBody (all optional): ``{\"reference\": \"<filer's own confirmation\nreference/receipt number>\"}`` \u2014 stored as-is in ``figures.filed_reference``\nif supplied; no schema on it, this is a free-text confirmation note.", "operationId": "file_tax_return_api_v1_tax_returns__return_id__file_post", "parameters": [{"name": "return_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Return Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "default": {}, "title": "Payload"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/tax_returns/{return_id}/lodge": {"post": {"tags": ["tax_returns"], "summary": "Lodge Tax Return", "description": "Dispatch the return to the lodge-server.\n\nRoutes by ``return_type``:\n  * STP_PAYEVENT  -> LodgementService.lodge_stp\n  * BAS / IAS     -> LodgementService.lodge_bas\n  * TPAR          -> LodgementService.lodge_tpar\n  * SUPERSTREAM   -> LodgementService.send_superstream\n\nThe envelope is either supplied by the caller (base64\n``envelope_b64``, e.g. an external generator) or built here: BAS/IAS\nfrom the return's figures, STP_PAYEVENT from a stored pay-event\npayload. When neither applies there is NO real file, and the call is\nrefused with 409 (``no_lodgement_file``) before anything is sent or\nrecorded. This used to transmit a placeholder comment as the\n\"envelope\" for TPAR and SuperStream (and for an STP return with no\npayees) and record the return as lodged.", "operationId": "lodge_tax_return_api_v1_tax_returns__return_id__lodge_post", "parameters": [{"name": "return_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Return Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "default": {}, "title": "Payload"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/tax_returns/{return_id}/lodgement": {"get": {"tags": ["tax_returns"], "summary": "Get Tax Return Lodgement", "operationId": "get_tax_return_lodgement_api_v1_tax_returns__return_id__lodgement_get", "parameters": [{"name": "return_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Return Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/bas/position": {"get": {"tags": ["bas"], "summary": "Bas Position", "description": "GST to set aside for the current BAS period and the next due date.\n\n``current`` is the period containing ``as_of`` (to date). ``due`` is the\nearliest period that has ended and is not marked lodged \u2014 that is the\none the reminder is about.", "operationId": "bas_position_api_v1_bas_position_get", "parameters": [{"name": "as_of", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "description": "Defaults to today.", "title": "As Of"}, "description": "Defaults to today."}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/bas/gst_detail": {"get": {"tags": ["bas"], "summary": "Bas Gst Detail", "operationId": "bas_gst_detail_api_v1_bas_gst_detail_get", "parameters": [{"name": "label", "in": "query", "required": true, "schema": {"type": "string", "description": "G1 G2 G3 G10 G11 1A 1B W1 W2", "title": "Label"}, "description": "G1 G2 G3 G10 G11 1A 1B W1 W2"}, {"name": "from_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "From Date"}}, {"name": "to_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "To Date"}}, {"name": "basis", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "pattern": "^(accrual|cash)$"}, {"type": "null"}], "title": "Basis"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/bas/periods": {"get": {"tags": ["bas"], "summary": "Bas Periods", "description": "Every AU BAS period with its saved return and settlement, newest\nfirst, plus the most recent finished periods not yet worked out.", "operationId": "bas_periods_api_v1_bas_periods_get", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/bas/returns": {"post": {"tags": ["bas"], "summary": "Bas Create Return", "description": "Work out the BAS for a period and save it (status ``ready``).\n\nSaving again before it is lodged replaces the saved figures. A period\nalready marked lodged is refused (409): amend it at the ATO and record\nthe amendment separately.", "operationId": "bas_create_return_api_v1_bas_returns_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BasReturnCreate"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/bas/returns/{return_id}/lodge": {"post": {"tags": ["bas"], "summary": "Bas Mark Lodged", "description": "Record that this BAS was lodged with the ATO (outside this app).\n\nMarks the return ``lodged`` with the lodgement date and ATO reference,\nmarks its period lodged (voids dated inside it then warn), and when\n``lock_period`` is true also locks the books through the period end\n(admins only; skipped if the books are already locked that far).", "operationId": "bas_mark_lodged_api_v1_bas_returns__return_id__lodge_post", "parameters": [{"name": "return_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Return Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BasLodge"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/bas/lodged_check": {"get": {"tags": ["bas"], "summary": "Bas Lodged Check", "description": "Is ``date`` inside a BAS period marked lodged? Used by void dialogs.", "operationId": "bas_lodged_check_api_v1_bas_lodged_check_get", "parameters": [{"name": "date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "Date"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/bas/settle/preview": {"get": {"tags": ["bas"], "summary": "Bas Settle Preview", "operationId": "bas_settle_preview_api_v1_bas_settle_preview_get", "parameters": [{"name": "from_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "From Date"}}, {"name": "to_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "To Date"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/bas/settle": {"post": {"tags": ["bas"], "summary": "Bas Settle", "operationId": "bas_settle_api_v1_bas_settle_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BasSettle"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/bas/settle/payment": {"post": {"tags": ["bas"], "summary": "Bas Record Payment", "description": "Record the payment to the ATO for a BAS settled without one: spend\nmoney for what the settlement put in the ATO account, plus any extra\nlines. Refused if the period is not settled, is a refund, or is already\npaid.", "operationId": "bas_record_payment_api_v1_bas_settle_payment_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BasRecordPayment"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/bas/settle/refund": {"post": {"tags": ["bas"], "summary": "Bas Record Refund", "description": "Record the refund from the ATO for a BAS settled without it: receive\nmoney for what the settlement put in the ATO account. Refused if the\nperiod is not settled, is not a refund, or the refund is already\nrecorded.", "operationId": "bas_record_refund_api_v1_bas_settle_refund_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BasRecordRefund"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/statements/ingest": {"post": {"tags": ["statements"], "summary": "Ingest a Paperless document as a supplier statement", "description": "Ingest a Paperless document as a supplier statement.\n\nCalls ``ingest_statement(...)`` \u2014 fetches OCR text, extracts structured\nfields, reconciles against AP bills, and sets status via gates. Never\nposts to the GL.\n\nWrite-scope: read-only API tokens are rejected (403) by\n``require_bearer``'s scope enforcement before this handler runs.\n\nIdempotency: supply ``X-Idempotency-Key`` (any non-empty string) to make\nthe call retry-safe (24 h replay window, matching the bills pattern).\n\nReturns:\n    201 with the full ``StatementDetailOut`` shape on success or replay.", "operationId": "ingest_api_v1_statements_ingest_post", "parameters": [{"name": "X-Idempotency-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Idempotency-Key"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/StatementIngestRequest"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Ingest Api V1 Statements Ingest Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/statements": {"get": {"tags": ["statements"], "summary": "List supplier statements (queue)", "description": "Return the statement queue for the active company.\n\nOrdered by ``created_at`` desc (newest first). Optionally filter by\n``status`` \u2014 any ``StatementStatus`` value.\n\nReturns:\n    ``{\"items\": [StatementListItem], \"total\": int}``", "operationId": "list_statements_api_v1_statements_get", "parameters": [{"name": "status", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Status"}}, {"name": "contact_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Contact Id"}}, {"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 500, "minimum": 1, "default": 50, "title": "Limit"}}, {"name": "offset", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 0, "default": 0, "title": "Offset"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response List Statements Api V1 Statements Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/statements/{statement_id}": {"get": {"tags": ["statements"], "summary": "Get a supplier statement with lines", "description": "Return the full detail for a single statement, including all lines.\n\nRLS makes foreign-tenant rows invisible \u2014 the query returns None and we\nreturn 404, the same contract as ``GET /bills/{id}``.\n\nReturns:\n    ``StatementDetailOut`` on success, 404 if not found.", "operationId": "get_statement_api_v1_statements__statement_id__get", "parameters": [{"name": "statement_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Statement Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Get Statement Api V1 Statements  Statement Id  Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/statements/{statement_id}/draft-missing-bill": {"post": {"tags": ["statements"], "summary": "Draft a bill for a missing-in-books line", "description": "Draft a 0-line AP bill for a line whose match_status is missing_in_books.\n\nThe bill is created as a DRAFT \u2014 the operator must code the expense\naccount(s) and post it manually. This endpoint never posts to the GL.\n\nWrite-scope: read-only API tokens receive 403 (enforced by\n``require_bearer`` before this handler runs).\n\nArgs:\n    line_id: UUID of the ``SupplierStatementLine`` to action. Must belong\n        to this statement and have ``match_status == \"missing_in_books\"``.\n\nReturns:\n    201 ``{\"bill_id\": \"<uuid>\", \"statement\": <StatementDetailOut>}``\n\nRaises:\n    404: Statement not found for this tenant/company.\n    422: Line not found on this statement, or its match_status is not\n        ``missing_in_books``.", "operationId": "draft_missing_bill_api_v1_statements__statement_id__draft_missing_bill_post", "parameters": [{"name": "statement_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Statement Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Body_draft_missing_bill_api_v1_statements__statement_id__draft_missing_bill_post"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Draft Missing Bill Api V1 Statements  Statement Id  Draft Missing Bill Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/statements/{statement_id}/dismiss": {"post": {"tags": ["statements"], "summary": "Dismiss a supplier statement (not an AP statement / not actionable)", "description": "Mark a statement as dismissed.\n\nUsed for documents that are not AP statements or are otherwise not\nactionable (e.g. marketing material, duplicates).\n\nWrite-scope: read-only API tokens receive 403.\n\nReturns:\n    ``StatementDetailOut`` with ``status == \"dismissed\"``.\n\nRaises:\n    404: Statement not found for this tenant/company.", "operationId": "dismiss_statement_api_v1_statements__statement_id__dismiss_post", "parameters": [{"name": "statement_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Statement Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Dismiss Statement Api V1 Statements  Statement Id  Dismiss Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/statements/{statement_id}/confirm": {"post": {"tags": ["statements"], "summary": "Confirm a supplier statement as reconciled", "description": "Mark a statement as reconciled (operator has reviewed and signed off).\n\nWrite-scope: read-only API tokens receive 403.\n\nReturns:\n    ``StatementDetailOut`` with ``status == \"reconciled\"``.\n\nRaises:\n    404: Statement not found for this tenant/company.", "operationId": "confirm_statement_api_v1_statements__statement_id__confirm_post", "parameters": [{"name": "statement_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Statement Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Confirm Statement Api V1 Statements  Statement Id  Confirm Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/statement-templates": {"post": {"tags": ["statement-templates"], "summary": "Create a supplier-statement extraction-hint template", "description": "Create a per-supplier extraction-hint template.\n\nAt least one match key (``contact_id``, ``supplier_abn``, or\n``supplier_name``) is required alongside a non-empty ``prompt_hint``.\n\nWrite-scope: read-only API tokens receive 403.\n\nReturns:\n    201 with the created template object.", "operationId": "create_template_api_v1_statement_templates_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TemplateCreateRequest"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Create Template Api V1 Statement Templates Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "get": {"tags": ["statement-templates"], "summary": "List supplier-statement extraction-hint templates", "description": "Return templates for the active company.\n\nAll filters are optional; multiple filters combine with AND.\n\nReturns:\n    ``{\"items\": [TemplateOut]}``", "operationId": "list_templates_api_v1_statement_templates_get", "parameters": [{"name": "contact_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Contact Id"}}, {"name": "supplier_abn", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Supplier Abn"}}, {"name": "active", "in": "query", "required": false, "schema": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "title": "Active"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response List Templates Api V1 Statement Templates Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/statement-templates/{template_id}": {"delete": {"tags": ["statement-templates"], "summary": "Delete a supplier-statement extraction-hint template", "description": "Hard-delete a template.\n\nWrite-scope: read-only API tokens receive 403.\n\nReturns:\n    204 on success.\n\nRaises:\n    404: Template not found for this tenant/company.", "operationId": "delete_template_api_v1_statement_templates__template_id__delete", "parameters": [{"name": "template_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Template Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}, {"name": "X-Company-Id", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Company-Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"title": "Response Delete Template Api V1 Statement Templates  Template Id  Delete"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/sync/xero/connect": {"post": {"tags": ["sync-xero"], "summary": "Connect", "description": "Start a Xero consent flow.\n\nPersists the customer's OAuth ``client_id``/``client_secret`` (Fernet\n-encrypted) on a new ``sync_connections`` row in\n``pending_consent`` status. Returns the URL the operator's browser\nshould redirect to.", "operationId": "connect_api_v1_sync_xero_connect_post", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ConnectIn"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ConnectOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/sync/xero/callback": {"get": {"tags": ["sync-xero"], "summary": "Callback", "description": "OAuth redirect target.\n\nXero redirects the operator's browser here with ``?code=...&state=...``.\nWe exchange the code for tokens, fetch the available orgs, and\ntransition the connection to ``active``.\n\nThe endpoint deliberately requires the bearer + feature flag \u2014 i.e.\nthe *operator session* must still be alive in the API. If the\noperator has logged out, the redirect lands on a 401 and the\nconnection stays ``pending_consent``.", "operationId": "callback_api_v1_sync_xero_callback_get", "parameters": [{"name": "code", "in": "query", "required": true, "schema": {"type": "string", "title": "Code"}}, {"name": "state", "in": "query", "required": true, "schema": {"type": "string", "title": "State"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "title": "Response Callback Api V1 Sync Xero Callback Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/sync/xero/status": {"get": {"tags": ["sync-xero"], "summary": "Status", "description": "List all Xero connections for the current tenant.", "operationId": "status_api_v1_sync_xero_status_get", "parameters": [{"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "array", "items": {"$ref": "#/components/schemas/ConnectionOut"}, "title": "Response Status Api V1 Sync Xero Status Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/sync/xero/{connection_id}": {"delete": {"tags": ["sync-xero"], "summary": "Disconnect", "description": "Revoke a Xero connection.\n\nMarks the row ``revoked`` and zeroes the refresh-token ciphertext.\nLocal sync_state rows are kept (they're useful for re-linking on\nre-connect) but the connection's ``oauth_refresh_token_ciphertext``\nis wiped so the credential cannot be reused.", "operationId": "disconnect_api_v1_sync_xero__connection_id__delete", "parameters": [{"name": "connection_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Connection Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "responses": {"204": {"description": "Successful Response"}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/sync/xero/{connection_id}/trigger": {"post": {"tags": ["sync-xero"], "summary": "Trigger", "description": "Run one full sync cycle synchronously.\n\nReturns the run report. This endpoint is the only execution path\nas of this port \u2014 a scheduled background worker is future work\n(see docs/sync/xero.md).", "operationId": "trigger_api_v1_sync_xero__connection_id__trigger_post", "parameters": [{"name": "connection_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid", "title": "Connection Id"}}, {"name": "authorization", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Authorization"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TriggerOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}}, "components": {"schemas": {"AbrLookupRequest": {"properties": {"abn": {"type": "string", "title": "Abn"}, "contact_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Contact Id"}, "overwrite": {"type": "boolean", "title": "Overwrite", "default": false}, "expected_version": {"anyOf": [{"type": "integer"}, {"type": "null"}], "title": "Expected Version"}}, "type": "object", "required": ["abn"], "title": "AbrLookupRequest"}, "AccountConflictBody": {"properties": {"detail": {"type": "string", "title": "Detail"}, "current": {"$ref": "#/components/schemas/AccountOut"}}, "type": "object", "required": ["detail", "current"], "title": "AccountConflictBody"}, "AccountCreate": {"properties": {"code": {"type": "string", "maxLength": 32, "minLength": 1, "title": "Code"}, "name": {"type": "string", "maxLength": 255, "minLength": 1, "title": "Name"}, "account_type": {"$ref": "#/components/schemas/AccountType"}, "parent_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Parent Id"}, "tax_code_default": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Tax Code Default"}, "is_header": {"type": "boolean", "title": "Is Header", "default": false}, "reconcile": {"type": "boolean", "title": "Reconcile", "default": false}}, "type": "object", "required": ["code", "name", "account_type"], "title": "AccountCreate", "description": "POST body for creating a new account."}, "AccountListOut": {"properties": {"items": {"items": {"$ref": "#/components/schemas/AccountOut"}, "type": "array", "title": "Items"}, "total": {"type": "integer", "title": "Total"}, "limit": {"type": "integer", "title": "Limit"}, "offset": {"type": "integer", "title": "Offset"}}, "type": "object", "required": ["items", "total", "limit", "offset"], "title": "AccountListOut"}, "AccountOut": {"properties": {"code": {"type": "string", "maxLength": 32, "minLength": 1, "title": "Code"}, "name": {"type": "string", "maxLength": 255, "minLength": 1, "title": "Name"}, "account_type": {"$ref": "#/components/schemas/AccountType"}, "parent_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Parent Id"}, "tax_code_default": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Tax Code Default"}, "is_header": {"type": "boolean", "title": "Is Header", "default": false}, "reconcile": {"type": "boolean", "title": "Reconcile", "default": false}, "id": {"type": "string", "format": "uuid", "title": "Id"}, "company_id": {"type": "string", "format": "uuid", "title": "Company Id"}, "tenant_id": {"type": "string", "format": "uuid", "title": "Tenant Id"}, "version": {"type": "integer", "title": "Version"}, "system_managed": {"type": "boolean", "title": "System Managed"}, "bsb": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Bsb"}, "bank_account_number": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Bank Account Number"}, "bank_account_title": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Bank Account Title"}, "apca_user_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Apca User Id"}, "bank_abbreviation": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Bank Abbreviation"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At"}, "archived_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Archived At"}}, "type": "object", "required": ["code", "name", "account_type", "id", "company_id", "tenant_id", "version", "system_managed", "created_at"], "title": "AccountOut"}, "AccountRangeCreate": {"properties": {"prefix": {"type": "string", "maxLength": 16, "minLength": 1, "title": "Prefix"}, "label": {"type": "string", "maxLength": 255, "minLength": 1, "title": "Label"}, "account_types": {"items": {"type": "string"}, "type": "array", "title": "Account Types"}, "sort_order": {"type": "integer", "title": "Sort Order", "default": 0}}, "type": "object", "required": ["prefix", "label", "account_types"], "title": "AccountRangeCreate", "description": "POST body for creating an account range."}, "AccountRangeListOut": {"properties": {"items": {"items": {"$ref": "#/components/schemas/AccountRangeOut"}, "type": "array", "title": "Items"}, "total": {"type": "integer", "title": "Total"}}, "type": "object", "required": ["items", "total"], "title": "AccountRangeListOut"}, "AccountRangeOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "company_id": {"type": "string", "format": "uuid", "title": "Company Id"}, "prefix": {"type": "string", "title": "Prefix"}, "label": {"type": "string", "title": "Label"}, "account_types": {"items": {"type": "string"}, "type": "array", "title": "Account Types"}, "sort_order": {"type": "integer", "title": "Sort Order"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At"}}, "type": "object", "required": ["id", "company_id", "prefix", "label", "account_types", "sort_order", "created_at"], "title": "AccountRangeOut", "description": "Full account range response."}, "AccountRangeUpdate": {"properties": {"label": {"anyOf": [{"type": "string", "maxLength": 255, "minLength": 1}, {"type": "null"}], "title": "Label"}, "account_types": {"anyOf": [{"items": {"type": "string"}, "type": "array"}, {"type": "null"}], "title": "Account Types"}, "sort_order": {"anyOf": [{"type": "integer"}, {"type": "null"}], "title": "Sort Order"}}, "type": "object", "title": "AccountRangeUpdate", "description": "PATCH body \u2014 prefix is immutable; every other field optional."}, "AccountType": {"type": "string", "enum": ["ASSET", "LIABILITY", "EQUITY", "INCOME", "OTHER_INCOME", "EXPENSE", "COST_OF_SALES", "OTHER_EXPENSE"], "title": "AccountType"}, "AccountUpdate": {"properties": {"code": {"anyOf": [{"type": "string", "maxLength": 32, "minLength": 1}, {"type": "null"}], "title": "Code"}, "name": {"anyOf": [{"type": "string", "maxLength": 255, "minLength": 1}, {"type": "null"}], "title": "Name"}, "account_type": {"anyOf": [{"$ref": "#/components/schemas/AccountType"}, {"type": "null"}]}, "tax_code_default": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Tax Code Default"}, "is_header": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "title": "Is Header"}, "reconcile": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "title": "Reconcile"}, "account_kind": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Account Kind", "description": "BANK_CHECKING | BANK_SAVINGS | CREDIT_CARD | BANK_LOAN | CASH | OTHER"}}, "type": "object", "title": "AccountUpdate", "description": "PATCH body \u2014 every field optional."}, "ActAsRequest": {"properties": {"tenant_id": {"type": "string", "format": "uuid", "title": "Tenant Id"}}, "type": "object", "required": ["tenant_id"], "title": "ActAsRequest"}, "ActableTenantOut": {"properties": {"tenant_id": {"type": "string", "format": "uuid", "title": "Tenant Id"}, "role": {"type": "string", "title": "Role"}, "grant_id": {"type": "string", "format": "uuid", "title": "Grant Id"}}, "type": "object", "required": ["tenant_id", "role", "grant_id"], "title": "ActableTenantOut"}, "AgedReport": {"properties": {"as_of_date": {"type": "string", "format": "date", "title": "As Of Date"}, "buckets": {"items": {"type": "string"}, "type": "array", "title": "Buckets"}, "contacts": {"items": {"additionalProperties": true, "type": "object"}, "type": "array", "title": "Contacts"}, "totals": {"additionalProperties": true, "type": "object", "title": "Totals"}, "retentions_receivable": {"anyOf": [{"additionalProperties": true, "type": "object"}, {"type": "null"}], "title": "Retentions Receivable"}, "unapplied_credits": {"items": {"additionalProperties": true, "type": "object"}, "type": "array", "title": "Unapplied Credits"}, "unapplied_total": {"type": "number", "title": "Unapplied Total", "default": 0.0}, "net_total": {"anyOf": [{"type": "number"}, {"type": "null"}], "title": "Net Total"}, "control_account_code": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Control Account Code"}, "control_balance": {"anyOf": [{"type": "number"}, {"type": "null"}], "title": "Control Balance"}, "tie_out_difference": {"anyOf": [{"type": "number"}, {"type": "null"}], "title": "Tie Out Difference"}}, "type": "object", "required": ["as_of_date", "buckets", "contacts", "totals"], "title": "AgedReport", "description": "Full aged receivables / payables report.\n\n``buckets`` is the ordered list of bucket label strings.\n``contacts`` is one row per contact (each row has keys matching\n``buckets`` plus ``contact_id``, ``contact_name``, ``total``).\n``totals`` is the grand-total row (Trade Debtors only \u2014 excludes\nretentions) with the same bucket keys plus ``total``.\n``retentions_receivable`` is present on AR reports only; it carries\nthe cumulative Retentions Receivable balance split by aging bucket,\nmatching the same bucket keys as ``totals``.  None when there are no\noutstanding retentions (or for AP reports where retentions don't apply)."}, "AllocationApplyIn": {"properties": {"entry_date": {"type": "string", "format": "date", "title": "Entry Date"}, "amount": {"anyOf": [{"type": "number", "exclusiveMinimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Amount"}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Description"}}, "type": "object", "required": ["entry_date", "amount"], "title": "AllocationApplyIn", "description": "Request body for POST /api/v1/allocation_rules/{id}/apply."}, "AllocationApplyOut": {"properties": {"journal_entry_id": {"type": "string", "format": "uuid", "title": "Journal Entry Id"}, "lines_count": {"type": "integer", "title": "Lines Count"}, "total_amount": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Total Amount"}}, "type": "object", "required": ["journal_entry_id", "lines_count", "total_amount"], "title": "AllocationApplyOut", "description": "Response from apply \u2014 the generated journal entry id."}, "AllocationRuleCreate": {"properties": {"name": {"type": "string", "maxLength": 255, "minLength": 1, "title": "Name"}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Description"}, "source_account_id": {"type": "string", "format": "uuid", "title": "Source Account Id"}, "targets": {"items": {"$ref": "#/components/schemas/AllocationTarget"}, "type": "array", "minItems": 1, "title": "Targets"}, "is_active": {"type": "boolean", "title": "Is Active", "default": true}}, "type": "object", "required": ["name", "source_account_id", "targets"], "title": "AllocationRuleCreate"}, "AllocationRuleListOut": {"properties": {"items": {"items": {"$ref": "#/components/schemas/AllocationRuleOut"}, "type": "array", "title": "Items"}, "total": {"type": "integer", "title": "Total"}, "limit": {"type": "integer", "title": "Limit"}, "offset": {"type": "integer", "title": "Offset"}}, "type": "object", "required": ["items", "total", "limit", "offset"], "title": "AllocationRuleListOut"}, "AllocationRuleOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "company_id": {"type": "string", "format": "uuid", "title": "Company Id"}, "tenant_id": {"type": "string", "format": "uuid", "title": "Tenant Id"}, "name": {"type": "string", "title": "Name"}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Description"}, "source_account_id": {"type": "string", "format": "uuid", "title": "Source Account Id"}, "targets": {"items": {"additionalProperties": true, "type": "object"}, "type": "array", "title": "Targets"}, "is_active": {"type": "boolean", "title": "Is Active"}, "version": {"type": "integer", "title": "Version"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At"}, "updated_at": {"type": "string", "format": "date-time", "title": "Updated At"}, "archived_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Archived At"}}, "type": "object", "required": ["id", "company_id", "tenant_id", "name", "description", "source_account_id", "targets", "is_active", "version", "created_at", "updated_at", "archived_at"], "title": "AllocationRuleOut"}, "AllocationRuleUpdate": {"properties": {"name": {"anyOf": [{"type": "string", "maxLength": 255, "minLength": 1}, {"type": "null"}], "title": "Name"}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Description"}, "source_account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Source Account Id"}, "targets": {"anyOf": [{"items": {"$ref": "#/components/schemas/AllocationTarget"}, "type": "array"}, {"type": "null"}], "title": "Targets"}, "is_active": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "title": "Is Active"}}, "type": "object", "title": "AllocationRuleUpdate"}, "AllocationTarget": {"properties": {"account_id": {"type": "string", "format": "uuid", "title": "Account Id"}, "label": {"type": "string", "maxLength": 200, "title": "Label", "default": ""}, "percentage": {"anyOf": [{"type": "number", "maximum": 100.0, "exclusiveMinimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Percentage"}}, "type": "object", "required": ["account_id", "percentage"], "title": "AllocationTarget", "description": "One target entry in an allocation rule."}, "ApprovalBody": {"properties": {"action": {"type": "string", "enum": ["submit", "approve", "send_back"], "title": "Action"}, "note": {"anyOf": [{"type": "string", "maxLength": 1000}, {"type": "null"}], "title": "Note"}, "planned_pay_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Planned Pay Date"}}, "type": "object", "required": ["action"], "title": "ApprovalBody"}, "AtoPrefillRequest": {"properties": {"period_start": {"type": "string", "title": "Period Start"}, "period_end": {"type": "string", "title": "Period End"}}, "type": "object", "required": ["period_start", "period_end"], "title": "AtoPrefillRequest"}, "AttentionItemOut": {"properties": {"key": {"type": "string", "title": "Key"}, "count": {"type": "integer", "title": "Count"}, "amount": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Amount"}, "oldest": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Oldest"}}, "type": "object", "required": ["key", "count"], "title": "AttentionItemOut"}, "AuditSnapshotEntry": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "table_name": {"type": "string", "title": "Table Name"}, "row_id": {"type": "string", "title": "Row Id"}, "action": {"type": "string", "title": "Action"}, "before_data": {"additionalProperties": true, "type": "object", "title": "Before Data"}, "after_data": {"anyOf": [{"additionalProperties": true, "type": "object"}, {"type": "null"}], "title": "After Data"}, "reason": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Reason"}, "performed_by": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Performed By"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At"}}, "type": "object", "required": ["id", "table_name", "row_id", "action", "before_data", "after_data", "reason", "performed_by", "created_at"], "title": "AuditSnapshotEntry", "description": "One row from ``audit_snapshots`` \u2014 the FLAG_AUDIT_SNAPSHOTS browse API."}, "AuditSnapshotFilterOptions": {"properties": {"tables": {"items": {"type": "string"}, "type": "array", "title": "Tables"}, "actors": {"items": {"type": "string"}, "type": "array", "title": "Actors"}}, "type": "object", "required": ["tables", "actors"], "title": "AuditSnapshotFilterOptions"}, "AuditSnapshotPage": {"properties": {"items": {"items": {"$ref": "#/components/schemas/AuditSnapshotEntry"}, "type": "array", "title": "Items"}, "total": {"type": "integer", "title": "Total"}, "limit": {"type": "integer", "title": "Limit"}, "offset": {"type": "integer", "title": "Offset"}}, "type": "object", "required": ["items", "total", "limit", "offset"], "title": "AuditSnapshotPage"}, "AuthenticateBeginResponse": {"properties": {"publicKey": {"additionalProperties": true, "type": "object", "title": "Publickey"}}, "type": "object", "required": ["publicKey"], "title": "AuthenticateBeginResponse"}, "AuthenticateFinishRequest": {"properties": {"credential": {"additionalProperties": true, "type": "object", "title": "Credential"}}, "type": "object", "required": ["credential"], "title": "AuthenticateFinishRequest"}, "AuthenticateFinishResponse": {"properties": {"access_token": {"type": "string", "title": "Access Token"}, "token_type": {"type": "string", "title": "Token Type", "default": "bearer"}, "expires_in": {"type": "integer", "title": "Expires In"}}, "type": "object", "required": ["access_token", "expires_in"], "title": "AuthenticateFinishResponse"}, "BASSummary": {"properties": {"from_date": {"type": "string", "format": "date", "title": "From Date"}, "to_date": {"type": "string", "format": "date", "title": "To Date"}, "basis": {"type": "string", "title": "Basis", "default": "accrual"}, "g1_total_sales": {"type": "number", "title": "G1 Total Sales"}, "g2_export_sales": {"type": "number", "title": "G2 Export Sales"}, "g3_other_gst_free_sales": {"type": "number", "title": "G3 Other Gst Free Sales"}, "g10_capital_acquisitions": {"type": "number", "title": "G10 Capital Acquisitions"}, "g11_other_acquisitions": {"type": "number", "title": "G11 Other Acquisitions"}, "label_1a_gst_on_sales": {"type": "number", "title": "Label 1A Gst On Sales"}, "label_1b_gst_on_purchases": {"type": "number", "title": "Label 1B Gst On Purchases"}, "net_gst": {"type": "number", "title": "Net Gst"}, "remit_or_refund": {"type": "string", "title": "Remit Or Refund"}, "registration_effective_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Registration Effective Date"}, "g1_pre_registration": {"type": "number", "title": "G1 Pre Registration", "default": 0.0}, "g1_post_registration": {"type": "number", "title": "G1 Post Registration", "default": 0.0}, "w1_total_wages": {"type": "number", "title": "W1 Total Wages", "default": 0.0}, "w2_amounts_withheld": {"type": "number", "title": "W2 Amounts Withheld", "default": 0.0}, "label_4_payg_withheld": {"type": "number", "title": "Label 4 Payg Withheld", "default": 0.0}, "label_5a_payg_instalment": {"type": "number", "title": "Label 5A Payg Instalment", "default": 0.0}, "label_8a_owed_to_ato": {"type": "number", "title": "Label 8A Owed To Ato", "default": 0.0}, "label_8b_owed_by_ato": {"type": "number", "title": "Label 8B Owed By Ato", "default": 0.0}, "label_9_amount_payable": {"type": "number", "title": "Label 9 Amount Payable", "default": 0.0}, "result": {"type": "string", "title": "Result", "default": "NIL"}, "pay_run_count": {"type": "integer", "title": "Pay Run Count", "default": 0}, "withholding_account_code": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Withholding Account Code"}, "withholding_account_credits": {"type": "number", "title": "Withholding Account Credits", "default": 0.0}, "withholding_difference": {"type": "number", "title": "Withholding Difference", "default": 0.0}, "notes": {"items": {"type": "string"}, "type": "array", "title": "Notes"}}, "type": "object", "required": ["from_date", "to_date", "g1_total_sales", "g2_export_sales", "g3_other_gst_free_sales", "g10_capital_acquisitions", "g11_other_acquisitions", "label_1a_gst_on_sales", "label_1b_gst_on_purchases", "net_gst", "remit_or_refund"], "title": "BASSummary", "description": "Australian Business Activity Statement for a date range.\n\nEvery figure comes from ``jurisdictions.au.bas_service.compute_bas`` \u2014\nthe one BAS calculation shared by every screen and export. Labels use\nthe ATO calculation-worksheet convention (all GST-inclusive):\n\n  G1  \u2014 Total sales INCLUDING GST (taxable, GST-free, export, input taxed)\n  G2  \u2014 Export sales;  G3 \u2014 Other GST-free sales (both inside G1)\n  G10 \u2014 Capital purchases INCLUDING GST\n  G11 \u2014 Non-capital purchases INCLUDING GST\n  1A  \u2014 GST on sales;  1B \u2014 GST on purchases (from the GST accounts)\n  W1  \u2014 Total salary and wages; W2 \u2014 amounts withheld (finalised pay\n        runs only, by payment date); label 4 = W2\n  5A  \u2014 PAYG instalment (T7) as entered; 8A = 1A + 4 + 5A; 8B = 1B;\n  9   \u2014 amount payable (positive) or refundable (negative)\n\n``remit_or_refund`` is the GST-only result and is \"NIL\" when 1A = 1B.\n``result`` is the whole-statement result (PAYABLE / REFUND / NIL).\n``basis`` is \"accrual\" or \"cash\".\n\nWhen registration_effective_date is set (mid-period GST registration),\nG1 is split into pre- and post-registration totals; 1A, 1B, G10 and G11\nonly count from the registration date."}, "BSAccountLine": {"properties": {"account_id": {"type": "string", "format": "uuid", "title": "Account Id"}, "account_name": {"type": "string", "title": "Account Name"}, "code": {"type": "string", "title": "Code"}, "balance": {"type": "number", "title": "Balance"}, "comparative": {"anyOf": [{"type": "number"}, {"type": "null"}], "title": "Comparative"}}, "type": "object", "required": ["account_id", "account_name", "code", "balance"], "title": "BSAccountLine", "description": "One account's balance in a balance sheet section.\n\n``comparative`` (R7) is the account's balance as at the comparative\ndate -- only populated when ``?compare=previous_period|previous_year``\nwas requested; absent from the response otherwise."}, "BSAssets": {"properties": {"ASSET": {"items": {"$ref": "#/components/schemas/BSAccountLine"}, "type": "array", "title": "Asset"}, "total_assets": {"type": "number", "title": "Total Assets"}, "total_assets_comparative": {"anyOf": [{"type": "number"}, {"type": "null"}], "title": "Total Assets Comparative"}}, "type": "object", "required": ["total_assets"], "title": "BSAssets", "description": "Assets section of a balance sheet."}, "BSEquity": {"properties": {"EQUITY": {"items": {"$ref": "#/components/schemas/BSAccountLine"}, "type": "array", "title": "Equity"}, "total_equity": {"type": "number", "title": "Total Equity"}, "total_equity_comparative": {"anyOf": [{"type": "number"}, {"type": "null"}], "title": "Total Equity Comparative"}}, "type": "object", "required": ["total_equity"], "title": "BSEquity", "description": "Equity section of a balance sheet."}, "BSLiabilities": {"properties": {"LIABILITY": {"items": {"$ref": "#/components/schemas/BSAccountLine"}, "type": "array", "title": "Liability"}, "total_liabilities": {"type": "number", "title": "Total Liabilities"}, "total_liabilities_comparative": {"anyOf": [{"type": "number"}, {"type": "null"}], "title": "Total Liabilities Comparative"}}, "type": "object", "required": ["total_liabilities"], "title": "BSLiabilities", "description": "Liabilities section of a balance sheet."}, "BSReport": {"properties": {"as_of_date": {"type": "string", "format": "date", "title": "As Of Date"}, "assets": {"$ref": "#/components/schemas/BSAssets"}, "liabilities": {"$ref": "#/components/schemas/BSLiabilities"}, "equity": {"$ref": "#/components/schemas/BSEquity"}, "balanced": {"type": "boolean", "title": "Balanced"}, "difference": {"type": "number", "title": "Difference"}, "warnings": {"items": {"type": "string"}, "type": "array", "title": "Warnings"}, "compare": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Compare"}, "comparative_as_of_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Comparative As Of Date"}}, "type": "object", "required": ["as_of_date", "assets", "liabilities", "equity", "balanced", "difference"], "title": "BSReport", "description": "Full balance sheet as at a given date.\n\nR7 comparative fields (``compare``, ``comparative_as_of_date``, and\neach line's ``comparative``/``total_*_comparative``) are populated\nONLY when the caller opts in via ``?compare=previous_period|previous_year``\n-- omitted from the JSON response entirely when not requested.\nBalance-sheet comparative = the balance AS AT the comparative date\n(not a period movement), matching the statement-pack PDF's prior-year\nbalance-sheet semantics."}, "BankAccountConflictBody": {"properties": {"detail": {"type": "string", "title": "Detail"}, "current": {"$ref": "#/components/schemas/BankAccountOut"}}, "type": "object", "required": ["detail", "current"], "title": "BankAccountConflictBody"}, "BankAccountCreate": {"properties": {"code": {"type": "string", "maxLength": 32, "minLength": 1, "title": "Code"}, "name": {"type": "string", "maxLength": 255, "minLength": 1, "title": "Name"}, "account_kind": {"type": "string", "title": "Account Kind", "description": "One of BANK_CHECKING / BANK_SAVINGS / CREDIT_CARD / BANK_LOAN / CASH / OTHER", "default": "BANK_CHECKING"}, "bsb": {"anyOf": [{"type": "string", "maxLength": 7, "minLength": 6}, {"type": "null"}], "title": "Bsb", "description": "BSB formatted 'xxx-xxx' \u2014 required for BANK_* kinds, ignored otherwise"}, "bank_account_number": {"anyOf": [{"type": "string", "maxLength": 32}, {"type": "null"}], "title": "Bank Account Number"}, "bank_account_title": {"anyOf": [{"type": "string", "maxLength": 32}, {"type": "null"}], "title": "Bank Account Title"}, "apca_user_id": {"anyOf": [{"type": "string", "maxLength": 6}, {"type": "null"}], "title": "Apca User Id"}, "bank_abbreviation": {"anyOf": [{"type": "string", "maxLength": 3}, {"type": "null"}], "title": "Bank Abbreviation"}, "is_trust_account": {"type": "boolean", "title": "Is Trust Account", "default": false}, "show_on_invoice": {"type": "boolean", "title": "Show On Invoice", "description": "Render this account's bank details on invoice/credit-note PDFs (Remit-to). Setting true clears the flag on every other account in the company.", "default": false}, "credit_limit": {"anyOf": [{"type": "number", "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Credit Limit", "description": "Credit limit for this account; null = no limit"}, "credit_limit_kind": {"type": "string", "enum": ["soft", "hard"], "title": "Credit Limit Kind", "description": "soft (warn only, default) | hard \u2014 mirrors SeatCapKind", "default": "soft"}, "currency": {"anyOf": [{"type": "string", "maxLength": 3, "minLength": 3}, {"type": "null"}], "title": "Currency", "description": "Currency the account is held in; leave out for the company currency"}}, "type": "object", "required": ["code", "name"], "title": "BankAccountCreate", "description": "POST body for creating a new bank-side account (bank/card/loan/cash)."}, "BankAccountListOut": {"properties": {"items": {"items": {"$ref": "#/components/schemas/BankAccountOut"}, "type": "array", "title": "Items"}, "total": {"type": "integer", "title": "Total"}, "limit": {"type": "integer", "title": "Limit"}, "offset": {"type": "integer", "title": "Offset"}}, "type": "object", "required": ["items", "total", "limit", "offset"], "title": "BankAccountListOut"}, "BankAccountOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "company_id": {"type": "string", "format": "uuid", "title": "Company Id"}, "tenant_id": {"type": "string", "format": "uuid", "title": "Tenant Id"}, "code": {"type": "string", "title": "Code"}, "name": {"type": "string", "title": "Name"}, "account_kind": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Account Kind"}, "account_type": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Account Type"}, "bsb": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Bsb"}, "bank_account_number": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Bank Account Number"}, "bank_account_title": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Bank Account Title"}, "apca_user_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Apca User Id"}, "bank_abbreviation": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Bank Abbreviation"}, "is_trust_account": {"type": "boolean", "title": "Is Trust Account", "default": false}, "show_on_invoice": {"type": "boolean", "title": "Show On Invoice", "default": false}, "currency": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Currency"}, "version": {"type": "integer", "title": "Version"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At"}, "archived_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Archived At"}, "balance": {"anyOf": [{"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Balance"}, "statement_balance": {"anyOf": [{"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Statement Balance"}, "credit_limit": {"anyOf": [{"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Credit Limit"}, "credit_limit_kind": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Credit Limit Kind"}, "available": {"anyOf": [{"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Available"}, "over_limit": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "title": "Over Limit"}}, "type": "object", "required": ["id", "company_id", "tenant_id", "code", "name", "version", "created_at"], "title": "BankAccountOut", "description": "Full bank account response."}, "BankAccountUpdate": {"properties": {"code": {"anyOf": [{"type": "string", "maxLength": 32, "minLength": 1}, {"type": "null"}], "title": "Code"}, "name": {"anyOf": [{"type": "string", "maxLength": 255, "minLength": 1}, {"type": "null"}], "title": "Name"}, "account_kind": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Account Kind", "description": "Re-classify between BANK_*/CREDIT_CARD/BANK_LOAN/CASH/OTHER"}, "bsb": {"anyOf": [{"type": "string", "maxLength": 7, "minLength": 6}, {"type": "null"}], "title": "Bsb"}, "bank_account_number": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Bank Account Number"}, "bank_account_title": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Bank Account Title"}, "apca_user_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Apca User Id"}, "bank_abbreviation": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Bank Abbreviation"}, "is_trust_account": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "title": "Is Trust Account"}, "show_on_invoice": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "title": "Show On Invoice"}, "credit_limit": {"anyOf": [{"type": "number", "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Credit Limit"}, "credit_limit_kind": {"anyOf": [{"type": "string", "enum": ["soft", "hard"]}, {"type": "null"}], "title": "Credit Limit Kind"}, "currency": {"anyOf": [{"type": "string", "maxLength": 3, "minLength": 3}, {"type": "null"}], "title": "Currency", "description": "Currency the account is held in; leave out for the company currency"}}, "type": "object", "title": "BankAccountUpdate", "description": "PATCH body \u2014 every field optional."}, "BankPreviewBody": {"properties": {"account_id": {"type": "string", "format": "uuid", "title": "Account Id"}, "raw": {"type": "string", "title": "Raw"}, "format": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Format"}, "flip_signs": {"type": "boolean", "title": "Flip Signs", "default": false}}, "type": "object", "required": ["account_id", "raw"], "title": "BankPreviewBody"}, "BankRuleApplyOut": {"properties": {"applied": {"type": "integer", "title": "Applied"}}, "type": "object", "required": ["applied"], "title": "BankRuleApplyOut", "description": "Response body for POST /bank_rules/apply and POST /bank_rules/{id}/apply."}, "BankRuleCreate": {"properties": {"name": {"type": "string", "maxLength": 255, "minLength": 1, "title": "Name"}, "match_pattern": {"type": "string", "minLength": 1, "title": "Match Pattern"}, "match_type": {"type": "string", "title": "Match Type", "default": "CONTAINS"}, "account_id": {"type": "string", "format": "uuid", "title": "Account Id"}, "tax_code": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Tax Code"}, "contact_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Contact Id"}, "description_template": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Description Template"}, "auto_create": {"type": "boolean", "title": "Auto Create", "default": false}, "priority": {"type": "integer", "title": "Priority", "default": 0}, "is_active": {"type": "boolean", "title": "Is Active", "default": true}, "direction": {"type": "string", "maxLength": 8, "title": "Direction", "default": "ANY"}, "amount_min": {"anyOf": [{"type": "number", "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Amount Min"}, "amount_max": {"anyOf": [{"type": "number", "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Amount Max"}, "bank_account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Bank Account Id"}}, "type": "object", "required": ["name", "match_pattern", "account_id"], "title": "BankRuleCreate", "description": "POST body for creating a bank rule."}, "BankRuleListOut": {"properties": {"items": {"items": {"$ref": "#/components/schemas/BankRuleOut"}, "type": "array", "title": "Items"}, "total": {"type": "integer", "title": "Total"}, "limit": {"type": "integer", "title": "Limit"}, "offset": {"type": "integer", "title": "Offset"}}, "type": "object", "required": ["items", "total", "limit", "offset"], "title": "BankRuleListOut"}, "BankRuleOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "company_id": {"type": "string", "format": "uuid", "title": "Company Id"}, "name": {"type": "string", "title": "Name"}, "match_pattern": {"type": "string", "title": "Match Pattern"}, "match_type": {"type": "string", "title": "Match Type"}, "account_id": {"type": "string", "format": "uuid", "title": "Account Id"}, "tax_code": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Tax Code"}, "contact_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Contact Id"}, "description_template": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Description Template"}, "auto_create": {"type": "boolean", "title": "Auto Create"}, "priority": {"type": "integer", "title": "Priority"}, "is_active": {"type": "boolean", "title": "Is Active"}, "direction": {"type": "string", "title": "Direction", "default": "ANY"}, "amount_min": {"anyOf": [{"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Amount Min"}, "amount_max": {"anyOf": [{"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Amount Max"}, "bank_account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Bank Account Id"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At"}, "updated_at": {"type": "string", "format": "date-time", "title": "Updated At"}}, "type": "object", "required": ["id", "company_id", "name", "match_pattern", "match_type", "account_id", "auto_create", "priority", "is_active", "created_at", "updated_at"], "title": "BankRuleOut", "description": "Full bank rule response."}, "BankRuleUpdate": {"properties": {"name": {"anyOf": [{"type": "string", "maxLength": 255, "minLength": 1}, {"type": "null"}], "title": "Name"}, "match_pattern": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Match Pattern"}, "match_type": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Match Type"}, "account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Account Id"}, "tax_code": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Tax Code"}, "contact_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Contact Id"}, "description_template": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Description Template"}, "auto_create": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "title": "Auto Create"}, "priority": {"anyOf": [{"type": "integer"}, {"type": "null"}], "title": "Priority"}, "is_active": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "title": "Is Active"}, "direction": {"anyOf": [{"type": "string", "maxLength": 8}, {"type": "null"}], "title": "Direction"}, "amount_min": {"anyOf": [{"type": "number", "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Amount Min"}, "amount_max": {"anyOf": [{"type": "number", "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Amount Max"}, "bank_account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Bank Account Id"}}, "type": "object", "title": "BankRuleUpdate", "description": "PATCH body \u2014 every field optional."}, "BankStatementLineBulkCreate": {"properties": {"account_id": {"type": "string", "format": "uuid", "title": "Account Id"}, "bank_feed_account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Bank Feed Account Id"}, "lines": {"items": {"$ref": "#/components/schemas/BankStatementLineBulkItem"}, "type": "array", "title": "Lines"}}, "type": "object", "required": ["account_id", "lines"], "title": "BankStatementLineBulkCreate", "description": "POST body for ``/bank_statement_lines/bulk``.\n\nDedup strategy is inferred from provenance: when\n``bank_feed_account_id`` is set, the feed EXTERNAL_ID + ON CONFLICT\nstrategy is used (every line must carry ``external_id``); otherwise\nthe CSV/OFX FINGERPRINT strategy is used."}, "BankStatementLineBulkItem": {"properties": {"txn_date": {"type": "string", "format": "date", "title": "Txn Date"}, "amount": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Amount"}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Description"}, "reference": {"anyOf": [{"type": "string", "maxLength": 128}, {"type": "null"}], "title": "Reference"}, "external_id": {"anyOf": [{"type": "string", "maxLength": 255}, {"type": "null"}], "title": "External Id"}}, "type": "object", "required": ["txn_date", "amount"], "title": "BankStatementLineBulkItem", "description": "One line in a bulk statement-line create.\n\n``external_id`` is REQUIRED when the request carries a\n``bank_feed_account_id`` (feed provenance \u2014 it becomes the upstream\ntransaction id deduped by ON CONFLICT); it is ignored for the CSV/OFX\nfingerprint path, which computes its own external_id."}, "BankStatementLineBulkResult": {"properties": {"created": {"type": "integer", "title": "Created"}, "deduped": {"type": "integer", "title": "Deduped"}, "ids": {"items": {"type": "string", "format": "uuid"}, "type": "array", "title": "Ids"}}, "type": "object", "required": ["created", "deduped", "ids"], "title": "BankStatementLineBulkResult", "description": "Response for a bulk statement-line create."}, "BankStatementLineConflictBody": {"properties": {"detail": {"type": "string", "title": "Detail"}, "current": {"$ref": "#/components/schemas/BankStatementLineOut"}}, "type": "object", "required": ["detail", "current"], "title": "BankStatementLineConflictBody"}, "BankStatementLineCreate": {"properties": {"account_id": {"type": "string", "format": "uuid", "title": "Account Id"}, "txn_date": {"type": "string", "format": "date", "title": "Txn Date"}, "amount": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Amount"}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Description"}, "balance": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Balance"}, "reference": {"anyOf": [{"type": "string", "maxLength": 128}, {"type": "null"}], "title": "Reference"}, "status": {"type": "string", "title": "Status", "default": "UNMATCHED"}, "external_id": {"anyOf": [{"type": "string", "maxLength": 255}, {"type": "null"}], "title": "External Id"}, "bank_feed_account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Bank Feed Account Id"}, "contact_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Contact Id"}}, "type": "object", "required": ["account_id", "txn_date", "amount"], "title": "BankStatementLineCreate", "description": "POST body for creating a new bank statement line."}, "BankStatementLineListOut": {"properties": {"items": {"items": {"$ref": "#/components/schemas/BankStatementLineOut"}, "type": "array", "title": "Items"}, "total": {"type": "integer", "title": "Total"}, "limit": {"type": "integer", "title": "Limit"}, "offset": {"type": "integer", "title": "Offset"}}, "type": "object", "required": ["items", "total", "limit", "offset"], "title": "BankStatementLineListOut"}, "BankStatementLineMatchRequest": {"properties": {"matched_to_type": {"type": "string", "title": "Matched To Type", "description": "PAYMENT or JOURNAL_ENTRY"}, "matched_to_id": {"type": "string", "format": "uuid", "title": "Matched To Id", "description": "UUID of the matching payment or journal entry"}}, "type": "object", "required": ["matched_to_type", "matched_to_id"], "title": "BankStatementLineMatchRequest", "description": "POST body for /bank_statement_lines/{id}/match."}, "BankStatementLineOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "company_id": {"type": "string", "format": "uuid", "title": "Company Id"}, "tenant_id": {"type": "string", "format": "uuid", "title": "Tenant Id"}, "account_id": {"type": "string", "format": "uuid", "title": "Account Id"}, "txn_date": {"type": "string", "format": "date", "title": "Txn Date"}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Description"}, "amount": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Amount"}, "balance": {"anyOf": [{"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Balance"}, "reference": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Reference"}, "foreign_amount": {"anyOf": [{"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Foreign Amount"}, "foreign_currency": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Foreign Currency"}, "status": {"type": "string", "title": "Status"}, "matched_entry_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Matched Entry Id"}, "matched_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Matched At"}, "matched_by": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Matched By"}, "matched_to_type": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Matched To Type"}, "matched_to_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Matched To Id"}, "contact_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Contact Id"}, "bank_rule_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Bank Rule Id"}, "bank_feed_account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Bank Feed Account Id"}, "external_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "External Id"}, "reconciliation_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Reconciliation Id"}, "ignored_reason": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Ignored Reason"}, "version": {"type": "integer", "title": "Version"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At"}, "archived_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Archived At"}}, "type": "object", "required": ["id", "company_id", "tenant_id", "account_id", "txn_date", "amount", "status", "version", "created_at"], "title": "BankStatementLineOut", "description": "Full bank statement line response."}, "BankStatementLineSplitMatchRequest": {"properties": {"allocations": {"items": {"$ref": "#/components/schemas/SplitAllocation"}, "type": "array", "minItems": 1, "title": "Allocations"}, "entry_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Entry Date"}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Description"}}, "type": "object", "required": ["allocations"], "title": "BankStatementLineSplitMatchRequest", "description": "POST body for /bank_statement_lines/{id}/split_match.\n\n``allocations`` are the non-bank-account sides of the journal entry.\nThe bank account side is auto-generated from the BSL amount.\n\nValidation: sum(credit) - sum(debit) across allocations must equal the\nBSL amount (positive for deposits, negative for withdrawals)."}, "BankStatementLineUpdate": {"properties": {"description": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Description"}, "reference": {"anyOf": [{"type": "string", "maxLength": 128}, {"type": "null"}], "title": "Reference"}, "status": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Status"}, "matched_entry_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Matched Entry Id"}, "matched_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Matched At"}, "matched_by": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Matched By"}, "contact_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Contact Id"}, "balance": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Balance"}}, "type": "object", "title": "BankStatementLineUpdate", "description": "PATCH body \u2014 every field optional. Primarily for reconciliation."}, "BasLodge": {"properties": {"lodged_on": {"type": "string", "format": "date", "title": "Lodged On"}, "reference": {"anyOf": [{"type": "string", "maxLength": 64}, {"type": "null"}], "title": "Reference"}, "lock_period": {"type": "boolean", "title": "Lock Period", "default": false}}, "type": "object", "required": ["lodged_on"], "title": "BasLodge"}, "BasPaymentExtraLine": {"properties": {"account_id": {"type": "string", "format": "uuid", "title": "Account Id"}, "amount": {"anyOf": [{"type": "number", "exclusiveMinimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Amount"}, "description": {"anyOf": [{"type": "string", "maxLength": 200}, {"type": "null"}], "title": "Description"}}, "type": "object", "required": ["account_id", "amount"], "title": "BasPaymentExtraLine", "description": "Interest / GIC, a penalty or a card fee paid with the BAS. Goes to\nits own expense account, never the ATO, GST or PAYG account."}, "BasRecordPayment": {"properties": {"from_date": {"type": "string", "format": "date", "title": "From Date"}, "to_date": {"type": "string", "format": "date", "title": "To Date"}, "pay_from_account_id": {"type": "string", "format": "uuid", "title": "Pay From Account Id"}, "payment_date": {"type": "string", "format": "date", "title": "Payment Date"}, "contact_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Contact Id"}, "extra_lines": {"items": {"$ref": "#/components/schemas/BasPaymentExtraLine"}, "type": "array", "title": "Extra Lines"}}, "type": "object", "required": ["from_date", "to_date", "pay_from_account_id", "payment_date"], "title": "BasRecordPayment"}, "BasRecordRefund": {"properties": {"from_date": {"type": "string", "format": "date", "title": "From Date"}, "to_date": {"type": "string", "format": "date", "title": "To Date"}, "bank_account_id": {"type": "string", "format": "uuid", "title": "Bank Account Id"}, "receipt_date": {"type": "string", "format": "date", "title": "Receipt Date"}, "contact_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Contact Id"}}, "type": "object", "required": ["from_date", "to_date", "bank_account_id", "receipt_date"], "title": "BasRecordRefund"}, "BasReturnCreate": {"properties": {"from_date": {"type": "string", "format": "date", "title": "From Date"}, "to_date": {"type": "string", "format": "date", "title": "To Date"}, "payg_instalment": {"anyOf": [{"type": "number", "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Payg Instalment", "default": "0"}}, "type": "object", "required": ["from_date", "to_date"], "title": "BasReturnCreate"}, "BasSettle": {"properties": {"from_date": {"type": "string", "format": "date", "title": "From Date"}, "to_date": {"type": "string", "format": "date", "title": "To Date"}, "settlement_date": {"type": "string", "format": "date", "title": "Settlement Date"}, "pay_from_account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Pay From Account Id"}, "payment_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Payment Date"}, "contact_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Contact Id"}, "extra_lines": {"items": {"$ref": "#/components/schemas/BasPaymentExtraLine"}, "type": "array", "title": "Extra Lines"}}, "type": "object", "required": ["from_date", "to_date", "settlement_date"], "title": "BasSettle"}, "BillConflictBody": {"properties": {"detail": {"type": "string", "title": "Detail"}, "current": {"$ref": "#/components/schemas/BillOut"}}, "type": "object", "required": ["detail", "current"], "title": "BillConflictBody"}, "BillCreate": {"properties": {"contact_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Contact Id"}, "issue_date": {"type": "string", "format": "date", "title": "Issue Date"}, "due_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Due Date"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}, "supplier_reference": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Supplier Reference"}, "currency": {"anyOf": [{"type": "string", "maxLength": 3, "minLength": 3}, {"type": "null"}], "title": "Currency"}, "fx_rate": {"anyOf": [{"type": "number", "exclusiveMinimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Fx Rate", "description": "Rate from the document currency to the company currency (1 unit = this many). Leave out to use the published rate for the date; refused if there is none."}, "amounts_include_tax": {"type": "boolean", "title": "Amounts Include Tax", "default": false}, "purchase_order_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Purchase Order Id"}, "lines": {"items": {"$ref": "#/components/schemas/BillLineCreate"}, "type": "array", "title": "Lines"}}, "type": "object", "required": ["issue_date"], "title": "BillCreate", "description": "POST body."}, "BillLineCreate": {"properties": {"description": {"type": "string", "minLength": 1, "title": "Description"}, "account_id": {"type": "string", "format": "uuid", "title": "Account Id"}, "tax_code_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Tax Code Id"}, "quantity": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Quantity", "default": "1"}, "unit_price": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Unit Price", "default": "0"}, "discount_pct": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Discount Pct", "default": "0"}, "retention_pct": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Retention Pct", "default": "0"}, "project_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Project Id"}, "item_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Item Id"}, "tracking_vehicle_id": {"anyOf": [{"type": "string", "maxLength": 64}, {"type": "null"}], "title": "Tracking Vehicle Id"}, "tax_override": {"anyOf": [{"type": "number", "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Tax Override"}, "purchase_order_line_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Purchase Order Line Id"}, "billable": {"type": "boolean", "title": "Billable", "default": false}}, "type": "object", "required": ["description", "account_id"], "title": "BillLineCreate", "description": "One line in a POST/PATCH payload.\n\n``billable`` marks a cost to pass on to the project's customer\n(needs ``project_id``) \u2014 P0-41."}, "BillLineOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "line_no": {"type": "integer", "title": "Line No"}, "description": {"type": "string", "title": "Description"}, "account_id": {"type": "string", "format": "uuid", "title": "Account Id"}, "tax_code_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Tax Code Id"}, "quantity": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Quantity"}, "unit_price": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Unit Price"}, "discount_pct": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Discount Pct"}, "retention_pct": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Retention Pct", "default": "0"}, "line_subtotal": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Line Subtotal"}, "line_tax": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Line Tax"}, "line_total": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Line Total"}, "project_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Project Id"}, "item_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Item Id"}, "tracking_vehicle_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Tracking Vehicle Id"}, "purchase_order_line_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Purchase Order Line Id"}, "billable": {"type": "boolean", "title": "Billable", "default": false}, "rebill_invoice_line_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Rebill Invoice Line Id"}}, "type": "object", "required": ["id", "line_no", "description", "account_id", "quantity", "unit_price", "discount_pct", "line_subtotal", "line_tax", "line_total"], "title": "BillLineOut", "description": "One line of a bill (nested in BillOut)."}, "BillListOut": {"properties": {"items": {"items": {"$ref": "#/components/schemas/BillOut"}, "type": "array", "title": "Items"}, "total": {"type": "integer", "title": "Total"}, "limit": {"type": "integer", "title": "Limit"}, "offset": {"type": "integer", "title": "Offset"}, "totals": {"anyOf": [{"additionalProperties": {"type": "string"}, "type": "object"}, {"type": "null"}], "title": "Totals"}}, "type": "object", "required": ["items", "total", "limit", "offset"], "title": "BillListOut"}, "BillOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "company_id": {"type": "string", "format": "uuid", "title": "Company Id"}, "tenant_id": {"type": "string", "format": "uuid", "title": "Tenant Id"}, "contact_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Contact Id"}, "one_off_vendor_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "One Off Vendor Id"}, "one_off_vendor_name": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "One Off Vendor Name"}, "number": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Number"}, "supplier_reference": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Supplier Reference"}, "issue_date": {"type": "string", "format": "date", "title": "Issue Date"}, "due_date": {"type": "string", "format": "date", "title": "Due Date"}, "status": {"type": "string", "title": "Status"}, "subtotal": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Subtotal"}, "tax_total": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Tax Total"}, "total": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Total"}, "amount_paid": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Amount Paid"}, "currency": {"type": "string", "title": "Currency"}, "fx_rate": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Fx Rate"}, "amounts_include_tax": {"type": "boolean", "title": "Amounts Include Tax", "default": false}, "base_subtotal": {"anyOf": [{"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Base Subtotal"}, "base_tax_total": {"anyOf": [{"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Base Tax Total"}, "base_total": {"anyOf": [{"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Base Total"}, "base_amount_paid": {"anyOf": [{"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Base Amount Paid"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}, "journal_entry_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Journal Entry Id"}, "void_journal_entry_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Void Journal Entry Id"}, "purchase_order_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Purchase Order Id"}, "posted_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Posted At"}, "posted_by": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Posted By"}, "planned_pay_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Planned Pay Date"}, "approval_status": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Approval Status"}, "approval_note": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Approval Note"}, "approval_requested_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Approval Requested At"}, "approval_decided_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Approval Decided At"}, "version": {"type": "integer", "title": "Version"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At"}, "updated_at": {"type": "string", "format": "date-time", "title": "Updated At"}, "archived_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Archived At"}, "lines": {"items": {"$ref": "#/components/schemas/BillLineOut"}, "type": "array", "title": "Lines"}, "credits_applied": {"items": {"$ref": "#/components/schemas/CreditApplicationOut"}, "type": "array", "title": "Credits Applied"}, "amount_due": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Amount Due", "description": "Still owing: total less cash paid and credits applied (POSTED\nonly; a draft, voided or written-off document owes nothing).", "readOnly": true}}, "type": "object", "required": ["id", "company_id", "tenant_id", "issue_date", "due_date", "status", "subtotal", "tax_total", "total", "amount_paid", "currency", "fx_rate", "version", "created_at", "updated_at", "amount_due"], "title": "BillOut", "description": "Full bill response \u2014 includes nested lines, tenant_id, version."}, "BillUpdate": {"properties": {"contact_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Contact Id"}, "issue_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Issue Date"}, "due_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Due Date"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}, "supplier_reference": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Supplier Reference"}, "currency": {"anyOf": [{"type": "string", "maxLength": 3, "minLength": 3}, {"type": "null"}], "title": "Currency"}, "fx_rate": {"anyOf": [{"type": "number", "exclusiveMinimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Fx Rate"}, "lines": {"anyOf": [{"items": {"$ref": "#/components/schemas/BillLineCreate"}, "type": "array"}, {"type": "null"}], "title": "Lines"}, "amounts_include_tax": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "title": "Amounts Include Tax"}}, "type": "object", "title": "BillUpdate", "description": "PATCH body \u2014 every field optional."}, "Body_draft_missing_bill_api_v1_statements__statement_id__draft_missing_bill_post": {"properties": {"line_id": {"type": "string", "format": "uuid", "title": "Line Id"}}, "type": "object", "required": ["line_id"], "title": "Body_draft_missing_bill_api_v1_statements__statement_id__draft_missing_bill_post"}, "Body_extract_api_v1_documents_extract_post": {"properties": {"file": {"type": "string", "contentMediaType": "application/octet-stream", "title": "File", "description": "PDF or image to extract data from"}}, "type": "object", "required": ["file"], "title": "Body_extract_api_v1_documents_extract_post"}, "Body_reject_time_entry_api_v1_time_entries__entry_id__reject_post": {"properties": {"reason": {"type": "string", "title": "Reason"}}, "type": "object", "required": ["reason"], "title": "Body_reject_time_entry_api_v1_time_entries__entry_id__reject_post"}, "Body_upload_attachment_api_v1_attachments_post": {"properties": {"entity_kind": {"type": "string", "title": "Entity Kind"}, "entity_id": {"type": "string", "format": "uuid", "title": "Entity Id"}, "file": {"type": "string", "contentMediaType": "application/octet-stream", "title": "File"}}, "type": "object", "required": ["entity_kind", "entity_id", "file"], "title": "Body_upload_attachment_api_v1_attachments_post"}, "Body_upload_document_api_v1_inbox_documents_post": {"properties": {"file": {"type": "string", "contentMediaType": "application/octet-stream", "title": "File"}, "company_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Company Id"}}, "type": "object", "required": ["file"], "title": "Body_upload_document_api_v1_inbox_documents_post"}, "Body_upload_keystore_api_v1_ato_sbr_keystore_post": {"properties": {"file": {"type": "string", "contentMediaType": "application/octet-stream", "title": "File"}, "password": {"type": "string", "title": "Password"}, "label": {"type": "string", "title": "Label", "default": ""}}, "type": "object", "required": ["file", "password"], "title": "Body_upload_keystore_api_v1_ato_sbr_keystore_post"}, "BookkeepingModeChange": {"properties": {"mode": {"type": "string", "pattern": "^(cashbook|full)$", "title": "Mode"}, "bank_account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Bank Account Id"}}, "type": "object", "required": ["mode"], "title": "BookkeepingModeChange", "description": "POST body for ``/companies/{id}/bookkeeping-mode``."}, "BookkeepingModeOut": {"properties": {"company_id": {"type": "string", "format": "uuid", "title": "Company Id"}, "bookkeeping_mode": {"type": "string", "title": "Bookkeeping Mode"}, "cashbook_default_bank_account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Cashbook Default Bank Account Id"}, "version": {"type": "integer", "title": "Version"}}, "type": "object", "required": ["company_id", "bookkeeping_mode", "cashbook_default_bank_account_id", "version"], "title": "BookkeepingModeOut"}, "BoundContactOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "name": {"type": "string", "title": "Name"}, "tenant_id": {"type": "string", "format": "uuid", "title": "Tenant Id"}}, "type": "object", "required": ["id", "name", "tenant_id"], "title": "BoundContactOut"}, "BranchCreate": {"properties": {"code": {"type": "string", "maxLength": 32, "minLength": 1, "title": "Code"}, "name": {"type": "string", "maxLength": 255, "minLength": 1, "title": "Name"}, "is_default": {"type": "boolean", "title": "Is Default", "default": false}}, "type": "object", "required": ["code", "name"], "title": "BranchCreate", "description": "POST body for creating a branch."}, "BranchListOut": {"properties": {"items": {"items": {"$ref": "#/components/schemas/BranchOut"}, "type": "array", "title": "Items"}, "total": {"type": "integer", "title": "Total"}}, "type": "object", "required": ["items", "total"], "title": "BranchListOut"}, "BranchOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "company_id": {"type": "string", "format": "uuid", "title": "Company Id"}, "tenant_id": {"type": "string", "format": "uuid", "title": "Tenant Id"}, "code": {"type": "string", "title": "Code"}, "name": {"type": "string", "title": "Name"}, "is_default": {"type": "boolean", "title": "Is Default"}, "archived_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Archived At"}, "version": {"type": "integer", "title": "Version"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At"}}, "type": "object", "required": ["id", "company_id", "tenant_id", "code", "name", "is_default", "version", "created_at"], "title": "BranchOut", "description": "Branch response body."}, "BranchUpdate": {"properties": {"name": {"anyOf": [{"type": "string", "maxLength": 255, "minLength": 1}, {"type": "null"}], "title": "Name"}, "is_default": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "title": "Is Default"}}, "type": "object", "title": "BranchUpdate", "description": "PATCH body \u2014 code is immutable; every other field optional."}, "BudgetConflictBody": {"properties": {"detail": {"type": "string", "title": "Detail"}, "current": {"$ref": "#/components/schemas/BudgetOut"}}, "type": "object", "required": ["detail", "current"], "title": "BudgetConflictBody"}, "BudgetCreate": {"properties": {"account_id": {"type": "string", "format": "uuid", "title": "Account Id"}, "year": {"type": "integer", "maximum": 9999.0, "minimum": 1900.0, "title": "Year"}, "month": {"type": "integer", "maximum": 12.0, "minimum": 1.0, "title": "Month"}, "amount": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Amount", "default": "0"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}}, "type": "object", "required": ["account_id", "year", "month"], "title": "BudgetCreate", "description": "POST body for creating a budget row."}, "BudgetListOut": {"properties": {"items": {"items": {"$ref": "#/components/schemas/BudgetOut"}, "type": "array", "title": "Items"}, "total": {"type": "integer", "title": "Total"}, "limit": {"type": "integer", "title": "Limit"}, "offset": {"type": "integer", "title": "Offset"}}, "type": "object", "required": ["items", "total", "limit", "offset"], "title": "BudgetListOut"}, "BudgetOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "company_id": {"type": "string", "format": "uuid", "title": "Company Id"}, "tenant_id": {"type": "string", "format": "uuid", "title": "Tenant Id"}, "account_id": {"type": "string", "format": "uuid", "title": "Account Id"}, "year": {"type": "integer", "title": "Year"}, "month": {"type": "integer", "title": "Month"}, "amount": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Amount"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}, "version": {"type": "integer", "title": "Version"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At"}, "updated_at": {"type": "string", "format": "date-time", "title": "Updated At"}, "archived_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Archived At"}}, "type": "object", "required": ["id", "company_id", "tenant_id", "account_id", "year", "month", "amount", "version", "created_at", "updated_at"], "title": "BudgetOut", "description": "Full budget row response."}, "BudgetUpdate": {"properties": {"account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Account Id"}, "year": {"anyOf": [{"type": "integer", "maximum": 9999.0, "minimum": 1900.0}, {"type": "null"}], "title": "Year"}, "month": {"anyOf": [{"type": "integer", "maximum": 12.0, "minimum": 1.0}, {"type": "null"}], "title": "Month"}, "amount": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Amount"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}}, "type": "object", "title": "BudgetUpdate", "description": "PATCH body \u2014 every field optional."}, "BudgetVsActualLine": {"properties": {"account_id": {"type": "string", "format": "uuid", "title": "Account Id"}, "account_code": {"type": "string", "title": "Account Code"}, "account_name": {"type": "string", "title": "Account Name"}, "account_type": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Account Type"}, "section": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Section"}, "budget": {"type": "number", "title": "Budget"}, "actual": {"type": "number", "title": "Actual"}, "variance": {"type": "number", "title": "Variance"}, "variance_pct": {"anyOf": [{"type": "number"}, {"type": "null"}], "title": "Variance Pct"}}, "type": "object", "required": ["account_id", "account_code", "account_name", "budget", "actual", "variance", "variance_pct"], "title": "BudgetVsActualLine", "description": "One account row in the budget vs actual report."}, "BudgetVsActualReport": {"properties": {"year": {"type": "integer", "title": "Year"}, "month": {"anyOf": [{"type": "integer"}, {"type": "null"}], "title": "Month"}, "lines": {"items": {"$ref": "#/components/schemas/BudgetVsActualLine"}, "type": "array", "title": "Lines"}, "total_income_budget": {"type": "number", "title": "Total Income Budget", "default": 0.0}, "total_income_actual": {"type": "number", "title": "Total Income Actual", "default": 0.0}, "total_income_variance": {"type": "number", "title": "Total Income Variance", "default": 0.0}, "total_expense_budget": {"type": "number", "title": "Total Expense Budget", "default": 0.0}, "total_expense_actual": {"type": "number", "title": "Total Expense Actual", "default": 0.0}, "total_expense_variance": {"type": "number", "title": "Total Expense Variance", "default": 0.0}, "total_budget": {"type": "number", "title": "Total Budget"}, "total_actual": {"type": "number", "title": "Total Actual"}, "total_variance": {"type": "number", "title": "Total Variance"}}, "type": "object", "required": ["year", "month", "lines", "total_budget", "total_actual", "total_variance"], "title": "BudgetVsActualReport", "description": "Budget vs actual report for a year (optionally a single month).\n\nProfit and loss accounts only (P1-33). ``total_budget`` /\n``total_actual`` / ``total_variance`` are NET PROFIT (income less\nexpenses); the income and expense subtotals are reported separately."}, "BulkStatementIn": {"properties": {"period_from": {"type": "string", "format": "date", "title": "Period From"}, "period_to": {"type": "string", "format": "date", "title": "Period To"}, "contact_ids": {"anyOf": [{"items": {"type": "string", "format": "uuid"}, "type": "array"}, {"type": "null"}], "title": "Contact Ids"}}, "type": "object", "required": ["period_from", "period_to"], "title": "BulkStatementIn"}, "CashbookCategoryOut": {"properties": {"code": {"type": "string", "title": "Code"}, "label": {"type": "string", "title": "Label"}, "group": {"type": "string", "title": "Group"}, "direction": {"type": "string", "title": "Direction"}, "gst_default": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Gst Default"}, "hint_text": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Hint Text"}}, "type": "object", "required": ["code", "label", "group", "direction", "gst_default", "hint_text"], "title": "CashbookCategoryOut"}, "CashbookEntryCreate": {"properties": {"entry_date": {"type": "string", "format": "date", "title": "Entry Date"}, "description": {"anyOf": [{"type": "string", "maxLength": 500}, {"type": "null"}], "title": "Description"}, "amount": {"anyOf": [{"type": "number", "exclusiveMinimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Amount"}, "direction": {"type": "string", "pattern": "^(income|expense)$", "title": "Direction"}, "category_code": {"type": "string", "maxLength": 64, "minLength": 1, "title": "Category Code"}, "gst_amount": {"anyOf": [{"type": "number", "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Gst Amount"}}, "type": "object", "required": ["entry_date", "amount", "direction", "category_code"], "title": "CashbookEntryCreate", "description": "POST /entries body. Mirrors the design doc shape."}, "CashbookEntryListOut": {"properties": {"items": {"items": {"$ref": "#/components/schemas/CashbookEntryOut"}, "type": "array", "title": "Items"}, "next_cursor": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Next Cursor"}}, "type": "object", "required": ["items"], "title": "CashbookEntryListOut"}, "CashbookEntryOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "journal_entry_id": {"type": "string", "format": "uuid", "title": "Journal Entry Id"}, "journal_entry_ref": {"type": "string", "title": "Journal Entry Ref"}, "entry_date": {"type": "string", "format": "date", "title": "Entry Date"}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Description"}, "amount": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Amount"}, "direction": {"type": "string", "title": "Direction"}, "category_code": {"type": "string", "title": "Category Code"}, "category_label": {"type": "string", "title": "Category Label"}, "gst_amount": {"anyOf": [{"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Gst Amount"}, "version": {"type": "integer", "title": "Version"}, "created_at": {"type": "string", "title": "Created At"}, "posted_at": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Posted At"}, "status": {"type": "string", "title": "Status"}}, "type": "object", "required": ["id", "journal_entry_id", "journal_entry_ref", "entry_date", "description", "amount", "direction", "category_code", "category_label", "gst_amount", "version", "created_at", "posted_at", "status"], "title": "CashbookEntryOut"}, "CashbookModeOut": {"properties": {"company_id": {"type": "string", "format": "uuid", "title": "Company Id"}, "bookkeeping_mode": {"type": "string", "title": "Bookkeeping Mode"}, "cashbook_default_bank_account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Cashbook Default Bank Account Id"}, "version": {"type": "integer", "title": "Version"}}, "type": "object", "required": ["company_id", "bookkeeping_mode", "cashbook_default_bank_account_id", "version"], "title": "CashbookModeOut", "description": "Response shape for /setup and /upgrade-to-full \u2014 the slice of\ncompany state the caller actually cares about. The full company\nrecord is available at /api/v1/companies/{id}."}, "CashbookSetupBody": {"properties": {"bank_account_id": {"type": "string", "format": "uuid", "title": "Bank Account Id"}}, "type": "object", "required": ["bank_account_id"], "title": "CashbookSetupBody", "description": "POST /setup body \u2014 pick the bank account that becomes the\nimplicit counter-account for every cashbook entry."}, "CashbookSummaryByCategory": {"properties": {"code": {"type": "string", "title": "Code"}, "label": {"type": "string", "title": "Label"}, "direction": {"type": "string", "title": "Direction"}, "amount": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Amount"}, "count": {"type": "integer", "title": "Count"}}, "type": "object", "required": ["code", "label", "direction", "amount", "count"], "title": "CashbookSummaryByCategory"}, "CashbookSummaryOut": {"properties": {"from": {"type": "string", "format": "date", "title": "From"}, "to": {"type": "string", "format": "date", "title": "To"}, "income_total": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Income Total"}, "expense_total": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Expense Total"}, "net": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Net"}, "by_category": {"items": {"$ref": "#/components/schemas/CashbookSummaryByCategory"}, "type": "array", "title": "By Category"}, "gst_collected": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Gst Collected"}, "gst_paid": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Gst Paid"}}, "type": "object", "required": ["from", "to", "income_total", "expense_total", "net", "by_category", "gst_collected", "gst_paid"], "title": "CashbookSummaryOut"}, "CashflowCashAccount": {"properties": {"account_id": {"type": "string", "title": "Account Id"}, "code": {"type": "string", "title": "Code"}, "name": {"type": "string", "title": "Name"}, "opening": {"type": "number", "title": "Opening"}, "closing": {"type": "number", "title": "Closing"}}, "type": "object", "required": ["account_id", "code", "name", "opening", "closing"], "title": "CashflowCashAccount", "description": "One bank or cash account counted as cash, with its two balances."}, "CashflowFinancing": {"properties": {"loan_proceeds": {"type": "number", "title": "Loan Proceeds"}, "loan_repayments": {"type": "number", "title": "Loan Repayments"}, "owner_contributions": {"type": "number", "title": "Owner Contributions", "default": 0.0}, "owner_drawings": {"type": "number", "title": "Owner Drawings", "default": 0.0}, "lines": {"items": {"$ref": "#/components/schemas/CashflowLine"}, "type": "array", "title": "Lines"}, "total_financing": {"type": "number", "title": "Total Financing"}}, "type": "object", "required": ["loan_proceeds", "loan_repayments", "total_financing"], "title": "CashflowFinancing"}, "CashflowForecastItem": {"properties": {"expected_date": {"type": "string", "format": "date", "title": "Expected Date"}, "description": {"type": "string", "title": "Description"}, "source": {"type": "string", "title": "Source"}, "source_id": {"type": "string", "format": "uuid", "title": "Source Id"}, "amount": {"type": "number", "title": "Amount"}}, "type": "object", "required": ["expected_date", "description", "source", "source_id", "amount"], "title": "CashflowForecastItem", "description": "One projected cash event. ``amount`` is signed: +=inflow, -=outflow."}, "CashflowForecastReport": {"properties": {"from_date": {"type": "string", "format": "date", "title": "From Date"}, "to_date": {"type": "string", "format": "date", "title": "To Date"}, "opening_balance": {"type": "number", "title": "Opening Balance"}, "total_inflows": {"type": "number", "title": "Total Inflows"}, "total_outflows": {"type": "number", "title": "Total Outflows"}, "projected_closing": {"type": "number", "title": "Projected Closing"}, "items": {"items": {"$ref": "#/components/schemas/CashflowForecastItem"}, "type": "array", "title": "Items"}, "weeks": {"items": {"$ref": "#/components/schemas/CashflowForecastWeek"}, "type": "array", "title": "Weeks"}}, "type": "object", "required": ["from_date", "to_date", "opening_balance", "total_inflows", "total_outflows", "projected_closing", "items", "weeks"], "title": "CashflowForecastReport", "description": "Full cash-flow forecast: items, weekly buckets, grand totals."}, "CashflowForecastWeek": {"properties": {"start": {"type": "string", "format": "date", "title": "Start"}, "inflows": {"type": "number", "title": "Inflows"}, "outflows": {"type": "number", "title": "Outflows"}, "net": {"type": "number", "title": "Net"}, "running_balance": {"type": "number", "title": "Running Balance"}}, "type": "object", "required": ["start", "inflows", "outflows", "net", "running_balance"], "title": "CashflowForecastWeek", "description": "One 7-day slice of the horizon for the weekly roll-up."}, "CashflowInvesting": {"properties": {"asset_purchases": {"type": "number", "title": "Asset Purchases"}, "asset_disposals": {"type": "number", "title": "Asset Disposals"}, "lines": {"items": {"$ref": "#/components/schemas/CashflowLine"}, "type": "array", "title": "Lines"}, "total_investing": {"type": "number", "title": "Total Investing"}}, "type": "object", "required": ["asset_purchases", "asset_disposals", "total_investing"], "title": "CashflowInvesting"}, "CashflowLine": {"properties": {"account_id": {"type": "string", "title": "Account Id"}, "code": {"type": "string", "title": "Code"}, "name": {"type": "string", "title": "Name"}, "label": {"type": "string", "title": "Label"}, "amount": {"type": "number", "title": "Amount"}}, "type": "object", "required": ["account_id", "code", "name", "label", "amount"], "title": "CashflowLine", "description": "One account's movement in a cash flow section.\n\n``amount`` is the signed cash effect: positive = cash in, negative =\ncash out."}, "CashflowOperating": {"properties": {"net_profit": {"type": "number", "title": "Net Profit"}, "adjustments": {"items": {"$ref": "#/components/schemas/CashflowLine"}, "type": "array", "title": "Adjustments"}, "working_capital": {"items": {"$ref": "#/components/schemas/CashflowLine"}, "type": "array", "title": "Working Capital"}, "total_operating": {"type": "number", "title": "Total Operating"}}, "type": "object", "required": ["net_profit", "total_operating"], "title": "CashflowOperating"}, "CashflowStatement": {"properties": {"from_date": {"type": "string", "format": "date", "title": "From Date"}, "to_date": {"type": "string", "format": "date", "title": "To Date"}, "operating": {"$ref": "#/components/schemas/CashflowOperating"}, "investing": {"$ref": "#/components/schemas/CashflowInvesting"}, "financing": {"$ref": "#/components/schemas/CashflowFinancing"}, "net_change": {"type": "number", "title": "Net Change"}, "opening_cash": {"type": "number", "title": "Opening Cash"}, "closing_cash": {"type": "number", "title": "Closing Cash"}, "cash_accounts": {"items": {"$ref": "#/components/schemas/CashflowCashAccount"}, "type": "array", "title": "Cash Accounts"}, "reconciled": {"type": "boolean", "title": "Reconciled", "default": true}, "difference": {"type": "number", "title": "Difference", "default": 0.0}, "warnings": {"items": {"type": "string"}, "type": "array", "title": "Warnings"}}, "type": "object", "required": ["from_date", "to_date", "operating", "investing", "financing", "net_change", "opening_cash", "closing_cash"], "title": "CashflowStatement", "description": "Indirect-method cashflow statement for a date range.\n\nCash = the bank and cash accounts (``cash_accounts``). ``reconciled`` is\nTrue when operating + investing + financing equals the change in those\naccounts' balances; ``difference`` is any unexplained remainder."}, "ChangeContactBody": {"properties": {"contact_id": {"type": "string", "format": "uuid", "title": "Contact Id"}, "reason": {"type": "string", "maxLength": 1000, "minLength": 1, "title": "Reason"}, "override_reason": {"anyOf": [{"type": "string", "maxLength": 1000}, {"type": "null"}], "title": "Override Reason"}}, "type": "object", "required": ["contact_id", "reason"], "title": "ChangeContactBody"}, "ChangePasswordRequest": {"properties": {"current_password": {"type": "string", "title": "Current Password"}, "new_password": {"type": "string", "title": "New Password"}}, "type": "object", "required": ["current_password", "new_password"], "title": "ChangePasswordRequest"}, "ChecklistItemOut": {"properties": {"key": {"type": "string", "title": "Key"}, "count": {"type": "integer", "title": "Count"}, "oldest": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Oldest"}}, "type": "object", "required": ["key", "count"], "title": "ChecklistItemOut"}, "CheckoutRequest": {"properties": {"edition": {"type": "string", "enum": ["business", "pro"], "title": "Edition"}, "period": {"type": "string", "enum": ["month", "year"], "title": "Period", "default": "month"}}, "type": "object", "required": ["edition"], "title": "CheckoutRequest"}, "CheckoutResponse": {"properties": {"checkout_url": {"type": "string", "title": "Checkout Url"}}, "type": "object", "required": ["checkout_url"], "title": "CheckoutResponse"}, "ClosePreviewOut": {"properties": {"through_date": {"type": "string", "format": "date", "title": "Through Date"}, "total_income": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Total Income"}, "total_expenses": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Total Expenses"}, "net_profit": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Net Profit"}, "has_anything_to_close": {"type": "boolean", "title": "Has Anything To Close"}, "retained_earnings_debit": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Retained Earnings Debit"}, "retained_earnings_credit": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Retained Earnings Credit"}, "lines": {"items": {"additionalProperties": true, "type": "object"}, "type": "array", "title": "Lines"}}, "type": "object", "required": ["through_date", "total_income", "total_expenses", "net_profit", "has_anything_to_close", "retained_earnings_debit", "retained_earnings_credit", "lines"], "title": "ClosePreviewOut"}, "CloseYearRequest": {"properties": {"through_date": {"type": "string", "format": "date", "title": "Through Date"}, "retained_earnings_account_id": {"type": "string", "format": "uuid", "title": "Retained Earnings Account Id"}, "from_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "From Date"}, "override_reason": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Override Reason"}}, "type": "object", "required": ["through_date", "retained_earnings_account_id"], "title": "CloseYearRequest"}, "CloseYearResult": {"properties": {"closed": {"type": "boolean", "title": "Closed"}, "journal_entry_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Journal Entry Id"}}, "type": "object", "required": ["closed"], "title": "CloseYearResult"}, "CollectionSettingsIn": {"properties": {"reminders_enabled": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "title": "Reminders Enabled"}, "reminder_days": {"anyOf": [{"items": {"type": "integer"}, "type": "array"}, {"type": "string"}, {"type": "null"}], "title": "Reminder Days"}, "from_addr": {"anyOf": [{"type": "string", "maxLength": 320}, {"type": "null"}], "title": "From Addr"}, "reminder_message": {"anyOf": [{"type": "string", "maxLength": 2000}, {"type": "null"}], "title": "Reminder Message"}, "online_payment_account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Online Payment Account Id"}, "online_fee_account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Online Fee Account Id"}, "online_fee_tax_code_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Online Fee Tax Code Id"}}, "type": "object", "title": "CollectionSettingsIn"}, "ColumnLine": {"properties": {"account_id": {"type": "string", "title": "Account Id"}, "code": {"type": "string", "title": "Code"}, "account_name": {"type": "string", "title": "Account Name"}, "section": {"type": "string", "title": "Section"}, "amounts": {"items": {"type": "number"}, "type": "array", "title": "Amounts"}, "total": {"anyOf": [{"type": "number"}, {"type": "null"}], "title": "Total"}, "change": {"anyOf": [{"type": "number"}, {"type": "null"}], "title": "Change"}, "change_pct": {"anyOf": [{"type": "number"}, {"type": "null"}], "title": "Change Pct"}}, "type": "object", "required": ["account_id", "code", "account_name", "section", "amounts"], "title": "ColumnLine"}, "ColumnSpec": {"properties": {"label": {"type": "string", "title": "Label"}, "from_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "From Date"}, "to_date": {"type": "string", "format": "date", "title": "To Date"}}, "type": "object", "required": ["label", "to_date"], "title": "ColumnSpec"}, "ColumnTotals": {"properties": {"label": {"type": "string", "title": "Label"}, "amounts": {"items": {"type": "number"}, "type": "array", "title": "Amounts"}, "total": {"anyOf": [{"type": "number"}, {"type": "null"}], "title": "Total"}, "change": {"anyOf": [{"type": "number"}, {"type": "null"}], "title": "Change"}, "change_pct": {"anyOf": [{"type": "number"}, {"type": "null"}], "title": "Change Pct"}}, "type": "object", "required": ["label", "amounts"], "title": "ColumnTotals"}, "ColumnsReport": {"properties": {"report": {"type": "string", "title": "Report"}, "period": {"type": "string", "title": "Period"}, "from_date": {"type": "string", "format": "date", "title": "From Date"}, "to_date": {"type": "string", "format": "date", "title": "To Date"}, "columns": {"items": {"$ref": "#/components/schemas/ColumnSpec"}, "type": "array", "title": "Columns"}, "lines": {"items": {"$ref": "#/components/schemas/ColumnLine"}, "type": "array", "title": "Lines"}, "totals": {"items": {"$ref": "#/components/schemas/ColumnTotals"}, "type": "array", "title": "Totals"}}, "type": "object", "required": ["report", "period", "from_date", "to_date", "columns", "lines", "totals"], "title": "ColumnsReport", "description": "A report laid out in period columns.\n\n``change`` / ``change_pct`` compare the LAST column with the one before\nit (this month against last month, this quarter against last quarter),\nabsent when there is only one column. ``total`` is the sum across the\ncolumns for the profit and loss (a balance sheet has no meaningful sum\nof balances, so it is absent there)."}, "CompaniesHouseSearchRequest": {"properties": {"query": {"type": "string", "title": "Query"}}, "type": "object", "required": ["query"], "title": "CompaniesHouseSearchRequest"}, "CompanyConflictBody": {"properties": {"detail": {"type": "string", "title": "Detail"}, "current": {"$ref": "#/components/schemas/CompanyOut"}}, "type": "object", "required": ["detail", "current"], "title": "CompanyConflictBody"}, "CompanyCreate": {"properties": {"name": {"type": "string", "maxLength": 255, "minLength": 1, "title": "Name"}, "legal_name": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Legal Name"}, "trading_name": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Trading Name"}, "abn": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Abn"}, "acn": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Acn"}, "base_currency": {"type": "string", "maxLength": 3, "minLength": 3, "title": "Base Currency", "default": "AUD"}, "fin_year_start_month": {"type": "integer", "maximum": 12.0, "minimum": 1.0, "title": "Fin Year Start Month", "default": 7}, "fin_year_start_day": {"type": "integer", "maximum": 31.0, "minimum": 1.0, "title": "Fin Year Start Day", "default": 1}, "jurisdiction": {"type": "string", "title": "Jurisdiction", "default": "AU"}, "coa_template_key": {"type": "string", "title": "Coa Template Key", "default": "au/default"}, "registrikood": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Registrikood"}, "kmv_number": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Kmv Number"}, "entity_type": {"type": "string", "title": "Entity Type", "default": "COMPANY"}, "trades": {"type": "boolean", "title": "Trades", "default": true}, "trustee_company_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Trustee Company Id"}}, "type": "object", "required": ["name"], "title": "CompanyCreate", "description": "POST body for creating a new company."}, "CompanyListOut": {"properties": {"items": {"items": {"$ref": "#/components/schemas/CompanyOut"}, "type": "array", "title": "Items"}, "total": {"type": "integer", "title": "Total"}}, "type": "object", "required": ["items", "total"], "title": "CompanyListOut"}, "CompanyOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "tenant_id": {"type": "string", "format": "uuid", "title": "Tenant Id"}, "name": {"type": "string", "title": "Name"}, "legal_name": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Legal Name"}, "trading_name": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Trading Name"}, "abn": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Abn"}, "acn": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Acn"}, "base_currency": {"type": "string", "title": "Base Currency"}, "fin_year_start_month": {"type": "integer", "title": "Fin Year Start Month"}, "fin_year_start_day": {"type": "integer", "title": "Fin Year Start Day", "default": 1}, "audit_mode": {"type": "string", "title": "Audit Mode"}, "timezone": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Timezone"}, "tax_registered": {"type": "boolean", "title": "Tax Registered", "default": false}, "gst_effective_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Gst Effective Date"}, "psi_status": {"type": "string", "title": "Psi Status", "default": "unsure"}, "whm_employer_registered": {"type": "boolean", "title": "Whm Employer Registered", "default": false}, "whm_employer_registered_on": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Whm Employer Registered On"}, "gst_accounting_basis": {"type": "string", "title": "Gst Accounting Basis", "default": "accrual"}, "gst_reporting_frequency": {"type": "string", "title": "Gst Reporting Frequency", "default": "quarterly"}, "bas_settle_requires_lodged": {"type": "boolean", "title": "Bas Settle Requires Lodged", "default": false}, "writeoff_mode": {"type": "string", "title": "Writeoff Mode", "default": "review"}, "writeoff_threshold_days": {"type": "integer", "title": "Writeoff Threshold Days", "default": 90}, "recovery_mode": {"type": "string", "title": "Recovery Mode", "default": "smart_prompt"}, "bad_debt_recovery_account": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Bad Debt Recovery Account"}, "ar_control_account_code": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Ar Control Account Code"}, "ap_control_account_code": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Ap Control Account Code"}, "asset_disposal_gain_account_code": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Asset Disposal Gain Account Code"}, "asset_disposal_loss_account_code": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Asset Disposal Loss Account Code"}, "lifecycle_status": {"type": "string", "title": "Lifecycle Status", "default": "active"}, "industry_code": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Industry Code"}, "jurisdiction": {"type": "string", "title": "Jurisdiction", "default": "AU"}, "coa_template_key": {"type": "string", "title": "Coa Template Key", "default": "au/default"}, "registrikood": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Registrikood"}, "kmv_number": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Kmv Number"}, "phone": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Phone"}, "email": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Email"}, "website": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Website"}, "default_payment_terms": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Default Payment Terms"}, "bank_name": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Bank Name"}, "bank_bsb": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Bank Bsb"}, "bank_account_number": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Bank Account Number"}, "bank_account_name": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Bank Account Name"}, "payment_terms_text": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Payment Terms Text"}, "terms_url": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Terms Url"}, "address": {"anyOf": [{"additionalProperties": true, "type": "object"}, {"type": "null"}], "title": "Address"}, "bookkeeping_mode": {"type": "string", "title": "Bookkeeping Mode", "default": "full"}, "cashbook_default_bank_account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Cashbook Default Bank Account Id"}, "costing_method": {"type": "string", "title": "Costing Method", "default": "weighted_average"}, "entity_type": {"type": "string", "title": "Entity Type", "default": "COMPANY"}, "trades": {"type": "boolean", "title": "Trades", "default": true}, "trustee_company_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Trustee Company Id"}, "version": {"type": "integer", "title": "Version"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At"}, "archived_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Archived At"}}, "type": "object", "required": ["id", "tenant_id", "name", "base_currency", "fin_year_start_month", "audit_mode", "version", "created_at"], "title": "CompanyOut"}, "CompanyRateIn": {"properties": {"currency": {"type": "string", "maxLength": 3, "minLength": 3, "title": "Currency"}, "rate_date": {"type": "string", "format": "date", "title": "Rate Date"}, "rate": {"anyOf": [{"type": "number", "exclusiveMinimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Rate"}, "note": {"anyOf": [{"type": "string", "maxLength": 255}, {"type": "null"}], "title": "Note"}}, "type": "object", "required": ["currency", "rate_date", "rate"], "title": "CompanyRateIn"}, "CompanyRateListOut": {"properties": {"base_currency": {"type": "string", "title": "Base Currency"}, "items": {"items": {"$ref": "#/components/schemas/CompanyRateOut"}, "type": "array", "title": "Items"}}, "type": "object", "required": ["base_currency", "items"], "title": "CompanyRateListOut"}, "CompanyRateOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "currency": {"type": "string", "title": "Currency"}, "rate_date": {"type": "string", "format": "date", "title": "Rate Date"}, "rate": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Rate"}, "note": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Note"}, "created_by": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Created By"}}, "type": "object", "required": ["id", "currency", "rate_date", "rate"], "title": "CompanyRateOut"}, "CompanyUpdate": {"properties": {"name": {"anyOf": [{"type": "string", "maxLength": 255, "minLength": 1}, {"type": "null"}], "title": "Name"}, "legal_name": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Legal Name"}, "trading_name": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Trading Name"}, "abn": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Abn"}, "acn": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Acn"}, "base_currency": {"anyOf": [{"type": "string", "maxLength": 3, "minLength": 3}, {"type": "null"}], "title": "Base Currency"}, "fin_year_start_month": {"anyOf": [{"type": "integer", "maximum": 12.0, "minimum": 1.0}, {"type": "null"}], "title": "Fin Year Start Month"}, "fin_year_start_day": {"anyOf": [{"type": "integer", "maximum": 31.0, "minimum": 1.0}, {"type": "null"}], "title": "Fin Year Start Day"}, "audit_mode": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Audit Mode"}, "timezone": {"anyOf": [{"type": "string", "maxLength": 64}, {"type": "null"}], "title": "Timezone"}, "tax_registered": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "title": "Tax Registered"}, "gst_effective_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Gst Effective Date"}, "psi_status": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Psi Status"}, "whm_employer_registered": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "title": "Whm Employer Registered"}, "whm_employer_registered_on": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Whm Employer Registered On"}, "gst_accounting_basis": {"anyOf": [{"type": "string", "enum": ["accrual", "cash"]}, {"type": "null"}], "title": "Gst Accounting Basis"}, "gst_reporting_frequency": {"anyOf": [{"type": "string", "enum": ["monthly", "quarterly", "annual"]}, {"type": "null"}], "title": "Gst Reporting Frequency"}, "bas_settle_requires_lodged": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "title": "Bas Settle Requires Lodged"}, "writeoff_mode": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Writeoff Mode"}, "writeoff_threshold_days": {"anyOf": [{"type": "integer"}, {"type": "null"}], "title": "Writeoff Threshold Days"}, "recovery_mode": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Recovery Mode"}, "bad_debt_recovery_account": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Bad Debt Recovery Account"}, "ar_control_account_code": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Ar Control Account Code"}, "ap_control_account_code": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Ap Control Account Code"}, "asset_disposal_gain_account_code": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Asset Disposal Gain Account Code"}, "asset_disposal_loss_account_code": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Asset Disposal Loss Account Code"}, "lifecycle_status": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Lifecycle Status"}, "industry_code": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Industry Code"}, "registrikood": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Registrikood"}, "kmv_number": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Kmv Number"}, "phone": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Phone"}, "email": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Email"}, "website": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Website"}, "default_payment_terms": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Default Payment Terms"}, "bank_name": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Bank Name"}, "bank_bsb": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Bank Bsb"}, "bank_account_number": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Bank Account Number"}, "bank_account_name": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Bank Account Name"}, "payment_terms_text": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Payment Terms Text"}, "terms_url": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Terms Url"}, "address": {"anyOf": [{"additionalProperties": true, "type": "object"}, {"type": "null"}], "title": "Address"}, "costing_method": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Costing Method"}, "entity_type": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Entity Type"}, "trades": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "title": "Trades"}, "trustee_company_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Trustee Company Id"}}, "type": "object", "title": "CompanyUpdate", "description": "PATCH body for updating company metadata \u2014 every field optional."}, "ConfigIn": {"properties": {"enabled": {"type": "boolean", "title": "Enabled", "default": true}, "destination_type": {"type": "string", "title": "Destination Type", "default": "local_path"}, "destination_params": {"additionalProperties": true, "type": "object", "title": "Destination Params"}, "retention_keep_n": {"anyOf": [{"type": "integer", "minimum": 1.0}, {"type": "null"}], "title": "Retention Keep N"}, "retention_keep_days": {"anyOf": [{"type": "integer", "minimum": 1.0}, {"type": "null"}], "title": "Retention Keep Days"}, "managed_by": {"type": "string", "title": "Managed By", "default": "client"}}, "type": "object", "title": "ConfigIn"}, "ConfigOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "tenant_id": {"type": "string", "format": "uuid", "title": "Tenant Id"}, "enabled": {"type": "boolean", "title": "Enabled"}, "destination_type": {"type": "string", "title": "Destination Type"}, "destination_params": {"additionalProperties": true, "type": "object", "title": "Destination Params"}, "retention_keep_n": {"anyOf": [{"type": "integer"}, {"type": "null"}], "title": "Retention Keep N"}, "retention_keep_days": {"anyOf": [{"type": "integer"}, {"type": "null"}], "title": "Retention Keep Days"}, "managed_by": {"type": "string", "title": "Managed By"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At"}, "updated_at": {"type": "string", "format": "date-time", "title": "Updated At"}}, "type": "object", "required": ["id", "tenant_id", "enabled", "destination_type", "destination_params", "retention_keep_n", "retention_keep_days", "managed_by", "created_at", "updated_at"], "title": "ConfigOut"}, "ConflictBody": {"properties": {"detail": {"type": "string", "title": "Detail"}, "current": {"$ref": "#/components/schemas/ContactOut"}}, "type": "object", "required": ["detail", "current"], "title": "ConflictBody", "description": "409 response body \u2014 includes the current server state so the client\ncan show a three-way reconcile dialog."}, "ConnectIn": {"properties": {"client_id": {"type": "string", "maxLength": 200, "minLength": 1, "title": "Client Id"}, "client_secret": {"type": "string", "maxLength": 200, "minLength": 1, "title": "Client Secret"}, "redirect_uri": {"type": "string", "maxLength": 512, "minLength": 1, "title": "Redirect Uri"}}, "type": "object", "required": ["client_id", "client_secret", "redirect_uri"], "title": "ConnectIn", "description": "Body for ``POST /connect``."}, "ConnectOut": {"properties": {"connection_id": {"type": "string", "format": "uuid", "title": "Connection Id"}, "authorize_url": {"type": "string", "title": "Authorize Url"}, "state": {"type": "string", "title": "State"}}, "type": "object", "required": ["connection_id", "authorize_url", "state"], "title": "ConnectOut", "description": "Response shape: caller redirects the browser to ``authorize_url``."}, "ConnectionOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "provider": {"type": "string", "title": "Provider"}, "external_tenant_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "External Tenant Id"}, "external_tenant_name": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "External Tenant Name"}, "status": {"type": "string", "title": "Status"}, "last_pulled_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Last Pulled At"}, "last_pushed_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Last Pushed At"}, "last_error": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Last Error"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At"}, "updated_at": {"type": "string", "format": "date-time", "title": "Updated At"}}, "type": "object", "required": ["id", "provider", "external_tenant_id", "external_tenant_name", "status", "last_pulled_at", "last_pushed_at", "last_error", "created_at", "updated_at"], "title": "ConnectionOut"}, "ConnectionRowOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "siss_client_id": {"type": "string", "title": "Siss Client Id"}, "account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Account Id"}, "status": {"type": "string", "title": "Status"}, "last_sync_cursor": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Last Sync Cursor"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At"}, "updated_at": {"type": "string", "format": "date-time", "title": "Updated At"}}, "type": "object", "required": ["id", "siss_client_id", "account_id", "status", "last_sync_cursor", "created_at", "updated_at"], "title": "ConnectionRowOut"}, "ContactAliasIn": {"properties": {"alias": {"type": "string", "maxLength": 255, "minLength": 1, "title": "Alias"}, "alias_kind": {"type": "string", "title": "Alias Kind", "default": "trading"}, "source": {"type": "string", "title": "Source", "default": "manual"}}, "type": "object", "required": ["alias"], "title": "ContactAliasIn", "description": "POST body. ``alias_key`` is derived server-side, never supplied."}, "ContactAliasOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "contact_id": {"type": "string", "format": "uuid", "title": "Contact Id"}, "alias": {"type": "string", "title": "Alias"}, "alias_key": {"type": "string", "title": "Alias Key"}, "alias_kind": {"type": "string", "title": "Alias Kind"}, "source": {"type": "string", "title": "Source"}, "active": {"type": "boolean", "title": "Active"}}, "type": "object", "required": ["id", "contact_id", "alias", "alias_key", "alias_kind", "source", "active"], "title": "ContactAliasOut"}, "ContactBalances": {"properties": {"receivable_unpaid": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Receivable Unpaid"}, "receivable_overdue": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Receivable Overdue"}, "payable_unpaid": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Payable Unpaid"}, "payable_overdue": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Payable Overdue"}, "receivable_credit": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Receivable Credit", "default": "0"}, "payable_credit": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Payable Credit", "default": "0"}, "last_transaction_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Last Transaction Date"}, "net_position": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Net Position", "description": "Positive: the contact owes us. Negative: we owe the contact.", "readOnly": true}}, "type": "object", "required": ["receivable_unpaid", "receivable_overdue", "payable_unpaid", "payable_overdue", "net_position"], "title": "ContactBalances", "description": "Opt-in balance summary \u2014 ``GET /contacts?include_balances=true`` and\n``GET /contacts/{id}?include_balances=true``.\n\nMirrors the aged-AR/AP reports' and the customer-statement builder's\noutstanding convention (POSTED invoices/bills, ``outstanding = total -\namount_paid``) but is a *live* scalar snapshot, not the reports' date-aware\npoint-in-time settlement calc \u2014 use ``GET /reports/aged_receivables`` /\n``aged_payables`` when you need a balance as-at a past date."}, "ContactCreate": {"properties": {"name": {"type": "string", "maxLength": 255, "minLength": 1, "title": "Name"}, "family_name": {"anyOf": [{"type": "string", "maxLength": 64}, {"type": "null"}], "title": "Family Name"}, "given_name": {"anyOf": [{"type": "string", "maxLength": 64}, {"type": "null"}], "title": "Given Name"}, "other_given_name": {"anyOf": [{"type": "string", "maxLength": 64}, {"type": "null"}], "title": "Other Given Name"}, "contact_type": {"$ref": "#/components/schemas/ContactType"}, "email": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Email"}, "phone": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Phone"}, "abn": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Abn"}, "address_line1": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Address Line1"}, "address_line2": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Address Line2"}, "city": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "City"}, "state": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "State"}, "postcode": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Postcode"}, "country": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Country", "default": "Australia"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}, "default_account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Default Account Id"}, "default_tax_code": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Default Tax Code"}, "bank_bsb": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Bank Bsb"}, "bank_account_number": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Bank Account Number"}, "bank_account_title": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Bank Account Title"}, "iban": {"anyOf": [{"type": "string", "maxLength": 34}, {"type": "null"}], "title": "Iban", "description": "SEPA IBAN (EE and other IBAN jurisdictions)"}, "bic": {"anyOf": [{"type": "string", "maxLength": 11}, {"type": "null"}], "title": "Bic", "description": "SWIFT/BIC"}, "currency_code": {"anyOf": [{"type": "string", "maxLength": 3}, {"type": "null"}], "title": "Currency Code", "description": "ISO 4217 billing currency"}, "is_one_off": {"type": "boolean", "title": "Is One Off", "default": false}, "is_tpar_supplier": {"type": "boolean", "title": "Is Tpar Supplier", "description": "Flag as a sub-contractor included in TPAR reporting", "default": false}, "payment_terms_basis": {"anyOf": [{"$ref": "#/components/schemas/PaymentTermsBasis"}, {"type": "null"}], "description": "Default terms basis: DAYS (net N from invoice date) or EOM (N days after end of invoice month). NULL = no default."}, "payment_terms_days": {"anyOf": [{"type": "integer", "maximum": 365.0, "minimum": 0.0}, {"type": "null"}], "title": "Payment Terms Days", "description": "Days component of the default payment terms"}, "e_invoice_recipient": {"type": "boolean", "title": "E Invoice Recipient", "default": false}, "peppol_participant_id": {"anyOf": [{"type": "string", "maxLength": 64}, {"type": "null"}], "title": "Peppol Participant Id"}}, "type": "object", "required": ["name", "contact_type"], "title": "ContactCreate", "description": "POST body."}, "ContactListWithBalancesOut": {"properties": {"items": {"items": {"$ref": "#/components/schemas/ContactWithBalancesOut"}, "type": "array", "title": "Items"}, "total": {"type": "integer", "title": "Total"}, "limit": {"type": "integer", "title": "Limit"}, "offset": {"type": "integer", "title": "Offset"}}, "type": "object", "required": ["items", "total", "limit", "offset"], "title": "ContactListWithBalancesOut", "description": "``response_model`` for ``GET /contacts`` \u2014 see ``ContactWithBalancesOut``."}, "ContactOut": {"properties": {"name": {"type": "string", "maxLength": 255, "minLength": 1, "title": "Name"}, "family_name": {"anyOf": [{"type": "string", "maxLength": 64}, {"type": "null"}], "title": "Family Name"}, "given_name": {"anyOf": [{"type": "string", "maxLength": 64}, {"type": "null"}], "title": "Given Name"}, "other_given_name": {"anyOf": [{"type": "string", "maxLength": 64}, {"type": "null"}], "title": "Other Given Name"}, "contact_type": {"$ref": "#/components/schemas/ContactType"}, "email": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Email"}, "phone": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Phone"}, "abn": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Abn"}, "address_line1": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Address Line1"}, "address_line2": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Address Line2"}, "city": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "City"}, "state": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "State"}, "postcode": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Postcode"}, "country": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Country", "default": "Australia"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}, "default_account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Default Account Id"}, "default_tax_code": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Default Tax Code"}, "bank_bsb": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Bank Bsb"}, "bank_account_number": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Bank Account Number"}, "bank_account_title": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Bank Account Title"}, "iban": {"anyOf": [{"type": "string", "maxLength": 34}, {"type": "null"}], "title": "Iban", "description": "SEPA IBAN (EE and other IBAN jurisdictions)"}, "bic": {"anyOf": [{"type": "string", "maxLength": 11}, {"type": "null"}], "title": "Bic", "description": "SWIFT/BIC"}, "currency_code": {"anyOf": [{"type": "string", "maxLength": 3}, {"type": "null"}], "title": "Currency Code", "description": "ISO 4217 billing currency"}, "is_one_off": {"type": "boolean", "title": "Is One Off", "default": false}, "is_tpar_supplier": {"type": "boolean", "title": "Is Tpar Supplier", "description": "Flag as a sub-contractor included in TPAR reporting", "default": false}, "payment_terms_basis": {"anyOf": [{"$ref": "#/components/schemas/PaymentTermsBasis"}, {"type": "null"}], "description": "Default terms basis: DAYS (net N from invoice date) or EOM (N days after end of invoice month). NULL = no default."}, "payment_terms_days": {"anyOf": [{"type": "integer", "maximum": 365.0, "minimum": 0.0}, {"type": "null"}], "title": "Payment Terms Days", "description": "Days component of the default payment terms"}, "e_invoice_recipient": {"type": "boolean", "title": "E Invoice Recipient", "default": false}, "peppol_participant_id": {"anyOf": [{"type": "string", "maxLength": 64}, {"type": "null"}], "title": "Peppol Participant Id"}, "id": {"type": "string", "format": "uuid", "title": "Id"}, "company_id": {"type": "string", "format": "uuid", "title": "Company Id"}, "tenant_id": {"type": "string", "format": "uuid", "title": "Tenant Id"}, "version": {"type": "integer", "title": "Version"}, "archived_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Archived At"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At"}, "updated_at": {"type": "string", "format": "date-time", "title": "Updated At"}, "reminders_opt_out": {"type": "boolean", "title": "Reminders Opt Out", "default": false}, "email_bounced_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Email Bounced At"}, "email_bounce_reason": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Email Bounce Reason"}}, "type": "object", "required": ["name", "contact_type", "id", "company_id", "tenant_id", "version", "archived_at", "created_at", "updated_at"], "title": "ContactOut"}, "ContactRequest": {"properties": {"name": {"type": "string", "maxLength": 120, "minLength": 1, "title": "Name"}, "email": {"type": "string", "title": "Email"}, "topic": {"type": "string", "enum": ["general", "enterprise", "support"], "title": "Topic", "default": "general"}, "message": {"type": "string", "maxLength": 4000, "minLength": 10, "title": "Message"}, "website": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Website"}}, "type": "object", "required": ["name", "email", "message"], "title": "ContactRequest"}, "ContactType": {"type": "string", "enum": ["CUSTOMER", "SUPPLIER", "CONTRACTOR", "SUB_CONTRACTOR", "BOTH", "BENEFICIARY"], "title": "ContactType"}, "ContactUpdate": {"properties": {"name": {"anyOf": [{"type": "string", "maxLength": 255, "minLength": 1}, {"type": "null"}], "title": "Name"}, "family_name": {"anyOf": [{"type": "string", "maxLength": 64}, {"type": "null"}], "title": "Family Name"}, "given_name": {"anyOf": [{"type": "string", "maxLength": 64}, {"type": "null"}], "title": "Given Name"}, "other_given_name": {"anyOf": [{"type": "string", "maxLength": 64}, {"type": "null"}], "title": "Other Given Name"}, "contact_type": {"anyOf": [{"$ref": "#/components/schemas/ContactType"}, {"type": "null"}]}, "email": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Email"}, "phone": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Phone"}, "abn": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Abn"}, "address_line1": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Address Line1"}, "address_line2": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Address Line2"}, "city": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "City"}, "state": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "State"}, "postcode": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Postcode"}, "country": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Country"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}, "default_account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Default Account Id"}, "default_tax_code": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Default Tax Code"}, "bank_bsb": {"anyOf": [{"type": "string", "maxLength": 7}, {"type": "null"}], "title": "Bank Bsb"}, "bank_account_number": {"anyOf": [{"type": "string", "maxLength": 9}, {"type": "null"}], "title": "Bank Account Number"}, "bank_account_title": {"anyOf": [{"type": "string", "maxLength": 32}, {"type": "null"}], "title": "Bank Account Title"}, "iban": {"anyOf": [{"type": "string", "maxLength": 34}, {"type": "null"}], "title": "Iban", "description": "SEPA IBAN (EE and other IBAN jurisdictions)"}, "bic": {"anyOf": [{"type": "string", "maxLength": 11}, {"type": "null"}], "title": "Bic", "description": "SWIFT/BIC"}, "currency_code": {"anyOf": [{"type": "string", "maxLength": 3}, {"type": "null"}], "title": "Currency Code"}, "is_one_off": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "title": "Is One Off"}, "is_tpar_supplier": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "title": "Is Tpar Supplier"}, "payment_terms_basis": {"anyOf": [{"$ref": "#/components/schemas/PaymentTermsBasis"}, {"type": "null"}]}, "payment_terms_days": {"anyOf": [{"type": "integer", "maximum": 365.0, "minimum": 0.0}, {"type": "null"}], "title": "Payment Terms Days"}, "e_invoice_recipient": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "title": "E Invoice Recipient"}, "peppol_participant_id": {"anyOf": [{"type": "string", "maxLength": 64}, {"type": "null"}], "title": "Peppol Participant Id"}, "reminders_opt_out": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "title": "Reminders Opt Out"}}, "type": "object", "title": "ContactUpdate", "description": "PATCH body \u2014 every field optional. ``None`` clears, missing leaves alone.\n\nBecause \"omit\" vs \"set to None\" matters, callers iterate\n``model_dump(exclude_unset=True)`` at the route layer."}, "ContactWithBalancesOut": {"properties": {"name": {"type": "string", "maxLength": 255, "minLength": 1, "title": "Name"}, "family_name": {"anyOf": [{"type": "string", "maxLength": 64}, {"type": "null"}], "title": "Family Name"}, "given_name": {"anyOf": [{"type": "string", "maxLength": 64}, {"type": "null"}], "title": "Given Name"}, "other_given_name": {"anyOf": [{"type": "string", "maxLength": 64}, {"type": "null"}], "title": "Other Given Name"}, "contact_type": {"$ref": "#/components/schemas/ContactType"}, "email": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Email"}, "phone": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Phone"}, "abn": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Abn"}, "address_line1": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Address Line1"}, "address_line2": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Address Line2"}, "city": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "City"}, "state": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "State"}, "postcode": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Postcode"}, "country": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Country", "default": "Australia"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}, "default_account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Default Account Id"}, "default_tax_code": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Default Tax Code"}, "bank_bsb": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Bank Bsb"}, "bank_account_number": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Bank Account Number"}, "bank_account_title": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Bank Account Title"}, "iban": {"anyOf": [{"type": "string", "maxLength": 34}, {"type": "null"}], "title": "Iban", "description": "SEPA IBAN (EE and other IBAN jurisdictions)"}, "bic": {"anyOf": [{"type": "string", "maxLength": 11}, {"type": "null"}], "title": "Bic", "description": "SWIFT/BIC"}, "currency_code": {"anyOf": [{"type": "string", "maxLength": 3}, {"type": "null"}], "title": "Currency Code", "description": "ISO 4217 billing currency"}, "is_one_off": {"type": "boolean", "title": "Is One Off", "default": false}, "is_tpar_supplier": {"type": "boolean", "title": "Is Tpar Supplier", "description": "Flag as a sub-contractor included in TPAR reporting", "default": false}, "payment_terms_basis": {"anyOf": [{"$ref": "#/components/schemas/PaymentTermsBasis"}, {"type": "null"}], "description": "Default terms basis: DAYS (net N from invoice date) or EOM (N days after end of invoice month). NULL = no default."}, "payment_terms_days": {"anyOf": [{"type": "integer", "maximum": 365.0, "minimum": 0.0}, {"type": "null"}], "title": "Payment Terms Days", "description": "Days component of the default payment terms"}, "e_invoice_recipient": {"type": "boolean", "title": "E Invoice Recipient", "default": false}, "peppol_participant_id": {"anyOf": [{"type": "string", "maxLength": 64}, {"type": "null"}], "title": "Peppol Participant Id"}, "id": {"type": "string", "format": "uuid", "title": "Id"}, "company_id": {"type": "string", "format": "uuid", "title": "Company Id"}, "tenant_id": {"type": "string", "format": "uuid", "title": "Tenant Id"}, "version": {"type": "integer", "title": "Version"}, "archived_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Archived At"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At"}, "updated_at": {"type": "string", "format": "date-time", "title": "Updated At"}, "reminders_opt_out": {"type": "boolean", "title": "Reminders Opt Out", "default": false}, "email_bounced_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Email Bounced At"}, "email_bounce_reason": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Email Bounce Reason"}, "balances": {"anyOf": [{"$ref": "#/components/schemas/ContactBalances"}, {"type": "null"}]}}, "type": "object", "required": ["name", "contact_type", "id", "company_id", "tenant_id", "version", "archived_at", "created_at", "updated_at"], "title": "ContactWithBalancesOut", "description": "GET-only response shape \u2014 adds the opt-in ``balances`` object.\n\n``ContactOut`` is reused by the write endpoints (create/update, and the\n409 conflict body's ``current`` field), where ``balances`` must never\nappear, so the field lives on this subclass instead. Used as the\n``response_model`` for ``GET /contacts`` and ``GET /contacts/{id}`` only\n\u2014 the two routes with an ``include_balances`` opt-in. ``balances`` is\n``None`` (and omitted from the actual JSON body \u2014 the handlers build the\nresponse by hand) unless ``include_balances=true`` was passed."}, "ConversionDateIn": {"properties": {"conversion_date": {"type": "string", "format": "date", "title": "Conversion Date"}}, "type": "object", "required": ["conversion_date"], "title": "ConversionDateIn"}, "CounterIn": {"properties": {"prefix": {"anyOf": [{"type": "string", "maxLength": 16}, {"type": "null"}], "title": "Prefix"}, "next_value": {"anyOf": [{"type": "integer", "maximum": 1000000000.0, "minimum": 1.0}, {"type": "null"}], "title": "Next Value"}, "pad_width": {"anyOf": [{"type": "integer", "maximum": 10.0, "minimum": 1.0}, {"type": "null"}], "title": "Pad Width"}}, "type": "object", "title": "CounterIn"}, "CreateAndMatchExpenseSpec": {"properties": {"contact_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Contact Id"}, "expense_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Expense Date"}, "reference": {"anyOf": [{"type": "string", "maxLength": 64}, {"type": "null"}], "title": "Reference"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}, "account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Account Id"}, "tax_code_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Tax Code Id"}, "description": {"anyOf": [{"type": "string", "maxLength": 500}, {"type": "null"}], "title": "Description"}, "gross_lines": {"items": {"$ref": "#/components/schemas/GrossLine"}, "type": "array", "title": "Gross Lines"}, "currency": {"type": "string", "maxLength": 3, "minLength": 3, "title": "Currency", "default": "AUD"}, "fx_rate": {"anyOf": [{"type": "number", "exclusiveMinimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Fx Rate"}, "lines": {"items": {"$ref": "#/components/schemas/ExpenseLineCreate"}, "type": "array", "title": "Lines"}}, "type": "object", "title": "CreateAndMatchExpenseSpec", "description": "Expense side of a create_and_match body.\n\n``payment_account_id``, ``amount`` and direction are NEVER accepted\nhere \u2014 they are always derived from the bank statement line\nserver-side, so the created expense and the match can never disagree.\n\nLines: either ``lines`` (engine shape, ex-GST unit prices), or\n``gross_lines`` (GST-inclusive amounts that must add up to the amount\nbeing matched), or just ``account_id`` + ``tax_code_id`` (+\n``description``) for one line covering the whole amount."}, "CreateAndMatchPaymentSpec": {"properties": {"contact_id": {"type": "string", "format": "uuid", "title": "Contact Id"}, "payment_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Payment Date"}, "method": {"type": "string", "title": "Method", "default": "eft"}, "reference": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Reference"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}, "currency": {"type": "string", "maxLength": 3, "minLength": 3, "title": "Currency", "default": "AUD"}, "fx_rate": {"anyOf": [{"type": "number", "exclusiveMinimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Fx Rate"}, "allocations": {"items": {"$ref": "#/components/schemas/PaymentAllocationCreate"}, "type": "array", "title": "Allocations"}}, "type": "object", "required": ["contact_id"], "title": "CreateAndMatchPaymentSpec", "description": "Payment side of a create_and_match body.\n\n``bank_account_id``, ``amount`` and ``direction`` are NEVER accepted\nhere \u2014 see ``CreateAndMatchExpenseSpec`` docstring."}, "CreateAndMatchReceiptSpec": {"properties": {"contact_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Contact Id"}, "receipt_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Receipt Date"}, "reference": {"anyOf": [{"type": "string", "maxLength": 255}, {"type": "null"}], "title": "Reference"}, "reason": {"anyOf": [{"type": "string", "maxLength": 255}, {"type": "null"}], "title": "Reason"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}, "account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Account Id"}, "tax_code_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Tax Code Id"}, "description": {"anyOf": [{"type": "string", "maxLength": 500}, {"type": "null"}], "title": "Description"}, "gross_lines": {"items": {"$ref": "#/components/schemas/GrossLine"}, "type": "array", "title": "Gross Lines"}}, "type": "object", "title": "CreateAndMatchReceiptSpec", "description": "Money received with no invoice (interest, a cash sale, a refund).\n\nSame line options as the expense spec; amounts in ``gross_lines`` are\nGST-inclusive."}, "CreateAndMatchRequest": {"properties": {"bsl_id": {"type": "string", "format": "uuid", "title": "Bsl Id"}, "record_type": {"type": "string", "enum": ["expense", "payment", "receipt", "transfer"], "title": "Record Type"}, "amount": {"anyOf": [{"type": "number", "exclusiveMinimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Amount"}, "expense": {"anyOf": [{"$ref": "#/components/schemas/CreateAndMatchExpenseSpec"}, {"type": "null"}]}, "payment": {"anyOf": [{"$ref": "#/components/schemas/CreateAndMatchPaymentSpec"}, {"type": "null"}]}, "receipt": {"anyOf": [{"$ref": "#/components/schemas/CreateAndMatchReceiptSpec"}, {"type": "null"}]}, "transfer": {"anyOf": [{"$ref": "#/components/schemas/CreateAndMatchTransferSpec"}, {"type": "null"}]}}, "type": "object", "required": ["bsl_id", "record_type"], "title": "CreateAndMatchRequest"}, "CreateAndMatchTransferSpec": {"properties": {"other_account_id": {"type": "string", "format": "uuid", "title": "Other Account Id"}, "transfer_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Transfer Date"}, "description": {"anyOf": [{"type": "string", "maxLength": 500}, {"type": "null"}], "title": "Description"}, "reference": {"anyOf": [{"type": "string", "maxLength": 64}, {"type": "null"}], "title": "Reference"}, "counterpart_line_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Counterpart Line Id"}, "match_other_side": {"type": "boolean", "title": "Match Other Side", "default": true}}, "type": "object", "required": ["other_account_id"], "title": "CreateAndMatchTransferSpec", "description": "Money moved between two of the company's own accounts.\n\nDirection comes from the bank line (money out of this account = from\nhere to ``other_account_id``). ``counterpart_line_id`` names the other\naccount's bank line to match as well; when omitted the engine looks for\nexactly one unmatched opposite line within a few days\n(``match_other_side``)."}, "CreateApiTokenRequest": {"properties": {"name": {"type": "string", "maxLength": 200, "title": "Name", "description": "Human-friendly label"}, "scopes": {"items": {"type": "string"}, "type": "array", "title": "Scopes"}, "ttl_days": {"anyOf": [{"type": "integer", "maximum": 3650.0, "minimum": 1.0}, {"type": "null"}], "title": "Ttl Days"}}, "type": "object", "required": ["name"], "title": "CreateApiTokenRequest"}, "CreateConnectionIn": {"properties": {"bank": {"type": "string", "maxLength": 64, "minLength": 1, "title": "Bank"}, "account_label": {"type": "string", "maxLength": 200, "minLength": 1, "title": "Account Label"}, "ledger_id": {"anyOf": [{"type": "string", "maxLength": 64}, {"type": "null"}], "title": "Ledger Id"}, "redirect_uri": {"anyOf": [{"type": "string", "maxLength": 512}, {"type": "null"}], "title": "Redirect Uri"}}, "type": "object", "required": ["bank", "account_label"], "title": "CreateConnectionIn", "description": "Body for ``POST /connections``."}, "CreateConnectionOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "consent_url": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Consent Url"}, "status": {"type": "string", "title": "Status"}}, "type": "object", "required": ["id", "consent_url", "status"], "title": "CreateConnectionOut"}, "CredentialOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "friendly_name": {"type": "string", "title": "Friendly Name"}, "transports": {"items": {"type": "string"}, "type": "array", "title": "Transports"}, "last_used_at": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Last Used At"}, "created_at": {"type": "string", "title": "Created At"}}, "type": "object", "required": ["id", "friendly_name", "transports", "last_used_at", "created_at"], "title": "CredentialOut"}, "CreditApplicationOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "side": {"type": "string", "title": "Side"}, "contact_id": {"type": "string", "format": "uuid", "title": "Contact Id"}, "credit_note_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Credit Note Id"}, "invoice_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Invoice Id"}, "supplier_credit_note_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Supplier Credit Note Id"}, "bill_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Bill Id"}, "amount": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Amount"}, "applied_date": {"type": "string", "format": "date", "title": "Applied Date"}, "source": {"type": "string", "title": "Source"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}, "created_by": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Created By"}, "created_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Created At"}, "reversed_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Reversed At"}, "reversed_by": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Reversed By"}, "reversal_reason": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Reversal Reason"}, "credit_number": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Credit Number"}, "credit_reference": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Credit Reference"}, "document_number": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Document Number"}, "document_reference": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Document Reference"}}, "type": "object", "required": ["id", "side", "contact_id", "amount", "applied_date", "source"], "title": "CreditApplicationOut", "description": "One credit applied to one document (credit_applications, 0227).\n\nSupplier side: ``supplier_credit_note_id`` -> ``bill_id``. Customer\nside: ``credit_note_id`` -> ``invoice_id``. ``credit_number`` /\n``document_number`` are attached by the API for display. A reversed\napplication has ``reversed_at`` set and settles nothing."}, "CreditNoteApplyIn": {"properties": {"allocations": {"items": {"$ref": "#/components/schemas/CreditNoteApplyLine"}, "type": "array", "maxItems": 500, "minItems": 1, "title": "Allocations"}, "applied_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Applied Date", "description": "Defaults to today. Must be on/after both documents' dates."}, "notes": {"anyOf": [{"type": "string", "maxLength": 2000}, {"type": "null"}], "title": "Notes"}}, "type": "object", "required": ["allocations"], "title": "CreditNoteApplyIn", "description": "POST /credit_notes/{id}/applications body."}, "CreditNoteApplyLine": {"properties": {"invoice_id": {"type": "string", "format": "uuid", "title": "Invoice Id"}, "amount": {"anyOf": [{"type": "number", "exclusiveMinimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*(?:\\d{0,16}|(?=[\\d.]{1,19}0*$)\\d{0,16}\\.\\d{0,2}0*$)"}], "title": "Amount"}}, "type": "object", "required": ["invoice_id", "amount"], "title": "CreditNoteApplyLine"}, "CreditNoteConflictBody": {"properties": {"detail": {"type": "string", "title": "Detail"}, "current": {"$ref": "#/components/schemas/CreditNoteOut"}}, "type": "object", "required": ["detail", "current"], "title": "CreditNoteConflictBody"}, "CreditNoteCreate": {"properties": {"contact_id": {"type": "string", "format": "uuid", "title": "Contact Id"}, "issue_date": {"type": "string", "format": "date", "title": "Issue Date"}, "reason": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Reason"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}, "payment_terms": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Payment Terms"}, "original_invoice_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Original Invoice Id"}, "lines": {"items": {"$ref": "#/components/schemas/CreditNoteLineCreate"}, "type": "array", "title": "Lines"}}, "type": "object", "required": ["contact_id", "issue_date"], "title": "CreditNoteCreate", "description": "POST body."}, "CreditNoteLineCreate": {"properties": {"description": {"type": "string", "minLength": 1, "title": "Description"}, "account_id": {"type": "string", "format": "uuid", "title": "Account Id"}, "tax_code_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Tax Code Id"}, "quantity": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Quantity", "default": "1"}, "unit_price": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Unit Price", "default": "0"}, "discount_pct": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Discount Pct", "default": "0"}, "item_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Item Id"}, "project_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Project Id"}}, "type": "object", "required": ["description", "account_id"], "title": "CreditNoteLineCreate", "description": "One line in a POST/PATCH payload.\n\n``item_id`` marks a returned product: posting puts a stock item back\non hand (P1-67)."}, "CreditNoteLineOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "line_no": {"type": "integer", "title": "Line No"}, "description": {"type": "string", "title": "Description"}, "account_id": {"type": "string", "format": "uuid", "title": "Account Id"}, "tax_code_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Tax Code Id"}, "quantity": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Quantity"}, "unit_price": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Unit Price"}, "discount_pct": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Discount Pct"}, "line_subtotal": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Line Subtotal"}, "line_tax": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Line Tax"}, "line_total": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Line Total"}, "item_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Item Id"}, "project_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Project Id"}}, "type": "object", "required": ["id", "line_no", "description", "account_id", "quantity", "unit_price", "discount_pct", "line_subtotal", "line_tax", "line_total"], "title": "CreditNoteLineOut", "description": "One line of a credit note (nested in CreditNoteOut)."}, "CreditNoteListOut": {"properties": {"items": {"items": {"$ref": "#/components/schemas/CreditNoteOut"}, "type": "array", "title": "Items"}, "total": {"type": "integer", "title": "Total"}, "limit": {"type": "integer", "title": "Limit"}, "offset": {"type": "integer", "title": "Offset"}}, "type": "object", "required": ["items", "total", "limit", "offset"], "title": "CreditNoteListOut"}, "CreditNoteOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "company_id": {"type": "string", "format": "uuid", "title": "Company Id"}, "tenant_id": {"type": "string", "format": "uuid", "title": "Tenant Id"}, "contact_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Contact Id"}, "one_off_customer_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "One Off Customer Id"}, "one_off_customer_name": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "One Off Customer Name"}, "number": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Number"}, "issue_date": {"type": "string", "format": "date", "title": "Issue Date"}, "status": {"type": "string", "title": "Status"}, "original_invoice_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Original Invoice Id"}, "subtotal": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Subtotal"}, "tax_total": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Tax Total"}, "total": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Total"}, "amount_allocated": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Amount Allocated"}, "amount_applied": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Amount Applied", "default": "0"}, "amount_remaining": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Amount Remaining", "default": "0"}, "reason": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Reason"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}, "payment_terms": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Payment Terms"}, "posted_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Posted At"}, "posted_by": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Posted By"}, "version": {"type": "integer", "title": "Version"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At"}, "updated_at": {"type": "string", "format": "date-time", "title": "Updated At"}, "archived_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Archived At"}, "lines": {"items": {"$ref": "#/components/schemas/CreditNoteLineOut"}, "type": "array", "title": "Lines"}, "applications": {"items": {"$ref": "#/components/schemas/CreditApplicationOut"}, "type": "array", "title": "Applications"}}, "type": "object", "required": ["id", "company_id", "tenant_id", "issue_date", "status", "subtotal", "tax_total", "total", "amount_allocated", "version", "created_at", "updated_at"], "title": "CreditNoteOut", "description": "Full credit note response \u2014 includes nested lines, tenant_id, version."}, "CreditNoteUpdate": {"properties": {"contact_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Contact Id"}, "issue_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Issue Date"}, "reason": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Reason"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}, "payment_terms": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Payment Terms"}, "original_invoice_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Original Invoice Id"}, "lines": {"anyOf": [{"items": {"$ref": "#/components/schemas/CreditNoteLineCreate"}, "type": "array"}, {"type": "null"}], "title": "Lines"}}, "type": "object", "title": "CreditNoteUpdate", "description": "PATCH body \u2014 every field optional."}, "CreditReissueBody": {"properties": {"reason": {"type": "string", "maxLength": 1000, "minLength": 1, "title": "Reason"}, "credit_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Credit Date"}}, "type": "object", "required": ["reason"], "title": "CreditReissueBody"}, "CsvImportIn": {"properties": {"csv": {"type": "string", "maxLength": 5000000, "title": "Csv"}, "options": {"additionalProperties": true, "type": "object", "title": "Options"}}, "type": "object", "required": ["csv"], "title": "CsvImportIn"}, "CurrencyListOut": {"properties": {"base_currency": {"type": "string", "title": "Base Currency"}, "items": {"items": {"$ref": "#/components/schemas/CurrencyOut"}, "type": "array", "title": "Items"}}, "type": "object", "required": ["base_currency", "items"], "title": "CurrencyListOut"}, "CurrencyOut": {"properties": {"code": {"type": "string", "title": "Code"}, "name": {"type": "string", "title": "Name"}, "published_rate": {"type": "boolean", "title": "Published Rate"}, "is_base": {"type": "boolean", "title": "Is Base"}}, "type": "object", "required": ["code", "name", "published_rate", "is_base"], "title": "CurrencyOut"}, "DeferredRevenuePreviewBody": {"properties": {"period_date": {"type": "string", "format": "date", "title": "Period Date"}}, "type": "object", "required": ["period_date"], "title": "DeferredRevenuePreviewBody", "description": "``period_date`` is any date inside the calendar month to recognise."}, "DeferredRevenuePreviewLine": {"properties": {"invoice_line_id": {"type": "string", "format": "uuid", "title": "Invoice Line Id"}, "invoice_number": {"type": "string", "title": "Invoice Number"}, "description": {"type": "string", "title": "Description"}, "income_account_id": {"type": "string", "format": "uuid", "title": "Income Account Id"}, "amount": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Amount"}}, "type": "object", "required": ["invoice_line_id", "invoice_number", "description", "income_account_id", "amount"], "title": "DeferredRevenuePreviewLine"}, "DeferredRevenuePreviewOut": {"properties": {"period_first": {"type": "string", "format": "date", "title": "Period First"}, "total_recognized": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Total Recognized"}, "lines": {"items": {"$ref": "#/components/schemas/DeferredRevenuePreviewLine"}, "type": "array", "title": "Lines"}}, "type": "object", "required": ["period_first", "total_recognized"], "title": "DeferredRevenuePreviewOut"}, "DeferredRevenueRecognizeBody": {"properties": {"period_date": {"type": "string", "format": "date", "title": "Period Date"}, "override_reason": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Override Reason"}}, "type": "object", "required": ["period_date"], "title": "DeferredRevenueRecognizeBody"}, "DeferredRevenueRecognizeOut": {"properties": {"period_first": {"type": "string", "format": "date", "title": "Period First"}, "total_recognized": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Total Recognized"}, "lines_recognized": {"type": "integer", "title": "Lines Recognized"}, "posted": {"type": "boolean", "title": "Posted"}}, "type": "object", "required": ["period_first", "total_recognized", "lines_recognized", "posted"], "title": "DeferredRevenueRecognizeOut"}, "DepreciationAssetLine": {"properties": {"asset_id": {"type": "string", "format": "uuid", "title": "Asset Id"}, "asset_number": {"type": "string", "title": "Asset Number"}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Description"}, "acquisition_date": {"type": "string", "format": "date", "title": "Acquisition Date"}, "cost": {"type": "number", "title": "Cost"}, "residual_value": {"type": "number", "title": "Residual Value"}, "useful_life_months": {"type": "integer", "title": "Useful Life Months"}, "depreciation_method": {"type": "string", "title": "Depreciation Method"}, "accumulated_depreciation": {"type": "number", "title": "Accumulated Depreciation"}, "current_book_value": {"type": "number", "title": "Current Book Value"}, "next_month_depreciation": {"type": "number", "title": "Next Month Depreciation"}, "fully_depreciated": {"type": "boolean", "title": "Fully Depreciated"}}, "type": "object", "required": ["asset_id", "asset_number", "description", "acquisition_date", "cost", "residual_value", "useful_life_months", "depreciation_method", "accumulated_depreciation", "current_book_value", "next_month_depreciation", "fully_depreciated"], "title": "DepreciationAssetLine", "description": "One asset row in the depreciation schedule report."}, "DepreciationModelListOut": {"properties": {"items": {"items": {"$ref": "#/components/schemas/DepreciationModelOut"}, "type": "array", "title": "Items"}, "total": {"type": "integer", "title": "Total"}, "limit": {"type": "integer", "title": "Limit"}, "offset": {"type": "integer", "title": "Offset"}}, "type": "object", "required": ["items", "total", "limit", "offset"], "title": "DepreciationModelListOut"}, "DepreciationModelOut": {"properties": {"id": {"type": "string", "title": "Id"}, "method": {"type": "string", "title": "Method"}, "method_number": {"type": "integer", "title": "Method Number"}, "method_period": {"type": "integer", "title": "Method Period"}, "method_progress_factor": {"anyOf": [{"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Method Progress Factor"}, "rate_pct": {"anyOf": [{"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Rate Pct"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At"}}, "type": "object", "required": ["id", "method", "method_number", "method_period", "created_at"], "title": "DepreciationModelOut", "description": "Full depreciation model response \u2014 used both embedded in FixedAssetOut\nand as the list-endpoint item schema for ``/api/v1/depreciation_models``."}, "DepreciationRunAllRequest": {"properties": {"through": {"type": "string", "format": "date", "title": "Through"}}, "type": "object", "required": ["through"], "title": "DepreciationRunAllRequest", "description": "POST body for POST /depreciation_run_all \u2014 batch run across all active assets."}, "DepreciationRunAllResponse": {"properties": {"through": {"type": "string", "format": "date", "title": "Through"}, "total_assets": {"type": "integer", "title": "Total Assets"}, "total_amount": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Total Amount"}, "results": {"items": {"$ref": "#/components/schemas/DepreciationRunAllResultItem"}, "type": "array", "title": "Results"}, "errors": {"items": {"type": "string"}, "type": "array", "title": "Errors"}}, "type": "object", "required": ["through", "total_assets", "total_amount", "results", "errors"], "title": "DepreciationRunAllResponse", "description": "Response body for POST /depreciation_run_all."}, "DepreciationRunAllResultItem": {"properties": {"asset_id": {"type": "string", "format": "uuid", "title": "Asset Id"}, "asset_code": {"type": "string", "title": "Asset Code"}, "amount_posted": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Amount Posted"}, "note": {"type": "string", "title": "Note"}}, "type": "object", "required": ["asset_id", "asset_code", "amount_posted", "note"], "title": "DepreciationRunAllResultItem", "description": "One asset's result row in a batch depreciation run."}, "DepreciationSchedule": {"properties": {"as_of_date": {"type": "string", "format": "date", "title": "As Of Date"}, "assets": {"items": {"$ref": "#/components/schemas/DepreciationAssetLine"}, "type": "array", "title": "Assets"}, "total_cost": {"type": "number", "title": "Total Cost"}, "total_accumulated": {"type": "number", "title": "Total Accumulated"}, "total_book_value": {"type": "number", "title": "Total Book Value"}}, "type": "object", "required": ["as_of_date", "assets", "total_cost", "total_accumulated", "total_book_value"], "title": "DepreciationSchedule", "description": "Depreciation schedule as at a given date.\n\n``assets`` is sorted by asset_number.  ``method`` query param\nfilters to ``linear`` or ``diminishing_value`` (DB method strings).\nThe convenience aliases ``STRAIGHT_LINE`` and ``DECLINING_BALANCE``\nare also accepted and mapped internally."}, "DuplicateBody": {"properties": {"issue_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Issue Date"}}, "type": "object", "title": "DuplicateBody"}, "EmailAddressCreate": {"properties": {"company_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Company Id"}}, "additionalProperties": false, "type": "object", "title": "EmailAddressCreate"}, "EmailOnlyRequest": {"properties": {"email": {"type": "string", "title": "Email"}}, "type": "object", "required": ["email"], "title": "EmailOnlyRequest"}, "EmailPayslipsIn": {"properties": {"employee_ids": {"anyOf": [{"items": {"type": "string", "format": "uuid"}, "type": "array"}, {"type": "null"}], "title": "Employee Ids"}, "from_addr": {"anyOf": [{"type": "string", "maxLength": 254}, {"type": "null"}], "title": "From Addr"}}, "type": "object", "title": "EmailPayslipsIn"}, "EmployeeCreate": {"properties": {"contact_id": {"type": "string", "format": "uuid", "title": "Contact Id"}, "start_date": {"type": "string", "format": "date", "title": "Start Date"}, "employment_basis": {"type": "string", "title": "Employment Basis", "description": "STP2 single-letter code: F/P/C/L/V/N"}, "base_rate": {"anyOf": [{"type": "number", "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Base Rate"}, "employee_number": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Employee Number"}, "dob": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Dob"}, "sex_code": {"anyOf": [{"type": "string", "enum": ["0", "1", "2", "3"]}, {"type": "null"}], "title": "Sex Code"}, "address_line1": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Address Line1"}, "address_line2": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Address Line2"}, "suburb": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Suburb"}, "state": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "State"}, "postcode": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Postcode"}, "country_code": {"type": "string", "title": "Country Code", "default": "AU"}, "tax_treatment_code": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Tax Treatment Code"}, "claims_tax_free_threshold": {"type": "boolean", "title": "Claims Tax Free Threshold", "default": false}, "is_australian_resident": {"type": "boolean", "title": "Is Australian Resident", "default": true}, "study_training_support_loan": {"type": "boolean", "title": "Study Training Support Loan", "default": false}, "working_holiday_maker": {"type": "boolean", "title": "Working Holiday Maker", "default": false}, "whm_country_code": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Whm Country Code"}, "visa_subclass": {"anyOf": [{"type": "string", "enum": ["417", "462"]}, {"type": "null"}], "title": "Visa Subclass"}, "visa_grant_number": {"anyOf": [{"type": "string", "maxLength": 32}, {"type": "null"}], "title": "Visa Grant Number"}, "visa_expiry_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Visa Expiry Date"}, "vevo_checked_on": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Vevo Checked On"}, "vevo_work_entitlement": {"anyOf": [{"type": "string", "enum": ["UNLIMITED", "LIMITED", "NONE"]}, {"type": "null"}], "title": "Vevo Work Entitlement"}, "vevo_conditions": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Vevo Conditions"}, "vevo_attachment_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Vevo Attachment Id"}, "income_stream_type": {"type": "string", "title": "Income Stream Type", "default": "SAW"}, "payg_branch_code": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Payg Branch Code"}, "super_fund_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Super Fund Id"}, "super_member_number": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Super Member Number"}, "tfn_declaration_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Tfn Declaration Date"}, "super_choice_source": {"anyOf": [{"type": "string", "enum": ["EMPLOYEE_CHOICE", "STAPLED_FUND", "EMPLOYER_DEFAULT"]}, {"type": "null"}], "title": "Super Choice Source"}, "super_choice_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Super Choice Date"}, "stapled_fund_requested_on": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Stapled Fund Requested On"}, "payslip_email": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Payslip Email"}, "payslip_delivery": {"type": "string", "title": "Payslip Delivery", "default": "EMAIL"}, "pay_frequency": {"type": "string", "title": "Pay Frequency", "default": "WEEKLY"}, "pay_basis": {"type": "string", "title": "Pay Basis", "default": "HOURLY"}, "weekly_hours": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Weekly Hours", "default": "38.00"}, "casual_loading_pct": {"anyOf": [{"type": "number", "maximum": 100.0, "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Casual Loading Pct"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}, "tfn": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Tfn"}, "tfn_status": {"type": "string", "title": "Tfn Status", "default": "NOT_PROVIDED"}, "bsb": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Bsb"}, "account_number": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Account Number"}, "account_name": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Account Name"}}, "type": "object", "required": ["contact_id", "start_date", "employment_basis", "base_rate"], "title": "EmployeeCreate", "description": "POST /api/v1/employees body. TFN + bank are write-only \u2014 never echoed back."}, "EmployeeListOut": {"properties": {"items": {"items": {"$ref": "#/components/schemas/EmployeeOut"}, "type": "array", "title": "Items"}, "total": {"type": "integer", "title": "Total"}, "limit": {"type": "integer", "title": "Limit"}, "offset": {"type": "integer", "title": "Offset"}}, "type": "object", "required": ["items", "total", "limit", "offset"], "title": "EmployeeListOut"}, "EmployeeOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "company_id": {"type": "string", "format": "uuid", "title": "Company Id"}, "contact_id": {"type": "string", "format": "uuid", "title": "Contact Id"}, "employee_number": {"type": "string", "title": "Employee Number"}, "payee_id_bms": {"type": "string", "format": "uuid", "title": "Payee Id Bms"}, "previous_payee_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Previous Payee Id"}, "tfn_masked": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Tfn Masked"}, "tfn_status": {"type": "string", "title": "Tfn Status"}, "has_bank": {"type": "boolean", "title": "Has Bank", "default": false}, "dob": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Dob"}, "sex_code": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Sex Code"}, "start_date": {"type": "string", "format": "date", "title": "Start Date"}, "end_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "End Date"}, "termination_reason": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Termination Reason"}, "address_line1": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Address Line1"}, "address_line2": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Address Line2"}, "suburb": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Suburb"}, "state": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "State"}, "postcode": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Postcode"}, "country_code": {"type": "string", "title": "Country Code"}, "employment_basis": {"type": "string", "title": "Employment Basis"}, "tax_treatment_code": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Tax Treatment Code"}, "claims_tax_free_threshold": {"type": "boolean", "title": "Claims Tax Free Threshold"}, "is_australian_resident": {"type": "boolean", "title": "Is Australian Resident"}, "study_training_support_loan": {"type": "boolean", "title": "Study Training Support Loan"}, "working_holiday_maker": {"type": "boolean", "title": "Working Holiday Maker"}, "whm_country_code": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Whm Country Code"}, "visa_subclass": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Visa Subclass"}, "visa_grant_number": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Visa Grant Number"}, "visa_expiry_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Visa Expiry Date"}, "vevo_checked_on": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Vevo Checked On"}, "vevo_work_entitlement": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Vevo Work Entitlement"}, "vevo_conditions": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Vevo Conditions"}, "vevo_attachment_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Vevo Attachment Id"}, "income_stream_type": {"type": "string", "title": "Income Stream Type"}, "payg_branch_code": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Payg Branch Code"}, "super_fund_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Super Fund Id"}, "super_member_number": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Super Member Number"}, "tfn_declaration_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Tfn Declaration Date"}, "super_choice_source": {"anyOf": [{"type": "string", "enum": ["EMPLOYEE_CHOICE", "STAPLED_FUND", "EMPLOYER_DEFAULT"]}, {"type": "null"}], "title": "Super Choice Source"}, "super_choice_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Super Choice Date"}, "stapled_fund_requested_on": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Stapled Fund Requested On"}, "payslip_email": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Payslip Email"}, "payslip_delivery": {"type": "string", "title": "Payslip Delivery"}, "pay_frequency": {"type": "string", "title": "Pay Frequency"}, "pay_basis": {"type": "string", "title": "Pay Basis"}, "base_rate": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Base Rate"}, "weekly_hours": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Weekly Hours"}, "casual_loading_pct": {"anyOf": [{"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Casual Loading Pct"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}, "version": {"type": "integer", "title": "Version"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At"}, "updated_at": {"type": "string", "format": "date-time", "title": "Updated At"}, "archived_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Archived At"}}, "type": "object", "required": ["id", "company_id", "contact_id", "employee_number", "payee_id_bms", "tfn_status", "start_date", "country_code", "employment_basis", "claims_tax_free_threshold", "is_australian_resident", "study_training_support_loan", "working_holiday_maker", "income_stream_type", "payslip_delivery", "pay_frequency", "pay_basis", "base_rate", "weekly_hours", "version", "created_at", "updated_at"], "title": "EmployeeOut", "description": "Default API response. TFN + bank are MASKED.\n\nPrivileged callers (with employee.tfn_view) hit /employees/{id}/tfn\nfor plaintext; bank decryption flows through the pay-run service\nwhen issuing ABA disbursements."}, "EmployeeTerminateRequest": {"properties": {"end_date": {"type": "string", "format": "date", "title": "End Date"}, "reason": {"type": "string", "title": "Reason", "description": "STP2 code: V/I/D/R/F/C/T"}}, "type": "object", "required": ["end_date", "reason"], "title": "EmployeeTerminateRequest"}, "EmployeeTfnRevealOut": {"properties": {"employee_id": {"type": "string", "format": "uuid", "title": "Employee Id"}, "tfn": {"type": "string", "title": "Tfn"}}, "type": "object", "required": ["employee_id", "tfn"], "title": "EmployeeTfnRevealOut", "description": "Returned by /employees/{id}/tfn when the caller has employee.tfn_view."}, "EmployeeUpdate": {"properties": {"employee_number": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Employee Number"}, "contact_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Contact Id"}, "start_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Start Date"}, "dob": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Dob"}, "sex_code": {"anyOf": [{"type": "string", "enum": ["0", "1", "2", "3"]}, {"type": "null"}], "title": "Sex Code"}, "address_line1": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Address Line1"}, "address_line2": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Address Line2"}, "suburb": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Suburb"}, "state": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "State"}, "postcode": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Postcode"}, "country_code": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Country Code"}, "employment_basis": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Employment Basis"}, "tax_treatment_code": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Tax Treatment Code"}, "claims_tax_free_threshold": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "title": "Claims Tax Free Threshold"}, "is_australian_resident": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "title": "Is Australian Resident"}, "study_training_support_loan": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "title": "Study Training Support Loan"}, "working_holiday_maker": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "title": "Working Holiday Maker"}, "whm_country_code": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Whm Country Code"}, "visa_subclass": {"anyOf": [{"type": "string", "enum": ["417", "462"]}, {"type": "null"}], "title": "Visa Subclass"}, "visa_grant_number": {"anyOf": [{"type": "string", "maxLength": 32}, {"type": "null"}], "title": "Visa Grant Number"}, "visa_expiry_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Visa Expiry Date"}, "vevo_checked_on": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Vevo Checked On"}, "vevo_work_entitlement": {"anyOf": [{"type": "string", "enum": ["UNLIMITED", "LIMITED", "NONE"]}, {"type": "null"}], "title": "Vevo Work Entitlement"}, "vevo_conditions": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Vevo Conditions"}, "vevo_attachment_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Vevo Attachment Id"}, "income_stream_type": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Income Stream Type"}, "payg_branch_code": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Payg Branch Code"}, "super_fund_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Super Fund Id"}, "super_member_number": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Super Member Number"}, "tfn_declaration_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Tfn Declaration Date"}, "super_choice_source": {"anyOf": [{"type": "string", "enum": ["EMPLOYEE_CHOICE", "STAPLED_FUND", "EMPLOYER_DEFAULT"]}, {"type": "null"}], "title": "Super Choice Source"}, "super_choice_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Super Choice Date"}, "stapled_fund_requested_on": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Stapled Fund Requested On"}, "payslip_email": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Payslip Email"}, "payslip_delivery": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Payslip Delivery"}, "pay_frequency": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Pay Frequency"}, "pay_basis": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Pay Basis"}, "base_rate": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Base Rate"}, "weekly_hours": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Weekly Hours"}, "casual_loading_pct": {"anyOf": [{"type": "number", "maximum": 100.0, "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Casual Loading Pct"}, "tfn_status": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Tfn Status"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}, "tfn": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Tfn"}, "bsb": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Bsb"}, "account_number": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Account Number"}, "account_name": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Account Name"}}, "type": "object", "title": "EmployeeUpdate", "description": "PATCH /api/v1/employees/{id} \u2014 every field optional. To clear a\nsensitive field, send the empty string explicitly; to leave it\nuntouched, omit the key."}, "ExpenseConflictBody": {"properties": {"detail": {"type": "string", "title": "Detail"}, "current": {"$ref": "#/components/schemas/ExpenseOut"}}, "type": "object", "required": ["detail", "current"], "title": "ExpenseConflictBody"}, "ExpenseCreate": {"properties": {"payment_account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Payment Account Id"}, "expense_date": {"type": "string", "format": "date", "title": "Expense Date"}, "contact_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Contact Id"}, "reference": {"anyOf": [{"type": "string", "maxLength": 64}, {"type": "null"}], "title": "Reference"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}, "currency": {"anyOf": [{"type": "string", "maxLength": 3, "minLength": 3}, {"type": "null"}], "title": "Currency"}, "fx_rate": {"anyOf": [{"type": "number", "exclusiveMinimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Fx Rate", "description": "Rate from the document currency to the company currency (1 unit = this many). Leave out to use the published rate for the date; refused if there is none."}, "fx_fee_amount": {"anyOf": [{"type": "number", "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Fx Fee Amount", "description": "Card conversion fee in the company currency (no GST)."}, "fx_fee_account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Fx Fee Account Id"}, "amounts_include_tax": {"type": "boolean", "title": "Amounts Include Tax", "default": false}, "paid_by": {"type": "string", "enum": ["business", "owner"], "title": "Paid By", "default": "business"}, "lines": {"items": {"$ref": "#/components/schemas/ExpenseLineCreate"}, "type": "array", "title": "Lines"}}, "type": "object", "required": ["expense_date"], "title": "ExpenseCreate", "description": "POST body.\n\nBatch 14: ``paid_by='owner'`` records an expense the owner paid with\ntheir own money. ``payment_account_id`` may then be left out \u2014 the\ncompany's owner loan account is used."}, "ExpenseLineCreate": {"properties": {"description": {"type": "string", "minLength": 1, "title": "Description"}, "account_id": {"type": "string", "format": "uuid", "title": "Account Id"}, "tax_code_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Tax Code Id"}, "quantity": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Quantity", "default": "1"}, "unit_price": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Unit Price", "default": "0"}, "discount_pct": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Discount Pct", "default": "0"}, "tax_override": {"anyOf": [{"type": "number", "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Tax Override"}, "project_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Project Id"}, "billable": {"type": "boolean", "title": "Billable", "default": false}, "private_pct": {"anyOf": [{"type": "number", "maximum": 100.0, "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Private Pct", "default": "0"}}, "type": "object", "required": ["description", "account_id"], "title": "ExpenseLineCreate", "description": "One line in a POST/PATCH payload."}, "ExpenseLineOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "line_no": {"type": "integer", "title": "Line No"}, "description": {"type": "string", "title": "Description"}, "account_id": {"type": "string", "format": "uuid", "title": "Account Id"}, "tax_code_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Tax Code Id"}, "quantity": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Quantity"}, "unit_price": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Unit Price"}, "discount_pct": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Discount Pct"}, "line_subtotal": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Line Subtotal"}, "line_tax": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Line Tax"}, "line_total": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Line Total"}, "project_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Project Id"}, "billable": {"type": "boolean", "title": "Billable", "default": false}, "rebill_invoice_line_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Rebill Invoice Line Id"}, "private_pct": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Private Pct", "default": "0"}}, "type": "object", "required": ["id", "line_no", "description", "account_id", "quantity", "unit_price", "discount_pct", "line_subtotal", "line_tax", "line_total"], "title": "ExpenseLineOut", "description": "One line of an expense (nested in ExpenseOut)."}, "ExpenseListOut": {"properties": {"items": {"items": {"$ref": "#/components/schemas/ExpenseOut"}, "type": "array", "title": "Items"}, "total": {"type": "integer", "title": "Total"}, "limit": {"type": "integer", "title": "Limit"}, "offset": {"type": "integer", "title": "Offset"}}, "type": "object", "required": ["items", "total", "limit", "offset"], "title": "ExpenseListOut"}, "ExpenseOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "company_id": {"type": "string", "format": "uuid", "title": "Company Id"}, "tenant_id": {"type": "string", "format": "uuid", "title": "Tenant Id"}, "contact_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Contact Id"}, "one_off_vendor_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "One Off Vendor Id"}, "one_off_vendor_name": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "One Off Vendor Name"}, "payment_account_id": {"type": "string", "format": "uuid", "title": "Payment Account Id"}, "number": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Number"}, "reference": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Reference"}, "expense_date": {"type": "string", "format": "date", "title": "Expense Date"}, "status": {"type": "string", "title": "Status"}, "subtotal": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Subtotal"}, "tax_total": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Tax Total"}, "total": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Total"}, "currency": {"type": "string", "title": "Currency"}, "fx_rate": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Fx Rate"}, "amounts_include_tax": {"type": "boolean", "title": "Amounts Include Tax", "default": false}, "base_subtotal": {"anyOf": [{"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Base Subtotal"}, "base_tax_total": {"anyOf": [{"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Base Tax Total"}, "base_total": {"anyOf": [{"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Base Total"}, "fx_fee_amount": {"anyOf": [{"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Fx Fee Amount"}, "fx_fee_account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Fx Fee Account Id"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}, "journal_entry_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Journal Entry Id"}, "void_journal_entry_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Void Journal Entry Id"}, "posted_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Posted At"}, "posted_by": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Posted By"}, "flagged_for_review": {"type": "boolean", "title": "Flagged For Review", "default": false}, "review_note": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Review Note"}, "paid_by": {"type": "string", "title": "Paid By", "default": "business"}, "reimbursed_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Reimbursed At"}, "reimbursement_transfer_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Reimbursement Transfer Id"}, "version": {"type": "integer", "title": "Version"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At"}, "updated_at": {"type": "string", "format": "date-time", "title": "Updated At"}, "archived_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Archived At"}, "lines": {"items": {"$ref": "#/components/schemas/ExpenseLineOut"}, "type": "array", "title": "Lines"}}, "type": "object", "required": ["id", "company_id", "tenant_id", "payment_account_id", "expense_date", "status", "subtotal", "tax_total", "total", "currency", "fx_rate", "version", "created_at", "updated_at"], "title": "ExpenseOut", "description": "Full expense response \u2014 includes nested lines, tenant_id, version."}, "ExpenseUpdate": {"properties": {"payment_account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Payment Account Id"}, "contact_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Contact Id"}, "expense_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Expense Date"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}, "reference": {"anyOf": [{"type": "string", "maxLength": 64}, {"type": "null"}], "title": "Reference"}, "currency": {"anyOf": [{"type": "string", "maxLength": 3, "minLength": 3}, {"type": "null"}], "title": "Currency"}, "fx_rate": {"anyOf": [{"type": "number", "exclusiveMinimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Fx Rate"}, "amounts_include_tax": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "title": "Amounts Include Tax"}, "fx_fee_amount": {"anyOf": [{"type": "number", "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Fx Fee Amount", "description": "Card conversion fee in the company currency (no GST)."}, "fx_fee_account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Fx Fee Account Id"}, "lines": {"anyOf": [{"items": {"$ref": "#/components/schemas/ExpenseLineCreate"}, "type": "array"}, {"type": "null"}], "title": "Lines"}, "paid_by": {"anyOf": [{"type": "string", "enum": ["business", "owner"]}, {"type": "null"}], "title": "Paid By"}}, "type": "object", "title": "ExpenseUpdate", "description": "PATCH body \u2014 every field optional."}, "ExportAbaOut": {"properties": {"aba_file_b64": {"type": "string", "title": "Aba File B64"}, "journal_id": {"type": "string", "format": "uuid", "title": "Journal Id"}}, "type": "object", "required": ["aba_file_b64", "journal_id"], "title": "ExportAbaOut"}, "ExportRequest": {"properties": {"passphrase": {"type": "string", "minLength": 12, "title": "Passphrase"}}, "type": "object", "required": ["passphrase"], "title": "ExportRequest"}, "FXRevaluationItem": {"properties": {"entity_type": {"type": "string", "title": "Entity Type"}, "entity_id": {"type": "string", "format": "uuid", "title": "Entity Id"}, "entity_ref": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Entity Ref"}, "contact_name": {"type": "string", "title": "Contact Name"}, "currency": {"type": "string", "title": "Currency"}, "original_amount": {"type": "number", "title": "Original Amount"}, "amount_paid": {"type": "number", "title": "Amount Paid"}, "outstanding_foreign": {"type": "number", "title": "Outstanding Foreign"}, "outstanding_base": {"anyOf": [{"type": "number"}, {"type": "null"}], "title": "Outstanding Base"}, "booked_rate": {"anyOf": [{"type": "number"}, {"type": "null"}], "title": "Booked Rate"}, "booked_base": {"anyOf": [{"type": "number"}, {"type": "null"}], "title": "Booked Base"}, "rate": {"anyOf": [{"type": "number"}, {"type": "null"}], "title": "Rate"}, "rate_source": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Rate Source"}, "unrealised_gain": {"anyOf": [{"type": "number"}, {"type": "null"}], "title": "Unrealised Gain"}, "note": {"type": "string", "title": "Note"}}, "type": "object", "required": ["entity_type", "entity_id", "entity_ref", "contact_name", "currency", "original_amount", "amount_paid", "outstanding_foreign", "outstanding_base", "note"], "title": "FXRevaluationItem", "description": "One foreign-currency document line in the FX revaluation report."}, "FXRevaluationReport": {"properties": {"as_of_date": {"type": "string", "format": "date", "title": "As Of Date"}, "base_currency": {"type": "string", "title": "Base Currency"}, "items": {"items": {"$ref": "#/components/schemas/FXRevaluationItem"}, "type": "array", "title": "Items"}, "total_items": {"type": "integer", "title": "Total Items"}, "total_booked_base": {"anyOf": [{"type": "number"}, {"type": "null"}], "title": "Total Booked Base"}, "total_revalued_base": {"anyOf": [{"type": "number"}, {"type": "null"}], "title": "Total Revalued Base"}, "note": {"type": "string", "title": "Note"}}, "type": "object", "required": ["as_of_date", "base_currency", "items", "total_items", "note"], "title": "FXRevaluationReport", "description": "FX revaluation report as at a given date."}, "FinaliseYearIn": {"properties": {"employee_ids": {"anyOf": [{"items": {"type": "string", "format": "uuid"}, "type": "array"}, {"type": "null"}], "title": "Employee Ids"}}, "type": "object", "title": "FinaliseYearIn"}, "FirstPeriodPreviewBody": {"properties": {"full_period_amount": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Full Period Amount"}, "basis": {"type": "string", "title": "Basis"}, "service_start": {"type": "string", "format": "date", "title": "Service Start"}, "service_end": {"type": "string", "format": "date", "title": "Service End"}}, "type": "object", "required": ["full_period_amount", "basis", "service_start", "service_end"], "title": "FirstPeriodPreviewBody", "description": "First-period recurring prorate (Prorate flow #1).\n\nIdentical body to the generic preview but the response includes a\nsuggested line-description string the caller can drop straight into\nthe first invoice's line."}, "FirstPeriodPreviewOut": {"properties": {"full_period_amount": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Full Period Amount"}, "basis": {"type": "string", "title": "Basis"}, "service_start": {"type": "string", "format": "date", "title": "Service Start"}, "service_end": {"type": "string", "format": "date", "title": "Service End"}, "days_used": {"type": "integer", "title": "Days Used"}, "days_in_full": {"type": "integer", "title": "Days In Full"}, "factor": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Factor"}, "prorated_amount": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Prorated Amount"}, "line_description_suggestion": {"type": "string", "title": "Line Description Suggestion"}}, "type": "object", "required": ["full_period_amount", "basis", "service_start", "service_end", "days_used", "days_in_full", "factor", "prorated_amount", "line_description_suggestion"], "title": "FirstPeriodPreviewOut"}, "FixedAssetConflictBody": {"properties": {"detail": {"type": "string", "title": "Detail"}, "current": {"$ref": "#/components/schemas/FixedAssetOut"}}, "type": "object", "required": ["detail", "current"], "title": "FixedAssetConflictBody"}, "FixedAssetConvertToInventory": {"properties": {"conversion_date": {"type": "string", "format": "date", "title": "Conversion Date"}, "inventory_account_id": {"type": "string", "format": "uuid", "title": "Inventory Account Id"}, "cogs_account_id": {"type": "string", "format": "uuid", "title": "Cogs Account Id"}, "income_account_id": {"type": "string", "format": "uuid", "title": "Income Account Id"}, "sku": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Sku"}, "vin": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Vin"}}, "type": "object", "required": ["conversion_date", "inventory_account_id", "cogs_account_id", "income_account_id"], "title": "FixedAssetConvertToInventory", "description": "POST body for converting an active FA demonstrator to used-inventory stock.\n\nThe conversion journal debits the inventory account at NBV, debits the\naccumulated-depreciation account (clearing this asset's share), and credits\nthe FA cost account (clearing the full original cost). The asset is then\nstamped disposed at NBV proceeds and an inventory Item is created with\non_hand_qty=1, wac_cost=NBV.\n\n``sku`` defaults to the asset's FA code when not supplied.\n``vin`` is stored as the item's description for used-vehicle tracking."}, "FixedAssetConvertToInventoryResponse": {"properties": {"asset": {"$ref": "#/components/schemas/FixedAssetOut"}, "item_id": {"type": "string", "format": "uuid", "title": "Item Id"}, "item_sku": {"type": "string", "title": "Item Sku"}, "nbv": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Nbv"}, "journal_id": {"type": "string", "format": "uuid", "title": "Journal Id"}}, "type": "object", "required": ["asset", "item_id", "item_sku", "nbv", "journal_id"], "title": "FixedAssetConvertToInventoryResponse", "description": "Response from POST /{id}/convert_to_inventory."}, "FixedAssetCreate": {"properties": {"name": {"type": "string", "maxLength": 255, "minLength": 1, "title": "Name"}, "depreciation_model_id": {"type": "string", "maxLength": 64, "minLength": 1, "title": "Depreciation Model Id"}, "cost_account_id": {"type": "string", "format": "uuid", "title": "Cost Account Id"}, "accum_dep_account_id": {"type": "string", "format": "uuid", "title": "Accum Dep Account Id"}, "dep_expense_account_id": {"type": "string", "format": "uuid", "title": "Dep Expense Account Id"}, "purchase_date": {"type": "string", "format": "date", "title": "Purchase Date"}, "cost": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Cost"}, "in_service_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "In Service Date"}, "residual_value": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Residual Value", "default": "0"}, "code": {"anyOf": [{"type": "string", "maxLength": 32, "minLength": 1}, {"type": "null"}], "title": "Code"}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Description"}, "tax_model_id": {"anyOf": [{"type": "string", "maxLength": 64}, {"type": "null"}], "title": "Tax Model Id"}, "serial_number": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Serial Number"}, "manufacturer": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Manufacturer"}, "model_number": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Model Number"}, "location": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Location"}, "custody_person": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Custody Person"}, "warranty_end": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Warranty End"}, "extra": {"anyOf": [{"additionalProperties": true, "type": "object"}, {"type": "null"}], "title": "Extra"}, "purchase": {"anyOf": [{"$ref": "#/components/schemas/FixedAssetPurchase"}, {"type": "null"}]}, "purchase_gst_full": {"anyOf": [{"type": "number", "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Purchase Gst Full", "description": "GST in the purchase price: the full GST credit, had the asset been bought solely for business use. Blank or 0 (bought from a seller not registered for GST) = no GST decreasing adjustment on a later sale."}, "purchase_gst_claimed": {"anyOf": [{"type": "number", "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Purchase Gst Claimed", "description": "GST credit actually claimed on the purchase, plus or minus later adjustments. Less than purchase_gst_full for a partly private asset: a taxable sale then takes a GST decreasing adjustment (BAS 1B). Needs purchase_gst_full; cannot be more than it."}, "motor_vehicle": {"type": "boolean", "title": "Motor Vehicle", "description": "A motor vehicle, trailer or body of a motor vehicle. Bought before 23 May 2001, it has no GST decreasing adjustment on sale (GSTR 2004/8 para 39: the GST Transition Act denied the credit on it).", "default": false}}, "type": "object", "required": ["name", "depreciation_model_id", "cost_account_id", "accum_dep_account_id", "dep_expense_account_id", "purchase_date", "cost"], "title": "FixedAssetCreate", "description": "POST body for creating a new fixed asset."}, "FixedAssetDepreciationRunRequest": {"properties": {"through": {"type": "string", "format": "date", "title": "Through"}}, "type": "object", "required": ["through"], "title": "FixedAssetDepreciationRunRequest", "description": "POST body for running a depreciation posting on a fixed asset."}, "FixedAssetDepreciationRunResponse": {"properties": {"asset": {"$ref": "#/components/schemas/FixedAssetOut"}, "amount_posted": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Amount Posted"}, "note": {"type": "string", "title": "Note"}}, "type": "object", "required": ["asset", "amount_posted", "note"], "title": "FixedAssetDepreciationRunResponse", "description": "Response body for POST /{id}/post_depreciation."}, "FixedAssetDispose": {"properties": {"disposal_date": {"type": "string", "format": "date", "title": "Disposal Date"}, "proceeds": {"anyOf": [{"type": "number", "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Proceeds"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}, "proceeds_account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Proceeds Account Id"}, "gst_applies": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "title": "Gst Applies"}, "motor_vehicle": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "title": "Motor Vehicle"}}, "type": "object", "required": ["disposal_date", "proceeds"], "title": "FixedAssetDispose", "description": "POST body for disposing a fixed asset.\n\nDisposal posts its journal (batch 14). ``proceeds_account_id`` is the\naccount the sale money went into \u2014 required when ``proceeds`` > 0.\n\n``proceeds`` is what the buyer pays. ``gst_applies`` (optional) says\nwhether that price includes GST; omitted = the company's GST\nregistration on the disposal date, the same default as the disposal\npreview. When GST applies the journal credits GST collected with one\neleventh of the price and reports the sale on the BAS (G1 and 1A).\n``false`` = not a business asset: no GST, not reported on the BAS.\nA taxable sale of a partly private asset (``purchase_gst_claimed``\nbelow ``purchase_gst_full``) also posts the GST decreasing adjustment\n(BAS 1B), as the disposal preview shows."}, "FixedAssetLinkPurchase": {"properties": {"method": {"type": "string", "enum": ["paid", "bill"], "title": "Method"}, "paid_from_account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Paid From Account Id"}, "gst_amount": {"anyOf": [{"type": "number", "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Gst Amount", "default": "0"}, "tax_code_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Tax Code Id"}, "bill_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Bill Id"}}, "type": "object", "required": ["method"], "title": "FixedAssetLinkPurchase", "description": "POST /fixed_assets/{id}/link_purchase body \u2014 ``method`` paid or bill."}, "FixedAssetListOut": {"properties": {"items": {"items": {"$ref": "#/components/schemas/FixedAssetOut"}, "type": "array", "title": "Items"}, "total": {"type": "integer", "title": "Total"}, "limit": {"type": "integer", "title": "Limit"}, "offset": {"type": "integer", "title": "Offset"}}, "type": "object", "required": ["items", "total", "limit", "offset"], "title": "FixedAssetListOut"}, "FixedAssetOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "company_id": {"type": "string", "format": "uuid", "title": "Company Id"}, "tenant_id": {"type": "string", "format": "uuid", "title": "Tenant Id"}, "code": {"type": "string", "title": "Code"}, "name": {"type": "string", "title": "Name"}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Description"}, "status": {"type": "string", "title": "Status"}, "depreciation_model_id": {"type": "string", "title": "Depreciation Model Id"}, "depreciation_model": {"anyOf": [{"$ref": "#/components/schemas/DepreciationModelOut"}, {"type": "null"}]}, "tax_model_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Tax Model Id"}, "cost_account_id": {"type": "string", "format": "uuid", "title": "Cost Account Id"}, "accum_dep_account_id": {"type": "string", "format": "uuid", "title": "Accum Dep Account Id"}, "dep_expense_account_id": {"type": "string", "format": "uuid", "title": "Dep Expense Account Id"}, "purchase_date": {"type": "string", "format": "date", "title": "Purchase Date"}, "in_service_date": {"type": "string", "format": "date", "title": "In Service Date"}, "cost": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Cost"}, "residual_value": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Residual Value"}, "last_depreciation_posted_through": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Last Depreciation Posted Through"}, "disposal_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Disposal Date"}, "disposal_proceeds": {"anyOf": [{"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Disposal Proceeds"}, "disposal_journal_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Disposal Journal Id"}, "purchase_journal_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Purchase Journal Id"}, "purchase_bill_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Purchase Bill Id"}, "loan_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Loan Id"}, "linked_to_purchase": {"type": "boolean", "title": "Linked To Purchase", "default": false}, "purchase_gst_full": {"anyOf": [{"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Purchase Gst Full"}, "purchase_gst_claimed": {"anyOf": [{"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Purchase Gst Claimed"}, "motor_vehicle": {"type": "boolean", "title": "Motor Vehicle", "default": false}, "serial_number": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Serial Number"}, "manufacturer": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Manufacturer"}, "model_number": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Model Number"}, "location": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Location"}, "custody_person": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Custody Person"}, "warranty_end": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Warranty End"}, "extra": {"anyOf": [{"additionalProperties": true, "type": "object"}, {"type": "null"}], "title": "Extra"}, "version": {"type": "integer", "title": "Version"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At"}, "updated_at": {"type": "string", "format": "date-time", "title": "Updated At"}, "archived_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Archived At"}}, "type": "object", "required": ["id", "company_id", "tenant_id", "code", "name", "status", "depreciation_model_id", "cost_account_id", "accum_dep_account_id", "dep_expense_account_id", "purchase_date", "in_service_date", "cost", "residual_value", "version", "created_at", "updated_at"], "title": "FixedAssetOut", "description": "Full fixed asset response \u2014 includes depreciation_model name for UX."}, "FixedAssetPurchase": {"properties": {"method": {"type": "string", "enum": ["paid", "bill", "existing"], "title": "Method", "default": "existing"}, "paid_from_account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Paid From Account Id"}, "gst_amount": {"anyOf": [{"type": "number", "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Gst Amount", "default": "0"}, "tax_code_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Tax Code Id"}, "bill_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Bill Id"}}, "type": "object", "title": "FixedAssetPurchase", "description": "How a new asset got onto the balance sheet (P1-73, batch 14).\n\n* ``paid`` \u2014 post the purchase now: Dr cost (with GST) / Cr\n  ``paid_from_account_id``.\n* ``bill`` \u2014 link the posted supplier bill that charged the cost account.\n* ``existing`` \u2014 already in the ledger (opening balances); nothing posts."}, "FixedAssetUpdate": {"properties": {"name": {"anyOf": [{"type": "string", "maxLength": 255, "minLength": 1}, {"type": "null"}], "title": "Name"}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Description"}, "depreciation_model_id": {"anyOf": [{"type": "string", "maxLength": 64, "minLength": 1}, {"type": "null"}], "title": "Depreciation Model Id"}, "tax_model_id": {"anyOf": [{"type": "string", "maxLength": 64}, {"type": "null"}], "title": "Tax Model Id"}, "purchase_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Purchase Date"}, "in_service_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "In Service Date"}, "residual_value": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Residual Value"}, "serial_number": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Serial Number"}, "manufacturer": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Manufacturer"}, "model_number": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Model Number"}, "location": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Location"}, "custody_person": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Custody Person"}, "warranty_end": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Warranty End"}, "extra": {"anyOf": [{"additionalProperties": true, "type": "object"}, {"type": "null"}], "title": "Extra"}, "purchase_gst_full": {"anyOf": [{"type": "number", "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Purchase Gst Full", "description": "GST in the purchase price: the full GST credit, had the asset been bought solely for business use. Blank or 0 (bought from a seller not registered for GST) = no GST decreasing adjustment on a later sale."}, "purchase_gst_claimed": {"anyOf": [{"type": "number", "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Purchase Gst Claimed", "description": "GST credit actually claimed on the purchase, plus or minus later adjustments. Less than purchase_gst_full for a partly private asset: a taxable sale then takes a GST decreasing adjustment (BAS 1B). Needs purchase_gst_full; cannot be more than it."}, "motor_vehicle": {"type": "boolean", "title": "Motor Vehicle", "description": "A motor vehicle, trailer or body of a motor vehicle. Bought before 23 May 2001, it has no GST decreasing adjustment on sale (GSTR 2004/8 para 39: the GST Transition Act denied the credit on it).", "default": false}}, "type": "object", "title": "FixedAssetUpdate", "description": "PATCH body \u2014 every field optional."}, "GLAccount": {"properties": {"account_id": {"type": "string", "title": "Account Id"}, "code": {"type": "string", "title": "Code"}, "name": {"type": "string", "title": "Name"}, "account_type": {"type": "string", "title": "Account Type"}, "balance_side": {"type": "string", "title": "Balance Side"}, "opening": {"type": "number", "title": "Opening"}, "total_debit": {"type": "number", "title": "Total Debit"}, "total_credit": {"type": "number", "title": "Total Credit"}, "closing": {"type": "number", "title": "Closing"}, "lines": {"items": {"$ref": "#/components/schemas/GLLine"}, "type": "array", "title": "Lines"}}, "type": "object", "required": ["account_id", "code", "name", "account_type", "balance_side", "opening", "total_debit", "total_credit", "closing"], "title": "GLAccount"}, "GLLine": {"properties": {"entry_id": {"type": "string", "title": "Entry Id"}, "date": {"type": "string", "format": "date", "title": "Date"}, "ref": {"type": "string", "title": "Ref"}, "source": {"type": "string", "title": "Source"}, "description": {"type": "string", "title": "Description"}, "debit": {"type": "number", "title": "Debit"}, "credit": {"type": "number", "title": "Credit"}, "balance": {"type": "number", "title": "Balance"}}, "type": "object", "required": ["entry_id", "date", "ref", "source", "description", "debit", "credit", "balance"], "title": "GLLine"}, "GeneralLedgerReport": {"properties": {"from_date": {"type": "string", "format": "date", "title": "From Date"}, "to_date": {"type": "string", "format": "date", "title": "To Date"}, "accounts": {"items": {"$ref": "#/components/schemas/GLAccount"}, "type": "array", "title": "Accounts"}, "total_debit": {"type": "number", "title": "Total Debit"}, "total_credit": {"type": "number", "title": "Total Credit"}}, "type": "object", "required": ["from_date", "to_date", "accounts", "total_debit", "total_credit"], "title": "GeneralLedgerReport"}, "GrantCreate": {"properties": {"principal_id": {"type": "string", "format": "uuid", "title": "Principal Id"}, "role": {"type": "string", "title": "Role"}}, "type": "object", "required": ["principal_id", "role"], "title": "GrantCreate"}, "GrantOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "principal_id": {"type": "string", "format": "uuid", "title": "Principal Id"}, "tenant_id": {"type": "string", "format": "uuid", "title": "Tenant Id"}, "role": {"type": "string", "title": "Role"}, "status": {"type": "string", "title": "Status"}, "granted_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Granted At"}, "revoked_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Revoked At"}}, "type": "object", "required": ["id", "principal_id", "tenant_id", "role", "status"], "title": "GrantOut"}, "GrossLine": {"properties": {"account_id": {"type": "string", "format": "uuid", "title": "Account Id"}, "tax_code_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Tax Code Id"}, "description": {"anyOf": [{"type": "string", "maxLength": 500}, {"type": "null"}], "title": "Description"}, "gross": {"anyOf": [{"type": "number", "exclusiveMinimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Gross"}, "project_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Project Id"}}, "type": "object", "required": ["account_id", "gross"], "title": "GrossLine", "description": "One GST-inclusive line, the way the bank shows the money (batch 4)."}, "HTTPValidationError": {"properties": {"detail": {"items": {"$ref": "#/components/schemas/ValidationError"}, "type": "array", "title": "Detail"}}, "type": "object", "title": "HTTPValidationError"}, "HistoryChangeOut": {"properties": {"field": {"type": "string", "title": "Field"}, "label": {"type": "string", "title": "Label"}, "before": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Before"}, "after": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "After"}}, "type": "object", "required": ["field", "label"], "title": "HistoryChangeOut"}, "HistoryEventOut": {"properties": {"at": {"type": "string", "format": "date-time", "title": "At"}, "action": {"type": "string", "title": "Action"}, "label": {"type": "string", "title": "Label"}, "user_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "User Id"}, "user_name": {"type": "string", "title": "User Name"}, "reason": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Reason"}, "changes": {"items": {"$ref": "#/components/schemas/HistoryChangeOut"}, "type": "array", "title": "Changes", "default": []}}, "type": "object", "required": ["at", "action", "label", "user_name"], "title": "HistoryEventOut"}, "HistoryOut": {"properties": {"entity": {"type": "string", "title": "Entity"}, "entity_id": {"type": "string", "format": "uuid", "title": "Entity Id"}, "events": {"items": {"$ref": "#/components/schemas/HistoryEventOut"}, "type": "array", "title": "Events"}}, "type": "object", "required": ["entity", "entity_id", "events"], "title": "HistoryOut"}, "IcLegOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "company_id": {"type": "string", "format": "uuid", "title": "Company Id"}, "journal_entry_id": {"type": "string", "format": "uuid", "title": "Journal Entry Id"}, "side": {"type": "string", "title": "Side"}}, "type": "object", "required": ["id", "company_id", "journal_entry_id", "side"], "title": "IcLegOut"}, "IgnoreRequest": {"properties": {"reason": {"anyOf": [{"type": "string", "maxLength": 500}, {"type": "null"}], "title": "Reason"}}, "type": "object", "title": "IgnoreRequest"}, "InboxDocumentPatch": {"properties": {"version": {"type": "integer", "title": "Version"}, "extraction_override": {"anyOf": [{"additionalProperties": true, "type": "object"}, {"type": "null"}], "title": "Extraction Override"}, "company_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Company Id"}, "suggested_contact_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Suggested Contact Id"}, "suggested_account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Suggested Account Id"}, "suggested_tax_code_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Suggested Tax Code Id"}}, "additionalProperties": false, "type": "object", "required": ["version"], "title": "InboxDocumentPatch", "description": "PATCH body \u2014 reviewer edits. ``extract`` is immutable by design;\nonly the override, the company routing, the suggestion overrides\n(spec \u00a73) and the optimistic-lock version are accepted\n(``extra=\"forbid\"`` turns anything else into a 422 rather than\nsilently dropping it)."}, "IntercompanyCreate": {"properties": {"originator_company_id": {"type": "string", "format": "uuid", "title": "Originator Company Id"}, "counterparty_company_id": {"type": "string", "format": "uuid", "title": "Counterparty Company Id"}, "amount": {"anyOf": [{"type": "number", "exclusiveMinimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Amount"}, "entry_date": {"type": "string", "format": "date", "title": "Entry Date"}, "originator_contra_account_id": {"type": "string", "format": "uuid", "title": "Originator Contra Account Id"}, "counterparty_contra_account_id": {"type": "string", "format": "uuid", "title": "Counterparty Contra Account Id"}, "description": {"anyOf": [{"type": "string", "maxLength": 500}, {"type": "null"}], "title": "Description"}}, "type": "object", "required": ["originator_company_id", "counterparty_company_id", "amount", "entry_date", "originator_contra_account_id", "counterparty_contra_account_id"], "title": "IntercompanyCreate", "description": "POST /intercompany body \u2014 a reciprocal LOCAL (same-tenant) pair.\n\nBoth companies must be in the authenticated tenant and a reciprocal\n``IcEdge`` pair (an ORIGINATOR edge on the originator and a COUNTERPARTY\nedge on the counterparty) must already exist; the control accounts come\nfrom those edges. Sign convention (fixed by the service): the originator's\ncontrol account is DEBITED (a receivable / \"due from\") and its contra\ncredited; the counterparty's control account is CREDITED (an obligation /\n\"due to\") and its contra debited."}, "IntercompanyListItem": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "company_id": {"type": "string", "format": "uuid", "title": "Company Id"}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Description"}, "status": {"type": "string", "title": "Status"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At"}, "updated_at": {"type": "string", "format": "date-time", "title": "Updated At"}}, "type": "object", "required": ["id", "company_id", "description", "status", "created_at", "updated_at"], "title": "IntercompanyListItem"}, "IntercompanyListOut": {"properties": {"items": {"items": {"$ref": "#/components/schemas/IntercompanyListItem"}, "type": "array", "title": "Items"}}, "type": "object", "required": ["items"], "title": "IntercompanyListOut"}, "IntercompanyOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "company_id": {"type": "string", "format": "uuid", "title": "Company Id"}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Description"}, "status": {"type": "string", "title": "Status"}, "legs": {"items": {"$ref": "#/components/schemas/IcLegOut"}, "type": "array", "title": "Legs"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At"}, "updated_at": {"type": "string", "format": "date-time", "title": "Updated At"}}, "type": "object", "required": ["id", "company_id", "description", "status", "legs", "created_at", "updated_at"], "title": "IntercompanyOut"}, "IntercompanyReconOut": {"properties": {"items": {"items": {"$ref": "#/components/schemas/ReconRowOut"}, "type": "array", "title": "Items"}, "unmatched_count": {"type": "integer", "title": "Unmatched Count"}}, "type": "object", "required": ["items", "unmatched_count"], "title": "IntercompanyReconOut", "description": "Read-only intercompany reconciliation/position for the active company.\n\n``unmatched_count`` is the number of txns missing a leg \u2014 the operator's\n\"needs attention\" tally (a stuck half-pair from a relay delivery failure\nsurfaces here; the engine never auto-reverses)."}, "IntercompanyReverse": {"properties": {"reversal_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Reversal Date"}}, "type": "object", "title": "IntercompanyReverse", "description": "POST /intercompany/{id}/reverse body."}, "InvoiceConflictBody": {"properties": {"detail": {"type": "string", "title": "Detail"}, "current": {"$ref": "#/components/schemas/InvoiceOut"}}, "type": "object", "required": ["detail", "current"], "title": "InvoiceConflictBody"}, "InvoiceCreate": {"properties": {"contact_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Contact Id"}, "issue_date": {"type": "string", "format": "date", "title": "Issue Date"}, "due_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Due Date"}, "settlement_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Settlement Date"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}, "payment_terms": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Payment Terms"}, "currency": {"anyOf": [{"type": "string", "maxLength": 3, "minLength": 3}, {"type": "null"}], "title": "Currency"}, "fx_rate": {"anyOf": [{"type": "number", "exclusiveMinimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Fx Rate", "description": "Rate from the document currency to the company currency (1 unit = this many). Leave out to use the published rate for the date; refused if there is none."}, "lines": {"items": {"$ref": "#/components/schemas/InvoiceLineCreate"}, "type": "array", "title": "Lines"}, "source_quote_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Source Quote Id"}}, "type": "object", "required": ["issue_date"], "title": "InvoiceCreate", "description": "POST body."}, "InvoiceLineAppendOut": {"properties": {"invoice_id": {"type": "string", "format": "uuid", "title": "Invoice Id"}, "invoice_version": {"type": "integer", "title": "Invoice Version"}, "line": {"$ref": "#/components/schemas/InvoiceLineOut"}}, "type": "object", "required": ["invoice_id", "invoice_version", "line"], "title": "InvoiceLineAppendOut", "description": "Response for ``POST /api/v1/invoices/{id}/lines``.\n\nReturns the full created line (so the caller can read the new\n``line.id`` to write back into e.g. ``time_entries.invoice_line_id``)\nplus the invoice id and its post-append version."}, "InvoiceLineCreate": {"properties": {"description": {"type": "string", "minLength": 1, "title": "Description"}, "account_id": {"type": "string", "format": "uuid", "title": "Account Id"}, "tax_code_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Tax Code Id"}, "quantity": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Quantity", "default": "1"}, "unit_price": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Unit Price", "default": "0"}, "discount_pct": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Discount Pct", "default": "0"}, "retention_pct": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Retention Pct", "default": "0"}, "project_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Project Id"}, "item_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Item Id"}, "service_start_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Service Start Date"}, "service_end_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Service End Date"}}, "type": "object", "required": ["description", "account_id"], "title": "InvoiceLineCreate", "description": "One line in a POST/PATCH payload."}, "InvoiceLineOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "line_no": {"type": "integer", "title": "Line No"}, "description": {"type": "string", "title": "Description"}, "account_id": {"type": "string", "format": "uuid", "title": "Account Id"}, "tax_code_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Tax Code Id"}, "quantity": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Quantity"}, "unit_price": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Unit Price"}, "discount_pct": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Discount Pct"}, "retention_pct": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Retention Pct", "default": "0"}, "line_subtotal": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Line Subtotal"}, "line_tax": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Line Tax"}, "line_total": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Line Total"}, "project_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Project Id"}, "item_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Item Id"}, "service_start_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Service Start Date"}, "service_end_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Service End Date"}}, "type": "object", "required": ["id", "line_no", "description", "account_id", "quantity", "unit_price", "discount_pct", "line_subtotal", "line_tax", "line_total"], "title": "InvoiceLineOut", "description": "One line of an invoice (nested in InvoiceOut)."}, "InvoiceListOut": {"properties": {"items": {"items": {"$ref": "#/components/schemas/InvoiceOut"}, "type": "array", "title": "Items"}, "total": {"type": "integer", "title": "Total"}, "limit": {"type": "integer", "title": "Limit"}, "offset": {"type": "integer", "title": "Offset"}, "totals": {"anyOf": [{"additionalProperties": {"type": "string"}, "type": "object"}, {"type": "null"}], "title": "Totals"}}, "type": "object", "required": ["items", "total", "limit", "offset"], "title": "InvoiceListOut"}, "InvoiceOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "company_id": {"type": "string", "format": "uuid", "title": "Company Id"}, "tenant_id": {"type": "string", "format": "uuid", "title": "Tenant Id"}, "contact_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Contact Id"}, "one_off_customer_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "One Off Customer Id"}, "one_off_customer_name": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "One Off Customer Name"}, "number": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Number"}, "issue_date": {"type": "string", "format": "date", "title": "Issue Date"}, "due_date": {"type": "string", "format": "date", "title": "Due Date"}, "settlement_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Settlement Date"}, "status": {"type": "string", "title": "Status"}, "subtotal": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Subtotal"}, "tax_total": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Tax Total"}, "total": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Total"}, "amount_paid": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Amount Paid"}, "currency": {"type": "string", "title": "Currency"}, "fx_rate": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Fx Rate"}, "base_subtotal": {"anyOf": [{"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Base Subtotal"}, "base_tax_total": {"anyOf": [{"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Base Tax Total"}, "base_total": {"anyOf": [{"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Base Total"}, "base_amount_paid": {"anyOf": [{"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Base Amount Paid"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}, "payment_terms": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Payment Terms"}, "journal_entry_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Journal Entry Id"}, "void_journal_entry_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Void Journal Entry Id"}, "write_off_journal_entry_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Write Off Journal Entry Id"}, "posted_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Posted At"}, "posted_by": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Posted By"}, "flagged_for_review": {"type": "boolean", "title": "Flagged For Review", "default": false}, "review_note": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Review Note"}, "version": {"type": "integer", "title": "Version"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At"}, "updated_at": {"type": "string", "format": "date-time", "title": "Updated At"}, "archived_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Archived At"}, "stripe_payment_link": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Stripe Payment Link"}, "source_quote_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Source Quote Id"}, "lines": {"items": {"$ref": "#/components/schemas/InvoiceLineOut"}, "type": "array", "title": "Lines"}, "credits_applied": {"items": {"$ref": "#/components/schemas/CreditApplicationOut"}, "type": "array", "title": "Credits Applied"}, "amount_due": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Amount Due", "description": "Still owing: total less cash paid and credits applied (POSTED\nonly; a draft, voided or written-off document owes nothing).", "readOnly": true}}, "type": "object", "required": ["id", "company_id", "tenant_id", "issue_date", "due_date", "status", "subtotal", "tax_total", "total", "amount_paid", "currency", "fx_rate", "version", "created_at", "updated_at", "amount_due"], "title": "InvoiceOut", "description": "Full invoice response \u2014 includes nested lines, tenant_id, version."}, "InvoiceRecoveryBody": {"properties": {"bank_account_id": {"type": "string", "format": "uuid", "title": "Bank Account Id"}, "amount": {"anyOf": [{"type": "number", "exclusiveMinimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Amount"}, "recovery_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Recovery Date"}, "payer_contact_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Payer Contact Id"}}, "type": "object", "required": ["bank_account_id", "amount"], "title": "InvoiceRecoveryBody", "description": "Body for POST /invoices/{id}/record-recovery.\n\nRecords money received against a previously written-off debt as Other\nIncome (no GST). ``bank_account_id`` is the account the funds landed in;\n``amount`` must be positive (supports partial / multiple recoveries).\n``payer_contact_id`` lets a collection agency be recorded as the payer\nwhen it differs from the original debtor."}, "InvoiceUpdate": {"properties": {"contact_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Contact Id"}, "issue_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Issue Date"}, "due_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Due Date"}, "settlement_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Settlement Date"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}, "payment_terms": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Payment Terms"}, "currency": {"anyOf": [{"type": "string", "maxLength": 3, "minLength": 3}, {"type": "null"}], "title": "Currency"}, "fx_rate": {"anyOf": [{"type": "number", "exclusiveMinimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Fx Rate"}, "lines": {"anyOf": [{"items": {"$ref": "#/components/schemas/InvoiceLineCreate"}, "type": "array"}, {"type": "null"}], "title": "Lines"}}, "type": "object", "title": "InvoiceUpdate", "description": "PATCH body \u2014 every field optional."}, "InvoiceWriteOffBody": {"properties": {"write_off_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Write Off Date"}, "reason": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Reason"}}, "type": "object", "title": "InvoiceWriteOffBody", "description": "Body for POST /invoices/{id}/write-off.\n\n``write_off_date`` defaults to today (run/confirmation date, NOT the\ninvoice date) when omitted. ``reason`` is an optional note recorded on the\nwrite-off journal entry (e.g. \"EC Credit Control \u2014 uncollectable\")."}, "ItemConflictBody": {"properties": {"detail": {"type": "string", "title": "Detail"}, "current": {"$ref": "#/components/schemas/ItemOut"}}, "type": "object", "required": ["detail", "current"], "title": "ItemConflictBody"}, "ItemCreate": {"properties": {"sku": {"type": "string", "maxLength": 64, "minLength": 1, "title": "Sku"}, "name": {"type": "string", "maxLength": 255, "minLength": 1, "title": "Name"}, "item_type": {"type": "string", "maxLength": 16, "minLength": 1, "title": "Item Type", "default": "inventory"}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Description"}, "cost_method": {"type": "string", "maxLength": 16, "minLength": 1, "title": "Cost Method", "default": "WAC"}, "default_sale_price": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Default Sale Price", "default": "0"}, "inventory_account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Inventory Account Id"}, "cogs_account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Cogs Account Id"}, "income_account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Income Account Id"}, "purchase_price": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Purchase Price", "default": "0"}, "purchase_account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Purchase Account Id"}, "sale_tax_code_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Sale Tax Code Id"}, "purchase_tax_code_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Purchase Tax Code Id"}, "unit_of_measure": {"anyOf": [{"type": "string", "maxLength": 32}, {"type": "null"}], "title": "Unit Of Measure"}, "reorder_level": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Reorder Level"}, "preferred_supplier_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Preferred Supplier Id"}, "on_hand_qty": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "On Hand Qty", "default": "0"}, "wac_cost": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Wac Cost", "default": "0"}}, "type": "object", "required": ["sku", "name"], "title": "ItemCreate", "description": "POST body for creating a new item."}, "ItemListOut": {"properties": {"items": {"items": {"$ref": "#/components/schemas/ItemOut"}, "type": "array", "title": "Items"}, "total": {"type": "integer", "title": "Total"}, "limit": {"type": "integer", "title": "Limit"}, "offset": {"type": "integer", "title": "Offset"}, "total_value": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Total Value", "default": "0"}}, "type": "object", "required": ["items", "total", "limit", "offset"], "title": "ItemListOut"}, "ItemOut": {"properties": {"sku": {"type": "string", "maxLength": 64, "minLength": 1, "title": "Sku"}, "name": {"type": "string", "maxLength": 255, "minLength": 1, "title": "Name"}, "item_type": {"type": "string", "maxLength": 16, "minLength": 1, "title": "Item Type", "default": "inventory"}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Description"}, "cost_method": {"type": "string", "maxLength": 16, "minLength": 1, "title": "Cost Method", "default": "WAC"}, "default_sale_price": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Default Sale Price", "default": "0"}, "inventory_account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Inventory Account Id"}, "cogs_account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Cogs Account Id"}, "income_account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Income Account Id"}, "purchase_price": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Purchase Price", "default": "0"}, "purchase_account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Purchase Account Id"}, "sale_tax_code_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Sale Tax Code Id"}, "purchase_tax_code_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Purchase Tax Code Id"}, "unit_of_measure": {"anyOf": [{"type": "string", "maxLength": 32}, {"type": "null"}], "title": "Unit Of Measure"}, "reorder_level": {"anyOf": [{"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Reorder Level"}, "preferred_supplier_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Preferred Supplier Id"}, "id": {"type": "string", "format": "uuid", "title": "Id"}, "company_id": {"type": "string", "format": "uuid", "title": "Company Id"}, "tenant_id": {"type": "string", "format": "uuid", "title": "Tenant Id"}, "on_hand_qty": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "On Hand Qty"}, "wac_cost": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Wac Cost"}, "inventory_value": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Inventory Value", "default": "0"}, "below_reorder_level": {"type": "boolean", "title": "Below Reorder Level", "default": false}, "version": {"type": "integer", "title": "Version"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At"}, "archived_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Archived At"}}, "type": "object", "required": ["sku", "name", "id", "company_id", "tenant_id", "on_hand_qty", "wac_cost", "version", "created_at"], "title": "ItemOut"}, "ItemUpdate": {"properties": {"sku": {"anyOf": [{"type": "string", "maxLength": 64, "minLength": 1}, {"type": "null"}], "title": "Sku"}, "name": {"anyOf": [{"type": "string", "maxLength": 255, "minLength": 1}, {"type": "null"}], "title": "Name"}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Description"}, "default_sale_price": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Default Sale Price"}, "inventory_account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Inventory Account Id"}, "cogs_account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Cogs Account Id"}, "income_account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Income Account Id"}, "purchase_price": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Purchase Price"}, "purchase_account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Purchase Account Id"}, "sale_tax_code_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Sale Tax Code Id"}, "purchase_tax_code_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Purchase Tax Code Id"}, "unit_of_measure": {"anyOf": [{"type": "string", "maxLength": 32}, {"type": "null"}], "title": "Unit Of Measure"}, "reorder_level": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Reorder Level"}, "preferred_supplier_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Preferred Supplier Id"}}, "type": "object", "title": "ItemUpdate", "description": "PATCH body \u2014 every field optional. on_hand_qty/wac_cost/cost_method/item_type not editable here."}, "JournalEntryConflictBody": {"properties": {"detail": {"type": "string", "title": "Detail"}, "current": {"$ref": "#/components/schemas/JournalEntryOut"}}, "type": "object", "required": ["detail", "current"], "title": "JournalEntryConflictBody"}, "JournalEntryCreate": {"properties": {"entry_date": {"type": "string", "format": "date", "title": "Entry Date"}, "narration": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Narration"}, "reference": {"anyOf": [{"type": "string", "maxLength": 32}, {"type": "null"}], "title": "Reference"}, "lines": {"items": {"$ref": "#/components/schemas/JournalLineCreate"}, "type": "array", "title": "Lines"}}, "type": "object", "required": ["entry_date"], "title": "JournalEntryCreate", "description": "POST body."}, "JournalEntryListOut": {"properties": {"items": {"items": {"$ref": "#/components/schemas/JournalEntryOut"}, "type": "array", "title": "Items"}, "total": {"type": "integer", "title": "Total"}, "limit": {"type": "integer", "title": "Limit"}, "offset": {"type": "integer", "title": "Offset"}}, "type": "object", "required": ["items", "total", "limit", "offset"], "title": "JournalEntryListOut"}, "JournalEntryOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "company_id": {"type": "string", "format": "uuid", "title": "Company Id"}, "tenant_id": {"type": "string", "format": "uuid", "title": "Tenant Id"}, "ref": {"type": "string", "title": "Ref"}, "entry_date": {"type": "string", "format": "date", "title": "Entry Date"}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Description"}, "status": {"type": "string", "title": "Status"}, "posted_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Posted At"}, "posted_by": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Posted By"}, "reversal_of_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Reversal Of Id"}, "override_reason": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Override Reason"}, "source_type": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Source Type"}, "source_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Source Id"}, "flagged_for_review": {"type": "boolean", "title": "Flagged For Review", "default": false}, "review_note": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Review Note"}, "version": {"type": "integer", "title": "Version"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At"}, "updated_at": {"type": "string", "format": "date-time", "title": "Updated At"}, "archived_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Archived At"}, "lines": {"items": {"$ref": "#/components/schemas/JournalLineOut"}, "type": "array", "title": "Lines"}}, "type": "object", "required": ["id", "company_id", "tenant_id", "ref", "entry_date", "status", "version", "created_at", "updated_at"], "title": "JournalEntryOut", "description": "Full response \u2014 includes nested lines, tenant_id, version."}, "JournalEntryPostBody": {"properties": {"override_reason": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Override Reason"}}, "type": "object", "title": "JournalEntryPostBody", "description": "Optional body for POST /{id}/post \u2014 carries override_reason for period-lock bypass."}, "JournalEntryReverseBody": {"properties": {"reversal_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Reversal Date"}, "override_reason": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Override Reason"}}, "type": "object", "title": "JournalEntryReverseBody", "description": "Optional body for POST /{id}/reverse.\n\n``reversal_date`` lands the mirror entry on a chosen date \u2014 e.g. a\n30-Jun accrual reversed on 1-Jul \u2014 instead of the original entry's\ndate (the default). ``override_reason`` satisfies the period-lock\ngate (F-04) if the reversal date falls in a locked range."}, "JournalEntryUpdate": {"properties": {"entry_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Entry Date"}, "narration": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Narration"}, "reference": {"anyOf": [{"type": "string", "maxLength": 32}, {"type": "null"}], "title": "Reference"}, "status": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Status"}, "lines": {"anyOf": [{"items": {"$ref": "#/components/schemas/JournalLineCreate"}, "type": "array"}, {"type": "null"}], "title": "Lines"}, "override_reason": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Override Reason"}}, "type": "object", "title": "JournalEntryUpdate", "description": "PATCH body \u2014 every field optional."}, "JournalLineCreate": {"properties": {"account_id": {"type": "string", "format": "uuid", "title": "Account Id"}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Description"}, "debit": {"anyOf": [{"type": "number", "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Debit", "default": "0"}, "credit": {"anyOf": [{"type": "number", "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Credit", "default": "0"}, "tax_code_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Tax Code Id"}, "gst_amount": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Gst Amount"}, "project_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Project Id"}}, "type": "object", "required": ["account_id"], "title": "JournalLineCreate", "description": "One line in a POST/PATCH payload.\n\n``debit``/``credit`` are non-negative: a signed amount belongs on the\nother side of the line, not as a negative here. Two negative debits\nthat net to zero satisfy the sum-equality balance checks (schema AND\nthe 0101 DB trigger) while producing a \"double-entry\" with no credit\nside at all \u2014 and the trust-commingling and PSI statutory guards\nclassify the debit side via ``debit > 0``, so a sign-flipped entry\nwould slip both. Mirrors ``SplitAllocation``'s existing ``ge=0``."}, "JournalLineOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "line_no": {"type": "integer", "title": "Line No"}, "account_id": {"type": "string", "format": "uuid", "title": "Account Id"}, "account_code": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Account Code"}, "account_name": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Account Name"}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Description"}, "debit": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Debit"}, "credit": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Credit"}, "tax_code_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Tax Code Id"}, "gst_amount": {"anyOf": [{"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Gst Amount"}, "project_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Project Id"}}, "type": "object", "required": ["id", "line_no", "account_id", "debit", "credit"], "title": "JournalLineOut", "description": "One line of a journal entry."}, "JournalListingEntry": {"properties": {"entry_id": {"type": "string", "title": "Entry Id"}, "date": {"type": "string", "format": "date", "title": "Date"}, "ref": {"type": "string", "title": "Ref"}, "source": {"type": "string", "title": "Source"}, "status": {"type": "string", "title": "Status"}, "description": {"type": "string", "title": "Description"}, "lines": {"items": {"$ref": "#/components/schemas/JournalListingLine"}, "type": "array", "title": "Lines"}}, "type": "object", "required": ["entry_id", "date", "ref", "source", "status", "description", "lines"], "title": "JournalListingEntry"}, "JournalListingLine": {"properties": {"account_code": {"type": "string", "title": "Account Code"}, "account_name": {"type": "string", "title": "Account Name"}, "description": {"type": "string", "title": "Description"}, "debit": {"type": "number", "title": "Debit"}, "credit": {"type": "number", "title": "Credit"}}, "type": "object", "required": ["account_code", "account_name", "description", "debit", "credit"], "title": "JournalListingLine"}, "JournalListingReport": {"properties": {"from_date": {"type": "string", "format": "date", "title": "From Date"}, "to_date": {"type": "string", "format": "date", "title": "To Date"}, "total": {"type": "integer", "title": "Total"}, "limit": {"type": "integer", "title": "Limit"}, "offset": {"type": "integer", "title": "Offset"}, "entries": {"items": {"$ref": "#/components/schemas/JournalListingEntry"}, "type": "array", "title": "Entries"}}, "type": "object", "required": ["from_date", "to_date", "total", "limit", "offset", "entries"], "title": "JournalListingReport"}, "JournalTemplateApplyOut": {"properties": {"template_id": {"type": "string", "format": "uuid", "title": "Template Id"}, "template_name": {"type": "string", "title": "Template Name"}, "suggested_lines": {"items": {"$ref": "#/components/schemas/JournalTemplateLineOut"}, "type": "array", "title": "Suggested Lines"}}, "type": "object", "required": ["template_id", "template_name", "suggested_lines"], "title": "JournalTemplateApplyOut", "description": "Response body for POST /journal_templates/{id}/apply.\n\nReturns the suggested pre-filled lines; the caller POSTs these\nto /api/v1/journal_entries to create the actual entry."}, "JournalTemplateCreate": {"properties": {"name": {"type": "string", "maxLength": 255, "minLength": 1, "title": "Name"}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Description"}, "lines": {"items": {"$ref": "#/components/schemas/JournalTemplateLineCreate"}, "type": "array", "title": "Lines"}}, "type": "object", "required": ["name"], "title": "JournalTemplateCreate", "description": "POST body for creating a journal template."}, "JournalTemplateLineCreate": {"properties": {"account_id": {"type": "string", "format": "uuid", "title": "Account Id"}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Description"}, "debit": {"anyOf": [{"type": "number", "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Debit", "default": "0"}, "credit": {"anyOf": [{"type": "number", "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Credit", "default": "0"}, "tax_code_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Tax Code Id"}}, "type": "object", "required": ["account_id"], "title": "JournalTemplateLineCreate", "description": "One line in a journal template (create / replace).\n\nNon-negative for the same reason as ``JournalLineCreate`` \u2014 templates\nmaterialise into journal entries, so a signed template line would\nreintroduce the sign-flip bypass one step upstream."}, "JournalTemplateLineOut": {"properties": {"account_id": {"type": "string", "format": "uuid", "title": "Account Id"}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Description"}, "debit": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Debit", "default": "0"}, "credit": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Credit", "default": "0"}, "tax_code_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Tax Code Id"}}, "type": "object", "required": ["account_id"], "title": "JournalTemplateLineOut", "description": "One line in a journal template response."}, "JournalTemplateListOut": {"properties": {"items": {"items": {"$ref": "#/components/schemas/JournalTemplateOut"}, "type": "array", "title": "Items"}, "total": {"type": "integer", "title": "Total"}, "limit": {"type": "integer", "title": "Limit"}, "offset": {"type": "integer", "title": "Offset"}}, "type": "object", "required": ["items", "total", "limit", "offset"], "title": "JournalTemplateListOut"}, "JournalTemplateOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "company_id": {"type": "string", "format": "uuid", "title": "Company Id"}, "name": {"type": "string", "title": "Name"}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Description"}, "lines": {"items": {"additionalProperties": true, "type": "object"}, "type": "array", "title": "Lines"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At"}, "archived_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Archived At"}}, "type": "object", "required": ["id", "company_id", "name", "created_at"], "title": "JournalTemplateOut", "description": "Full journal template response."}, "JournalTemplateUpdate": {"properties": {"name": {"anyOf": [{"type": "string", "maxLength": 255, "minLength": 1}, {"type": "null"}], "title": "Name"}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Description"}, "lines": {"anyOf": [{"items": {"$ref": "#/components/schemas/JournalTemplateLineCreate"}, "type": "array"}, {"type": "null"}], "title": "Lines"}}, "type": "object", "title": "JournalTemplateUpdate", "description": "PATCH body \u2014 every field optional."}, "LeaveAdjustIn": {"properties": {"leave_type": {"type": "string", "title": "Leave Type"}, "delta_hours": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Delta Hours"}, "reason": {"type": "string", "minLength": 1, "title": "Reason"}}, "type": "object", "required": ["leave_type", "delta_hours", "reason"], "title": "LeaveAdjustIn"}, "LeaveBalanceOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "employee_id": {"type": "string", "format": "uuid", "title": "Employee Id"}, "leave_type": {"type": "string", "title": "Leave Type"}, "balance_hours": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Balance Hours"}, "opening_balance_hours": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Opening Balance Hours"}, "opening_balance_as_at": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Opening Balance As At"}, "version": {"type": "integer", "title": "Version"}}, "type": "object", "required": ["id", "employee_id", "leave_type", "balance_hours", "opening_balance_hours", "version"], "title": "LeaveBalanceOut"}, "LeaveOpeningBalanceIn": {"properties": {"leave_type": {"type": "string", "title": "Leave Type"}, "hours": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Hours"}, "as_at": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "As At"}}, "type": "object", "required": ["leave_type", "hours"], "title": "LeaveOpeningBalanceIn"}, "LeiLookupRequest": {"properties": {"search": {"type": "string", "title": "Search"}}, "type": "object", "required": ["search"], "title": "LeiLookupRequest"}, "LoanAssetIn": {"properties": {"name": {"type": "string", "maxLength": 255, "minLength": 1, "title": "Name"}, "depreciation_model_id": {"type": "string", "maxLength": 64, "minLength": 1, "title": "Depreciation Model Id"}, "cost_account_id": {"type": "string", "format": "uuid", "title": "Cost Account Id"}, "accum_dep_account_id": {"type": "string", "format": "uuid", "title": "Accum Dep Account Id"}, "dep_expense_account_id": {"type": "string", "format": "uuid", "title": "Dep Expense Account Id"}, "cost": {"anyOf": [{"type": "number", "exclusiveMinimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Cost", "description": "Price before GST"}, "gst_amount": {"anyOf": [{"type": "number", "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Gst Amount", "default": "0"}, "tax_code_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Tax Code Id"}, "deposit": {"anyOf": [{"type": "number", "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Deposit", "default": "0"}, "deposit_account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Deposit Account Id"}, "purchase_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Purchase Date"}, "in_service_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "In Service Date"}, "residual_value": {"anyOf": [{"type": "number", "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Residual Value", "default": "0"}, "code": {"anyOf": [{"type": "string", "maxLength": 32}, {"type": "null"}], "title": "Code"}, "serial_number": {"anyOf": [{"type": "string", "maxLength": 255}, {"type": "null"}], "title": "Serial Number"}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Description"}}, "type": "object", "required": ["name", "depreciation_model_id", "cost_account_id", "accum_dep_account_id", "dep_expense_account_id", "cost"], "title": "LoanAssetIn", "description": "The asset a loan paid for (``funding='asset'``)."}, "LoanCreate": {"properties": {"principal": {"anyOf": [{"type": "number", "exclusiveMinimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Principal"}, "annual_rate_pct": {"anyOf": [{"type": "number", "maximum": 100.0, "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Annual Rate Pct"}, "term_periods": {"type": "integer", "maximum": 1200.0, "exclusiveMinimum": 0.0, "title": "Term Periods"}, "frequency": {"type": "string", "enum": ["weekly", "fortnightly", "monthly", "quarterly"], "title": "Frequency", "default": "monthly"}, "balloon": {"anyOf": [{"type": "number", "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Balloon", "default": "0"}, "repayment_amount": {"anyOf": [{"type": "number", "exclusiveMinimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Repayment Amount"}, "first_repayment_date": {"type": "string", "format": "date", "title": "First Repayment Date"}, "name": {"type": "string", "maxLength": 255, "minLength": 1, "title": "Name"}, "kind": {"type": "string", "enum": ["loan", "chattel_mortgage", "hire_purchase"], "title": "Kind", "default": "loan"}, "lender_contact_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Lender Contact Id"}, "reference": {"anyOf": [{"type": "string", "maxLength": 64}, {"type": "null"}], "title": "Reference"}, "start_date": {"type": "string", "format": "date", "title": "Start Date"}, "interest_method": {"anyOf": [{"type": "string", "enum": ["as_you_go", "unexpired"]}, {"type": "null"}], "title": "Interest Method"}, "liability_account_id": {"type": "string", "format": "uuid", "title": "Liability Account Id"}, "interest_account_id": {"type": "string", "format": "uuid", "title": "Interest Account Id"}, "unexpired_interest_account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Unexpired Interest Account Id"}, "funding": {"type": "string", "enum": ["cash", "asset"], "title": "Funding", "default": "cash"}, "drawdown_account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Drawdown Account Id"}, "asset": {"anyOf": [{"$ref": "#/components/schemas/LoanAssetIn"}, {"type": "null"}]}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}}, "type": "object", "required": ["annual_rate_pct", "term_periods", "first_repayment_date", "name", "start_date", "liability_account_id", "interest_account_id"], "title": "LoanCreate"}, "LoanPreviewIn": {"properties": {"principal": {"anyOf": [{"type": "number", "exclusiveMinimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Principal"}, "annual_rate_pct": {"anyOf": [{"type": "number", "maximum": 100.0, "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Annual Rate Pct"}, "term_periods": {"type": "integer", "maximum": 1200.0, "exclusiveMinimum": 0.0, "title": "Term Periods"}, "frequency": {"type": "string", "enum": ["weekly", "fortnightly", "monthly", "quarterly"], "title": "Frequency", "default": "monthly"}, "balloon": {"anyOf": [{"type": "number", "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Balloon", "default": "0"}, "repayment_amount": {"anyOf": [{"type": "number", "exclusiveMinimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Repayment Amount"}, "first_repayment_date": {"type": "string", "format": "date", "title": "First Repayment Date"}, "asset_cost": {"anyOf": [{"type": "number", "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Asset Cost"}, "asset_gst": {"anyOf": [{"type": "number", "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Asset Gst", "default": "0"}, "deposit": {"anyOf": [{"type": "number", "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Deposit", "default": "0"}}, "type": "object", "required": ["annual_rate_pct", "term_periods", "first_repayment_date"], "title": "LoanPreviewIn", "description": "Preview needs the amount financed directly (or the asset sums)."}, "LoanUpdate": {"properties": {"name": {"anyOf": [{"type": "string", "maxLength": 255, "minLength": 1}, {"type": "null"}], "title": "Name"}, "reference": {"anyOf": [{"type": "string", "maxLength": 64}, {"type": "null"}], "title": "Reference"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}, "lender_contact_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Lender Contact Id"}}, "type": "object", "title": "LoanUpdate"}, "LodgedElsewhereIn": {"properties": {"reference": {"type": "string", "maxLength": 128, "minLength": 1, "title": "Reference"}, "lodged_on": {"type": "string", "format": "date", "title": "Lodged On"}}, "type": "object", "required": ["reference", "lodged_on"], "title": "LodgedElsewhereIn"}, "LoginRequest": {"properties": {"email": {"type": "string", "title": "Email"}, "password": {"type": "string", "title": "Password"}}, "type": "object", "required": ["email", "password"], "title": "LoginRequest"}, "LogoIn": {"properties": {"data_b64": {"type": "string", "maxLength": 1500000, "title": "Data B64"}}, "type": "object", "required": ["data_b64"], "title": "LogoIn"}, "MarkSuperPaidIn": {"properties": {"bank_account_id": {"type": "string", "format": "uuid", "title": "Bank Account Id"}, "paid_on": {"type": "string", "format": "date", "title": "Paid On"}, "reference": {"anyOf": [{"type": "string", "maxLength": 64}, {"type": "null"}], "title": "Reference"}}, "type": "object", "required": ["bank_account_id", "paid_on"], "title": "MarkSuperPaidIn"}, "MatchManyItem": {"properties": {"target_type": {"type": "string", "enum": ["JOURNAL_ENTRY", "PAYMENT"], "title": "Target Type", "default": "JOURNAL_ENTRY"}, "target_id": {"type": "string", "format": "uuid", "title": "Target Id"}, "amount": {"anyOf": [{"type": "number", "exclusiveMinimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Amount"}}, "type": "object", "required": ["target_id"], "title": "MatchManyItem"}, "MatchManyRequest": {"properties": {"bsl_id": {"type": "string", "format": "uuid", "title": "Bsl Id"}, "items": {"items": {"$ref": "#/components/schemas/MatchManyItem"}, "type": "array", "maxItems": 100, "minItems": 1, "title": "Items"}}, "type": "object", "required": ["bsl_id", "items"], "title": "MatchManyRequest"}, "MatchRequest": {"properties": {"bsl_id": {"type": "string", "format": "uuid", "title": "Bsl Id"}, "entry_id": {"type": "string", "format": "uuid", "title": "Entry Id"}}, "type": "object", "required": ["bsl_id", "entry_id"], "title": "MatchRequest"}, "MessageResponse": {"properties": {"message": {"type": "string", "title": "Message"}}, "type": "object", "required": ["message"], "title": "MessageResponse"}, "NeedsAttentionOut": {"properties": {"as_at": {"type": "string", "format": "date", "title": "As At"}, "total_count": {"type": "integer", "title": "Total Count"}, "items": {"items": {"$ref": "#/components/schemas/AttentionItemOut"}, "type": "array", "title": "Items"}}, "type": "object", "required": ["as_at", "total_count", "items"], "title": "NeedsAttentionOut"}, "NextNumberRequest": {"properties": {"company_id": {"type": "string", "format": "uuid", "title": "Company Id"}, "kind": {"type": "string", "title": "Kind"}}, "type": "object", "required": ["company_id", "kind"], "title": "NextNumberRequest"}, "NoteIn": {"properties": {"body": {"type": "string", "maxLength": 10000, "minLength": 1, "title": "Body"}, "note_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Note Date"}}, "additionalProperties": false, "type": "object", "required": ["body"], "title": "NoteIn"}, "OAuthHandoffRequest": {"properties": {"provider": {"type": "string", "title": "Provider"}, "provider_user_id": {"type": "string", "title": "Provider User Id"}, "email": {"type": "string", "title": "Email"}, "display_name": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Display Name"}}, "type": "object", "required": ["provider", "provider_user_id", "email"], "title": "OAuthHandoffRequest"}, "OneOffCustomerConflictBody": {"properties": {"detail": {"type": "string", "title": "Detail"}, "current": {"$ref": "#/components/schemas/OneOffCustomerOut"}}, "type": "object", "required": ["detail", "current"], "title": "OneOffCustomerConflictBody"}, "OneOffCustomerCreate": {"properties": {"name": {"type": "string", "maxLength": 255, "minLength": 1, "title": "Name"}, "abn": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Abn"}, "default_account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Default Account Id"}, "default_tax_code": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Default Tax Code"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}}, "type": "object", "required": ["name"], "title": "OneOffCustomerCreate", "description": "POST body for creating a one-off customer."}, "OneOffCustomerListOut": {"properties": {"items": {"items": {"$ref": "#/components/schemas/OneOffCustomerOut"}, "type": "array", "title": "Items"}, "total": {"type": "integer", "title": "Total"}, "limit": {"type": "integer", "title": "Limit"}, "offset": {"type": "integer", "title": "Offset"}}, "type": "object", "required": ["items", "total", "limit", "offset"], "title": "OneOffCustomerListOut"}, "OneOffCustomerOut": {"properties": {"name": {"type": "string", "maxLength": 255, "minLength": 1, "title": "Name"}, "abn": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Abn"}, "default_account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Default Account Id"}, "default_tax_code": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Default Tax Code"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}, "id": {"type": "string", "format": "uuid", "title": "Id"}, "company_id": {"type": "string", "format": "uuid", "title": "Company Id"}, "tenant_id": {"type": "string", "format": "uuid", "title": "Tenant Id"}, "last_used_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Last Used At"}, "use_count": {"type": "integer", "title": "Use Count"}, "total_billed": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Total Billed"}, "archived_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Archived At"}, "promoted_to_contact_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Promoted To Contact Id"}, "version": {"type": "integer", "title": "Version"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At"}, "updated_at": {"type": "string", "format": "date-time", "title": "Updated At"}}, "type": "object", "required": ["name", "id", "company_id", "tenant_id", "use_count", "total_billed", "version", "created_at", "updated_at"], "title": "OneOffCustomerOut"}, "OneOffCustomerUpdate": {"properties": {"name": {"anyOf": [{"type": "string", "maxLength": 255, "minLength": 1}, {"type": "null"}], "title": "Name"}, "abn": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Abn"}, "default_account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Default Account Id"}, "default_tax_code": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Default Tax Code"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}}, "type": "object", "title": "OneOffCustomerUpdate", "description": "PATCH body \u2014 every field optional. ``None`` clears, missing leaves alone."}, "OneOffVendorConflictBody": {"properties": {"detail": {"type": "string", "title": "Detail"}, "current": {"$ref": "#/components/schemas/OneOffVendorOut"}}, "type": "object", "required": ["detail", "current"], "title": "OneOffVendorConflictBody"}, "OneOffVendorCreate": {"properties": {"name": {"type": "string", "maxLength": 255, "minLength": 1, "title": "Name"}, "abn": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Abn"}, "default_account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Default Account Id"}, "default_tax_code": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Default Tax Code"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}}, "type": "object", "required": ["name"], "title": "OneOffVendorCreate", "description": "POST body for creating a one-off vendor."}, "OneOffVendorListOut": {"properties": {"items": {"items": {"$ref": "#/components/schemas/OneOffVendorOut"}, "type": "array", "title": "Items"}, "total": {"type": "integer", "title": "Total"}, "limit": {"type": "integer", "title": "Limit"}, "offset": {"type": "integer", "title": "Offset"}}, "type": "object", "required": ["items", "total", "limit", "offset"], "title": "OneOffVendorListOut"}, "OneOffVendorOut": {"properties": {"name": {"type": "string", "maxLength": 255, "minLength": 1, "title": "Name"}, "abn": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Abn"}, "default_account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Default Account Id"}, "default_tax_code": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Default Tax Code"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}, "id": {"type": "string", "format": "uuid", "title": "Id"}, "company_id": {"type": "string", "format": "uuid", "title": "Company Id"}, "tenant_id": {"type": "string", "format": "uuid", "title": "Tenant Id"}, "last_used_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Last Used At"}, "use_count": {"type": "integer", "title": "Use Count"}, "total_spent": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Total Spent"}, "archived_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Archived At"}, "promoted_to_contact_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Promoted To Contact Id"}, "version": {"type": "integer", "title": "Version"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At"}, "updated_at": {"type": "string", "format": "date-time", "title": "Updated At"}}, "type": "object", "required": ["name", "id", "company_id", "tenant_id", "use_count", "total_spent", "version", "created_at", "updated_at"], "title": "OneOffVendorOut"}, "OneOffVendorUpdate": {"properties": {"name": {"anyOf": [{"type": "string", "maxLength": 255, "minLength": 1}, {"type": "null"}], "title": "Name"}, "abn": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Abn"}, "default_account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Default Account Id"}, "default_tax_code": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Default Tax Code"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}}, "type": "object", "title": "OneOffVendorUpdate", "description": "PATCH body \u2014 every field optional. ``None`` clears, missing leaves alone."}, "OpenDocsIn": {"properties": {"kind": {"type": "string", "enum": ["invoice", "bill"], "title": "Kind"}, "csv": {"type": "string", "maxLength": 5000000, "title": "Csv"}, "create_missing_contacts": {"type": "boolean", "title": "Create Missing Contacts", "default": false}}, "type": "object", "required": ["kind", "csv"], "title": "OpenDocsIn"}, "OwnerMoneySettingsIn": {"properties": {"owner_loan_account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Owner Loan Account Id"}, "drawings_account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Drawings Account Id"}}, "type": "object", "title": "OwnerMoneySettingsIn"}, "PLBySegmentReport": {"properties": {"from_date": {"type": "string", "format": "date", "title": "From Date"}, "to_date": {"type": "string", "format": "date", "title": "To Date"}, "segment_type": {"type": "string", "title": "Segment Type"}, "segments": {"items": {"$ref": "#/components/schemas/PLSegmentRow"}, "type": "array", "title": "Segments"}}, "type": "object", "required": ["from_date", "to_date", "segment_type", "segments"], "title": "PLBySegmentReport", "description": "P&L by segment (project) for a date range."}, "PLSegmentAccountLine": {"properties": {"account_id": {"type": "string", "format": "uuid", "title": "Account Id"}, "code": {"type": "string", "title": "Code"}, "name": {"type": "string", "title": "Name"}, "amount": {"type": "number", "title": "Amount"}}, "type": "object", "required": ["account_id", "code", "name", "amount"], "title": "PLSegmentAccountLine", "description": "One account line within a segment section."}, "PLSegmentRow": {"properties": {"segment_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Segment Id"}, "segment_label": {"type": "string", "title": "Segment Label"}, "sections": {"items": {"$ref": "#/components/schemas/PLSegmentSection"}, "type": "array", "title": "Sections"}, "net_profit": {"type": "number", "title": "Net Profit"}}, "type": "object", "required": ["segment_id", "segment_label", "sections", "net_profit"], "title": "PLSegmentRow", "description": "One project segment's P&L."}, "PLSegmentSection": {"properties": {"account_type": {"type": "string", "title": "Account Type"}, "lines": {"items": {"$ref": "#/components/schemas/PLSegmentAccountLine"}, "type": "array", "title": "Lines"}, "total": {"type": "number", "title": "Total"}}, "type": "object", "required": ["account_type", "lines", "total"], "title": "PLSegmentSection", "description": "One account-type grouping within a segment."}, "PasswordResetConfirmRequest": {"properties": {"token": {"type": "string", "title": "Token"}, "new_password": {"type": "string", "minLength": 1, "title": "New Password"}}, "type": "object", "required": ["token", "new_password"], "title": "PasswordResetConfirmRequest"}, "PayRunConflictBody": {"properties": {"detail": {"type": "string", "title": "Detail"}, "current": {"$ref": "#/components/schemas/PayRunOut"}}, "type": "object", "required": ["detail", "current"], "title": "PayRunConflictBody"}, "PayRunCreate": {"properties": {"period_start": {"type": "string", "format": "date", "title": "Period Start"}, "period_end": {"type": "string", "format": "date", "title": "Period End"}, "payment_date": {"type": "string", "format": "date", "title": "Payment Date"}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Description"}}, "type": "object", "required": ["period_start", "period_end", "payment_date"], "title": "PayRunCreate"}, "PayRunLineCreate": {"properties": {"employee_id": {"type": "string", "format": "uuid", "title": "Employee Id"}, "gross": {"anyOf": [{"type": "number", "exclusiveMinimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Gross"}, "tax": {"anyOf": [{"type": "number", "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Tax"}, "super_amount": {"anyOf": [{"type": "number", "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Super Amount"}, "net": {"anyOf": [{"type": "number", "exclusiveMinimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Net"}}, "type": "object", "required": ["employee_id", "gross", "tax", "super_amount", "net"], "title": "PayRunLineCreate"}, "PayRunLineOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "pay_run_id": {"type": "string", "format": "uuid", "title": "Pay Run Id"}, "employee_id": {"type": "string", "format": "uuid", "title": "Employee Id"}, "gross": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Gross"}, "tax": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Tax"}, "super_amount": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Super Amount"}, "net": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Net"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At"}}, "type": "object", "required": ["id", "pay_run_id", "employee_id", "gross", "tax", "super_amount", "net", "created_at"], "title": "PayRunLineOut"}, "PayRunListOut": {"properties": {"items": {"items": {"$ref": "#/components/schemas/PayRunOut"}, "type": "array", "title": "Items"}, "total": {"type": "integer", "title": "Total"}, "limit": {"type": "integer", "title": "Limit"}, "offset": {"type": "integer", "title": "Offset"}}, "type": "object", "required": ["items", "total", "limit", "offset"], "title": "PayRunListOut"}, "PayRunOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "company_id": {"type": "string", "format": "uuid", "title": "Company Id"}, "tenant_id": {"type": "string", "format": "uuid", "title": "Tenant Id"}, "period_start": {"type": "string", "format": "date", "title": "Period Start"}, "period_end": {"type": "string", "format": "date", "title": "Period End"}, "payment_date": {"type": "string", "format": "date", "title": "Payment Date"}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Description"}, "status": {"type": "string", "title": "Status"}, "journal_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Journal Id"}, "version": {"type": "integer", "title": "Version"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At"}, "updated_at": {"type": "string", "format": "date-time", "title": "Updated At"}, "lines": {"items": {"$ref": "#/components/schemas/PayRunLineOut"}, "type": "array", "title": "Lines", "default": []}, "blockers": {"items": {"type": "string"}, "type": "array", "title": "Blockers", "default": []}, "warnings": {"items": {"type": "string"}, "type": "array", "title": "Warnings", "default": []}}, "type": "object", "required": ["id", "company_id", "tenant_id", "period_start", "period_end", "payment_date", "description", "status", "journal_id", "version", "created_at", "updated_at"], "title": "PayRunOut"}, "PayRunVoidIn": {"properties": {"reason": {"anyOf": [{"type": "string", "maxLength": 500}, {"type": "null"}], "title": "Reason"}}, "type": "object", "title": "PayRunVoidIn", "description": "Optional body for ``POST /pay-runs/{id}/void``."}, "PaymentAllocateIn": {"properties": {"allocations": {"items": {"$ref": "#/components/schemas/PaymentAllocationCreate"}, "type": "array", "maxItems": 500, "minItems": 1, "title": "Allocations"}}, "type": "object", "required": ["allocations"], "title": "PaymentAllocateIn", "description": "POST /payments/{id}/allocations \u2014 apply money on account from a\nPOSTED payment to open invoices (INCOMING) or bills (OUTGOING)."}, "PaymentAllocationCreate": {"properties": {"invoice_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Invoice Id"}, "bill_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Bill Id"}, "credit_note_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Credit Note Id"}, "supplier_credit_note_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Supplier Credit Note Id"}, "refund_of_payment_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Refund Of Payment Id"}, "amount": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Amount"}}, "type": "object", "required": ["amount"], "title": "PaymentAllocationCreate", "description": "Allocation sub-object in a POST/PATCH payload.\n\nExactly one target. ``refund_of_payment_id`` (0227) refunds the\nunallocated remainder of a posted payment in the other direction: an\nOUTGOING refund of a customer's on-account receipt posts Dr Trade\nDebtors / Cr Bank; an INCOMING refund of an on-account supplier payment\nposts Dr Bank / Cr Trade Creditors. ``supplier_credit_note_id`` on an\nINCOMING payment records a supplier paying its credit back in cash\n(Dr Bank / Cr Trade Creditors)."}, "PaymentAllocationOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "payment_id": {"type": "string", "format": "uuid", "title": "Payment Id"}, "invoice_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Invoice Id"}, "bill_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Bill Id"}, "credit_note_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Credit Note Id"}, "supplier_credit_note_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Supplier Credit Note Id"}, "refund_of_payment_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Refund Of Payment Id"}, "amount": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Amount"}}, "type": "object", "required": ["id", "payment_id", "amount"], "title": "PaymentAllocationOut", "description": "One allocation nested inside PaymentOut."}, "PaymentConflictBody": {"properties": {"detail": {"type": "string", "title": "Detail"}, "current": {"$ref": "#/components/schemas/PaymentOut"}}, "type": "object", "required": ["detail", "current"], "title": "PaymentConflictBody"}, "PaymentCreate": {"properties": {"contact_id": {"type": "string", "format": "uuid", "title": "Contact Id"}, "bank_account_id": {"type": "string", "format": "uuid", "title": "Bank Account Id"}, "payment_date": {"type": "string", "format": "date", "title": "Payment Date"}, "amount": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Amount"}, "direction": {"type": "string", "title": "Direction", "default": "INCOMING"}, "method": {"type": "string", "title": "Method", "default": "eft"}, "reference": {"anyOf": [{"type": "string", "maxLength": 128}, {"type": "null"}], "title": "Reference"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}, "remittance_note": {"anyOf": [{"type": "string", "maxLength": 2000}, {"type": "null"}], "title": "Remittance Note"}, "currency": {"anyOf": [{"type": "string", "maxLength": 3, "minLength": 3}, {"type": "null"}], "title": "Currency"}, "fx_rate": {"anyOf": [{"type": "number", "exclusiveMinimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Fx Rate", "description": "Rate from the document currency to the company currency (1 unit = this many). Leave out to use the published rate for the date; refused if there is none."}, "base_amount": {"anyOf": [{"type": "number", "exclusiveMinimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Base Amount", "description": "Amount in the company currency that actually left or reached the bank. For a foreign payment the rate is worked out from it and the difference against the document rate is booked as a realised exchange gain or loss."}, "allocations": {"items": {"$ref": "#/components/schemas/PaymentAllocationCreate"}, "type": "array", "title": "Allocations"}, "credit_applications": {"items": {"$ref": "#/components/schemas/PaymentCreditUse"}, "type": "array", "title": "Credit Applications"}}, "type": "object", "required": ["contact_id", "bank_account_id", "payment_date", "amount"], "title": "PaymentCreate", "description": "POST body."}, "PaymentCreditUse": {"properties": {"credit_note_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Credit Note Id"}, "invoice_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Invoice Id"}, "supplier_credit_note_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Supplier Credit Note Id"}, "bill_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Bill Id"}, "amount": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Amount"}}, "type": "object", "required": ["amount"], "title": "PaymentCreditUse", "description": "One open credit to use inside a payment (0231c).\n\n``supplier_credit_note_id`` + ``bill_id`` on a payment to a supplier\n(OUTGOING); ``credit_note_id`` + ``invoice_id`` on a receipt from a\ncustomer (INCOMING). Applied, with no journal, when the payment posts;\nthe payment's own amount is the cash only."}, "PaymentListOut": {"properties": {"items": {"items": {"$ref": "#/components/schemas/PaymentOut"}, "type": "array", "title": "Items"}, "total": {"type": "integer", "title": "Total"}, "limit": {"type": "integer", "title": "Limit"}, "offset": {"type": "integer", "title": "Offset"}}, "type": "object", "required": ["items", "total", "limit", "offset"], "title": "PaymentListOut"}, "PaymentOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "company_id": {"type": "string", "format": "uuid", "title": "Company Id"}, "tenant_id": {"type": "string", "format": "uuid", "title": "Tenant Id"}, "contact_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Contact Id"}, "one_off_vendor_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "One Off Vendor Id"}, "one_off_vendor_name": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "One Off Vendor Name"}, "one_off_customer_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "One Off Customer Id"}, "one_off_customer_name": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "One Off Customer Name"}, "bank_account_id": {"type": "string", "format": "uuid", "title": "Bank Account Id"}, "number": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Number"}, "direction": {"type": "string", "title": "Direction"}, "method": {"type": "string", "title": "Method"}, "status": {"type": "string", "title": "Status"}, "payment_date": {"type": "string", "format": "date", "title": "Payment Date"}, "amount": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Amount"}, "currency": {"type": "string", "title": "Currency"}, "fx_rate": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Fx Rate"}, "base_amount": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Base Amount"}, "reference": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Reference"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}, "remittance_note": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Remittance Note"}, "posted_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Posted At"}, "posted_by": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Posted By"}, "approval_status": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Approval Status"}, "approval_note": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Approval Note"}, "approval_requested_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Approval Requested At"}, "approval_decided_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Approval Decided At"}, "journal_entry_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Journal Entry Id"}, "void_journal_entry_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Void Journal Entry Id"}, "version": {"type": "integer", "title": "Version"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At"}, "updated_at": {"type": "string", "format": "date-time", "title": "Updated At"}, "archived_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Archived At"}, "allocations": {"items": {"$ref": "#/components/schemas/PaymentAllocationOut"}, "type": "array", "title": "Allocations"}, "credits_to_apply": {"anyOf": [{"items": {"additionalProperties": true, "type": "object"}, "type": "array"}, {"type": "null"}], "title": "Credits To Apply"}, "credit_applications": {"anyOf": [{"items": {"additionalProperties": true, "type": "object"}, "type": "array"}, {"type": "null"}], "title": "Credit Applications"}, "amount_unallocated": {"anyOf": [{"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Amount Unallocated"}}, "type": "object", "required": ["id", "company_id", "tenant_id", "bank_account_id", "direction", "method", "status", "payment_date", "amount", "currency", "fx_rate", "base_amount", "version", "created_at", "updated_at"], "title": "PaymentOut", "description": "Full payment response \u2014 includes nested allocations, tenant_id, version."}, "PaymentTermsBasis": {"type": "string", "enum": ["DAYS", "EOM"], "title": "PaymentTermsBasis", "description": "How a contact's default payment due-date is computed from an issue date.\n\n* DAYS \u2014 net N days from the invoice/issue date (e.g. \"Net 30\" = issue + 30).\n* EOM  \u2014 N days after the END of the issue month (Australian \"30-day EOM\":\n         an invoice dated anywhere in May, EOM30, is due 31 May + 30 = 30 Jun).\nNULL on a contact means \"no default terms\" \u2014 the due date must be entered\nexplicitly and is not derived."}, "PaymentUpdate": {"properties": {"contact_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Contact Id"}, "bank_account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Bank Account Id"}, "payment_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Payment Date"}, "amount": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Amount"}, "direction": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Direction"}, "method": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Method"}, "reference": {"anyOf": [{"type": "string", "maxLength": 128}, {"type": "null"}], "title": "Reference"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}, "remittance_note": {"anyOf": [{"type": "string", "maxLength": 2000}, {"type": "null"}], "title": "Remittance Note"}, "currency": {"anyOf": [{"type": "string", "maxLength": 3, "minLength": 3}, {"type": "null"}], "title": "Currency"}, "fx_rate": {"anyOf": [{"type": "number", "exclusiveMinimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Fx Rate"}, "base_amount": {"anyOf": [{"type": "number", "exclusiveMinimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Base Amount"}, "allocations": {"anyOf": [{"items": {"$ref": "#/components/schemas/PaymentAllocationCreate"}, "type": "array"}, {"type": "null"}], "title": "Allocations"}, "credit_applications": {"anyOf": [{"items": {"$ref": "#/components/schemas/PaymentCreditUse"}, "type": "array"}, {"type": "null"}], "title": "Credit Applications"}}, "type": "object", "title": "PaymentUpdate", "description": "PATCH body \u2014 every field optional."}, "PayrollSettingsIn": {"properties": {"leave_provision": {"type": "boolean", "title": "Leave Provision"}}, "type": "object", "required": ["leave_provision"], "title": "PayrollSettingsIn"}, "PayslipOut": {"properties": {"payslip": {"additionalProperties": true, "type": "object", "title": "Payslip"}}, "type": "object", "required": ["payslip"], "title": "PayslipOut"}, "PeriodLockCreate": {"properties": {"locked_through": {"type": "string", "format": "date", "title": "Locked Through"}, "reason": {"type": "string", "maxLength": 500, "minLength": 1, "title": "Reason"}}, "type": "object", "required": ["locked_through", "reason"], "title": "PeriodLockCreate"}, "PeriodLockListOut": {"properties": {"items": {"items": {"$ref": "#/components/schemas/PeriodLockOut"}, "type": "array", "title": "Items"}, "effective_locked_through": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Effective Locked Through"}}, "type": "object", "required": ["items"], "title": "PeriodLockListOut"}, "PeriodLockOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "locked_through": {"type": "string", "format": "date", "title": "Locked Through"}, "locked_at": {"type": "string", "format": "date-time", "title": "Locked At"}, "locked_by": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Locked By"}, "reason": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Reason"}}, "type": "object", "required": ["id", "locked_through", "locked_at"], "title": "PeriodLockOut"}, "PermissionOut": {"properties": {"code": {"type": "string", "title": "Code"}, "description": {"type": "string", "title": "Description"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At"}}, "type": "object", "required": ["code", "description", "created_at"], "title": "PermissionOut", "description": "One entry in the permission catalogue."}, "PersonIn": {"properties": {"name": {"type": "string", "maxLength": 255, "minLength": 1, "title": "Name"}, "role": {"anyOf": [{"type": "string", "maxLength": 100}, {"type": "null"}], "title": "Role"}, "email": {"anyOf": [{"type": "string", "maxLength": 255}, {"type": "null"}], "title": "Email"}, "phone": {"anyOf": [{"type": "string", "maxLength": 64}, {"type": "null"}], "title": "Phone"}, "receives_documents": {"type": "boolean", "title": "Receives Documents", "default": false}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}}, "additionalProperties": false, "type": "object", "required": ["name"], "title": "PersonIn"}, "PersonPatch": {"properties": {"name": {"anyOf": [{"type": "string", "maxLength": 255, "minLength": 1}, {"type": "null"}], "title": "Name"}, "role": {"anyOf": [{"type": "string", "maxLength": 100}, {"type": "null"}], "title": "Role"}, "email": {"anyOf": [{"type": "string", "maxLength": 255}, {"type": "null"}], "title": "Email"}, "phone": {"anyOf": [{"type": "string", "maxLength": 64}, {"type": "null"}], "title": "Phone"}, "receives_documents": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "title": "Receives Documents"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}, "active": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "title": "Active"}}, "additionalProperties": false, "type": "object", "title": "PersonPatch"}, "PlanChangePreviewBody": {"properties": {"old_period_amount": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Old Period Amount", "description": "Old plan's full-period amount."}, "new_period_amount": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "New Period Amount", "description": "New plan's full-period amount."}, "period_start": {"type": "string", "format": "date", "title": "Period Start"}, "period_end": {"type": "string", "format": "date", "title": "Period End"}, "change_date": {"type": "string", "format": "date", "title": "Change Date", "description": "Day the customer switches plans (inclusive of new plan)."}}, "type": "object", "required": ["old_period_amount", "new_period_amount", "period_start", "period_end", "change_date"], "title": "PlanChangePreviewBody", "description": "Mid-period plan-change (Prorate flow #2)."}, "PlanChangePreviewOut": {"properties": {"period_start": {"type": "string", "format": "date", "title": "Period Start"}, "period_end": {"type": "string", "format": "date", "title": "Period End"}, "change_date": {"type": "string", "format": "date", "title": "Change Date"}, "days_total": {"type": "integer", "title": "Days Total"}, "days_used": {"type": "integer", "title": "Days Used"}, "days_remaining": {"type": "integer", "title": "Days Remaining"}, "credit": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Credit"}, "charge": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Charge"}, "net": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Net"}}, "type": "object", "required": ["period_start", "period_end", "change_date", "days_total", "days_used", "days_remaining", "credit", "charge", "net"], "title": "PlanChangePreviewOut"}, "PlannedPayDateBody": {"properties": {"planned_pay_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Planned Pay Date"}}, "type": "object", "title": "PlannedPayDateBody"}, "PnLAccountLine": {"properties": {"account_id": {"type": "string", "format": "uuid", "title": "Account Id"}, "account_name": {"type": "string", "title": "Account Name"}, "code": {"type": "string", "title": "Code"}, "amount": {"type": "number", "title": "Amount"}, "comparative": {"anyOf": [{"type": "number"}, {"type": "null"}], "title": "Comparative"}}, "type": "object", "required": ["account_id", "account_name", "code", "amount"], "title": "PnLAccountLine", "description": "One account's net amount in a P&L section.\n\n``comparative`` (R7) is only populated when the request opted in via\n``?compare=previous_period|previous_year`` -- absent from the response\nentirely otherwise (route uses ``response_model_exclude_none``)."}, "PnLExpenses": {"properties": {"EXPENSE": {"items": {"$ref": "#/components/schemas/PnLAccountLine"}, "type": "array", "title": "Expense"}, "COST_OF_SALES": {"items": {"$ref": "#/components/schemas/PnLAccountLine"}, "type": "array", "title": "Cost Of Sales"}, "OTHER_EXPENSE": {"items": {"$ref": "#/components/schemas/PnLAccountLine"}, "type": "array", "title": "Other Expense"}, "total_expenses": {"type": "number", "title": "Total Expenses"}, "total_expenses_comparative": {"anyOf": [{"type": "number"}, {"type": "null"}], "title": "Total Expenses Comparative"}}, "type": "object", "required": ["total_expenses"], "title": "PnLExpenses", "description": "Expenses section of a P&L report."}, "PnLIncome": {"properties": {"INCOME": {"items": {"$ref": "#/components/schemas/PnLAccountLine"}, "type": "array", "title": "Income"}, "OTHER_INCOME": {"items": {"$ref": "#/components/schemas/PnLAccountLine"}, "type": "array", "title": "Other Income"}, "total_income": {"type": "number", "title": "Total Income"}, "total_income_comparative": {"anyOf": [{"type": "number"}, {"type": "null"}], "title": "Total Income Comparative"}}, "type": "object", "required": ["total_income"], "title": "PnLIncome", "description": "Income section of a P&L report."}, "PnLReport": {"properties": {"from_date": {"type": "string", "format": "date", "title": "From Date"}, "to_date": {"type": "string", "format": "date", "title": "To Date"}, "income": {"$ref": "#/components/schemas/PnLIncome"}, "expenses": {"$ref": "#/components/schemas/PnLExpenses"}, "net_profit": {"type": "number", "title": "Net Profit"}, "warnings": {"items": {"type": "string"}, "type": "array", "title": "Warnings"}, "compare": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Compare"}, "net_profit_comparative": {"anyOf": [{"type": "number"}, {"type": "null"}], "title": "Net Profit Comparative"}, "comparative_from_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Comparative From Date"}, "comparative_to_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Comparative To Date"}}, "type": "object", "required": ["from_date", "to_date", "income", "expenses", "net_profit"], "title": "PnLReport", "description": "Full profit & loss report for a date range.\n\nR7 comparative fields (``compare``, ``net_profit_comparative``,\n``comparative_from_date``, ``comparative_to_date``, and each line's\n``comparative``/``total_*_comparative``) are populated ONLY when the\ncaller opts in via ``?compare=previous_period|previous_year`` -- omitted\nfrom the JSON response entirely when not requested, so existing\nconsumers see the unchanged shape."}, "PortalResponse": {"properties": {"portal_url": {"type": "string", "title": "Portal Url"}}, "type": "object", "required": ["portal_url"], "title": "PortalResponse"}, "PrefixModeOut": {"properties": {"mode": {"type": "string", "title": "Mode"}}, "type": "object", "required": ["mode"], "title": "PrefixModeOut", "description": "Response body for GET /account_ranges/prefix_mode."}, "PrefixModeUpdate": {"properties": {"mode": {"type": "string", "minLength": 1, "title": "Mode"}}, "type": "object", "required": ["mode"], "title": "PrefixModeUpdate", "description": "PATCH body for /account_ranges/prefix_mode."}, "PrincipalSessionResponse": {"properties": {"access_token": {"type": "string", "title": "Access Token"}, "token_type": {"type": "string", "title": "Token Type", "default": "bearer"}, "expires_in": {"type": "integer", "title": "Expires In"}, "principal_id": {"type": "string", "format": "uuid", "title": "Principal Id"}, "tenant_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Tenant Id"}, "role": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Role"}}, "type": "object", "required": ["access_token", "expires_in", "principal_id"], "title": "PrincipalSessionResponse"}, "ProjectBillUnbilledRequest": {"properties": {"time_entry_ids": {"anyOf": [{"items": {"type": "string", "format": "uuid"}, "type": "array"}, {"type": "null"}], "title": "Time Entry Ids"}, "cost_line_ids": {"anyOf": [{"items": {"type": "string", "format": "uuid"}, "type": "array"}, {"type": "null"}], "title": "Cost Line Ids"}, "contact_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Contact Id"}, "issue_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Issue Date"}, "due_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Due Date"}, "time_item_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Time Item Id"}, "time_account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Time Account Id"}, "cost_account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Cost Account Id"}, "tax_code_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Tax Code Id"}, "markup_percent": {"anyOf": [{"type": "number", "maximum": 1000.0, "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Markup Percent", "default": "0"}}, "type": "object", "title": "ProjectBillUnbilledRequest", "description": "Body for POST /projects/{id}/bill-unbilled (P0-41).\n\nLeave ``time_entry_ids`` / ``cost_line_ids`` out to bill everything\nunbilled; send an empty list to bill none of that kind."}, "ProjectConflictBody": {"properties": {"detail": {"type": "string", "title": "Detail"}, "current": {"$ref": "#/components/schemas/ProjectOut"}}, "type": "object", "required": ["detail", "current"], "title": "ProjectConflictBody"}, "ProjectCreate": {"properties": {"code": {"type": "string", "maxLength": 32, "minLength": 1, "title": "Code"}, "name": {"type": "string", "maxLength": 128, "minLength": 1, "title": "Name"}, "status": {"type": "string", "title": "Status", "default": "ACTIVE"}, "start_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Start Date"}, "end_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "End Date"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}, "extra": {"anyOf": [{"additionalProperties": true, "type": "object"}, {"type": "null"}], "title": "Extra"}, "customer_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Customer Id"}, "budget_income": {"anyOf": [{"type": "number", "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Budget Income"}, "budget_cost": {"anyOf": [{"type": "number", "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Budget Cost"}}, "type": "object", "required": ["code", "name"], "title": "ProjectCreate", "description": "POST body for creating a new project."}, "ProjectListOut": {"properties": {"items": {"items": {"$ref": "#/components/schemas/ProjectOut"}, "type": "array", "title": "Items"}, "total": {"type": "integer", "title": "Total"}, "limit": {"type": "integer", "title": "Limit"}, "offset": {"type": "integer", "title": "Offset"}}, "type": "object", "required": ["items", "total", "limit", "offset"], "title": "ProjectListOut"}, "ProjectOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "company_id": {"type": "string", "format": "uuid", "title": "Company Id"}, "tenant_id": {"type": "string", "format": "uuid", "title": "Tenant Id"}, "code": {"type": "string", "title": "Code"}, "name": {"type": "string", "title": "Name"}, "status": {"type": "string", "title": "Status"}, "start_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Start Date"}, "end_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "End Date"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}, "extra": {"anyOf": [{"additionalProperties": true, "type": "object"}, {"type": "null"}], "title": "Extra"}, "customer_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Customer Id"}, "budget_income": {"anyOf": [{"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Budget Income"}, "budget_cost": {"anyOf": [{"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Budget Cost"}, "version": {"type": "integer", "title": "Version"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At"}, "archived_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Archived At"}}, "type": "object", "required": ["id", "company_id", "tenant_id", "code", "name", "status", "version", "created_at"], "title": "ProjectOut", "description": "Full project response."}, "ProjectUpdate": {"properties": {"code": {"anyOf": [{"type": "string", "maxLength": 32, "minLength": 1}, {"type": "null"}], "title": "Code"}, "name": {"anyOf": [{"type": "string", "maxLength": 128, "minLength": 1}, {"type": "null"}], "title": "Name"}, "status": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Status"}, "start_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Start Date"}, "end_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "End Date"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}, "extra": {"anyOf": [{"additionalProperties": true, "type": "object"}, {"type": "null"}], "title": "Extra"}, "customer_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Customer Id"}, "budget_income": {"anyOf": [{"type": "number", "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Budget Income"}, "budget_cost": {"anyOf": [{"type": "number", "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Budget Cost"}}, "type": "object", "title": "ProjectUpdate", "description": "PATCH body \u2014 every field optional."}, "ProratePreviewBody": {"properties": {"full_period_amount": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Full Period Amount", "description": "Full-period amount (e.g. monthly rent, annual subscription)."}, "basis": {"type": "string", "title": "Basis", "description": "DAILY / WEEKLY / MONTHLY / QUARTERLY / ANNUAL"}, "service_start": {"type": "string", "format": "date", "title": "Service Start"}, "service_end": {"type": "string", "format": "date", "title": "Service End"}}, "type": "object", "required": ["full_period_amount", "basis", "service_start", "service_end"], "title": "ProratePreviewBody", "description": "Generic per-line/date-range prorate (Prorate flow #3)."}, "ProratePreviewOut": {"properties": {"full_period_amount": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Full Period Amount"}, "basis": {"type": "string", "title": "Basis"}, "service_start": {"type": "string", "format": "date", "title": "Service Start"}, "service_end": {"type": "string", "format": "date", "title": "Service End"}, "days_used": {"type": "integer", "title": "Days Used"}, "days_in_full": {"type": "integer", "title": "Days In Full"}, "factor": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Factor"}, "prorated_amount": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Prorated Amount"}}, "type": "object", "required": ["full_period_amount", "basis", "service_start", "service_end", "days_used", "days_in_full", "factor", "prorated_amount"], "title": "ProratePreviewOut"}, "ProvisionRequest": {"properties": {"source_ip": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Source Ip"}}, "type": "object", "title": "ProvisionRequest"}, "PublishBody": {"properties": {"record_kind": {"type": "string", "title": "Record Kind"}, "company_id": {"type": "string", "format": "uuid", "title": "Company Id"}, "contact_id": {"type": "string", "format": "uuid", "title": "Contact Id"}, "date": {"type": "string", "format": "date", "title": "Date"}, "payment_account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Payment Account Id"}, "due_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Due Date"}, "reference": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Reference"}, "lines": {"items": {"$ref": "#/components/schemas/PublishLine"}, "type": "array", "minItems": 1, "title": "Lines"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}, "learn_rule": {"type": "boolean", "title": "Learn Rule", "default": false}, "update_rule": {"type": "boolean", "title": "Update Rule", "default": false}, "amounts_include_tax": {"type": "boolean", "title": "Amounts Include Tax", "default": false}}, "additionalProperties": false, "type": "object", "required": ["record_kind", "company_id", "contact_id", "date", "lines"], "title": "PublishBody"}, "PublishLine": {"properties": {"description": {"type": "string", "minLength": 1, "title": "Description"}, "account_id": {"type": "string", "format": "uuid", "title": "Account Id"}, "tax_code_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Tax Code Id"}, "quantity": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Quantity", "default": "1"}, "unit_price": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Unit Price", "default": "0"}, "project_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Project Id"}, "tax_override": {"anyOf": [{"type": "number", "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Tax Override"}}, "additionalProperties": false, "type": "object", "required": ["description", "account_id"], "title": "PublishLine", "description": "One coded expense line \u2014 the ``line amount = unit_price``\nconvention, matching ``ExpenseLineCreate``."}, "PurchaseOrderConflictBody": {"properties": {"detail": {"type": "string", "title": "Detail"}, "current": {"$ref": "#/components/schemas/PurchaseOrderOut"}}, "type": "object", "required": ["detail", "current"], "title": "PurchaseOrderConflictBody"}, "PurchaseOrderConvertBody": {"properties": {"quantities": {"anyOf": [{"additionalProperties": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}]}, "type": "object"}, {"type": "null"}], "title": "Quantities"}, "bill_issue_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Bill Issue Date"}, "bill_due_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Bill Due Date"}, "supplier_reference": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Supplier Reference"}}, "type": "object", "title": "PurchaseOrderConvertBody", "description": "POST /{id}/convert-to-bill payload \u2014 all fields optional.\n\n``quantities`` lets the caller bill less than the full unreceived\nremainder per line. Keys are ``line_no`` (1-indexed) values are the\nquantity to bill on that line. Lines omitted are skipped. If\n``quantities`` is ``None`` the service bills everything outstanding."}, "PurchaseOrderConvertOut": {"properties": {"purchase_order": {"$ref": "#/components/schemas/PurchaseOrderOut"}, "bill_id": {"type": "string", "format": "uuid", "title": "Bill Id"}, "bill_number": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Bill Number"}}, "type": "object", "required": ["purchase_order", "bill_id"], "title": "PurchaseOrderConvertOut"}, "PurchaseOrderCreate": {"properties": {"contact_id": {"type": "string", "format": "uuid", "title": "Contact Id"}, "issue_date": {"type": "string", "format": "date", "title": "Issue Date"}, "expected_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Expected Date"}, "delivery_address": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Delivery Address"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}, "currency": {"type": "string", "maxLength": 3, "minLength": 3, "title": "Currency", "default": "AUD"}, "fx_rate": {"anyOf": [{"type": "number", "exclusiveMinimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Fx Rate", "default": "1"}, "lines": {"items": {"$ref": "#/components/schemas/PurchaseOrderLineCreate"}, "type": "array", "title": "Lines"}}, "type": "object", "required": ["contact_id", "issue_date"], "title": "PurchaseOrderCreate", "description": "POST body \u2014 DRAFT is implied; lines optional."}, "PurchaseOrderLineCreate": {"properties": {"description": {"type": "string", "minLength": 1, "title": "Description"}, "account_id": {"type": "string", "format": "uuid", "title": "Account Id"}, "tax_code_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Tax Code Id"}, "quantity": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Quantity", "default": "1"}, "unit_price": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Unit Price", "default": "0"}, "discount_pct": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Discount Pct", "default": "0"}, "received_qty": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Received Qty", "default": "0"}, "project_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Project Id"}, "item_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Item Id"}}, "type": "object", "required": ["description", "account_id"], "title": "PurchaseOrderLineCreate", "description": "One line in a POST/PATCH payload.\n\n``received_qty`` is optional and defaults to 0 on a fresh line. On\nPATCH against an OPEN/PARTIAL PO, callers MUST round-trip the\n``received_qty`` returned by the GET \u2014 see service docstring."}, "PurchaseOrderLineOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "line_no": {"type": "integer", "title": "Line No"}, "description": {"type": "string", "title": "Description"}, "account_id": {"type": "string", "format": "uuid", "title": "Account Id"}, "tax_code_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Tax Code Id"}, "quantity": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Quantity"}, "unit_price": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Unit Price"}, "discount_pct": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Discount Pct"}, "line_subtotal": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Line Subtotal"}, "line_tax": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Line Tax"}, "line_total": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Line Total"}, "received_qty": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Received Qty"}, "project_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Project Id"}, "item_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Item Id"}}, "type": "object", "required": ["id", "line_no", "description", "account_id", "quantity", "unit_price", "discount_pct", "line_subtotal", "line_tax", "line_total", "received_qty"], "title": "PurchaseOrderLineOut", "description": "One line of a PO. ``received_qty`` reflects what's already been\nrolled into a converted bill \u2014 the unbilled remainder is\n``quantity - received_qty``."}, "PurchaseOrderListOut": {"properties": {"items": {"items": {"$ref": "#/components/schemas/PurchaseOrderOut"}, "type": "array", "title": "Items"}, "total": {"type": "integer", "title": "Total"}, "limit": {"type": "integer", "title": "Limit"}, "offset": {"type": "integer", "title": "Offset"}}, "type": "object", "required": ["items", "total", "limit", "offset"], "title": "PurchaseOrderListOut"}, "PurchaseOrderOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "company_id": {"type": "string", "format": "uuid", "title": "Company Id"}, "tenant_id": {"type": "string", "format": "uuid", "title": "Tenant Id"}, "contact_id": {"type": "string", "format": "uuid", "title": "Contact Id"}, "number": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Number"}, "issue_date": {"type": "string", "format": "date", "title": "Issue Date"}, "expected_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Expected Date"}, "status": {"type": "string", "title": "Status"}, "subtotal": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Subtotal"}, "tax_total": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Tax Total"}, "total": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Total"}, "currency": {"type": "string", "title": "Currency"}, "fx_rate": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Fx Rate"}, "delivery_address": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Delivery Address"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}, "sent_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Sent At"}, "closed_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Closed At"}, "cancelled_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Cancelled At"}, "version": {"type": "integer", "title": "Version"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At"}, "updated_at": {"type": "string", "format": "date-time", "title": "Updated At"}, "archived_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Archived At"}, "lines": {"items": {"$ref": "#/components/schemas/PurchaseOrderLineOut"}, "type": "array", "title": "Lines"}}, "type": "object", "required": ["id", "company_id", "tenant_id", "contact_id", "issue_date", "status", "subtotal", "tax_total", "total", "currency", "fx_rate", "version", "created_at", "updated_at"], "title": "PurchaseOrderOut", "description": "Full PO response \u2014 nested lines, tenant_id, version."}, "PurchaseOrderUpdate": {"properties": {"contact_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Contact Id"}, "issue_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Issue Date"}, "expected_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Expected Date"}, "delivery_address": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Delivery Address"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}, "currency": {"anyOf": [{"type": "string", "maxLength": 3, "minLength": 3}, {"type": "null"}], "title": "Currency"}, "fx_rate": {"anyOf": [{"type": "number", "exclusiveMinimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Fx Rate"}, "lines": {"anyOf": [{"items": {"$ref": "#/components/schemas/PurchaseOrderLineCreate"}, "type": "array"}, {"type": "null"}], "title": "Lines"}}, "type": "object", "title": "PurchaseOrderUpdate", "description": "PATCH body \u2014 every field optional."}, "QueueItemOut": {"properties": {"kind": {"type": "string", "title": "Kind"}, "id": {"type": "string", "format": "uuid", "title": "Id"}, "number": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Number"}, "reference": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Reference"}, "contact_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Contact Id"}, "contact_name": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Contact Name"}, "date": {"type": "string", "format": "date", "title": "Date"}, "total": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Total"}, "approval_status": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Approval Status"}, "approval_note": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Approval Note"}, "approval_requested_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Approval Requested At"}, "planned_pay_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Planned Pay Date"}, "version": {"type": "integer", "title": "Version"}}, "type": "object", "required": ["kind", "id", "date", "total", "version"], "title": "QueueItemOut"}, "QueueOut": {"properties": {"items": {"items": {"$ref": "#/components/schemas/QueueItemOut"}, "type": "array", "title": "Items"}}, "type": "object", "required": ["items"], "title": "QueueOut"}, "QuoteBillingOut": {"properties": {"quote_id": {"type": "string", "format": "uuid", "title": "Quote Id"}, "quote_subtotal": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Quote Subtotal"}, "invoiced_so_far": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Invoiced So Far"}, "remaining": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Remaining"}, "invoiced_percent": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Invoiced Percent"}, "claims": {"items": {"$ref": "#/components/schemas/QuoteClaimOut"}, "type": "array", "title": "Claims"}}, "type": "object", "required": ["quote_id", "quote_subtotal", "invoiced_so_far", "remaining", "invoiced_percent"], "title": "QuoteBillingOut", "description": "What has been invoiced against a quote and what is left (P0-40).\n\nAmounts are ex GST. ``counts=false`` claims are on voided invoices\nand do not reduce what is left to invoice."}, "QuoteClaimOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "claim_no": {"type": "integer", "title": "Claim No"}, "mode": {"type": "string", "title": "Mode"}, "percent": {"anyOf": [{"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Percent"}, "amount": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Amount"}, "invoice_id": {"type": "string", "format": "uuid", "title": "Invoice Id"}, "invoice_number": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Invoice Number"}, "invoice_status": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Invoice Status"}, "invoice_total": {"anyOf": [{"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Invoice Total"}, "issue_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Issue Date"}, "counts": {"type": "boolean", "title": "Counts", "default": true}, "created_at": {"type": "string", "format": "date-time", "title": "Created At"}}, "type": "object", "required": ["id", "claim_no", "mode", "amount", "invoice_id", "created_at"], "title": "QuoteClaimOut", "description": "One invoice raised against a quote (P0-40)."}, "QuoteConflictBody": {"properties": {"detail": {"type": "string", "title": "Detail"}, "current": {"$ref": "#/components/schemas/QuoteOut"}}, "type": "object", "required": ["detail", "current"], "title": "QuoteConflictBody"}, "QuoteConvertOut": {"properties": {"quote": {"$ref": "#/components/schemas/QuoteOut"}, "invoice_id": {"type": "string", "format": "uuid", "title": "Invoice Id"}}, "type": "object", "required": ["quote", "invoice_id"], "title": "QuoteConvertOut", "description": "Response from POST /quotes/{id}/convert-to-invoice."}, "QuoteCreate": {"properties": {"customer_id": {"type": "string", "format": "uuid", "title": "Customer Id"}, "issue_date": {"type": "string", "format": "date", "title": "Issue Date"}, "expiry_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Expiry Date"}, "currency": {"type": "string", "maxLength": 3, "minLength": 3, "title": "Currency", "default": "AUD"}, "validity_days": {"type": "integer", "minimum": 1.0, "title": "Validity Days", "default": 28}, "deposit_pct": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Deposit Pct", "default": "50"}, "late_fee_pct_per_month": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Late Fee Pct Per Month", "default": "2.5"}, "is_supply_only": {"type": "boolean", "title": "Is Supply Only", "default": false}, "title": {"anyOf": [{"type": "string", "maxLength": 255}, {"type": "null"}], "title": "Title"}, "scope": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Scope"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}, "terms": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Terms"}, "lines": {"items": {"$ref": "#/components/schemas/QuoteLineCreate"}, "type": "array", "title": "Lines"}}, "type": "object", "required": ["customer_id", "issue_date"], "title": "QuoteCreate", "description": "POST body \u2014 DRAFT is implied."}, "QuoteInvoiceRequest": {"properties": {"mode": {"type": "string", "pattern": "^(full|deposit|progress|remainder)$", "title": "Mode", "default": "full"}, "percent": {"anyOf": [{"type": "number", "maximum": 100.0, "exclusiveMinimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Percent"}, "amount": {"anyOf": [{"type": "number", "exclusiveMinimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Amount"}, "issue_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Issue Date"}, "due_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Due Date"}}, "type": "object", "title": "QuoteInvoiceRequest", "description": "Body for POST /quotes/{id}/convert-to-invoice (optional).\n\n* ``full`` (default) \u2014 the whole quote in one invoice (only when\n  nothing has been invoiced yet).\n* ``deposit`` \u2014 ``percent`` of the quote (default: the quote's\n  deposit percentage) or a fixed ``amount`` ex GST.\n* ``progress`` \u2014 a progress claim: ``percent`` or ``amount`` ex GST.\n* ``remainder`` \u2014 everything not yet invoiced."}, "QuoteLineCreate": {"properties": {"description": {"type": "string", "minLength": 1, "title": "Description"}, "quantity": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Quantity", "default": "1"}, "unit_price": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Unit Price", "default": "0"}, "tax_code_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Tax Code Id"}, "account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Account Id"}, "section_label": {"anyOf": [{"type": "string", "maxLength": 255}, {"type": "null"}], "title": "Section Label"}, "material": {"anyOf": [{"type": "string", "maxLength": 255}, {"type": "null"}], "title": "Material"}, "length_note": {"anyOf": [{"type": "string", "maxLength": 255}, {"type": "null"}], "title": "Length Note"}, "drawing_ref": {"anyOf": [{"type": "string", "maxLength": 255}, {"type": "null"}], "title": "Drawing Ref"}, "item_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Item Id"}}, "type": "object", "required": ["description"], "title": "QuoteLineCreate", "description": "One line in a POST/PATCH payload."}, "QuoteLineOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "line_no": {"type": "integer", "title": "Line No"}, "description": {"type": "string", "title": "Description"}, "quantity": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Quantity"}, "unit_price": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Unit Price"}, "line_total": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Line Total"}, "tax_code_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Tax Code Id"}, "account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Account Id"}, "section_label": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Section Label"}, "material": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Material"}, "length_note": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Length Note"}, "drawing_ref": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Drawing Ref"}, "item_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Item Id"}}, "type": "object", "required": ["id", "line_no", "description", "quantity", "unit_price", "line_total"], "title": "QuoteLineOut", "description": "One line of a quote (nested in QuoteOut)."}, "QuoteListOut": {"properties": {"items": {"items": {"$ref": "#/components/schemas/QuoteOut"}, "type": "array", "title": "Items"}, "total": {"type": "integer", "title": "Total"}, "limit": {"type": "integer", "title": "Limit"}, "offset": {"type": "integer", "title": "Offset"}}, "type": "object", "required": ["items", "total", "limit", "offset"], "title": "QuoteListOut"}, "QuoteOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "company_id": {"type": "string", "format": "uuid", "title": "Company Id"}, "tenant_id": {"type": "string", "format": "uuid", "title": "Tenant Id"}, "customer_id": {"type": "string", "format": "uuid", "title": "Customer Id"}, "number": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Number"}, "issue_date": {"type": "string", "format": "date", "title": "Issue Date"}, "expiry_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Expiry Date"}, "status": {"type": "string", "title": "Status"}, "subtotal": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Subtotal"}, "tax_total": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Tax Total"}, "total": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Total"}, "currency": {"type": "string", "title": "Currency"}, "validity_days": {"type": "integer", "title": "Validity Days"}, "deposit_pct": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Deposit Pct"}, "late_fee_pct_per_month": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Late Fee Pct Per Month"}, "is_supply_only": {"type": "boolean", "title": "Is Supply Only"}, "title": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Title"}, "scope": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Scope"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}, "terms": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Terms"}, "accepted_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Accepted At"}, "declined_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Declined At"}, "invoiced_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Invoiced At"}, "invoice_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Invoice Id"}, "parent_quote_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Parent Quote Id"}, "revision": {"type": "integer", "title": "Revision", "default": 1}, "version": {"type": "integer", "title": "Version"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At"}, "updated_at": {"type": "string", "format": "date-time", "title": "Updated At"}, "lines": {"items": {"$ref": "#/components/schemas/QuoteLineOut"}, "type": "array", "title": "Lines"}}, "type": "object", "required": ["id", "company_id", "tenant_id", "customer_id", "issue_date", "status", "subtotal", "tax_total", "total", "currency", "validity_days", "deposit_pct", "late_fee_pct_per_month", "is_supply_only", "version", "created_at", "updated_at"], "title": "QuoteOut", "description": "Full quote response \u2014 nested lines, tenant_id, version."}, "QuoteUpdate": {"properties": {"customer_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Customer Id"}, "issue_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Issue Date"}, "expiry_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Expiry Date"}, "currency": {"anyOf": [{"type": "string", "maxLength": 3, "minLength": 3}, {"type": "null"}], "title": "Currency"}, "validity_days": {"anyOf": [{"type": "integer", "minimum": 1.0}, {"type": "null"}], "title": "Validity Days"}, "deposit_pct": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Deposit Pct"}, "late_fee_pct_per_month": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Late Fee Pct Per Month"}, "is_supply_only": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "title": "Is Supply Only"}, "title": {"anyOf": [{"type": "string", "maxLength": 255}, {"type": "null"}], "title": "Title"}, "scope": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Scope"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}, "terms": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Terms"}, "lines": {"anyOf": [{"items": {"$ref": "#/components/schemas/QuoteLineCreate"}, "type": "array"}, {"type": "null"}], "title": "Lines"}}, "type": "object", "title": "QuoteUpdate", "description": "PATCH body \u2014 every field optional."}, "RateOut": {"properties": {"currency": {"type": "string", "title": "Currency"}, "base_currency": {"type": "string", "title": "Base Currency"}, "rate": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Rate", "description": "1 unit of currency = rate units of base"}, "inverse": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Inverse", "description": "1 unit of base = inverse units of currency"}, "source": {"type": "string", "title": "Source"}, "source_label": {"type": "string", "title": "Source Label"}, "rate_date": {"type": "string", "format": "date", "title": "Rate Date"}, "requested_date": {"type": "string", "format": "date", "title": "Requested Date"}}, "type": "object", "required": ["currency", "base_currency", "rate", "inverse", "source", "source_label", "rate_date", "requested_date"], "title": "RateOut"}, "ReceiptCreate": {"properties": {"bank_account_id": {"type": "string", "format": "uuid", "title": "Bank Account Id"}, "receipt_date": {"type": "string", "format": "date", "title": "Receipt Date"}, "lines": {"items": {"$ref": "#/components/schemas/ReceiptLineIn"}, "type": "array", "title": "Lines"}, "contact_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Contact Id"}, "reference": {"anyOf": [{"type": "string", "maxLength": 255}, {"type": "null"}], "title": "Reference"}, "reason": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Reason"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}}, "type": "object", "required": ["bank_account_id", "receipt_date"], "title": "ReceiptCreate"}, "ReceiptLineIn": {"properties": {"description": {"type": "string", "minLength": 1, "title": "Description"}, "account_id": {"type": "string", "format": "uuid", "title": "Account Id"}, "tax_code_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Tax Code Id"}, "amount": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Amount", "default": "0"}}, "type": "object", "required": ["description", "account_id"], "title": "ReceiptLineIn"}, "ReceiptLineOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "line_no": {"type": "integer", "title": "Line No"}, "description": {"type": "string", "title": "Description"}, "account_id": {"type": "string", "format": "uuid", "title": "Account Id"}, "tax_code_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Tax Code Id"}, "amount": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Amount"}, "tax_amount": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Tax Amount"}, "line_total": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Line Total"}}, "type": "object", "required": ["id", "line_no", "description", "account_id", "tax_code_id", "amount", "tax_amount", "line_total"], "title": "ReceiptLineOut"}, "ReceiptListOut": {"properties": {"items": {"items": {"$ref": "#/components/schemas/ReceiptOut"}, "type": "array", "title": "Items"}, "total": {"type": "integer", "title": "Total"}}, "type": "object", "required": ["items", "total"], "title": "ReceiptListOut"}, "ReceiptOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "company_id": {"type": "string", "format": "uuid", "title": "Company Id"}, "bank_account_id": {"type": "string", "format": "uuid", "title": "Bank Account Id"}, "contact_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Contact Id"}, "number": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Number"}, "receipt_date": {"type": "string", "format": "date", "title": "Receipt Date"}, "status": {"type": "string", "title": "Status"}, "reference": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Reference"}, "subtotal": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Subtotal"}, "tax_total": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Tax Total"}, "total": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Total"}, "reason": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Reason"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}, "journal_entry_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Journal Entry Id"}, "void_journal_entry_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Void Journal Entry Id"}, "tax_period_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Tax Period Id"}, "version": {"type": "integer", "title": "Version"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At"}, "updated_at": {"type": "string", "format": "date-time", "title": "Updated At"}, "lines": {"items": {"$ref": "#/components/schemas/ReceiptLineOut"}, "type": "array", "title": "Lines"}}, "type": "object", "required": ["id", "company_id", "bank_account_id", "contact_id", "number", "receipt_date", "status", "reference", "subtotal", "tax_total", "total", "reason", "notes", "journal_entry_id", "void_journal_entry_id", "version", "created_at", "updated_at", "lines"], "title": "ReceiptOut"}, "ReceiptStatus": {"type": "string", "enum": ["DRAFT", "POSTED", "VOIDED"], "title": "ReceiptStatus"}, "ReceiptUpdate": {"properties": {"bank_account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Bank Account Id"}, "receipt_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Receipt Date"}, "lines": {"anyOf": [{"items": {"$ref": "#/components/schemas/ReceiptLineIn"}, "type": "array"}, {"type": "null"}], "title": "Lines"}, "contact_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Contact Id"}, "reference": {"anyOf": [{"type": "string", "maxLength": 255}, {"type": "null"}], "title": "Reference"}, "reason": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Reason"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}}, "type": "object", "title": "ReceiptUpdate"}, "ReclassificationCreate": {"properties": {"from_account_id": {"type": "string", "format": "uuid", "title": "From Account Id"}, "to_account_id": {"type": "string", "format": "uuid", "title": "To Account Id"}, "amount": {"anyOf": [{"type": "number", "exclusiveMinimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Amount"}, "reclass_date": {"type": "string", "format": "date", "title": "Reclass Date"}, "reason": {"anyOf": [{"type": "string", "maxLength": 1000}, {"type": "null"}], "title": "Reason"}, "source_entry_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Source Entry Id"}, "override_reason": {"anyOf": [{"type": "string", "maxLength": 1000}, {"type": "null"}], "title": "Override Reason"}, "amount_side": {"anyOf": [{"type": "string", "pattern": "^(debit|credit)$"}, {"type": "null"}], "title": "Amount Side", "description": "debit | credit \u2014 the side the amount currently sits on; permits a side-preserving cross-side reclass. Needs reason."}}, "type": "object", "required": ["from_account_id", "to_account_id", "amount", "reclass_date"], "title": "ReclassificationCreate", "description": "POST /reclassifications body.\n\nMoves ``amount`` from ``from_account_id`` to ``to_account_id``. Both must\nbe accounts of the active company on the SAME natural balance side\n(expense->expense, asset->asset, income->income, liability->liability).\nThe canonical use is a same-parent child move or an account correction.\n``source_entry_id`` is the original JE being reclassified, for traceability\nonly \u2014 it is never mutated. ``override_reason`` is required to post into a\nlocked period (governed by the same gate as every other post)."}, "ReclassificationListOut": {"properties": {"items": {"items": {"$ref": "#/components/schemas/ReclassificationOut"}, "type": "array", "title": "Items"}}, "type": "object", "required": ["items"], "title": "ReclassificationListOut"}, "ReclassificationOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "company_id": {"type": "string", "format": "uuid", "title": "Company Id"}, "from_account_id": {"type": "string", "format": "uuid", "title": "From Account Id"}, "to_account_id": {"type": "string", "format": "uuid", "title": "To Account Id"}, "amount": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Amount"}, "reclass_date": {"type": "string", "format": "date", "title": "Reclass Date"}, "reason": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Reason"}, "source_entry_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Source Entry Id"}, "journal_entry_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Journal Entry Id"}, "status": {"type": "string", "title": "Status"}, "created_by": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Created By"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At"}, "updated_at": {"type": "string", "format": "date-time", "title": "Updated At"}}, "type": "object", "required": ["id", "company_id", "from_account_id", "to_account_id", "amount", "reclass_date", "reason", "source_entry_id", "journal_entry_id", "status", "created_by", "created_at", "updated_at"], "title": "ReclassificationOut"}, "ReclassificationReverse": {"properties": {"reversal_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Reversal Date"}, "override_reason": {"anyOf": [{"type": "string", "maxLength": 1000}, {"type": "null"}], "title": "Override Reason"}}, "type": "object", "title": "ReclassificationReverse", "description": "POST /reclassifications/{id}/reverse body."}, "ReclassifyLineBody": {"properties": {"to_account_id": {"type": "string", "format": "uuid", "title": "To Account Id"}, "reason": {"type": "string", "maxLength": 1000, "minLength": 1, "title": "Reason"}, "reclass_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Reclass Date"}, "override_reason": {"anyOf": [{"type": "string", "maxLength": 1000}, {"type": "null"}], "title": "Override Reason"}}, "type": "object", "required": ["to_account_id", "reason"], "title": "ReclassifyLineBody"}, "ReconLegOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "company_id": {"type": "string", "format": "uuid", "title": "Company Id"}, "journal_entry_id": {"type": "string", "format": "uuid", "title": "Journal Entry Id"}, "side": {"type": "string", "title": "Side"}}, "type": "object", "required": ["id", "company_id", "journal_entry_id", "side"], "title": "ReconLegOut", "description": "One posted leg in the reconciliation view."}, "ReconRowOut": {"properties": {"ic_txn_id": {"type": "string", "format": "uuid", "title": "Ic Txn Id"}, "company_id": {"type": "string", "format": "uuid", "title": "Company Id"}, "status": {"type": "string", "title": "Status"}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Description"}, "matched": {"type": "boolean", "title": "Matched"}, "legs": {"items": {"$ref": "#/components/schemas/ReconLegOut"}, "type": "array", "title": "Legs"}, "outbox_status": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Outbox Status"}, "inbox_status": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Inbox Status"}}, "type": "object", "required": ["ic_txn_id", "company_id", "status", "description", "matched", "legs", "outbox_status", "inbox_status"], "title": "ReconRowOut", "description": "One intercompany txn in the read-only reconciliation view.\n\n``matched`` is True when both legs (ORIGINATOR + COUNTERPARTY) are present \u2014\na complete, eliminated pair. ``outbox_status`` / ``inbox_status`` carry the\nin-flight relay state when present (None for a pure LOCAL pair)."}, "RecurrenceFrequency": {"type": "string", "enum": ["WEEKLY", "FORTNIGHTLY", "MONTHLY", "QUARTERLY", "YEARLY"], "title": "RecurrenceFrequency"}, "RecurrenceStatus": {"type": "string", "enum": ["ACTIVE", "PAUSED", "ENDED"], "title": "RecurrenceStatus"}, "RecurringBillCreate": {"properties": {"name": {"type": "string", "maxLength": 128, "minLength": 1, "title": "Name"}, "contact_id": {"type": "string", "format": "uuid", "title": "Contact Id"}, "frequency": {"$ref": "#/components/schemas/RecurrenceFrequency"}, "next_run": {"type": "string", "format": "date", "title": "Next Run"}, "status": {"$ref": "#/components/schemas/RecurrenceStatus", "default": "ACTIVE"}, "anchor_day": {"anyOf": [{"type": "integer", "maximum": 31.0, "minimum": 1.0}, {"type": "null"}], "title": "Anchor Day"}, "end_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "End Date"}, "due_days": {"type": "integer", "maximum": 3650.0, "minimum": 0.0, "title": "Due Days", "default": 30}, "supplier_reference": {"anyOf": [{"type": "string", "maxLength": 128}, {"type": "null"}], "title": "Supplier Reference"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}, "auto_post": {"type": "boolean", "title": "Auto Post", "default": false}, "catch_up": {"type": "boolean", "title": "Catch Up", "default": true}, "lines": {"items": {"$ref": "#/components/schemas/RecurringBillLineIn"}, "type": "array", "title": "Lines"}}, "type": "object", "required": ["name", "contact_id", "frequency", "next_run"], "title": "RecurringBillCreate"}, "RecurringBillLineIn": {"properties": {"description": {"type": "string", "minLength": 1, "title": "Description"}, "account_id": {"type": "string", "format": "uuid", "title": "Account Id"}, "tax_code_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Tax Code Id"}, "quantity": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Quantity", "default": "1"}, "unit_price": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Unit Price", "default": "0"}, "discount_pct": {"anyOf": [{"type": "number", "maximum": 100.0, "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Discount Pct", "default": "0"}}, "type": "object", "required": ["description", "account_id"], "title": "RecurringBillLineIn"}, "RecurringBillUpdate": {"properties": {"name": {"anyOf": [{"type": "string", "maxLength": 128, "minLength": 1}, {"type": "null"}], "title": "Name"}, "contact_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Contact Id"}, "frequency": {"anyOf": [{"$ref": "#/components/schemas/RecurrenceFrequency"}, {"type": "null"}]}, "next_run": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Next Run"}, "status": {"anyOf": [{"$ref": "#/components/schemas/RecurrenceStatus"}, {"type": "null"}]}, "anchor_day": {"anyOf": [{"type": "integer", "maximum": 31.0, "minimum": 1.0}, {"type": "null"}], "title": "Anchor Day"}, "end_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "End Date"}, "due_days": {"anyOf": [{"type": "integer", "maximum": 3650.0, "minimum": 0.0}, {"type": "null"}], "title": "Due Days"}, "supplier_reference": {"anyOf": [{"type": "string", "maxLength": 128}, {"type": "null"}], "title": "Supplier Reference"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}, "auto_post": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "title": "Auto Post"}, "catch_up": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "title": "Catch Up"}, "lines": {"anyOf": [{"items": {"$ref": "#/components/schemas/RecurringBillLineIn"}, "type": "array"}, {"type": "null"}], "title": "Lines"}}, "type": "object", "title": "RecurringBillUpdate"}, "RecurringInvoiceConflictBody": {"properties": {"detail": {"type": "string", "title": "Detail"}, "current": {"$ref": "#/components/schemas/RecurringInvoiceOut"}}, "type": "object", "required": ["detail", "current"], "title": "RecurringInvoiceConflictBody"}, "RecurringInvoiceCreate": {"properties": {"name": {"type": "string", "maxLength": 128, "minLength": 1, "title": "Name"}, "contact_id": {"type": "string", "format": "uuid", "title": "Contact Id"}, "frequency": {"$ref": "#/components/schemas/RecurrenceFrequency"}, "next_run": {"type": "string", "format": "date", "title": "Next Run"}, "status": {"$ref": "#/components/schemas/RecurrenceStatus", "default": "ACTIVE"}, "anchor_day": {"anyOf": [{"type": "integer", "maximum": 31.0, "minimum": 1.0}, {"type": "null"}], "title": "Anchor Day"}, "end_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "End Date"}, "due_days": {"type": "integer", "minimum": 0.0, "title": "Due Days", "default": 30}, "payment_terms": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Payment Terms"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}, "auto_post": {"type": "boolean", "title": "Auto Post", "default": false}, "currency": {"anyOf": [{"type": "string", "maxLength": 3, "minLength": 3}, {"type": "null"}], "title": "Currency"}, "auto_send": {"type": "boolean", "title": "Auto Send", "default": false}, "send_to": {"anyOf": [{"type": "string", "maxLength": 1000}, {"type": "null"}], "title": "Send To"}, "catch_up": {"type": "boolean", "title": "Catch Up", "default": true}, "lines": {"items": {"$ref": "#/components/schemas/RecurringInvoiceLineCreate"}, "type": "array", "title": "Lines"}}, "type": "object", "required": ["name", "contact_id", "frequency", "next_run"], "title": "RecurringInvoiceCreate", "description": "POST body for creating a recurring invoice template."}, "RecurringInvoiceGenerateResponse": {"properties": {"invoice_id": {"type": "string", "format": "uuid", "title": "Invoice Id"}, "invoice": {"$ref": "#/components/schemas/InvoiceOut"}}, "type": "object", "required": ["invoice_id", "invoice"], "title": "RecurringInvoiceGenerateResponse", "description": "Response body for POST /{id}/generate \u2014 the newly created invoice."}, "RecurringInvoiceLineCreate": {"properties": {"description": {"type": "string", "minLength": 1, "title": "Description"}, "account_id": {"type": "string", "format": "uuid", "title": "Account Id"}, "tax_code_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Tax Code Id"}, "quantity": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Quantity", "default": "1"}, "unit_price": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Unit Price", "default": "0"}, "discount_pct": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Discount Pct", "default": "0"}}, "type": "object", "required": ["description", "account_id"], "title": "RecurringInvoiceLineCreate", "description": "One line in a recurring invoice template (create / replace)."}, "RecurringInvoiceLineOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "line_no": {"type": "integer", "title": "Line No"}, "description": {"type": "string", "title": "Description"}, "account_id": {"type": "string", "format": "uuid", "title": "Account Id"}, "tax_code_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Tax Code Id"}, "quantity": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Quantity"}, "unit_price": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Unit Price"}, "discount_pct": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Discount Pct"}}, "type": "object", "required": ["id", "line_no", "description", "account_id", "quantity", "unit_price", "discount_pct"], "title": "RecurringInvoiceLineOut", "description": "Line item in a recurring invoice template response."}, "RecurringInvoiceListOut": {"properties": {"items": {"items": {"$ref": "#/components/schemas/RecurringInvoiceOut"}, "type": "array", "title": "Items"}, "total": {"type": "integer", "title": "Total"}, "limit": {"type": "integer", "title": "Limit"}, "offset": {"type": "integer", "title": "Offset"}}, "type": "object", "required": ["items", "total", "limit", "offset"], "title": "RecurringInvoiceListOut"}, "RecurringInvoiceOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "company_id": {"type": "string", "format": "uuid", "title": "Company Id"}, "tenant_id": {"type": "string", "format": "uuid", "title": "Tenant Id"}, "contact_id": {"type": "string", "format": "uuid", "title": "Contact Id"}, "name": {"type": "string", "title": "Name"}, "frequency": {"$ref": "#/components/schemas/RecurrenceFrequency"}, "status": {"$ref": "#/components/schemas/RecurrenceStatus"}, "anchor_day": {"anyOf": [{"type": "integer"}, {"type": "null"}], "title": "Anchor Day"}, "next_run": {"type": "string", "format": "date", "title": "Next Run"}, "end_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "End Date"}, "last_run": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Last Run"}, "due_days": {"type": "integer", "title": "Due Days"}, "payment_terms": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Payment Terms"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}, "currency": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Currency"}, "auto_post": {"type": "boolean", "title": "Auto Post"}, "invoices_generated": {"type": "integer", "title": "Invoices Generated"}, "version": {"type": "integer", "title": "Version"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At"}, "updated_at": {"type": "string", "format": "date-time", "title": "Updated At"}, "archived_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Archived At"}, "auto_send": {"type": "boolean", "title": "Auto Send", "default": false}, "send_to": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Send To"}, "catch_up": {"type": "boolean", "title": "Catch Up", "default": true}, "last_run_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Last Run At"}, "last_sent_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Last Sent At"}, "last_error": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Last Error"}, "last_error_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Last Error At"}, "failure_count": {"type": "integer", "title": "Failure Count", "default": 0}, "lines": {"items": {"$ref": "#/components/schemas/RecurringInvoiceLineOut"}, "type": "array", "title": "Lines"}}, "type": "object", "required": ["id", "company_id", "tenant_id", "contact_id", "name", "frequency", "status", "next_run", "due_days", "auto_post", "invoices_generated", "version", "created_at", "updated_at"], "title": "RecurringInvoiceOut", "description": "Full recurring invoice template response \u2014 lines nested."}, "RecurringInvoiceUpdate": {"properties": {"name": {"anyOf": [{"type": "string", "maxLength": 128, "minLength": 1}, {"type": "null"}], "title": "Name"}, "contact_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Contact Id"}, "frequency": {"anyOf": [{"$ref": "#/components/schemas/RecurrenceFrequency"}, {"type": "null"}]}, "next_run": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Next Run"}, "status": {"anyOf": [{"$ref": "#/components/schemas/RecurrenceStatus"}, {"type": "null"}]}, "anchor_day": {"anyOf": [{"type": "integer", "maximum": 31.0, "minimum": 1.0}, {"type": "null"}], "title": "Anchor Day"}, "end_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "End Date"}, "due_days": {"anyOf": [{"type": "integer", "minimum": 0.0}, {"type": "null"}], "title": "Due Days"}, "payment_terms": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Payment Terms"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}, "auto_post": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "title": "Auto Post"}, "currency": {"anyOf": [{"type": "string", "maxLength": 3, "minLength": 3}, {"type": "null"}], "title": "Currency"}, "auto_send": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "title": "Auto Send"}, "send_to": {"anyOf": [{"type": "string", "maxLength": 1000}, {"type": "null"}], "title": "Send To"}, "catch_up": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "title": "Catch Up"}, "lines": {"anyOf": [{"items": {"$ref": "#/components/schemas/RecurringInvoiceLineCreate"}, "type": "array"}, {"type": "null"}], "title": "Lines"}}, "type": "object", "title": "RecurringInvoiceUpdate", "description": "PATCH body \u2014 every field optional.\n\nIf ``lines`` is present, existing lines are replaced in full.\nIf ``lines`` is absent, existing lines are left untouched."}, "RefreshOut": {"properties": {"loaded": {"type": "integer", "title": "Loaded"}, "latest_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Latest Date"}}, "type": "object", "required": ["loaded", "latest_date"], "title": "RefreshOut"}, "RefreshRequest": {"properties": {"refresh_token": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Refresh Token"}}, "type": "object", "title": "RefreshRequest"}, "RegisterBeginResponse": {"properties": {"publicKey": {"additionalProperties": true, "type": "object", "title": "Publickey"}}, "type": "object", "required": ["publicKey"], "title": "RegisterBeginResponse"}, "RegisterFinishRequest": {"properties": {"credential": {"additionalProperties": true, "type": "object", "title": "Credential"}, "friendly_name": {"type": "string", "maxLength": 64, "title": "Friendly Name", "default": "Security key"}}, "type": "object", "required": ["credential"], "title": "RegisterFinishRequest"}, "RegisterFinishResponse": {"properties": {"credential_id": {"type": "string", "title": "Credential Id"}, "friendly_name": {"type": "string", "title": "Friendly Name"}}, "type": "object", "required": ["credential_id", "friendly_name"], "title": "RegisterFinishResponse"}, "ReimburseIn": {"properties": {"expense_ids": {"items": {"type": "string", "format": "uuid"}, "type": "array", "maxItems": 500, "minItems": 1, "title": "Expense Ids"}, "from_account_id": {"type": "string", "format": "uuid", "title": "From Account Id"}, "reimbursement_date": {"type": "string", "format": "date", "title": "Reimbursement Date"}, "reference": {"anyOf": [{"type": "string", "maxLength": 64}, {"type": "null"}], "title": "Reference"}}, "type": "object", "required": ["expense_ids", "from_account_id", "reimbursement_date"], "title": "ReimburseIn"}, "RejectBody": {"properties": {"reason": {"$ref": "#/components/schemas/RejectReason"}, "note": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Note"}}, "additionalProperties": false, "type": "object", "required": ["reason"], "title": "RejectBody"}, "RejectReason": {"type": "string", "enum": ["DUPLICATE", "NOT_A_DOCUMENT", "PERSONAL", "OTHER"], "title": "RejectReason"}, "ReopenRequest": {"properties": {"reason": {"type": "string", "maxLength": 2000, "minLength": 1, "title": "Reason"}}, "type": "object", "required": ["reason"], "title": "ReopenRequest"}, "RepaymentIn": {"properties": {"amount": {"anyOf": [{"type": "number", "exclusiveMinimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Amount"}, "repayment_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Repayment Date"}, "bank_account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Bank Account Id"}, "interest": {"anyOf": [{"type": "number", "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Interest"}, "fees": {"anyOf": [{"type": "number", "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Fees", "default": "0"}, "fees_account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Fees Account Id"}, "bank_statement_line_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Bank Statement Line Id"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}}, "type": "object", "title": "RepaymentIn"}, "RevalCurrencyOut": {"properties": {"currency": {"type": "string", "title": "Currency"}, "rate": {"anyOf": [{"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Rate"}, "rate_source": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Rate Source"}, "rate_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Rate Date"}, "outstanding_foreign_receivable": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Outstanding Foreign Receivable"}, "booked_receivable": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Booked Receivable"}, "revalued_receivable": {"anyOf": [{"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Revalued Receivable"}, "receivable_change": {"anyOf": [{"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Receivable Change"}, "outstanding_foreign_payable": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Outstanding Foreign Payable"}, "booked_payable": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Booked Payable"}, "revalued_payable": {"anyOf": [{"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Revalued Payable"}, "payable_change": {"anyOf": [{"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Payable Change"}, "gain_or_loss": {"anyOf": [{"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Gain Or Loss"}, "already_posted": {"type": "boolean", "title": "Already Posted"}, "adjustment_entry_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Adjustment Entry Id"}, "problem": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Problem"}}, "type": "object", "required": ["currency", "rate", "rate_source", "rate_date", "outstanding_foreign_receivable", "booked_receivable", "revalued_receivable", "receivable_change", "outstanding_foreign_payable", "booked_payable", "revalued_payable", "payable_change", "gain_or_loss", "already_posted"], "title": "RevalCurrencyOut"}, "RevalPostIn": {"properties": {"through_date": {"type": "string", "format": "date", "title": "Through Date"}}, "type": "object", "required": ["through_date"], "title": "RevalPostIn"}, "RevalPostOut": {"properties": {"through_date": {"type": "string", "format": "date", "title": "Through Date"}, "posted": {"items": {"additionalProperties": {"type": "string"}, "type": "object"}, "type": "array", "title": "Posted"}, "skipped_currencies": {"items": {"type": "string"}, "type": "array", "title": "Skipped Currencies"}, "zero_currencies": {"items": {"type": "string"}, "type": "array", "title": "Zero Currencies"}, "repaired_currencies": {"items": {"type": "string"}, "type": "array", "title": "Repaired Currencies"}}, "type": "object", "required": ["through_date", "posted", "skipped_currencies", "zero_currencies", "repaired_currencies"], "title": "RevalPostOut"}, "RevalPreviewOut": {"properties": {"through_date": {"type": "string", "format": "date", "title": "Through Date"}, "base_currency": {"type": "string", "title": "Base Currency"}, "currencies": {"items": {"$ref": "#/components/schemas/RevalCurrencyOut"}, "type": "array", "title": "Currencies"}, "total_gain_or_loss": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Total Gain Or Loss"}, "can_post": {"type": "boolean", "title": "Can Post"}}, "type": "object", "required": ["through_date", "base_currency", "currencies", "total_gain_or_loss", "can_post"], "title": "RevalPreviewOut"}, "RevenueByCustomerReport": {"properties": {"from_date": {"type": "string", "format": "date", "title": "From Date"}, "to_date": {"type": "string", "format": "date", "title": "To Date"}, "rows": {"items": {"$ref": "#/components/schemas/RevenueByCustomerRow"}, "type": "array", "title": "Rows"}, "total_revenue": {"type": "number", "title": "Total Revenue"}, "top_customer_pct": {"anyOf": [{"type": "number"}, {"type": "null"}], "title": "Top Customer Pct"}, "concentration_warning": {"type": "boolean", "title": "Concentration Warning"}}, "type": "object", "required": ["from_date", "to_date", "rows", "total_revenue", "top_customer_pct", "concentration_warning"], "title": "RevenueByCustomerReport", "description": "Revenue breakdown by customer with PSI concentration metrics."}, "RevenueByCustomerRow": {"properties": {"contact_id": {"type": "string", "format": "uuid", "title": "Contact Id"}, "contact_name": {"type": "string", "title": "Contact Name"}, "revenue": {"type": "number", "title": "Revenue"}, "pct_of_total": {"type": "number", "title": "Pct Of Total"}}, "type": "object", "required": ["contact_id", "contact_name", "revenue", "pct_of_total"], "title": "RevenueByCustomerRow", "description": "One customer's invoiced revenue for the period."}, "ReviewFlagBody": {"properties": {"flagged": {"type": "boolean", "title": "Flagged"}, "review_note": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Review Note"}}, "type": "object", "required": ["flagged"], "title": "ReviewFlagBody", "description": "Gap 3 (0157) \u2014 set/clear the review flag on a transaction/invoice/expense.\n\n``flagged`` toggles ``flagged_for_review``; ``review_note`` is an optional\nfollow-up note (preserved when re-flagging without a note, cleared when\n``flagged=false``). Flagging is metadata only \u2014 it never posts a JE and\nnever bumps the entity version, so no ``If-Match`` is required."}, "RoleCreate": {"properties": {"name": {"type": "string", "maxLength": 64, "minLength": 1, "title": "Name"}}, "type": "object", "required": ["name"], "title": "RoleCreate"}, "RoleFromTemplate": {"properties": {"template": {"type": "string", "pattern": "^(accountant)$", "title": "Template"}, "name": {"anyOf": [{"type": "string", "maxLength": 64, "minLength": 1}, {"type": "null"}], "title": "Name"}}, "type": "object", "required": ["template"], "title": "RoleFromTemplate"}, "RoleGrantsBody": {"properties": {"codes": {"items": {"type": "string"}, "type": "array", "title": "Codes"}}, "type": "object", "title": "RoleGrantsBody"}, "RoleOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "tenant_id": {"type": "string", "format": "uuid", "title": "Tenant Id"}, "name": {"type": "string", "title": "Name"}, "base_role": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Base Role"}, "is_system": {"type": "boolean", "title": "Is System"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At"}, "updated_at": {"type": "string", "format": "date-time", "title": "Updated At"}}, "type": "object", "required": ["id", "tenant_id", "name", "base_role", "is_system", "created_at", "updated_at"], "title": "RoleOut"}, "RoleRename": {"properties": {"name": {"type": "string", "maxLength": 64, "minLength": 1, "title": "Name"}}, "type": "object", "required": ["name"], "title": "RoleRename"}, "RoleWithGrantsOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "tenant_id": {"type": "string", "format": "uuid", "title": "Tenant Id"}, "name": {"type": "string", "title": "Name"}, "base_role": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Base Role"}, "is_system": {"type": "boolean", "title": "Is System"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At"}, "updated_at": {"type": "string", "format": "date-time", "title": "Updated At"}, "grants": {"items": {"type": "string"}, "type": "array", "title": "Grants"}}, "type": "object", "required": ["id", "tenant_id", "name", "base_role", "is_system", "created_at", "updated_at", "grants"], "title": "RoleWithGrantsOut"}, "RunListOut": {"properties": {"items": {"items": {"$ref": "#/components/schemas/RunOut"}, "type": "array", "title": "Items"}, "limit": {"type": "integer", "title": "Limit"}, "offset": {"type": "integer", "title": "Offset"}}, "type": "object", "required": ["items", "limit", "offset"], "title": "RunListOut"}, "RunOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "tenant_id": {"type": "string", "format": "uuid", "title": "Tenant Id"}, "config_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Config Id"}, "status": {"type": "string", "title": "Status"}, "destination_type": {"type": "string", "title": "Destination Type"}, "artifact_size_bytes": {"anyOf": [{"type": "integer"}, {"type": "null"}], "title": "Artifact Size Bytes"}, "artifact_sha256": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Artifact Sha256"}, "table_counts": {"anyOf": [{"additionalProperties": {"type": "integer"}, "type": "object"}, {"type": "null"}], "title": "Table Counts"}, "remote_push_status": {"type": "string", "title": "Remote Push Status"}, "error": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Error"}, "requested_by": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Requested By"}, "started_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Started At"}, "completed_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Completed At"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At"}}, "type": "object", "required": ["id", "tenant_id", "config_id", "status", "destination_type", "artifact_size_bytes", "artifact_sha256", "table_counts", "remote_push_status", "error", "requested_by", "started_at", "completed_at", "created_at"], "title": "RunOut"}, "SCNCreate": {"properties": {"contact_id": {"type": "string", "format": "uuid", "title": "Contact Id"}, "issue_date": {"type": "string", "format": "date", "title": "Issue Date"}, "lines": {"items": {"$ref": "#/components/schemas/SCNLineIn"}, "type": "array", "title": "Lines"}, "original_bill_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Original Bill Id"}, "supplier_reference": {"anyOf": [{"type": "string", "maxLength": 255}, {"type": "null"}], "title": "Supplier Reference"}, "reason": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Reason"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}}, "type": "object", "required": ["contact_id", "issue_date"], "title": "SCNCreate"}, "SCNLineIn": {"properties": {"description": {"type": "string", "minLength": 1, "title": "Description"}, "account_id": {"type": "string", "format": "uuid", "title": "Account Id"}, "tax_code_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Tax Code Id"}, "quantity": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Quantity", "default": "1"}, "unit_price": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Unit Price", "default": "0"}, "discount_pct": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Discount Pct", "default": "0"}}, "type": "object", "required": ["description", "account_id"], "title": "SCNLineIn"}, "SCNLineOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "line_no": {"type": "integer", "title": "Line No"}, "description": {"type": "string", "title": "Description"}, "account_id": {"type": "string", "format": "uuid", "title": "Account Id"}, "tax_code_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Tax Code Id"}, "quantity": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Quantity"}, "unit_price": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Unit Price"}, "discount_pct": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Discount Pct"}, "line_subtotal": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Line Subtotal"}, "line_tax": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Line Tax"}, "line_total": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Line Total"}}, "type": "object", "required": ["id", "line_no", "description", "account_id", "tax_code_id", "quantity", "unit_price", "discount_pct", "line_subtotal", "line_tax", "line_total"], "title": "SCNLineOut"}, "SCNListOut": {"properties": {"items": {"items": {"$ref": "#/components/schemas/SCNOut"}, "type": "array", "title": "Items"}, "total": {"type": "integer", "title": "Total"}}, "type": "object", "required": ["items", "total"], "title": "SCNListOut"}, "SCNOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "company_id": {"type": "string", "format": "uuid", "title": "Company Id"}, "contact_id": {"type": "string", "format": "uuid", "title": "Contact Id"}, "number": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Number"}, "issue_date": {"type": "string", "format": "date", "title": "Issue Date"}, "status": {"type": "string", "title": "Status"}, "original_bill_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Original Bill Id"}, "supplier_reference": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Supplier Reference"}, "subtotal": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Subtotal"}, "tax_total": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Tax Total"}, "total": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Total"}, "amount_applied": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Amount Applied", "default": "0"}, "amount_refunded": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Amount Refunded", "default": "0"}, "amount_remaining": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Amount Remaining", "default": "0"}, "reason": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Reason"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}, "journal_entry_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Journal Entry Id"}, "void_journal_entry_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Void Journal Entry Id"}, "version": {"type": "integer", "title": "Version"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At"}, "updated_at": {"type": "string", "format": "date-time", "title": "Updated At"}, "lines": {"items": {"$ref": "#/components/schemas/SCNLineOut"}, "type": "array", "title": "Lines"}, "applications": {"items": {"$ref": "#/components/schemas/CreditApplicationOut"}, "type": "array", "title": "Applications"}}, "type": "object", "required": ["id", "company_id", "contact_id", "number", "issue_date", "status", "original_bill_id", "supplier_reference", "subtotal", "tax_total", "total", "reason", "notes", "journal_entry_id", "void_journal_entry_id", "version", "created_at", "updated_at", "lines"], "title": "SCNOut"}, "SCNUpdate": {"properties": {"contact_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Contact Id"}, "issue_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Issue Date"}, "lines": {"anyOf": [{"items": {"$ref": "#/components/schemas/SCNLineIn"}, "type": "array"}, {"type": "null"}], "title": "Lines"}, "original_bill_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Original Bill Id"}, "supplier_reference": {"anyOf": [{"type": "string", "maxLength": 255}, {"type": "null"}], "title": "Supplier Reference"}, "reason": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Reason"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}}, "type": "object", "title": "SCNUpdate"}, "SearchHitOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "kind": {"type": "string", "title": "Kind"}, "title": {"type": "string", "title": "Title"}, "subtitle": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Subtitle"}, "url": {"type": "string", "title": "Url"}, "amount": {"anyOf": [{"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Amount"}, "date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Date"}}, "type": "object", "required": ["id", "kind", "title", "subtitle", "url"], "title": "SearchHitOut", "description": "One search result row."}, "SearchResponse": {"properties": {"query": {"type": "string", "title": "Query"}, "hits": {"items": {"$ref": "#/components/schemas/SearchHitOut"}, "type": "array", "title": "Hits"}, "total": {"type": "integer", "title": "Total"}, "counts": {"additionalProperties": {"type": "integer"}, "type": "object", "title": "Counts"}}, "type": "object", "required": ["query", "hits", "total"], "title": "SearchResponse", "description": "Response body for GET /api/v1/search.\n\n``total`` is the number of hits returned; ``counts`` is the full number\nof matches per kind (for \"view all\"), which can be larger."}, "SettingsIn": {"properties": {"bills_need_approval": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "title": "Bills Need Approval"}, "payments_need_approval": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "title": "Payments Need Approval"}}, "type": "object", "title": "SettingsIn"}, "SettingsOut": {"properties": {"bills_need_approval": {"type": "boolean", "title": "Bills Need Approval"}, "payments_need_approval": {"type": "boolean", "title": "Payments Need Approval"}}, "type": "object", "required": ["bills_need_approval", "payments_need_approval"], "title": "SettingsOut"}, "SignupRequest": {"properties": {"email": {"type": "string", "title": "Email"}, "password": {"type": "string", "minLength": 1, "title": "Password"}, "company_name": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Company Name"}, "plan": {"anyOf": [{"type": "string", "enum": ["business", "pro", "enterprise"]}, {"type": "null"}], "title": "Plan"}}, "type": "object", "required": ["email", "password"], "title": "SignupRequest"}, "SplitAllocation": {"properties": {"account_id": {"type": "string", "format": "uuid", "title": "Account Id"}, "debit": {"anyOf": [{"type": "number", "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Debit", "default": "0"}, "credit": {"anyOf": [{"type": "number", "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Credit", "default": "0"}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Description"}, "tax_code_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Tax Code Id"}}, "type": "object", "required": ["account_id"], "title": "SplitAllocation", "description": "One GL allocation row for a split-match journal entry."}, "SplitCreateRequest": {"properties": {"bsl_id": {"type": "string", "format": "uuid", "title": "Bsl Id"}, "parts": {"items": {"$ref": "#/components/schemas/SplitPart"}, "type": "array", "maxItems": 50, "minItems": 1, "title": "Parts"}}, "type": "object", "required": ["bsl_id", "parts"], "title": "SplitCreateRequest"}, "SplitPart": {"properties": {"record_type": {"type": "string", "enum": ["expense", "payment", "receipt", "transfer"], "title": "Record Type"}, "amount": {"anyOf": [{"type": "number", "exclusiveMinimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Amount"}, "expense": {"anyOf": [{"$ref": "#/components/schemas/CreateAndMatchExpenseSpec"}, {"type": "null"}]}, "payment": {"anyOf": [{"$ref": "#/components/schemas/CreateAndMatchPaymentSpec"}, {"type": "null"}]}, "receipt": {"anyOf": [{"$ref": "#/components/schemas/CreateAndMatchReceiptSpec"}, {"type": "null"}]}, "transfer": {"anyOf": [{"$ref": "#/components/schemas/CreateAndMatchTransferSpec"}, {"type": "null"}]}}, "type": "object", "required": ["record_type", "amount"], "title": "SplitPart"}, "SqlExecuteBody": {"properties": {"statement": {"type": "string", "minLength": 1, "title": "Statement"}, "write_confirmation": {"anyOf": [{"$ref": "#/components/schemas/WriteConfirmationBody"}, {"type": "null"}]}}, "type": "object", "required": ["statement"], "title": "SqlExecuteBody"}, "SqlExecuteResponse": {"properties": {"rows": {"items": {"items": {}, "type": "array"}, "type": "array", "title": "Rows"}, "columns": {"items": {"type": "string"}, "type": "array", "title": "Columns"}, "rowcount": {"type": "integer", "title": "Rowcount"}, "role_used": {"type": "string", "title": "Role Used"}, "audit_id": {"type": "integer", "title": "Audit Id"}, "truncated": {"type": "boolean", "title": "Truncated"}}, "type": "object", "required": ["rows", "columns", "rowcount", "role_used", "audit_id", "truncated"], "title": "SqlExecuteResponse"}, "StatementIngestRequest": {"properties": {"paperless_document_id": {"type": "integer", "title": "Paperless Document Id"}}, "type": "object", "required": ["paperless_document_id"], "title": "StatementIngestRequest", "description": "POST /api/v1/statements/ingest body."}, "StatementStartRequest": {"properties": {"account_id": {"type": "string", "format": "uuid", "title": "Account Id"}, "statement_date": {"type": "string", "format": "date", "title": "Statement Date"}, "statement_balance": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Statement Balance"}, "notes": {"anyOf": [{"type": "string", "maxLength": 2000}, {"type": "null"}], "title": "Notes"}}, "type": "object", "required": ["account_id", "statement_date", "statement_balance"], "title": "StatementStartRequest", "description": "Start (or update) the open reconciliation for an account.\n\n``statement_balance`` is the closing balance AS PRINTED on the bank\nstatement \u2014 for a credit card, the amount owing as a positive number."}, "StockAdjustmentCreate": {"properties": {"adjustment_date": {"type": "string", "format": "date", "title": "Adjustment Date"}, "account_id": {"type": "string", "format": "uuid", "title": "Account Id"}, "reason": {"type": "string", "maxLength": 32, "title": "Reason", "default": "stocktake"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}, "lines": {"items": {"$ref": "#/components/schemas/StockAdjustmentLineIn"}, "type": "array", "minItems": 1, "title": "Lines"}}, "type": "object", "required": ["adjustment_date", "account_id", "lines"], "title": "StockAdjustmentCreate"}, "StockAdjustmentLineIn": {"properties": {"item_id": {"type": "string", "format": "uuid", "title": "Item Id"}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Description"}, "counted_qty": {"anyOf": [{"type": "number", "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Counted Qty"}, "quantity_change": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Quantity Change"}, "unit_cost": {"anyOf": [{"type": "number", "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Unit Cost"}}, "type": "object", "required": ["item_id"], "title": "StockAdjustmentLineIn"}, "StockAdjustmentUpdate": {"properties": {"adjustment_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Adjustment Date"}, "account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Account Id"}, "reason": {"anyOf": [{"type": "string", "maxLength": 32}, {"type": "null"}], "title": "Reason"}, "notes": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Notes"}, "lines": {"anyOf": [{"items": {"$ref": "#/components/schemas/StockAdjustmentLineIn"}, "type": "array"}, {"type": "null"}], "title": "Lines"}}, "type": "object", "title": "StockAdjustmentUpdate"}, "StockOut": {"properties": {"item_id": {"type": "string", "format": "uuid", "title": "Item Id"}, "sku": {"type": "string", "title": "Sku"}, "item_type": {"type": "string", "title": "Item Type"}, "on_hand_qty": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "On Hand Qty"}, "wac_cost": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Wac Cost"}, "inventory_value": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Inventory Value"}}, "type": "object", "required": ["item_id", "sku", "item_type", "on_hand_qty", "wac_cost", "inventory_value"], "title": "StockOut", "description": "Response body for GET /api/v1/items/{id}/stock."}, "StpLodgeIn": {"properties": {"signatory": {"type": "string", "maxLength": 200, "minLength": 1, "title": "Signatory"}, "declaration_accepted": {"type": "boolean", "title": "Declaration Accepted"}}, "type": "object", "required": ["signatory", "declaration_accepted"], "title": "StpLodgeIn"}, "SuperFundCreate": {"properties": {"name": {"type": "string", "maxLength": 128, "minLength": 1, "title": "Name"}, "is_smsf": {"type": "boolean", "title": "Is Smsf", "default": false}, "usi": {"anyOf": [{"type": "string", "maxLength": 20, "minLength": 9}, {"type": "null"}], "title": "Usi"}, "employer_abn": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Employer Abn"}, "esa": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Esa"}, "smsf_bsb": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Smsf Bsb"}, "smsf_account_number": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Smsf Account Number"}, "smsf_account_name": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Smsf Account Name"}, "is_default": {"type": "boolean", "title": "Is Default", "default": false}}, "type": "object", "required": ["name"], "title": "SuperFundCreate"}, "SuperFundListOut": {"properties": {"items": {"items": {"$ref": "#/components/schemas/SuperFundOut"}, "type": "array", "title": "Items"}, "total": {"type": "integer", "title": "Total"}, "limit": {"type": "integer", "title": "Limit"}, "offset": {"type": "integer", "title": "Offset"}}, "type": "object", "required": ["items", "total", "limit", "offset"], "title": "SuperFundListOut"}, "SuperFundOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "company_id": {"type": "string", "format": "uuid", "title": "Company Id"}, "name": {"type": "string", "title": "Name"}, "usi": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Usi"}, "spin": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Spin"}, "is_smsf": {"type": "boolean", "title": "Is Smsf"}, "employer_abn": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Employer Abn"}, "esa": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Esa"}, "has_smsf_bank": {"type": "boolean", "title": "Has Smsf Bank", "default": false}, "is_default": {"type": "boolean", "title": "Is Default"}, "version": {"type": "integer", "title": "Version"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At"}, "updated_at": {"type": "string", "format": "date-time", "title": "Updated At"}, "archived_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Archived At"}}, "type": "object", "required": ["id", "company_id", "name", "is_smsf", "is_default", "version", "created_at", "updated_at"], "title": "SuperFundOut"}, "SuperFundUpdate": {"properties": {"name": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Name"}, "usi": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Usi"}, "employer_abn": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Employer Abn"}, "esa": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Esa"}, "smsf_bsb": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Smsf Bsb"}, "smsf_account_number": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Smsf Account Number"}, "smsf_account_name": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Smsf Account Name"}}, "type": "object", "title": "SuperFundUpdate"}, "SupplierCreditApplyIn": {"properties": {"allocations": {"items": {"$ref": "#/components/schemas/SupplierCreditApplyLine"}, "type": "array", "maxItems": 500, "minItems": 1, "title": "Allocations"}, "applied_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Applied Date", "description": "Defaults to today. Must be on/after both documents' dates."}, "notes": {"anyOf": [{"type": "string", "maxLength": 2000}, {"type": "null"}], "title": "Notes"}}, "type": "object", "required": ["allocations"], "title": "SupplierCreditApplyIn", "description": "POST /supplier_credit_notes/{id}/applications body."}, "SupplierCreditApplyLine": {"properties": {"bill_id": {"type": "string", "format": "uuid", "title": "Bill Id"}, "amount": {"anyOf": [{"type": "number", "exclusiveMinimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*(?:\\d{0,16}|(?=[\\d.]{1,19}0*$)\\d{0,16}\\.\\d{0,2}0*$)"}], "title": "Amount"}}, "type": "object", "required": ["bill_id", "amount"], "title": "SupplierCreditApplyLine"}, "SupplierCreditNoteStatus": {"type": "string", "enum": ["DRAFT", "POSTED", "VOIDED"], "title": "SupplierCreditNoteStatus"}, "SupplierRuleCreate": {"properties": {"vendor_name": {"type": "string", "minLength": 1, "title": "Vendor Name"}, "contact_id": {"type": "string", "format": "uuid", "title": "Contact Id"}, "company_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Company Id"}, "vendor_abn": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Vendor Abn"}, "account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Account Id"}, "tax_code_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Tax Code Id"}, "record_kind": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Record Kind"}}, "additionalProperties": false, "type": "object", "required": ["vendor_name", "contact_id"], "title": "SupplierRuleCreate", "description": "POST body \u2014 a MANUAL rule. ``vendor_name`` is normalised into\nthe stored ``vendor_key`` by the service."}, "SupplierRulePatch": {"properties": {"vendor_name": {"anyOf": [{"type": "string", "minLength": 1}, {"type": "null"}], "title": "Vendor Name"}, "vendor_abn": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Vendor Abn"}, "contact_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Contact Id"}, "company_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Company Id"}, "account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Account Id"}, "tax_code_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Tax Code Id"}, "record_kind": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Record Kind"}, "active": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "title": "Active"}}, "additionalProperties": false, "type": "object", "title": "SupplierRulePatch", "description": "PATCH body \u2014 partial update; ``active: false`` is the soft\ndelete (spec \u00a73). Omitted fields are untouched; explicit null clears\na nullable column."}, "SyncIn": {"properties": {"connection_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Connection Id"}, "since_cursor": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Since Cursor"}, "override_reason": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Override Reason"}}, "type": "object", "title": "SyncIn", "description": "Body for ``POST /sync``.\n\nAll fields optional \u2014 empty body means \"sync everything active\".\n``override_reason`` lets an admin force-sync past a period lock;\nmatches the ``journal.post`` override pattern."}, "SyncOut": {"properties": {"connection_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Connection Id"}, "stub": {"type": "boolean", "title": "Stub"}, "inserted": {"type": "integer", "title": "Inserted"}, "next_cursor": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Next Cursor"}, "has_more": {"type": "boolean", "title": "Has More"}}, "type": "object", "required": ["connection_id", "stub", "inserted", "next_cursor", "has_more"], "title": "SyncOut", "description": "Response for ``POST /sync``.\n\n``stub`` is True when the relay returned 501 with a stub body \u2014\nthe UI renders a banner rather than treating this as an error.\n``inserted`` is the count of new statement lines persisted via\n``services/bank_feeds/repo.insert_statement_lines``."}, "TaxCodeConflictBody": {"properties": {"detail": {"type": "string", "title": "Detail"}, "current": {"$ref": "#/components/schemas/TaxCodeOut"}}, "type": "object", "required": ["detail", "current"], "title": "TaxCodeConflictBody"}, "TaxCodeCreate": {"properties": {"code": {"type": "string", "maxLength": 16, "minLength": 1, "title": "Code"}, "name": {"type": "string", "maxLength": 255, "minLength": 1, "title": "Name"}, "rate": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Rate"}, "tax_system": {"type": "string", "maxLength": 16, "minLength": 1, "title": "Tax System", "default": "GST"}, "reporting_type": {"type": "string", "maxLength": 32, "minLength": 1, "title": "Reporting Type", "default": "taxable"}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Description"}}, "type": "object", "required": ["code", "name", "rate"], "title": "TaxCodeCreate", "description": "POST body for creating a new tax code."}, "TaxCodeListOut": {"properties": {"items": {"items": {"$ref": "#/components/schemas/TaxCodeOut"}, "type": "array", "title": "Items"}, "total": {"type": "integer", "title": "Total"}, "limit": {"type": "integer", "title": "Limit"}, "offset": {"type": "integer", "title": "Offset"}}, "type": "object", "required": ["items", "total", "limit", "offset"], "title": "TaxCodeListOut"}, "TaxCodeOut": {"properties": {"code": {"type": "string", "maxLength": 16, "minLength": 1, "title": "Code"}, "name": {"type": "string", "maxLength": 255, "minLength": 1, "title": "Name"}, "rate": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Rate"}, "tax_system": {"type": "string", "maxLength": 16, "minLength": 1, "title": "Tax System", "default": "GST"}, "reporting_type": {"type": "string", "maxLength": 32, "minLength": 1, "title": "Reporting Type", "default": "taxable"}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Description"}, "id": {"type": "string", "format": "uuid", "title": "Id"}, "company_id": {"type": "string", "format": "uuid", "title": "Company Id"}, "tenant_id": {"type": "string", "format": "uuid", "title": "Tenant Id"}, "jurisdiction": {"type": "string", "title": "Jurisdiction", "default": "AU"}, "version": {"type": "integer", "title": "Version"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At"}, "archived_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Archived At"}, "usage": {"type": "string", "title": "Usage", "default": "both"}}, "type": "object", "required": ["code", "name", "rate", "id", "company_id", "tenant_id", "version", "created_at"], "title": "TaxCodeOut"}, "TaxCodeUpdate": {"properties": {"code": {"anyOf": [{"type": "string", "maxLength": 16, "minLength": 1}, {"type": "null"}], "title": "Code"}, "name": {"anyOf": [{"type": "string", "maxLength": 255, "minLength": 1}, {"type": "null"}], "title": "Name"}, "rate": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Rate"}, "tax_system": {"anyOf": [{"type": "string", "maxLength": 16, "minLength": 1}, {"type": "null"}], "title": "Tax System"}, "reporting_type": {"anyOf": [{"type": "string", "maxLength": 32, "minLength": 1}, {"type": "null"}], "title": "Reporting Type"}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Description"}}, "type": "object", "title": "TaxCodeUpdate", "description": "PATCH body \u2014 every field optional."}, "TbLineIn": {"properties": {"account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Account Id"}, "account_code": {"anyOf": [{"type": "string", "maxLength": 32}, {"type": "null"}], "title": "Account Code"}, "debit": {"type": "string", "title": "Debit", "default": "0"}, "credit": {"type": "string", "title": "Credit", "default": "0"}}, "type": "object", "title": "TbLineIn"}, "TemplateCreateRequest": {"properties": {"contact_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Contact Id"}, "supplier_abn": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Supplier Abn"}, "supplier_name": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Supplier Name"}, "prompt_hint": {"type": "string", "minLength": 1, "title": "Prompt Hint"}, "page_scope": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Page Scope"}}, "type": "object", "required": ["prompt_hint"], "title": "TemplateCreateRequest"}, "TimeEntryConvertToInvoiceLineRequest": {"properties": {"invoice_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Invoice Id"}, "contact_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Contact Id"}, "entry_ids": {"items": {"type": "string", "format": "uuid"}, "type": "array", "minItems": 1, "title": "Entry Ids"}, "item_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Item Id"}, "account_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Account Id"}, "tax_code_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Tax Code Id"}}, "type": "object", "required": ["entry_ids"], "title": "TimeEntryConvertToInvoiceLineRequest", "description": "Body for POST /api/v1/time-entries/convert-to-invoice."}, "TimeEntryConvertToInvoiceLineResponse": {"properties": {"invoice_id": {"type": "string", "format": "uuid", "title": "Invoice Id"}, "invoice_line_id": {"type": "string", "format": "uuid", "title": "Invoice Line Id"}, "converted_entry_ids": {"items": {"type": "string", "format": "uuid"}, "type": "array", "title": "Converted Entry Ids"}, "total_hours": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Total Hours"}, "total_amount": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Total Amount"}}, "type": "object", "required": ["invoice_id", "invoice_line_id", "converted_entry_ids", "total_hours", "total_amount"], "title": "TimeEntryConvertToInvoiceLineResponse"}, "TimeEntryCreate": {"properties": {"work_date": {"type": "string", "format": "date", "title": "Work Date"}, "hours": {"anyOf": [{"type": "number", "exclusiveMinimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Hours"}, "start_time": {"anyOf": [{"type": "string", "format": "time"}, {"type": "null"}], "title": "Start Time"}, "end_time": {"anyOf": [{"type": "string", "format": "time"}, {"type": "null"}], "title": "End Time"}, "break_minutes": {"type": "integer", "minimum": 0.0, "title": "Break Minutes", "default": 0}, "description": {"type": "string", "title": "Description", "default": ""}, "project_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Project Id"}, "department_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Department Id"}, "cost_centre_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Cost Centre Id"}, "contact_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Contact Id"}, "billable": {"type": "boolean", "title": "Billable", "default": false}, "rate": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Rate"}, "user_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "User Id"}}, "type": "object", "required": ["work_date", "hours"], "title": "TimeEntryCreate", "description": "POST /api/v1/time-entries body."}, "TimeEntryListOut": {"properties": {"items": {"items": {"$ref": "#/components/schemas/TimeEntryOut"}, "type": "array", "title": "Items"}, "total": {"type": "integer", "title": "Total"}, "limit": {"type": "integer", "title": "Limit"}, "offset": {"type": "integer", "title": "Offset"}}, "type": "object", "required": ["items", "total", "limit", "offset"], "title": "TimeEntryListOut"}, "TimeEntryOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "company_id": {"type": "string", "format": "uuid", "title": "Company Id"}, "user_id": {"type": "string", "format": "uuid", "title": "User Id"}, "contact_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Contact Id"}, "work_date": {"type": "string", "format": "date", "title": "Work Date"}, "hours": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Hours"}, "start_time": {"anyOf": [{"type": "string", "format": "time"}, {"type": "null"}], "title": "Start Time"}, "end_time": {"anyOf": [{"type": "string", "format": "time"}, {"type": "null"}], "title": "End Time"}, "break_minutes": {"type": "integer", "title": "Break Minutes"}, "description": {"type": "string", "title": "Description"}, "project_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Project Id"}, "department_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Department Id"}, "cost_centre_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Cost Centre Id"}, "billable": {"type": "boolean", "title": "Billable"}, "rate": {"anyOf": [{"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Rate"}, "invoice_line_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Invoice Line Id"}, "invoice_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Invoice Id"}, "invoice_number": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Invoice Number"}, "approval_status": {"type": "string", "title": "Approval Status"}, "submitted_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Submitted At"}, "approved_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Approved At"}, "approved_by": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Approved By"}, "rejection_reason": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Rejection Reason"}, "version": {"type": "integer", "title": "Version"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At"}, "updated_at": {"type": "string", "format": "date-time", "title": "Updated At"}, "archived_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Archived At"}}, "type": "object", "required": ["id", "company_id", "user_id", "work_date", "hours", "break_minutes", "description", "billable", "approval_status", "version", "created_at", "updated_at"], "title": "TimeEntryOut", "description": "Full time entry as returned by the API."}, "TimeEntryUpdate": {"properties": {"work_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Work Date"}, "hours": {"anyOf": [{"type": "number", "exclusiveMinimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Hours"}, "start_time": {"anyOf": [{"type": "string", "format": "time"}, {"type": "null"}], "title": "Start Time"}, "end_time": {"anyOf": [{"type": "string", "format": "time"}, {"type": "null"}], "title": "End Time"}, "break_minutes": {"anyOf": [{"type": "integer", "minimum": 0.0}, {"type": "null"}], "title": "Break Minutes"}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Description"}, "project_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Project Id"}, "department_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Department Id"}, "cost_centre_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Cost Centre Id"}, "contact_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Contact Id"}, "billable": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "title": "Billable"}, "rate": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Rate"}}, "type": "object", "title": "TimeEntryUpdate", "description": "PATCH /api/v1/time-entries/{id} \u2014 every field optional."}, "TokenOnlyRequest": {"properties": {"token": {"type": "string", "title": "Token"}}, "type": "object", "required": ["token"], "title": "TokenOnlyRequest"}, "TransferCreate": {"properties": {"from_account_id": {"type": "string", "format": "uuid", "title": "From Account Id"}, "to_account_id": {"type": "string", "format": "uuid", "title": "To Account Id"}, "amount": {"anyOf": [{"type": "number", "exclusiveMinimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Amount"}, "transfer_date": {"type": "string", "format": "date", "title": "Transfer Date"}, "description": {"anyOf": [{"type": "string", "maxLength": 500}, {"type": "null"}], "title": "Description"}, "reference": {"anyOf": [{"type": "string", "maxLength": 64}, {"type": "null"}], "title": "Reference"}, "purpose": {"anyOf": [{"type": "string", "enum": ["own_accounts", "card_payment", "loan_repayment", "drawings", "owner_contribution", "owner_reimbursement"]}, {"type": "null"}], "title": "Purpose"}}, "type": "object", "required": ["from_account_id", "to_account_id", "amount", "transfer_date"], "title": "TransferCreate", "description": "POST /transfers body.\n\nMoney LEAVES ``from_account_id`` and ARRIVES at ``to_account_id``. Both\nmust be balance-sheet accounts of the active company. Examples:\ncredit-card paydown (from=bank, to=2-1115); director-loan repayment\n(from=bank, to=2-2200); bank/loan transfer (from=bank A, to=bank B)."}, "TransferListOut": {"properties": {"items": {"items": {"$ref": "#/components/schemas/TransferOut"}, "type": "array", "title": "Items"}}, "type": "object", "required": ["items"], "title": "TransferListOut"}, "TransferOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "company_id": {"type": "string", "format": "uuid", "title": "Company Id"}, "from_account_id": {"type": "string", "format": "uuid", "title": "From Account Id"}, "to_account_id": {"type": "string", "format": "uuid", "title": "To Account Id"}, "amount": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Amount"}, "transfer_date": {"type": "string", "format": "date", "title": "Transfer Date"}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Description"}, "reference": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Reference"}, "purpose": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Purpose"}, "status": {"type": "string", "title": "Status"}, "journal_entry_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Journal Entry Id"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At"}, "updated_at": {"type": "string", "format": "date-time", "title": "Updated At"}}, "type": "object", "required": ["id", "company_id", "from_account_id", "to_account_id", "amount", "transfer_date", "description", "reference", "status", "journal_entry_id", "created_at", "updated_at"], "title": "TransferOut"}, "TransferReverse": {"properties": {"reversal_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Reversal Date"}}, "type": "object", "title": "TransferReverse", "description": "POST /transfers/{id}/reverse body."}, "TrialBalanceIn": {"properties": {"conversion_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Conversion Date"}, "lines": {"items": {"$ref": "#/components/schemas/TbLineIn"}, "type": "array", "maxItems": 2000, "title": "Lines"}, "csv": {"anyOf": [{"type": "string", "maxLength": 2000000}, {"type": "null"}], "title": "Csv"}}, "type": "object", "title": "TrialBalanceIn"}, "TrialBalanceLine": {"properties": {"account_id": {"type": "string", "format": "uuid", "title": "Account Id"}, "code": {"type": "string", "title": "Code"}, "name": {"type": "string", "title": "Name"}, "account_type": {"$ref": "#/components/schemas/AccountType"}, "debit_total": {"type": "number", "title": "Debit Total"}, "credit_total": {"type": "number", "title": "Credit Total"}, "balance": {"type": "number", "title": "Balance"}, "comparative": {"anyOf": [{"type": "number"}, {"type": "null"}], "title": "Comparative"}}, "type": "object", "required": ["account_id", "code", "name", "account_type", "debit_total", "credit_total", "balance"], "title": "TrialBalanceLine", "description": "One account row in the trial balance.\n\n``comparative`` (R7) is the account's balance as at the comparative\ndate -- only populated when ``?compare=previous_period|previous_year``\nwas requested; absent from the response otherwise."}, "TrialBalanceReport": {"properties": {"as_of_date": {"type": "string", "format": "date", "title": "As Of Date"}, "accounts": {"items": {"$ref": "#/components/schemas/TrialBalanceLine"}, "type": "array", "title": "Accounts"}, "total_debits": {"type": "number", "title": "Total Debits"}, "total_credits": {"type": "number", "title": "Total Credits"}, "balanced": {"type": "boolean", "title": "Balanced"}, "compare": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Compare"}, "comparative_as_of_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Comparative As Of Date"}, "total_debits_comparative": {"anyOf": [{"type": "number"}, {"type": "null"}], "title": "Total Debits Comparative"}, "total_credits_comparative": {"anyOf": [{"type": "number"}, {"type": "null"}], "title": "Total Credits Comparative"}}, "type": "object", "required": ["as_of_date", "accounts", "total_debits", "total_credits", "balanced"], "title": "TrialBalanceReport", "description": "Full trial balance as at a given date.\n\nR7 comparative fields (``compare``, ``comparative_as_of_date``,\n``total_debits_comparative``, ``total_credits_comparative``, and each\nline's ``comparative``) are populated ONLY when the caller opts in via\n``?compare=previous_period|previous_year`` -- omitted from the JSON\nresponse entirely when not requested. Like the balance sheet (and\nunlike P&L), the trial balance has no ``from_date``/period length of\nits own -- it is cumulative-from-inception as at a single date -- so\nits comparative is the AS-AT balance at the comparative date, not a\nperiod movement (see api/v1/reports.py's ``_tb_comparative_asof``\ndocstring for the exact deviation from the task's \"TB = movement\"\nphrasing)."}, "TriggerOut": {"properties": {"connection_id": {"type": "string", "format": "uuid", "title": "Connection Id"}, "status": {"type": "string", "title": "Status"}, "started_at": {"type": "string", "format": "date-time", "title": "Started At"}, "finished_at": {"type": "string", "format": "date-time", "title": "Finished At"}, "summary": {"additionalProperties": true, "type": "object", "title": "Summary"}}, "type": "object", "required": ["connection_id", "status", "started_at", "finished_at", "summary"], "title": "TriggerOut"}, "UnmatchRequest": {"properties": {"void_created": {"type": "boolean", "title": "Void Created", "default": false}}, "type": "object", "title": "UnmatchRequest"}, "UserConflictBody": {"properties": {"detail": {"type": "string", "title": "Detail"}, "current": {"$ref": "#/components/schemas/UserOut"}}, "type": "object", "required": ["detail", "current"], "title": "UserConflictBody"}, "UserCreate": {"properties": {"username": {"type": "string", "maxLength": 64, "minLength": 1, "title": "Username"}, "display_name": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Display Name"}, "email": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Email"}, "role": {"type": "string", "maxLength": 16, "minLength": 1, "title": "Role", "default": "viewer"}, "role_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Role Id"}, "preferred_theme": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Preferred Theme"}}, "type": "object", "required": ["username"], "title": "UserCreate", "description": "POST body for creating a new user (admin only)."}, "UserInviteIn": {"properties": {"email": {"type": "string", "maxLength": 255, "minLength": 3, "title": "Email"}, "display_name": {"anyOf": [{"type": "string", "maxLength": 128}, {"type": "null"}], "title": "Display Name"}, "role": {"type": "string", "maxLength": 16, "minLength": 1, "title": "Role", "default": "bookkeeper"}, "role_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Role Id"}}, "type": "object", "required": ["email"], "title": "UserInviteIn"}, "UserListOut": {"properties": {"items": {"items": {"$ref": "#/components/schemas/UserOut"}, "type": "array", "title": "Items"}, "total": {"type": "integer", "title": "Total"}, "limit": {"type": "integer", "title": "Limit"}, "offset": {"type": "integer", "title": "Offset"}}, "type": "object", "required": ["items", "total", "limit", "offset"], "title": "UserListOut"}, "UserOut": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "tenant_id": {"type": "string", "format": "uuid", "title": "Tenant Id"}, "username": {"type": "string", "title": "Username"}, "display_name": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Display Name"}, "email": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Email"}, "role": {"type": "string", "title": "Role"}, "role_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Role Id"}, "preferred_theme": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Preferred Theme"}, "last_seen_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Last Seen At"}, "version": {"type": "integer", "title": "Version"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At"}, "updated_at": {"type": "string", "format": "date-time", "title": "Updated At"}, "archived_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Archived At"}, "invited_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Invited At"}, "invite_pending": {"type": "boolean", "title": "Invite Pending", "default": false}}, "type": "object", "required": ["id", "tenant_id", "username", "role", "version", "created_at", "updated_at"], "title": "UserOut", "description": "Response model \u2014 NO password_hash or any secret field."}, "UserPermissionOut": {"properties": {"code": {"type": "string", "title": "Code"}, "description": {"type": "string", "title": "Description"}, "resolved": {"type": "boolean", "title": "Resolved"}}, "type": "object", "required": ["code", "description", "resolved"], "title": "UserPermissionOut", "description": "A permission code as it applies to a user (resolved = True means granted)."}, "UserPermissionsBody": {"properties": {"grants": {"items": {"type": "string"}, "type": "array", "title": "Grants", "description": "Permission codes to explicitly grant (override role)."}, "revokes": {"items": {"type": "string"}, "type": "array", "title": "Revokes", "description": "Permission codes to explicitly revoke (override role)."}}, "type": "object", "title": "UserPermissionsBody", "description": "PUT /api/v1/users/{id}/permissions \u2014 replace the user's per-user overrides."}, "UserProfile": {"properties": {"id": {"type": "string", "title": "Id"}, "username": {"type": "string", "title": "Username"}, "email": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Email"}, "name": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Name"}, "role": {"type": "string", "title": "Role"}, "tenant_id": {"type": "string", "title": "Tenant Id"}}, "type": "object", "required": ["id", "username", "email", "name", "role", "tenant_id"], "title": "UserProfile"}, "UserUpdate": {"properties": {"display_name": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Display Name"}, "email": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Email"}, "role": {"anyOf": [{"type": "string", "maxLength": 16, "minLength": 1}, {"type": "null"}], "title": "Role"}, "role_id": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Role Id"}, "preferred_theme": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Preferred Theme"}}, "type": "object", "title": "UserUpdate", "description": "PATCH body \u2014 every field optional. Never includes password."}, "ValidationError": {"properties": {"loc": {"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]}, "type": "array", "title": "Location"}, "msg": {"type": "string", "title": "Message"}, "type": {"type": "string", "title": "Error Type"}, "input": {"title": "Input"}, "ctx": {"type": "object", "title": "Context"}}, "type": "object", "required": ["loc", "msg", "type"], "title": "ValidationError"}, "VerifyEmailRequest": {"properties": {"token": {"type": "string", "title": "Token"}}, "type": "object", "required": ["token"], "title": "VerifyEmailRequest"}, "VoidAndCopyBody": {"properties": {"reason": {"type": "string", "maxLength": 1000, "minLength": 1, "title": "Reason"}, "override_reason": {"anyOf": [{"type": "string", "maxLength": 1000}, {"type": "null"}], "title": "Override Reason"}, "reversal_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Reversal Date"}, "confirm_lodged_period": {"type": "boolean", "title": "Confirm Lodged Period", "default": false}}, "type": "object", "required": ["reason"], "title": "VoidAndCopyBody", "description": "Void-and-copy takes the same dating options as a plain void\n(batch 5, P0-20): ``reversal_date`` (default the document's own\ndate) and ``confirm_lodged_period`` for a date in a lodged BAS."}, "WageAccountCheckOut": {"properties": {"purpose": {"type": "string", "title": "Purpose"}, "code": {"type": "string", "title": "Code"}, "status": {"type": "string", "title": "Status"}, "account_name": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Account Name"}, "problem": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Problem"}}, "type": "object", "required": ["purpose", "code", "status"], "title": "WageAccountCheckOut"}, "WageAdditionalPaymentIn": {"properties": {"kind": {"type": "string", "pattern": "^(BONUS|COMMISSION|BACK_PAY)$", "title": "Kind"}, "description": {"type": "string", "maxLength": 120, "title": "Description", "default": ""}, "amount": {"anyOf": [{"type": "number", "maximum": 10000000.0, "exclusiveMinimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Amount"}, "periods": {"anyOf": [{"type": "integer", "maximum": 52.0, "minimum": 1.0}, {"type": "null"}], "title": "Periods"}, "counts_for_super": {"type": "boolean", "title": "Counts For Super", "default": true}, "prior_year": {"type": "boolean", "title": "Prior Year", "default": false}}, "type": "object", "required": ["kind", "amount"], "title": "WageAdditionalPaymentIn", "description": "A bonus, commission or back payment, withheld under ATO Schedule 5\nMethod A. ``periods`` = the number of pay periods a commission or bonus\nfor a defined period of less than 12 months covers."}, "WageAllowanceIn": {"properties": {"kind": {"type": "string", "maxLength": 8, "minLength": 1, "title": "Kind"}, "description": {"type": "string", "maxLength": 120, "title": "Description", "default": ""}, "amount": {"anyOf": [{"type": "number", "maximum": 1000000.0, "exclusiveMinimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Amount"}, "taxable": {"type": "boolean", "title": "Taxable", "default": true}, "counts_for_super": {"type": "boolean", "title": "Counts For Super", "default": false}}, "type": "object", "required": ["kind", "amount"], "title": "WageAllowanceIn", "description": "An allowance paid with wages. ``taxable`` False = not subject to\nwithholding (it is still paid in net pay). STP Phase 2 allowance codes:\nCD cents per kilometre, AD award transport, LD laundry, MD overtime\nmeal, RD domestic or overseas travel, TD tools, KN tasks, QN\nqualifications, OD other."}, "WageBankOut": {"properties": {"bsb": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Bsb"}, "account_number": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Account Number"}, "account_name": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Account Name"}, "source": {"type": "string", "title": "Source"}}, "type": "object", "required": ["source"], "title": "WageBankOut"}, "WageDeductionIn": {"properties": {"kind": {"type": "string", "maxLength": 8, "minLength": 1, "title": "Kind"}, "description": {"type": "string", "maxLength": 120, "title": "Description", "default": ""}, "amount": {"anyOf": [{"type": "number", "maximum": 1000000.0, "exclusiveMinimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Amount"}}, "type": "object", "required": ["kind", "amount"], "title": "WageDeductionIn", "description": "Taken from net pay after tax. STP codes: F union or professional\nfees, W workplace giving, G child support garnishee, D child support\ndeduction; OTHER for anything else (still owed to someone)."}, "WageFinalizeIn": {"properties": {"expected_line_count": {"type": "integer", "minimum": 1.0, "title": "Expected Line Count"}, "expected_total_net": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Expected Total Net"}, "expected_total_payg": {"anyOf": [{"type": "number"}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Expected Total Payg"}}, "type": "object", "required": ["expected_line_count", "expected_total_net", "expected_total_payg"], "title": "WageFinalizeIn", "description": "The figures the operator confirmed on the review screen."}, "WageLeaveIn": {"properties": {"leave_type": {"type": "string", "pattern": "^(ANNUAL|PERSONAL|LONG_SERVICE|OTHER)$", "title": "Leave Type"}, "hours": {"anyOf": [{"type": "number", "maximum": 744.0, "exclusiveMinimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Hours"}, "loading_percent": {"anyOf": [{"type": "number", "maximum": 100.0, "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Loading Percent", "default": "0"}, "amount": {"anyOf": [{"type": "number", "maximum": 1000000.0, "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Amount"}}, "type": "object", "required": ["leave_type", "hours"], "title": "WageLeaveIn"}, "WageLineCreate": {"properties": {"employee_id": {"type": "string", "format": "uuid", "title": "Employee Id"}, "ordinary_hours": {"anyOf": [{"type": "number", "maximum": 744.0, "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Ordinary Hours", "default": "0"}, "overtime_hours": {"anyOf": [{"type": "number", "maximum": 744.0, "minimum": 0.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Overtime Hours", "default": "0"}, "overtime_multiplier": {"anyOf": [{"type": "number", "maximum": 3.0, "minimum": 1.0}, {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}], "title": "Overtime Multiplier", "default": "1.5"}, "full_period_salary": {"type": "boolean", "title": "Full Period Salary", "default": false}, "allowances": {"items": {"$ref": "#/components/schemas/WageAllowanceIn"}, "type": "array", "maxItems": 20, "title": "Allowances"}, "deductions": {"items": {"$ref": "#/components/schemas/WageDeductionIn"}, "type": "array", "maxItems": 20, "title": "Deductions"}, "leave_taken": {"items": {"$ref": "#/components/schemas/WageLeaveIn"}, "type": "array", "maxItems": 10, "title": "Leave Taken"}, "additional_payments": {"items": {"$ref": "#/components/schemas/WageAdditionalPaymentIn"}, "type": "array", "maxItems": 10, "title": "Additional Payments"}}, "type": "object", "required": ["employee_id"], "title": "WageLineCreate", "description": "Hours for one employee; the engine computes gross / PAYG / super / net.\n\nThe ordinary rate is the employee record's ``base_rate``. Overtime is\npaid at ``overtime_multiplier`` x the ordinary rate (one multiplier per\nline -- a split of time-and-a-half then double time needs two runs or\nan adjusted multiplier; allowances are not taken here)."}, "WageLineOut": {"properties": {"line_id": {"type": "string", "format": "uuid", "title": "Line Id"}, "employee_id": {"type": "string", "format": "uuid", "title": "Employee Id"}, "employee_number": {"type": "string", "title": "Employee Number"}, "employee_name": {"type": "string", "title": "Employee Name"}, "employment_basis": {"type": "string", "title": "Employment Basis"}, "pay_frequency": {"type": "string", "title": "Pay Frequency"}, "working_holiday_maker": {"type": "boolean", "title": "Working Holiday Maker"}, "tfn_status": {"type": "string", "title": "Tfn Status"}, "ordinary_hours": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Ordinary Hours"}, "overtime_hours": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Overtime Hours"}, "ordinary_rate": {"anyOf": [{"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Ordinary Rate"}, "overtime_rate": {"anyOf": [{"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Overtime Rate"}, "overtime_multiplier": {"anyOf": [{"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Overtime Multiplier"}, "ordinary_pay": {"anyOf": [{"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Ordinary Pay"}, "overtime_pay": {"anyOf": [{"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, {"type": "null"}], "title": "Overtime Pay"}, "gross": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Gross"}, "payg": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Payg"}, "super_amount": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Super Amount"}, "net": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Net"}, "ytd_gross": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Ytd Gross"}, "ytd_tax": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Ytd Tax"}, "ytd_super": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Ytd Super"}, "payg_scale_used": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Payg Scale Used"}, "payg_explanation": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Payg Explanation"}, "super_explanation": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Super Explanation"}, "computed": {"type": "boolean", "title": "Computed"}, "super_fund_name": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Super Fund Name"}, "bank": {"anyOf": [{"$ref": "#/components/schemas/WageBankOut"}, {"type": "null"}]}, "blockers": {"items": {"type": "string"}, "type": "array", "title": "Blockers", "default": []}, "warnings": {"items": {"type": "string"}, "type": "array", "title": "Warnings", "default": []}, "full_period_salary": {"type": "boolean", "title": "Full Period Salary", "default": false}, "allowances": {"items": {"additionalProperties": true, "type": "object"}, "type": "array", "title": "Allowances", "default": []}, "deductions": {"items": {"additionalProperties": true, "type": "object"}, "type": "array", "title": "Deductions", "default": []}, "leave_taken": {"items": {"additionalProperties": true, "type": "object"}, "type": "array", "title": "Leave Taken", "default": []}, "additional_payments": {"items": {"additionalProperties": true, "type": "object"}, "type": "array", "title": "Additional Payments", "default": []}, "nontaxable_allowances": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Nontaxable Allowances", "default": "0"}, "deductions_total": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Deductions Total", "default": "0"}, "leave_balances": {"additionalProperties": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}, "type": "object", "title": "Leave Balances", "default": {}}, "payslip_email": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Payslip Email"}, "payslip_delivery": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Payslip Delivery"}}, "type": "object", "required": ["line_id", "employee_id", "employee_number", "employee_name", "employment_basis", "pay_frequency", "working_holiday_maker", "tfn_status", "ordinary_hours", "overtime_hours", "gross", "payg", "super_amount", "net", "ytd_gross", "ytd_tax", "ytd_super", "computed"], "title": "WageLineOut"}, "WageRunOut": {"properties": {"pay_run": {"$ref": "#/components/schemas/PayRunOut"}, "lines": {"items": {"$ref": "#/components/schemas/WageLineOut"}, "type": "array", "title": "Lines"}, "total_gross": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Total Gross"}, "total_payg": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Total Payg"}, "total_super": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Total Super"}, "total_net": {"type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Total Net"}, "accounts": {"items": {"$ref": "#/components/schemas/WageAccountCheckOut"}, "type": "array", "title": "Accounts"}, "finalise_blockers": {"items": {"type": "string"}, "type": "array", "title": "Finalise Blockers"}, "can_finalise": {"type": "boolean", "title": "Can Finalise"}, "stp": {"anyOf": [{"additionalProperties": true, "type": "object"}, {"type": "null"}], "title": "Stp"}, "super_due": {"anyOf": [{"additionalProperties": true, "type": "object"}, {"type": "null"}], "title": "Super Due"}}, "type": "object", "required": ["pay_run", "lines", "total_gross", "total_payg", "total_super", "total_net", "accounts", "finalise_blockers", "can_finalise"], "title": "WageRunOut"}, "WebauthnBeginResponse": {"properties": {"publicKey": {"additionalProperties": true, "type": "object", "title": "Publickey"}}, "type": "object", "required": ["publicKey"], "title": "WebauthnBeginResponse"}, "WizardStartBody": {"properties": {"kind": {"type": "string", "title": "Kind"}, "initial": {"additionalProperties": true, "type": "object", "title": "Initial", "default": {}}, "ttl_seconds": {"type": "integer", "title": "Ttl Seconds", "default": 3600}}, "type": "object", "required": ["kind"], "title": "WizardStartBody"}, "WizardStepBody": {"properties": {"step": {"type": "integer", "title": "Step"}, "patch": {"additionalProperties": true, "type": "object", "title": "Patch", "default": {}}}, "type": "object", "required": ["step"], "title": "WizardStepBody"}, "WriteConfirmationBody": {"properties": {"enabled": {"type": "boolean", "title": "Enabled", "default": false}, "verb_typed": {"type": "string", "title": "Verb Typed", "default": ""}}, "type": "object", "title": "WriteConfirmationBody", "description": "Inline confirmation that an admin really meant to run a write."}, "YTDTurnoverReport": {"properties": {"fy_start": {"type": "string", "format": "date", "title": "Fy Start"}, "fy_end": {"type": "string", "format": "date", "title": "Fy End"}, "ytd_turnover": {"type": "number", "title": "Ytd Turnover"}, "threshold": {"type": "number", "title": "Threshold"}, "threshold_crossed": {"type": "boolean", "title": "Threshold Crossed"}, "threshold_approaching": {"type": "boolean", "title": "Threshold Approaching"}}, "type": "object", "required": ["fy_start", "fy_end", "ytd_turnover", "threshold", "threshold_crossed", "threshold_approaching"], "title": "YTDTurnoverReport", "description": "YTD gross turnover and GST registration threshold status.\n\nfy_start / fy_end are the Australian financial-year bounds used\n(1 July - 30 June).  ytd_turnover is the sum of all INCOME and\nOTHER_INCOME journal credits (net of debits) for posted JEs in that\nwindow.  threshold is always 75000.00 (ATO GST registration limit\nfor for-profit entities).  threshold_crossed is true when\nytd_turnover >= threshold.  threshold_approaching is true when\nytd_turnover >= 80% of threshold but < threshold (amber warning zone)."}, "YearEndChecklistOut": {"properties": {"from_date": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "From Date"}, "through_date": {"type": "string", "format": "date", "title": "Through Date"}, "locked_through": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "Locked Through"}, "already_locked": {"type": "boolean", "title": "Already Locked"}, "open_count": {"type": "integer", "title": "Open Count"}, "ready": {"type": "boolean", "title": "Ready"}, "items": {"items": {"$ref": "#/components/schemas/ChecklistItemOut"}, "type": "array", "title": "Items"}}, "type": "object", "required": ["through_date", "already_locked", "open_count", "ready", "items"], "title": "YearEndChecklistOut"}, "_BulkTagOneOffIn": {"properties": {"contact_ids": {"items": {"type": "string", "format": "uuid"}, "type": "array", "title": "Contact Ids"}, "is_one_off": {"type": "boolean", "title": "Is One Off"}}, "type": "object", "required": ["contact_ids", "is_one_off"], "title": "_BulkTagOneOffIn"}, "_RefreshResponse": {"properties": {"snapshot": {"$ref": "#/components/schemas/_SnapshotResponse"}, "refreshed": {"type": "boolean", "title": "Refreshed"}, "upstream_status": {"type": "integer", "title": "Upstream Status"}}, "type": "object", "required": ["snapshot", "refreshed", "upstream_status"], "title": "_RefreshResponse"}, "_RelayAccept": {"properties": {"payload": {"additionalProperties": true, "type": "object", "title": "Payload"}, "signature": {"type": "string", "title": "Signature"}}, "type": "object", "required": ["payload", "signature"], "title": "_RelayAccept", "description": "Inbound relay envelope: the canonical payload + its base64 signature."}, "_SnapshotResponse": {"properties": {"edition": {"type": "string", "title": "Edition"}, "source": {"type": "string", "title": "Source"}, "is_paid": {"type": "boolean", "title": "Is Paid"}, "is_perpetual": {"type": "boolean", "title": "Is Perpetual"}, "expires_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Expires At"}, "licensed_to": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Licensed To"}, "ledger_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Ledger Id"}, "licence_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Licence Id"}}, "type": "object", "required": ["edition", "source", "is_paid", "is_perpetual", "expires_at", "licensed_to", "ledger_id", "licence_id"], "title": "_SnapshotResponse"}, "_UploadRequest": {"properties": {"token": {"type": "string", "minLength": 20, "title": "Token", "description": "A portal-issued JWT (header.payload.signature)."}}, "type": "object", "required": ["token"], "title": "_UploadRequest"}, "saebooks__api__v1__admin__AuditLogEntry": {"properties": {"id": {"type": "integer", "title": "Id"}, "entity": {"type": "string", "title": "Entity"}, "entity_id": {"type": "string", "format": "uuid", "title": "Entity Id"}, "op": {"type": "string", "title": "Op"}, "actor": {"type": "string", "title": "Actor"}, "at": {"type": "string", "format": "date-time", "title": "At"}, "version": {"type": "integer", "title": "Version"}, "payload": {"additionalProperties": true, "type": "object", "title": "Payload"}}, "type": "object", "required": ["id", "entity", "entity_id", "op", "actor", "at", "version", "payload"], "title": "AuditLogEntry", "description": "One row from ``change_log`` flattened for the audit-log API."}, "saebooks__api__v1__admin__AuditLogPage": {"properties": {"items": {"items": {"$ref": "#/components/schemas/saebooks__api__v1__admin__AuditLogEntry"}, "type": "array", "title": "Items"}, "total": {"type": "integer", "title": "Total"}, "limit": {"type": "integer", "title": "Limit"}, "offset": {"type": "integer", "title": "Offset"}}, "type": "object", "required": ["items", "total", "limit", "offset"], "title": "AuditLogPage"}, "saebooks__api__v1__audit_log__AuditLogEntry": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "actor_user_id": {"type": "string", "format": "uuid", "title": "Actor User Id"}, "actor_name": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Actor Name"}, "action": {"type": "string", "title": "Action"}, "table_name": {"type": "string", "title": "Table Name"}, "row_id": {"type": "string", "title": "Row Id"}, "row_snapshot": {"additionalProperties": true, "type": "object", "title": "Row Snapshot"}, "reason": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Reason"}, "at": {"type": "string", "format": "date-time", "title": "At"}}, "type": "object", "required": ["id", "actor_user_id", "action", "table_name", "row_id", "row_snapshot", "reason", "at"], "title": "AuditLogEntry"}, "saebooks__api__v1__audit_log__AuditLogPage": {"properties": {"items": {"items": {"$ref": "#/components/schemas/saebooks__api__v1__audit_log__AuditLogEntry"}, "type": "array", "title": "Items"}, "total": {"type": "integer", "title": "Total"}, "limit": {"type": "integer", "title": "Limit"}, "offset": {"type": "integer", "title": "Offset"}}, "type": "object", "required": ["items", "total", "limit", "offset"], "title": "AuditLogPage"}, "saebooks__api__v1__login__TokenResponse": {"properties": {"access_token": {"type": "string", "title": "Access Token"}, "token_type": {"type": "string", "title": "Token Type", "default": "bearer"}, "expires_in": {"type": "integer", "title": "Expires In"}}, "type": "object", "required": ["access_token", "expires_in"], "title": "TokenResponse"}, "saebooks__api__v1__signup__TokenResponse": {"properties": {"access_token": {"type": "string", "title": "Access Token"}, "token_type": {"type": "string", "title": "Token Type", "default": "bearer"}, "expires_in": {"type": "integer", "title": "Expires In", "default": 28800}, "signup_plan": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Signup Plan"}}, "type": "object", "required": ["access_token"], "title": "TokenResponse"}}}}