{"openapi":"3.1.0","info":{"title":"FinzBooks — Public API","description":"The **FinzBooks Public API** is a versioned, token-authenticated REST\ninterface to your accounting data — customers, vendors, items,\ninvoices, bills, payments — plus webhooks for real-time events.\n\n## Quickstart\n\n1. Mint a Personal Access Token (PAT) from your **Developer settings**\n   page in the FinzBooks UI: *Settings → Developer → New API Token*.\n   The raw token is shown once at creation — copy it then.\n2. Pass it as `Authorization: Bearer aibk_pat_…` on every request.\n3. Append `?organization_id=<your-org-id>` to scope each call\n   (optional for PATs — they're already bound to one org —\n   but required for OAuth-issued tokens).\n\n```bash\ncurl -X GET 'https://api.aibooks.in/api/public/v1/whoami' \\\n  -H 'Authorization: Bearer aibk_pat_…' \\\n  -H 'Content-Type: application/json'\n```\n\n## Authentication\n\nTwo modes both share the same `Authorization: Bearer …` header:\n\n| Token kind | Prefix | Issuance |\n|---|---|---|\n| Personal Access Token (PAT) | `aibk_pat_…`      | Developer portal — one-time mint |\n| Sandbox PAT                 | `aibk_pat_test_…` | Same flow, \"Sandbox\" checkbox |\n| OAuth access token          | `aibk_oat_…`      | `/oauth/authorize` + `/oauth/token` |\n\n## Response envelope\n\nSuccessful list:\n```json\n{\n  \"code\": 0,\n  \"message\": \"success\",\n  \"contacts\": [...],\n  \"page_context\": { \"per_page\": 50, \"has_more_page\": true, \"next_cursor\": \"...\" }\n}\n```\n\nSuccessful single resource:\n```json\n{ \"code\": 0, \"message\": \"success\", \"contact\": {...} }\n```\n\nError (HTTP status carries severity; `code` is the contract):\n```json\n{ \"code\": \"not_found.resource\", \"message\": \"...\", \"field\": \"...\", \"details\": {...} }\n```\n\n## Pagination\n\nCursor-based, opaque tokens. Pass the previous response's\n`page_context.next_cursor` back as `?cursor=…` to fetch the next\npage. `has_more_page: false` ends the walk.\n\n## Idempotency\n\nEvery `POST` accepts an `Idempotency-Key` header (any 1-200 char\nalphanumeric string with `-` or `_`). Repeating the same key\nwithin 24 hours replays the original response — safe to retry on\nnetwork blips.\n\n## Rate limits\n\n* Default tier: **600 requests/minute** per token.\n* Partner tier: **3,000 requests/minute**.\n\nEvery response carries `X-RateLimit-Limit`, `X-RateLimit-Remaining`,\nand `X-RateLimit-Reset` headers. `429 Too Many Requests` is\nreturned with a `Retry-After` header on overrun.\n\n## Webhooks\n\nRegister endpoints from *Settings → Developer → Webhooks*. We POST\nsigned JSON to your URL whenever subscribed events fire. Verify\nthe `X-AIBooks-Signature` header (HMAC-SHA256 over the raw body)\nusing your endpoint's secret. Reject events older than 5 minutes.\n\n## Scopes\n\nScope strings follow the Zoho-Books shape:\n`AIBooks.<resource>.<OP>` — e.g. `AIBooks.invoices.READ`,\n`AIBooks.invoices.CREATE`. `AIBooks.fullaccess.all` is the wildcard.\n","version":"1.0.0"},"paths":{"/ping":{"get":{"summary":"Liveness probe","description":"Returns 200 OK with the server's current time and the API version string. Use this to verify your token and DNS path before exercising real endpoints.","operationId":"ping_ping_get","responses":{"200":{"description":"Server is up.","content":{"application/json":{"schema":{},"example":{"code":0,"message":"success","ping":{"ok":true,"server_time":"2026-05-11T10:00:00Z","api_version":"v1"}}}}}}}},"/whoami":{"get":{"summary":"Echo the resolved token identity","description":"Returns the org, user, scopes, and rate tier the server resolved from your bearer token. Useful as a first-call sanity check after issuing a new token.","operationId":"whoami_whoami_get","parameters":[{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Token recognised.","content":{"application/json":{"schema":{},"example":{"code":0,"message":"success","token":{"token_id":"5a9f1c…","org_id":"org_abc","user_id":"usr_xyz","scopes":["AIBooks.contacts.READ"],"tier":"DEFAULT"}}}}},"401":{"description":"Token missing, invalid, expired, or revoked.","content":{"application/json":{"example":{"code":"auth.invalid_token","message":"Token is not valid for this API."}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/echo":{"post":{"summary":"Idempotency replay test endpoint","description":"Generates a fresh UUID per call. Send the same `Idempotency-Key` twice and observe identical `request_id` plus `Idempotency-Replay: true` on the second response.","operationId":"echo_echo_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/EchoRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/provision/organization":{"post":{"tags":["Provisioning"],"summary":"Create an org + mint its token (alias of POST /partner/organizations)","operationId":"provision_organization_provision_organization_post","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Required. A unique key (alphanumeric + `-` `_` `:`, ≤200 chars) that lets the server deduplicate retries — required on every money-moving POST. Reuse the same key on a retry to receive the original response instead of creating a duplicate record. UUID v4 is a fine default. Cached for 24 hours.","title":"Idempotency-Key"},"description":"Required. A unique key (alphanumeric + `-` `_` `:`, ≤200 chars) that lets the server deduplicate retries — required on every money-moving POST. Reuse the same key on a retry to receive the original response instead of creating a duplicate record. UUID v4 is a fine default. Cached for 24 hours."},{"name":"X-Partner-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Partner-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProvisionOrgRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/partner/organizations":{"post":{"tags":["Partner"],"summary":"Create a client org + mint its token","operationId":"create_org_partner_organizations_post","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Required. A unique key (alphanumeric + `-` `_` `:`, ≤200 chars) that lets the server deduplicate retries — required on every money-moving POST. Reuse the same key on a retry to receive the original response instead of creating a duplicate record. UUID v4 is a fine default. Cached for 24 hours.","title":"Idempotency-Key"},"description":"Required. A unique key (alphanumeric + `-` `_` `:`, ≤200 chars) that lets the server deduplicate retries — required on every money-moving POST. Reuse the same key on a retry to receive the original response instead of creating a duplicate record. UUID v4 is a fine default. Cached for 24 hours."},{"name":"X-Partner-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Partner-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrgRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Partner"],"summary":"List this partner's orgs","operationId":"list_orgs_partner_organizations_get","parameters":[{"name":"X-Partner-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Partner-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/partner/organizations/{org_id}":{"get":{"tags":["Partner"],"summary":"Get one of this partner's orgs","operationId":"get_org_partner_organizations__org_id__get","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}},{"name":"X-Partner-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Partner-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/partner/organizations/{org_id}/token":{"post":{"tags":["Partner"],"summary":"Re-issue an API token for a client org (CA book access)","operationId":"reissue_token_partner_organizations__org_id__token_post","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}},{"name":"X-Partner-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Partner-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/partner/organizations/{org_id}/suspend":{"post":{"tags":["Partner"],"summary":"Suspend a client org","operationId":"suspend_org_partner_organizations__org_id__suspend_post","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}},{"name":"X-Partner-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Partner-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/partner/organizations/{org_id}/reactivate":{"post":{"tags":["Partner"],"summary":"Reactivate a client org","operationId":"reactivate_org_partner_organizations__org_id__reactivate_post","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}},{"name":"X-Partner-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Partner-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/contacts":{"get":{"tags":["Contacts"],"summary":"List contacts (cursor-paginated)","description":"Returns contacts in this token's org, newest first. Pass the returned `page_context.next_cursor` to fetch the next page.","operationId":"list_contacts_contacts_get","parameters":[{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Per Page"}},{"name":"contact_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter to CUSTOMER, VENDOR, or BOTH.","title":"Contact Type"},"description":"Filter to CUSTOMER, VENDOR, or BOTH."},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter to ACTIVE or INACTIVE.","title":"Status"},"description":"Filter to ACTIVE or INACTIVE."},{"name":"gst_no","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Exact match on GSTIN. Use this to dedup-by-natural-key without a full scan.","title":"Gst No"},"description":"Exact match on GSTIN. Use this to dedup-by-natural-key without a full scan."},{"name":"email","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Exact match on the contact-level email (top-level email field, not contact_persons[]).","title":"Email"},"description":"Exact match on the contact-level email (top-level email field, not contact_persons[])."},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Case-insensitive substring search across contact name, company name, and contact-level email. Cheap LIKE filter intended for picker UIs; not full-text.","title":"Search"},"description":"Case-insensitive substring search across contact name, company name, and contact-level email. Cheap LIKE filter intended for picker UIs; not full-text."},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}},"post":{"tags":["Contacts"],"summary":"Create a contact (with addresses + persons in one call)","operationId":"create_contact_contacts_post","parameters":[{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactPublicCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/contacts/{contact_id}":{"get":{"tags":["Contacts"],"summary":"Get one contact (with addresses + persons)","operationId":"get_contact_contacts__contact_id__get","parameters":[{"name":"contact_id","in":"path","required":true,"schema":{"type":"string","title":"Contact Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}},"put":{"tags":["Contacts"],"summary":"Update a contact (partial — only sent keys are touched)","description":"Partial update with explicit-null semantics:\n\n**Top-level fields** — keys you pass are written; keys you omit are untouched; pass `null` to clear a nullable field.\n\n**Nested objects (`billing_address`, `shipping_address`)** — sub-fields you pass are merged onto the existing address; sub-fields you omit keep their current value. Pass the whole object as `null` to clear every component. Example: `{\"billing_address\": {\"zip\": \"560050\"}}` changes only the ZIP, leaving city/state/address untouched.\n\n**`contact_persons[]`** — the list is REPLACED in full when supplied. Match individual rows by their `contact_person_id` to keep them stable, omit the id for new rows, drop an existing id from the list to delete that row. Omit the `contact_persons` key entirely to leave the list untouched.","operationId":"update_contact_contacts__contact_id__put","parameters":[{"name":"contact_id","in":"path","required":true,"schema":{"type":"string","title":"Contact Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactPublicUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Contacts"],"summary":"Delete a contact","description":"Hard-delete. Returns 409 if the contact has any transactions referencing it — archive it instead with POST /contacts/{contact_id}/archive.","operationId":"delete_contact_contacts__contact_id__delete","parameters":[{"name":"contact_id","in":"path","required":true,"schema":{"type":"string","title":"Contact Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/contacts/{contact_id}/archive":{"post":{"tags":["Contacts"],"summary":"Archive a contact (soft-delete via status=INACTIVE)","operationId":"archive_contact_contacts__contact_id__archive_post","parameters":[{"name":"contact_id","in":"path","required":true,"schema":{"type":"string","title":"Contact Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/contact-field-packs":{"get":{"tags":["Contact Field Packs"],"summary":"List contact custom-field seed packs","description":"Returns the shippable packs (clinic, real-estate, education, …), each with the custom fields it provisions. Use a pack `key` with the apply endpoint to create those fields in your org.","operationId":"list_packs_contact_field_packs_get","parameters":[{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/contact-field-packs/{key}/apply":{"post":{"tags":["Contact Field Packs"],"summary":"Apply a contact field pack to this org","description":"Creates the pack's custom-field definitions in the token's org. Idempotent — fields that already exist (by api name) are skipped, so re-applying never duplicates. Returns a per-field created/exists summary.","operationId":"apply_pack_contact_field_packs__key__apply_post","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/items":{"get":{"tags":["Items"],"summary":"List items (cursor-paginated)","operationId":"list_items_items_get","parameters":[{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Per Page"}},{"name":"item_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"GOODS or SERVICE.","title":"Item Type"},"description":"GOODS or SERVICE."},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ACTIVE or INACTIVE.","title":"Status"},"description":"ACTIVE or INACTIVE."},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}},"post":{"tags":["Items"],"summary":"Create an item","operationId":"create_item_items_post","parameters":[{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ItemPublicCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/items/templates":{"get":{"tags":["Items"],"summary":"List starter item templates (by clinic type / vertical)","operationId":"list_item_templates_items_templates_get","parameters":[{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/items/seed-template":{"post":{"tags":["Items"],"summary":"Seed starter items from a template (by clinic type)","operationId":"seed_item_template_items_seed_template_post","parameters":[{"name":"template","in":"query","required":true,"schema":{"type":"string","description":"Template slug, e.g. clinic_gp / clinic_dental / clinic_homoeopathy","title":"Template"},"description":"Template slug, e.g. clinic_gp / clinic_dental / clinic_homoeopathy"},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/items/{item_id}":{"get":{"tags":["Items"],"summary":"Get one item","operationId":"get_item_items__item_id__get","parameters":[{"name":"item_id","in":"path","required":true,"schema":{"type":"string","title":"Item Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}},"put":{"tags":["Items"],"summary":"Update an item (partial)","operationId":"update_item_items__item_id__put","parameters":[{"name":"item_id","in":"path","required":true,"schema":{"type":"string","title":"Item Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ItemPublicUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Items"],"summary":"Delete an item","operationId":"delete_item_items__item_id__delete","parameters":[{"name":"item_id","in":"path","required":true,"schema":{"type":"string","title":"Item Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/items/{item_id}/archive":{"post":{"tags":["Items"],"summary":"Archive an item (soft-delete)","operationId":"archive_item_items__item_id__archive_post","parameters":[{"name":"item_id","in":"path","required":true,"schema":{"type":"string","title":"Item Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/taxes":{"get":{"tags":["Taxes"],"summary":"List tax rates configured for this org","description":"Returns all tax records the org has set up — standard GST slabs (5/12/18/28 etc.), exemptions, and custom rates. Use the `tax_id` from this list when creating invoice and bill line items.","operationId":"list_taxes_taxes_get","parameters":[{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":200,"title":"Per Page"}},{"name":"active_only","in":"query","required":false,"schema":{"type":"boolean","description":"Defaults to true — only ACTIVE taxes. Pass false to include archived rates.","default":true,"title":"Active Only"},"description":"Defaults to true — only ACTIVE taxes. Pass false to include archived rates."},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/taxes/{tax_id}":{"get":{"tags":["Taxes"],"summary":"Get one tax record","operationId":"get_tax_taxes__tax_id__get","parameters":[{"name":"tax_id","in":"path","required":true,"schema":{"type":"string","title":"Tax Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/accounts":{"get":{"tags":["Accounts"],"summary":"List ledger accounts","description":"Returns the org's Chart of Accounts. Use the `account_type` query to narrow (BANK, ACCOUNTS_RECEIVABLE, EXPENSE, REVENUE, etc.).","operationId":"list_accounts_accounts_get","parameters":[{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":200,"title":"Per Page"}},{"name":"account_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by AccountType (e.g. BANK, EXPENSE).","title":"Account Type"},"description":"Filter by AccountType (e.g. BANK, EXPENSE)."},{"name":"active_only","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Active Only"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/accounts/{account_id}":{"get":{"tags":["Accounts"],"summary":"Get one ledger account","operationId":"get_account_accounts__account_id__get","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/journals":{"get":{"tags":["Journals"],"summary":"List journal entries (cursor-paginated)","operationId":"list_journals_journals_get","parameters":[{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Per Page"}},{"name":"source","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by JournalSource — MANUAL / INVOICE / BILL / PAYMENT / EXPENSE / ADJUSTMENT / BANK_STATEMENT.","title":"Source"},"description":"Filter by JournalSource — MANUAL / INVOICE / BILL / PAYMENT / EXPENSE / ADJUSTMENT / BANK_STATEMENT."},{"name":"contact_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}},"post":{"tags":["Journals"],"summary":"Create a manual journal entry","description":"Posts a balanced JE. Total debits must equal total credits (penny tolerance). Source is fixed to MANUAL — auto-posted JEs from invoice/bill/payment workflows use INVOICE / BILL / PAYMENT and are created by their respective endpoints, not here.","operationId":"create_journal_journals_post","parameters":[{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JournalPublicCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/journals/{journal_id}":{"get":{"tags":["Journals"],"summary":"Get one journal entry (with lines)","operationId":"get_journal_journals__journal_id__get","parameters":[{"name":"journal_id","in":"path","required":true,"schema":{"type":"string","title":"Journal Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}},"delete":{"tags":["Journals"],"summary":"Delete a manual journal entry","description":"Only MANUAL journals can be deleted via this endpoint. JEs auto-created by invoice/bill/payment posting must be voided through their source document instead — deleting them directly would leave the source out of sync.","operationId":"delete_journal_journals__journal_id__delete","parameters":[{"name":"journal_id","in":"path","required":true,"schema":{"type":"string","title":"Journal Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/estimates":{"get":{"tags":["Estimates"],"summary":"List estimates (cursor-paginated)","operationId":"list_estimates_estimates_get","parameters":[{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Per Page"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"DRAFT / SENT / ACCEPTED / DECLINED / CONVERTED / CANCELLED.","title":"Status"},"description":"DRAFT / SENT / ACCEPTED / DECLINED / CONVERTED / CANCELLED."},{"name":"customer_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}},"post":{"tags":["Estimates"],"summary":"Create an estimate (DRAFT)","description":"Creates an estimate in DRAFT status. Same tax engine as invoices — CGST+SGST vs IGST is decided from place_of_supply. Each line accepts `{item_id, quantity}` minimum; name / rate / tax_id / hsn / unit auto-fill from the item master.","operationId":"create_estimate_estimates_post","parameters":[{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EstimatePublicCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/estimates/{estimate_id}":{"get":{"tags":["Estimates"],"summary":"Get one estimate (with line items)","operationId":"get_estimate_estimates__estimate_id__get","parameters":[{"name":"estimate_id","in":"path","required":true,"schema":{"type":"string","title":"Estimate Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}},"put":{"tags":["Estimates"],"summary":"Update an estimate (header fields only)","description":"Update mutable header fields on an estimate. To change line items, void and re-create.","operationId":"update_estimate_estimates__estimate_id__put","parameters":[{"name":"estimate_id","in":"path","required":true,"schema":{"type":"string","title":"Estimate Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EstimatePublicUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Estimates"],"summary":"Delete an estimate (only if not CONVERTED)","operationId":"delete_estimate_estimates__estimate_id__delete","parameters":[{"name":"estimate_id","in":"path","required":true,"schema":{"type":"string","title":"Estimate Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/estimates/{estimate_id}/accept":{"post":{"tags":["Estimates"],"summary":"Mark an estimate as ACCEPTED","operationId":"accept_estimate_estimates__estimate_id__accept_post","parameters":[{"name":"estimate_id","in":"path","required":true,"schema":{"type":"string","title":"Estimate Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/estimates/{estimate_id}/convert":{"post":{"tags":["Estimates"],"summary":"Convert an ACCEPTED estimate to a Sales Order","description":"Estimate must be in ACCEPTED status. Returns the new sales_order_id in the response details — fetch it via /sales_orders/{id} for the full document.","operationId":"convert_estimate_estimates__estimate_id__convert_post","parameters":[{"name":"estimate_id","in":"path","required":true,"schema":{"type":"string","title":"Estimate Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/invoices":{"get":{"tags":["Invoices"],"summary":"List invoices (cursor-paginated)","operationId":"list_invoices_invoices_get","parameters":[{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Per Page"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"DRAFT / SENT / PARTIALLY_PAID / PAID / OVERDUE / CANCELLED.","title":"Status"},"description":"DRAFT / SENT / PARTIALLY_PAID / PAID / OVERDUE / CANCELLED."},{"name":"customer_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Id"}},{"name":"branch_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Scope to a single branch (Place of Business). Legacy rows with no branch are always included.","title":"Branch Id"},"description":"Scope to a single branch (Place of Business). Legacy rows with no branch are always included."},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}},"post":{"tags":["Invoices"],"summary":"Create an invoice (DRAFT; set auto_approve=true to post)","description":"Creates an invoice in DRAFT status using the same service layer as the UI — GSTIN validation, automatic CGST+SGST vs IGST routing from place_of_supply, branch-scoped number generation. Pass `auto_approve: true` to also post the journal entry in the same call (status → SENT).","operationId":"create_invoice_invoices_post","parameters":[{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Required. A unique key (alphanumeric + `-` `_` `:`, ≤200 chars) that lets the server deduplicate retries — required on every money-moving POST. Reuse the same key on a retry to receive the original response instead of creating a duplicate record. UUID v4 is a fine default. Cached for 24 hours.","title":"Idempotency-Key"},"description":"Required. A unique key (alphanumeric + `-` `_` `:`, ≤200 chars) that lets the server deduplicate retries — required on every money-moving POST. Reuse the same key on a retry to receive the original response instead of creating a duplicate record. UUID v4 is a fine default. Cached for 24 hours."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoicePublicCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/invoices/series":{"get":{"tags":["Invoices"],"summary":"List invoice number series for this org/branch","description":"Returns the invoice number series available for the resolved branch under the current accounting period. Pass the `series_name` from one of these entries when creating an invoice to choose a specific series (e.g. 'export', 'rcm'). When no FY period is configured the response contains a single virtual 'default' series so the integrator's picker always has at least one entry.\n\nDefined BEFORE GET /{invoice_id} so the literal path 'series' isn't captured as an invoice id.","operationId":"list_invoice_series_public_invoices_series_get","parameters":[{"name":"transactionDate","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"FY context for series resolution. Defaults to today.","title":"Transactiondate"},"description":"FY context for series resolution. Defaults to today."},{"name":"branchId","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Resolve series for this branch. Falls back to the org's default branch when omitted.","title":"Branchid"},"description":"Resolve series for this branch. Falls back to the org's default branch when omitted."},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}},"post":{"tags":["Invoices"],"summary":"Create a new invoice number series","description":"Creates a branch-scoped invoice number series under the accounting period that covers `transaction_date` (defaults to today). Useful when an integrator needs to add a new prefix (e.g. 'EXP-' for export invoices) before issuing the first invoice under that series. Required fields: `series_name`, `prefix`. Optional: `label`, `padding`, `format_template`, `branch_id`, `transaction_date`.","operationId":"create_invoice_series_public_invoices_series_post","parameters":[{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/invoices/series/next-number":{"get":{"tags":["Invoices"],"summary":"Peek the next invoice number that will be assigned","description":"Returns the next number a `POST /invoices` call would consume for the given branch + series + transaction date, WITHOUT consuming it. Useful for previewing the number in your own UI before submitting. Idempotent — calling this 100 times in a row returns the same number; only `POST /invoices` increments the counter. Defined BEFORE GET /{invoice_id} so the literal path 'series' isn't captured as an invoice id.","operationId":"peek_next_invoice_number_invoices_series_next_number_get","parameters":[{"name":"series","in":"query","required":false,"schema":{"type":"string","description":"Series name (default, export, rcm, …). Use GET /invoices/series to list.","default":"default","title":"Series"},"description":"Series name (default, export, rcm, …). Use GET /invoices/series to list."},{"name":"transactionDate","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"FY context for the sequence. Defaults to today.","title":"Transactiondate"},"description":"FY context for the sequence. Defaults to today."},{"name":"branchId","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Resolve the sequence for this branch. Falls back to the org's default branch when omitted.","title":"Branchid"},"description":"Resolve the sequence for this branch. Falls back to the org's default branch when omitted."},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/invoices/{invoice_id}":{"get":{"tags":["Invoices"],"summary":"Get one invoice (with line items)","operationId":"get_invoice_invoices__invoice_id__get","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","title":"Invoice Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}},"put":{"tags":["Invoices"],"summary":"Update a DRAFT invoice (header fields only)","description":"Only DRAFT invoices can be edited via this endpoint, and only reference_number / due_date / notes. To change line items, void and re-create.","operationId":"update_invoice_invoices__invoice_id__put","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","title":"Invoice Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoicePublicUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Invoices"],"summary":"Delete a DRAFT invoice","operationId":"delete_invoice_invoices__invoice_id__delete","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","title":"Invoice Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/invoices/{invoice_id}/approve":{"post":{"tags":["Invoices"],"summary":"Approve a DRAFT invoice (post journal, status → SENT)","operationId":"approve_invoice_invoices__invoice_id__approve_post","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","title":"Invoice Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/invoices/{invoice_id}/void":{"post":{"tags":["Invoices"],"summary":"Void an invoice (status → CANCELLED)","operationId":"void_invoice_invoices__invoice_id__void_post","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","title":"Invoice Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/bills":{"get":{"tags":["Bills"],"summary":"List bills (cursor-paginated)","operationId":"list_bills_bills_get","parameters":[{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Per Page"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"DRAFT / OPEN / PARTIALLY_PAID / PAID / OVERDUE.","title":"Status"},"description":"DRAFT / OPEN / PARTIALLY_PAID / PAID / OVERDUE."},{"name":"vendor_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Id"}},{"name":"branch_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Scope to a single branch (Place of Business). Legacy rows with no branch are always included.","title":"Branch Id"},"description":"Scope to a single branch (Place of Business). Legacy rows with no branch are always included."},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}},"post":{"tags":["Bills"],"summary":"Create a bill (DRAFT)","operationId":"create_bill_bills_post","parameters":[{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Required. A unique key (alphanumeric + `-` `_` `:`, ≤200 chars) that lets the server deduplicate retries — required on every money-moving POST. Reuse the same key on a retry to receive the original response instead of creating a duplicate record. UUID v4 is a fine default. Cached for 24 hours.","title":"Idempotency-Key"},"description":"Required. A unique key (alphanumeric + `-` `_` `:`, ≤200 chars) that lets the server deduplicate retries — required on every money-moving POST. Reuse the same key on a retry to receive the original response instead of creating a duplicate record. UUID v4 is a fine default. Cached for 24 hours."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillPublicCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/bills/{bill_id}":{"get":{"tags":["Bills"],"summary":"Get one bill (with line items)","operationId":"get_bill_bills__bill_id__get","parameters":[{"name":"bill_id","in":"path","required":true,"schema":{"type":"string","title":"Bill Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}},"put":{"tags":["Bills"],"summary":"Update a DRAFT bill (header fields only)","operationId":"update_bill_bills__bill_id__put","parameters":[{"name":"bill_id","in":"path","required":true,"schema":{"type":"string","title":"Bill Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillPublicUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Bills"],"summary":"Delete a DRAFT bill","operationId":"delete_bill_bills__bill_id__delete","parameters":[{"name":"bill_id","in":"path","required":true,"schema":{"type":"string","title":"Bill Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/bills/{bill_id}/approve":{"post":{"tags":["Bills"],"summary":"Approve a DRAFT bill (post journal, status → OPEN)","operationId":"approve_bill_bills__bill_id__approve_post","parameters":[{"name":"bill_id","in":"path","required":true,"schema":{"type":"string","title":"Bill Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/credit_notes":{"get":{"tags":["Credit Notes"],"summary":"List credit notes (cursor-paginated)","operationId":"list_credit_notes_credit_notes_get","parameters":[{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Per Page"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"DRAFT / ISSUED / APPLIED / CANCELLED.","title":"Status"},"description":"DRAFT / ISSUED / APPLIED / CANCELLED."},{"name":"customer_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Id"}},{"name":"invoice_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Id"}},{"name":"bill_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter to vendor credits linked to this specific bill.","title":"Bill Id"},"description":"Filter to vendor credits linked to this specific bill."},{"name":"type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"`customer` → only customer credit notes (linked to invoices or bare customer-side CNs). `vendor` → only vendor credits (linked to bills or with vendor as contact).","title":"Type"},"description":"`customer` → only customer credit notes (linked to invoices or bare customer-side CNs). `vendor` → only vendor credits (linked to bills or with vendor as contact)."},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}},"post":{"tags":["Credit Notes"],"summary":"Create a credit note (auto-posts journal)","description":"Creates a credit note in ISSUED status, posts the journal entry that reverses sales + GST and credits AR (or AP for vendor-side returns), records stock movements for goods items, and reclaims TDS proportionally from the parent invoice when `invoice_id` is supplied.","operationId":"create_credit_note_credit_notes_post","parameters":[{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Required. A unique key (alphanumeric + `-` `_` `:`, ≤200 chars) that lets the server deduplicate retries — required on every money-moving POST. Reuse the same key on a retry to receive the original response instead of creating a duplicate record. UUID v4 is a fine default. Cached for 24 hours.","title":"Idempotency-Key"},"description":"Required. A unique key (alphanumeric + `-` `_` `:`, ≤200 chars) that lets the server deduplicate retries — required on every money-moving POST. Reuse the same key on a retry to receive the original response instead of creating a duplicate record. UUID v4 is a fine default. Cached for 24 hours."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditNotePublicCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/credit_notes/{credit_note_id}":{"get":{"tags":["Credit Notes"],"summary":"Get one credit note","operationId":"get_credit_note_credit_notes__credit_note_id__get","parameters":[{"name":"credit_note_id","in":"path","required":true,"schema":{"type":"string","title":"Credit Note Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}},"put":{"tags":["Credit Notes"],"summary":"Update a credit note","description":"Header fields and / or full line replacement. Totals are recomputed server-side when `line_items` is provided. Cannot edit a CN that already has applications recorded against it — void and re-issue instead.","operationId":"update_credit_note_credit_notes__credit_note_id__put","parameters":[{"name":"credit_note_id","in":"path","required":true,"schema":{"type":"string","title":"Credit Note Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditNotePublicUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/credit_notes/{credit_note_id}/apply-to-bill":{"post":{"tags":["Credit Notes"],"summary":"Apply a vendor credit to a bill (Dr AP / Cr 'Vendor Credit Used')","description":"Applies (knocks off) a portion or all of a vendor credit note against a bill belonging to the same vendor. Updates the bill's `vendor_credits_applied`, recomputes its balance + status. The credit note's `applied_amount` is bumped; it flips to APPLIED when fully consumed.\n\nThe credit note must have a non-null `bill_id` OR the contact must be a vendor (a CN linked to a vendor without an explicit `bill_id` is a generic vendor credit and may be applied to any open bill from the same vendor). Cannot apply a CANCELLED CN.","operationId":"apply_credit_note_to_bill_public_credit_notes__credit_note_id__apply_to_bill_post","parameters":[{"name":"credit_note_id","in":"path","required":true,"schema":{"type":"string","title":"Credit Note Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Required. A unique key (alphanumeric + `-` `_` `:`, ≤200 chars) that lets the server deduplicate retries — required on every money-moving POST. Reuse the same key on a retry to receive the original response instead of creating a duplicate record. UUID v4 is a fine default. Cached for 24 hours.","title":"Idempotency-Key"},"description":"Required. A unique key (alphanumeric + `-` `_` `:`, ≤200 chars) that lets the server deduplicate retries — required on every money-moving POST. Reuse the same key on a retry to receive the original response instead of creating a duplicate record. UUID v4 is a fine default. Cached for 24 hours."}],"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"}}}}}}},"/credit_notes/{credit_note_id}/apply-to-invoice":{"post":{"tags":["Credit Notes"],"summary":"Apply a customer credit to an open invoice (knocks off AR)","description":"Applies a portion or all of a customer credit note against an invoice belonging to the same customer. Updates the invoice's `balance_amount` and status. Customer credit notes only — for vendor credits use /apply-to-bill.","operationId":"apply_credit_note_to_invoice_public_credit_notes__credit_note_id__apply_to_invoice_post","parameters":[{"name":"credit_note_id","in":"path","required":true,"schema":{"type":"string","title":"Credit Note Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Required. A unique key (alphanumeric + `-` `_` `:`, ≤200 chars) that lets the server deduplicate retries — required on every money-moving POST. Reuse the same key on a retry to receive the original response instead of creating a duplicate record. UUID v4 is a fine default. Cached for 24 hours.","title":"Idempotency-Key"},"description":"Required. A unique key (alphanumeric + `-` `_` `:`, ≤200 chars) that lets the server deduplicate retries — required on every money-moving POST. Reuse the same key on a retry to receive the original response instead of creating a duplicate record. UUID v4 is a fine default. Cached for 24 hours."}],"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"}}}}}}},"/credit_notes/{credit_note_id}/void":{"post":{"tags":["Credit Notes"],"summary":"Void a credit note (status → CANCELLED)","operationId":"void_credit_note_credit_notes__credit_note_id__void_post","parameters":[{"name":"credit_note_id","in":"path","required":true,"schema":{"type":"string","title":"Credit Note Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/debit_notes":{"get":{"tags":["Debit Notes"],"summary":"List debit notes (cursor-paginated)","operationId":"list_debit_notes_debit_notes_get","parameters":[{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Per Page"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"DRAFT / ISSUED / APPLIED / CANCELLED.","title":"Status"},"description":"DRAFT / ISSUED / APPLIED / CANCELLED."},{"name":"vendor_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Id"}},{"name":"invoice_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}},"post":{"tags":["Debit Notes"],"summary":"Create a debit note (auto-posts journal)","operationId":"create_debit_note_debit_notes_post","parameters":[{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Required. A unique key (alphanumeric + `-` `_` `:`, ≤200 chars) that lets the server deduplicate retries — required on every money-moving POST. Reuse the same key on a retry to receive the original response instead of creating a duplicate record. UUID v4 is a fine default. Cached for 24 hours.","title":"Idempotency-Key"},"description":"Required. A unique key (alphanumeric + `-` `_` `:`, ≤200 chars) that lets the server deduplicate retries — required on every money-moving POST. Reuse the same key on a retry to receive the original response instead of creating a duplicate record. UUID v4 is a fine default. Cached for 24 hours."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DebitNotePublicCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/debit_notes/{debit_note_id}":{"get":{"tags":["Debit Notes"],"summary":"Get one debit note","operationId":"get_debit_note_debit_notes__debit_note_id__get","parameters":[{"name":"debit_note_id","in":"path","required":true,"schema":{"type":"string","title":"Debit Note Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}},"put":{"tags":["Debit Notes"],"summary":"Update a debit note","operationId":"update_debit_note_debit_notes__debit_note_id__put","parameters":[{"name":"debit_note_id","in":"path","required":true,"schema":{"type":"string","title":"Debit Note Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DebitNotePublicUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/debit_notes/{debit_note_id}/void":{"post":{"tags":["Debit Notes"],"summary":"Void a debit note (status → CANCELLED)","operationId":"void_debit_note_debit_notes__debit_note_id__void_post","parameters":[{"name":"debit_note_id","in":"path","required":true,"schema":{"type":"string","title":"Debit Note Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/expenses":{"get":{"tags":["Expenses"],"summary":"List expenses (cursor-paginated)","operationId":"list_expenses_expenses_get","parameters":[{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Per Page"}},{"name":"vendor_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Id"}},{"name":"account_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}},"post":{"tags":["Expenses"],"summary":"Create an expense (auto-posts journal)","description":"Posts the expense journal in one call. Send `line_items` for an itemised breakdown — each line's `account_id` becomes a separate debit; otherwise the header `account_id` + `amount` are used as a single-line expense.","operationId":"create_expense_expenses_post","parameters":[{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpensePublicCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/expenses/{expense_id}":{"get":{"tags":["Expenses"],"summary":"Get one expense","operationId":"get_expense_expenses__expense_id__get","parameters":[{"name":"expense_id","in":"path","required":true,"schema":{"type":"string","title":"Expense Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}},"put":{"tags":["Expenses"],"summary":"Update an expense","operationId":"update_expense_expenses__expense_id__put","parameters":[{"name":"expense_id","in":"path","required":true,"schema":{"type":"string","title":"Expense Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpensePublicUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Expenses"],"summary":"Delete an expense (reverses the journal)","operationId":"delete_expense_expenses__expense_id__delete","parameters":[{"name":"expense_id","in":"path","required":true,"schema":{"type":"string","title":"Expense Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/sales_orders":{"get":{"tags":["Sales Orders"],"summary":"List sales orders (cursor-paginated)","operationId":"list_sales_orders_sales_orders_get","parameters":[{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Per Page"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"DRAFT / OPEN / PARTIALLY_INVOICED / INVOICED / CLOSED / CANCELLED.","title":"Status"},"description":"DRAFT / OPEN / PARTIALLY_INVOICED / INVOICED / CLOSED / CANCELLED."},{"name":"customer_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}},"post":{"tags":["Sales Orders"],"summary":"Create a sales order","operationId":"create_sales_order_sales_orders_post","parameters":[{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SalesOrderPublicCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sales_orders/{sales_order_id}":{"get":{"tags":["Sales Orders"],"summary":"Get one sales order","operationId":"get_sales_order_sales_orders__sales_order_id__get","parameters":[{"name":"sales_order_id","in":"path","required":true,"schema":{"type":"string","title":"Sales Order Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}},"put":{"tags":["Sales Orders"],"summary":"Update a sales order (header fields)","operationId":"update_sales_order_sales_orders__sales_order_id__put","parameters":[{"name":"sales_order_id","in":"path","required":true,"schema":{"type":"string","title":"Sales Order Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SalesOrderPublicUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sales_orders/{sales_order_id}/convert":{"post":{"tags":["Sales Orders"],"summary":"Convert a sales order to an invoice","operationId":"convert_sales_order_sales_orders__sales_order_id__convert_post","parameters":[{"name":"sales_order_id","in":"path","required":true,"schema":{"type":"string","title":"Sales Order Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/purchase_orders":{"get":{"tags":["Purchase Orders"],"summary":"List purchase orders (cursor-paginated)","operationId":"list_purchase_orders_purchase_orders_get","parameters":[{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Per Page"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"DRAFT / OPEN / BILLED / CANCELLED.","title":"Status"},"description":"DRAFT / OPEN / BILLED / CANCELLED."},{"name":"vendor_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}},"post":{"tags":["Purchase Orders"],"summary":"Create a purchase order","operationId":"create_purchase_order_purchase_orders_post","parameters":[{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseOrderPublicCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/purchase_orders/{purchase_order_id}":{"get":{"tags":["Purchase Orders"],"summary":"Get one purchase order","operationId":"get_purchase_order_purchase_orders__purchase_order_id__get","parameters":[{"name":"purchase_order_id","in":"path","required":true,"schema":{"type":"string","title":"Purchase Order Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}},"put":{"tags":["Purchase Orders"],"summary":"Update a purchase order (header fields)","operationId":"update_purchase_order_purchase_orders__purchase_order_id__put","parameters":[{"name":"purchase_order_id","in":"path","required":true,"schema":{"type":"string","title":"Purchase Order Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseOrderPublicUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Purchase Orders"],"summary":"Delete a purchase order","operationId":"delete_purchase_order_purchase_orders__purchase_order_id__delete","parameters":[{"name":"purchase_order_id","in":"path","required":true,"schema":{"type":"string","title":"Purchase Order Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/purchase_orders/{purchase_order_id}/convert":{"post":{"tags":["Purchase Orders"],"summary":"Convert a purchase order to a bill","operationId":"convert_purchase_order_purchase_orders__purchase_order_id__convert_post","parameters":[{"name":"purchase_order_id","in":"path","required":true,"schema":{"type":"string","title":"Purchase Order Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/payments":{"get":{"tags":["Payments"],"summary":"List payments (cursor-paginated)","operationId":"list_payments_payments_get","parameters":[{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Per Page"}},{"name":"flow","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"INCOMING / OUTGOING. Omit to list both.","title":"Flow"},"description":"INCOMING / OUTGOING. Omit to list both."},{"name":"contact_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Id"}},{"name":"payment_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"REGULAR / ADVANCE / REFUND.","title":"Payment Type"},"description":"REGULAR / ADVANCE / REFUND."},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}},"post":{"tags":["Payments"],"summary":"Create a payment (receipt or vendor payment)","description":"INCOMING → customer receipt (Dr Bank / Cr AR). OUTGOING → vendor payment (Dr AP / Cr Bank). The journal entry is posted automatically. To allocate the payment to specific invoices/bills, call POST /payments/{id}/apply afterward.","operationId":"create_payment_payments_post","parameters":[{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Required. A unique key (alphanumeric + `-` `_` `:`, ≤200 chars) that lets the server deduplicate retries — required on every money-moving POST. Reuse the same key on a retry to receive the original response instead of creating a duplicate record. UUID v4 is a fine default. Cached for 24 hours.","title":"Idempotency-Key"},"description":"Required. A unique key (alphanumeric + `-` `_` `:`, ≤200 chars) that lets the server deduplicate retries — required on every money-moving POST. Reuse the same key on a retry to receive the original response instead of creating a duplicate record. UUID v4 is a fine default. Cached for 24 hours."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentPublicCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/payments/{payment_id}":{"get":{"tags":["Payments"],"summary":"Get one payment (with allocations)","operationId":"get_payment_payments__payment_id__get","parameters":[{"name":"payment_id","in":"path","required":true,"schema":{"type":"string","title":"Payment Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}},"put":{"tags":["Payments"],"summary":"Update a payment (receipt or vendor payment)","description":"Update a payment/receipt's fields and re-post its journal entry. All body fields are optional — only what you send changes. Changing the amount while the payment is applied to invoices/bills returns 409: unapply (delete the applications) first, update, then re-apply.","operationId":"update_payment_public_payments__payment_id__put","parameters":[{"name":"payment_id","in":"path","required":true,"schema":{"type":"string","title":"Payment Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentPublicUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Payments"],"summary":"Delete a payment (reverses journal)","operationId":"delete_payment_payments__payment_id__delete","parameters":[{"name":"payment_id","in":"path","required":true,"schema":{"type":"string","title":"Payment Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/payments/{payment_id}/apply":{"post":{"tags":["Payments"],"summary":"Apply (allocate) a payment to an invoice or bill","description":"INCOMING payments allocate to invoices (`invoice_id`); OUTGOING payments allocate to bills (`bill_id`). Repeat the call to split a payment across multiple invoices/bills. The applied amount may not exceed min(payment.unapplied_balance, target.outstanding).","operationId":"apply_payment_payments__payment_id__apply_post","parameters":[{"name":"payment_id","in":"path","required":true,"schema":{"type":"string","title":"Payment Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Required. A unique key (alphanumeric + `-` `_` `:`, ≤200 chars) that lets the server deduplicate retries — required on every money-moving POST. Reuse the same key on a retry to receive the original response instead of creating a duplicate record. UUID v4 is a fine default. Cached for 24 hours.","title":"Idempotency-Key"},"description":"Required. A unique key (alphanumeric + `-` `_` `:`, ≤200 chars) that lets the server deduplicate retries — required on every money-moving POST. Reuse the same key on a retry to receive the original response instead of creating a duplicate record. UUID v4 is a fine default. Cached for 24 hours."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentApplyRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/salespersons":{"get":{"tags":["Salespersons"],"summary":"List salespersons","description":"Returns the org's salesperson catalog (cursor-paginated). Use the `salesperson_id` from this list when creating or updating invoices.","operationId":"list_salespersons_salespersons_get","parameters":[{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":200,"title":"Per Page"}},{"name":"active_only","in":"query","required":false,"schema":{"type":"boolean","description":"Default true — only active salespersons. Pass false to include archived.","default":true,"title":"Active Only"},"description":"Default true — only active salespersons. Pass false to include archived."},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}},"post":{"tags":["Salespersons"],"summary":"Create a salesperson","operationId":"create_salesperson_salespersons_post","parameters":[{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SalespersonPublicCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/salespersons/{salesperson_id}":{"get":{"tags":["Salespersons"],"summary":"Get one salesperson","operationId":"get_salesperson_salespersons__salesperson_id__get","parameters":[{"name":"salesperson_id","in":"path","required":true,"schema":{"type":"string","title":"Salesperson Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}},"put":{"tags":["Salespersons"],"summary":"Update a salesperson (partial)","operationId":"update_salesperson_salespersons__salesperson_id__put","parameters":[{"name":"salesperson_id","in":"path","required":true,"schema":{"type":"string","title":"Salesperson Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SalespersonPublicUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Salespersons"],"summary":"Delete (or archive) a salesperson","operationId":"delete_salesperson_salespersons__salesperson_id__delete","parameters":[{"name":"salesperson_id","in":"path","required":true,"schema":{"type":"string","title":"Salesperson Id"}},{"name":"hard","in":"query","required":false,"schema":{"type":"boolean","description":"Default false — soft delete (sets is_active=false). Pass true to hard-delete; only allowed when no invoice references this salesperson_id.","default":false,"title":"Hard"},"description":"Default false — soft delete (sets is_active=false). Pass true to hard-delete; only allowed when no invoice references this salesperson_id."},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/reports/trial_balance":{"get":{"tags":["Reports"],"summary":"Trial Balance as of a date (or over a period)","operationId":"trial_balance_reports_trial_balance_get","parameters":[{"name":"as_of_date","in":"query","required":true,"schema":{"type":"string","format":"date-time","description":"Report date (ISO format).","title":"As Of Date"},"description":"Report date (ISO format)."},{"name":"from_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Optional period start. When supplied, P&L accounts show ONLY activity within [from_date, as_of_date] and Retained Earnings absorbs pre-period P&L so the TB balances. When omitted, P&L = current-FY-to-date. Mirrors the snake_case convention of as_of_date.","title":"From Date"},"description":"Optional period start. When supplied, P&L accounts show ONLY activity within [from_date, as_of_date] and Retained Earnings absorbs pre-period P&L so the TB balances. When omitted, P&L = current-FY-to-date. Mirrors the snake_case convention of as_of_date."},{"name":"branch_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Scope to a single branch. Omit for consolidated.","title":"Branch Id"},"description":"Scope to a single branch. Omit for consolidated."},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/reports/profit_and_loss":{"get":{"tags":["Reports"],"summary":"Profit & Loss for a period","operationId":"profit_and_loss_reports_profit_and_loss_get","parameters":[{"name":"to_date","in":"query","required":true,"schema":{"type":"string","format":"date-time","description":"End of the reporting period.","title":"To Date"},"description":"End of the reporting period."},{"name":"from_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Start of the reporting period. Defaults to inception when omitted.","title":"From Date"},"description":"Start of the reporting period. Defaults to inception when omitted."},{"name":"branch_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Branch Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/reports/balance_sheet":{"get":{"tags":["Reports"],"summary":"Balance Sheet as of a date","operationId":"balance_sheet_reports_balance_sheet_get","parameters":[{"name":"as_of_date","in":"query","required":true,"schema":{"type":"string","format":"date-time","title":"As Of Date"}},{"name":"branch_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Branch Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/reports/cash_flow":{"get":{"tags":["Reports"],"summary":"Cash Flow Statement (indirect method)","operationId":"cash_flow_reports_cash_flow_get","parameters":[{"name":"from_date","in":"query","required":true,"schema":{"type":"string","format":"date-time","title":"From Date"}},{"name":"to_date","in":"query","required":true,"schema":{"type":"string","format":"date-time","title":"To Date"}},{"name":"branch_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Branch Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/reports/ar_aging":{"get":{"tags":["Reports"],"summary":"Accounts Receivable aging (0-30 / 31-60 / 61-90 / 90+ buckets)","operationId":"ar_aging_reports_ar_aging_get","parameters":[{"name":"as_of_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"As Of Date"}},{"name":"branch_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Branch Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/reports/ap_aging":{"get":{"tags":["Reports"],"summary":"Accounts Payable aging (0-30 / 31-60 / 61-90 / 90+ buckets)","operationId":"ap_aging_reports_ap_aging_get","parameters":[{"name":"as_of_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"As Of Date"}},{"name":"branch_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Branch Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/reports/outstanding_receivables":{"get":{"tags":["Reports"],"summary":"Per-customer list of unpaid invoices","operationId":"outstanding_receivables_reports_outstanding_receivables_get","parameters":[{"name":"branch_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Branch Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/reports/outstanding_payables":{"get":{"tags":["Reports"],"summary":"Per-vendor list of unpaid bills","operationId":"outstanding_payables_reports_outstanding_payables_get","parameters":[{"name":"branch_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Branch Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/reports/ledger":{"get":{"tags":["Reports"],"summary":"Account ledger — transactions for a single account","description":"Every journal line touching `account_id` in the period, plus opening and closing balances. Useful for reconciliations and pulling sub-ledger detail (e.g. one customer's AR ledger).","operationId":"account_ledger_reports_ledger_get","parameters":[{"name":"account_id","in":"query","required":true,"schema":{"type":"string","description":"Account ID to pull the ledger for.","title":"Account Id"},"description":"Account ID to pull the ledger for."},{"name":"from_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"From Date"}},{"name":"to_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"To Date"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":10000,"minimum":1,"default":5000,"title":"Limit"}},{"name":"branch_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Branch Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/reports/customer_ledger":{"get":{"tags":["Reports"],"summary":"Customer Ledger — full subledger for one customer (statement of account)","description":"Per-customer statement: opening balance, every invoice / receipt / credit-note / debit-note / TDS booking / refund / manual JV that touches this customer's AR, with running balance. Skips CANCELLED documents. The `appliedInvoices` array on receipt/TDS rows traces which invoice each payment was applied against.","operationId":"customer_ledger_reports_customer_ledger_get","parameters":[{"name":"contact_id","in":"query","required":true,"schema":{"type":"string","description":"Customer contact id","title":"Contact Id"},"description":"Customer contact id"},{"name":"from_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"From Date"}},{"name":"to_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"To Date"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":10000,"minimum":1,"default":5000,"title":"Limit"}},{"name":"branch_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Branch Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/reports/vendor_ledger":{"get":{"tags":["Reports"],"summary":"Vendor Ledger — full subledger for one vendor (statement of account)","description":"Per-vendor statement: opening balance, every bill / payment / vendor credit note / TDS withholding / refund / manual JV that touches this vendor's AP, with running balance. Skips CANCELLED bills.","operationId":"vendor_ledger_reports_vendor_ledger_get","parameters":[{"name":"contact_id","in":"query","required":true,"schema":{"type":"string","description":"Vendor contact id","title":"Contact Id"},"description":"Vendor contact id"},{"name":"from_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"From Date"}},{"name":"to_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"To Date"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":10000,"minimum":1,"default":5000,"title":"Limit"}},{"name":"branch_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Branch Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/reports/contact_balances":{"get":{"tags":["Reports"],"summary":"Bulk closing balances for all customers (or all vendors)","description":"Returns `{ contactId: balance }` for every contact on the selected side. Each balance is computed via the same path as the per-contact ledger, so it always agrees with the statement. Use for sidebar widgets or dashboard rollups.","operationId":"contact_balances_reports_contact_balances_get","parameters":[{"name":"side","in":"query","required":false,"schema":{"type":"string","description":"`customer` (AR) or `vendor` (AP).","default":"customer","title":"Side"},"description":"`customer` (AR) or `vendor` (AP)."},{"name":"branch_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Branch Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/reports/sales_register":{"get":{"tags":["Reports"],"summary":"Sales register — invoices with HSN/SAC + line breakdown","operationId":"sales_register_reports_sales_register_get","parameters":[{"name":"from_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"From Date"}},{"name":"to_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"To Date"}},{"name":"branch_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Branch Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/reports/purchase_register":{"get":{"tags":["Reports"],"summary":"Purchase register — bills with HSN/SAC + line breakdown","operationId":"purchase_register_reports_purchase_register_get","parameters":[{"name":"from_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"From Date"}},{"name":"to_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"To Date"}},{"name":"branch_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Branch Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/reports/day_book":{"get":{"tags":["Reports"],"summary":"Day book — all journal entries grouped by date","operationId":"day_book_reports_day_book_get","parameters":[{"name":"from_date","in":"query","required":true,"schema":{"type":"string","format":"date-time","description":"Start of date range.","title":"From Date"},"description":"Start of date range."},{"name":"to_date","in":"query","required":true,"schema":{"type":"string","format":"date-time","description":"End of date range.","title":"To Date"},"description":"End of date range."},{"name":"branch_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Branch Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/reports/gstr1":{"get":{"tags":["Reports"],"summary":"GSTR-1 summary — outward supplies (B2B / B2C / HSN)","description":"Returns the GSTR-1 summary for the period — invoices grouped by B2B (GSTIN-bearing customers), B2C (consumers), and the HSN-wise summary required for filing.","operationId":"gstr1_reports_gstr1_get","parameters":[{"name":"from_date","in":"query","required":true,"schema":{"type":"string","format":"date-time","description":"Period start (typically 1st of the month).","title":"From Date"},"description":"Period start (typically 1st of the month)."},{"name":"to_date","in":"query","required":true,"schema":{"type":"string","format":"date-time","description":"Period end.","title":"To Date"},"description":"Period end."},{"name":"branch_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Branch Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/reports/gstr3b":{"get":{"tags":["Reports"],"summary":"GSTR-3B summary — outward + inward + ITC + tax payable","operationId":"gstr3b_reports_gstr3b_get","parameters":[{"name":"from_date","in":"query","required":true,"schema":{"type":"string","format":"date-time","title":"From Date"}},{"name":"to_date","in":"query","required":true,"schema":{"type":"string","format":"date-time","title":"To Date"}},{"name":"branch_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Branch Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/branches":{"get":{"tags":["Operational"],"summary":"List branches (Places of Business)","operationId":"list_branches_branches_get","parameters":[{"name":"active_only","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Active Only"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/branches/{branch_id}":{"get":{"tags":["Operational"],"summary":"Get a single branch","operationId":"get_branch_branches__branch_id__get","parameters":[{"name":"branch_id","in":"path","required":true,"schema":{"type":"string","title":"Branch Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/bank_accounts":{"get":{"tags":["Operational"],"summary":"List bank + cash accounts","description":"Returns Account rows typed BANK or CASH — these are the valid `paid_through_account_id` / `account_id` choices for payments, receipts, and expenses.","operationId":"list_bank_accounts_bank_accounts_get","parameters":[{"name":"active_only","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Active Only"}},{"name":"include_cash","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Include Cash"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/cost_centers":{"get":{"tags":["Operational"],"summary":"List cost centers","description":"Returns the active TagOption rows under the org's COST_CENTER tag. Pass any of these `cost_center_id` values in transaction `tags[]` to tag the document.","operationId":"list_cost_centers_cost_centers_get","parameters":[{"name":"active_only","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Active Only"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/currencies":{"get":{"tags":["Operational"],"summary":"List enabled currencies","operationId":"list_currencies_currencies_get","parameters":[{"name":"active_only","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Active Only"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/exchange_rates":{"get":{"tags":["Operational"],"summary":"List exchange rates","description":"Pass `from_currency` / `to_currency` to filter. Returns the most recent 200 rates by default — narrow with `rate_date_from`.","operationId":"list_exchange_rates_exchange_rates_get","parameters":[{"name":"from_currency","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From Currency"}},{"name":"to_currency","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"To Currency"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":200,"title":"Limit"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/invoices/{invoice_id}/pdf":{"get":{"tags":["PDFs"],"summary":"Download an invoice PDF","operationId":"invoice_pdf_invoices__invoice_id__pdf_get","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","title":"Invoice Id"}},{"name":"template","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"classic | modern | boxed | tally","title":"Template"},"description":"classic | modern | boxed | tally"},{"name":"download","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Pass 'true' for attachment Content-Disposition","title":"Download"},"description":"Pass 'true' for attachment Content-Disposition"},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/pdf":{}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/bills/{bill_id}/pdf":{"get":{"tags":["PDFs"],"summary":"Download a bill PDF","operationId":"bill_pdf_bills__bill_id__pdf_get","parameters":[{"name":"bill_id","in":"path","required":true,"schema":{"type":"string","title":"Bill Id"}},{"name":"download","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Download"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/pdf":{}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/estimates/{estimate_id}/pdf":{"get":{"tags":["PDFs"],"summary":"Download an estimate PDF","operationId":"estimate_pdf_estimates__estimate_id__pdf_get","parameters":[{"name":"estimate_id","in":"path","required":true,"schema":{"type":"string","title":"Estimate Id"}},{"name":"download","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Download"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/pdf":{}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/credit_notes/{credit_note_id}/pdf":{"get":{"tags":["PDFs"],"summary":"Download a credit note PDF","operationId":"credit_note_pdf_credit_notes__credit_note_id__pdf_get","parameters":[{"name":"credit_note_id","in":"path","required":true,"schema":{"type":"string","title":"Credit Note Id"}},{"name":"download","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Download"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/pdf":{}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/debit_notes/{debit_note_id}/pdf":{"get":{"tags":["PDFs"],"summary":"Download a debit note PDF","operationId":"debit_note_pdf_debit_notes__debit_note_id__pdf_get","parameters":[{"name":"debit_note_id","in":"path","required":true,"schema":{"type":"string","title":"Debit Note Id"}},{"name":"download","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Download"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/pdf":{}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/purchase_orders/{purchase_order_id}/pdf":{"get":{"tags":["PDFs"],"summary":"Download a purchase order PDF","operationId":"purchase_order_pdf_purchase_orders__purchase_order_id__pdf_get","parameters":[{"name":"purchase_order_id","in":"path","required":true,"schema":{"type":"string","title":"Purchase Order Id"}},{"name":"download","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Download"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/pdf":{}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/payments/{payment_id}/pdf":{"get":{"tags":["PDFs"],"summary":"Download a payment voucher PDF","operationId":"payment_pdf_payments__payment_id__pdf_get","parameters":[{"name":"payment_id","in":"path","required":true,"schema":{"type":"string","title":"Payment Id"}},{"name":"download","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Download"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/pdf":{}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/invoices/{invoice_id}/email":{"post":{"tags":["Email"],"summary":"Email an invoice (PDF attached by default)","description":"Sends the invoice to one or more recipients via the org's configured SES sender. PDF is attached when `attach_pdf` is true (default). Returns the SES MessageId.","operationId":"email_invoice_invoices__invoice_id__email_post","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","title":"Invoice Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/estimates/{estimate_id}/email":{"post":{"tags":["Email"],"summary":"Email an estimate (PDF attached by default)","operationId":"email_estimate_estimates__estimate_id__email_post","parameters":[{"name":"estimate_id","in":"path","required":true,"schema":{"type":"string","title":"Estimate Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/credit_notes/{credit_note_id}/email":{"post":{"tags":["Email"],"summary":"Email a credit note (PDF attached by default)","operationId":"email_credit_note_credit_notes__credit_note_id__email_post","parameters":[{"name":"credit_note_id","in":"path","required":true,"schema":{"type":"string","title":"Credit Note Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/attachments":{"post":{"tags":["Attachments"],"summary":"Upload a file and attach it to a document","description":"Multipart upload. `entity_type` + `entity_id` form fields tell the server which document to staple the file to. File is uploaded to S3 / MinIO under `orgs/<org_id>/attachments/...`. Hard cap of 25MB per file.","operationId":"upload_attachment_attachments_post","parameters":[{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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_attachment_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 (filter by entity_type + entity_id)","operationId":"list_attachments_attachments_get","parameters":[{"name":"entity_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Type"}},{"name":"entity_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Id"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Per Page"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/attachments/{attachment_id}":{"get":{"tags":["Attachments"],"summary":"Get one attachment (with fresh download URL)","operationId":"get_attachment_attachments__attachment_id__get","parameters":[{"name":"attachment_id","in":"path","required":true,"schema":{"type":"string","title":"Attachment Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}},"delete":{"tags":["Attachments"],"summary":"Delete an attachment (removes the S3 blob too)","operationId":"delete_attachment_attachments__attachment_id__delete","parameters":[{"name":"attachment_id","in":"path","required":true,"schema":{"type":"string","title":"Attachment Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/recurring":{"get":{"tags":["Recurring"],"summary":"List recurring schedules","operationId":"list_recurring_recurring_get","parameters":[{"name":"entity_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Type"}},{"name":"is_active","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Per Page"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}},"post":{"tags":["Recurring"],"summary":"Create a recurring schedule","description":"Either set `template_entity_id` (clone an existing document on every run) or `template_payload` (inline JSON template) — pass exactly one. The schedule's first run fires at 9 AM IST on `start_date`.","operationId":"create_recurring_recurring_post","parameters":[{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecurringPublicCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/recurring/{schedule_id}":{"get":{"tags":["Recurring"],"summary":"Get one schedule","operationId":"get_recurring_recurring__schedule_id__get","parameters":[{"name":"schedule_id","in":"path","required":true,"schema":{"type":"string","title":"Schedule Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}},"put":{"tags":["Recurring"],"summary":"Update a schedule","operationId":"update_recurring_recurring__schedule_id__put","parameters":[{"name":"schedule_id","in":"path","required":true,"schema":{"type":"string","title":"Schedule Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecurringPublicUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Recurring"],"summary":"Delete a schedule","operationId":"delete_recurring_recurring__schedule_id__delete","parameters":[{"name":"schedule_id","in":"path","required":true,"schema":{"type":"string","title":"Schedule Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/recurring/{schedule_id}/run":{"post":{"tags":["Recurring"],"summary":"Fire the schedule immediately (manual run)","description":"Generates one transaction right now using the same logic the background scheduler would run at `next_run_at`. Increments `run_count` + advances `next_run_at` by one interval.","operationId":"run_recurring_recurring__schedule_id__run_post","parameters":[{"name":"schedule_id","in":"path","required":true,"schema":{"type":"string","title":"Schedule Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/recurring/{schedule_id}/pause":{"post":{"tags":["Recurring"],"summary":"Pause (is_active → false)","operationId":"pause_recurring_recurring__schedule_id__pause_post","parameters":[{"name":"schedule_id","in":"path","required":true,"schema":{"type":"string","title":"Schedule Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/recurring/{schedule_id}/resume":{"post":{"tags":["Recurring"],"summary":"Resume (is_active → true)","operationId":"resume_recurring_recurring__schedule_id__resume_post","parameters":[{"name":"schedule_id","in":"path","required":true,"schema":{"type":"string","title":"Schedule Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/activity":{"get":{"tags":["Activity"],"summary":"List activity events","description":"Returns audit-log events for the org. Filter by `entity_type` + `entity_id` to scope to a single document, or just `entity_type` for the org-wide stream on one resource type. Newest first.","operationId":"list_activity_activity_get","parameters":[{"name":"entity_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Type"}},{"name":"entity_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Id"}},{"name":"actor_user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actor User Id"}},{"name":"since","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO timestamp lower bound.","title":"Since"},"description":"ISO timestamp lower bound."},{"name":"until","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO timestamp upper bound.","title":"Until"},"description":"ISO timestamp upper bound."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/invoices/{invoice_id}/activity":{"get":{"tags":["Activity"],"summary":"Activity timeline for one invoice","operationId":"invoice_activity_invoices__invoice_id__activity_get","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","title":"Invoice Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/bills/{bill_id}/activity":{"get":{"tags":["Activity"],"summary":"Activity timeline for one bill","operationId":"bill_activity_bills__bill_id__activity_get","parameters":[{"name":"bill_id","in":"path","required":true,"schema":{"type":"string","title":"Bill Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/estimates/{estimate_id}/activity":{"get":{"tags":["Activity"],"summary":"Activity timeline for one estimate","operationId":"estimate_activity_estimates__estimate_id__activity_get","parameters":[{"name":"estimate_id","in":"path","required":true,"schema":{"type":"string","title":"Estimate Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/credit_notes/{credit_note_id}/activity":{"get":{"tags":["Activity"],"summary":"Activity timeline for one credit note","operationId":"credit_note_activity_credit_notes__credit_note_id__activity_get","parameters":[{"name":"credit_note_id","in":"path","required":true,"schema":{"type":"string","title":"Credit Note Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/debit_notes/{debit_note_id}/activity":{"get":{"tags":["Activity"],"summary":"Activity timeline for one debit note","operationId":"debit_note_activity_debit_notes__debit_note_id__activity_get","parameters":[{"name":"debit_note_id","in":"path","required":true,"schema":{"type":"string","title":"Debit Note Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/payments/{payment_id}/activity":{"get":{"tags":["Activity"],"summary":"Activity timeline for one payment","operationId":"payment_activity_payments__payment_id__activity_get","parameters":[{"name":"payment_id","in":"path","required":true,"schema":{"type":"string","title":"Payment Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/expenses/{expense_id}/activity":{"get":{"tags":["Activity"],"summary":"Activity timeline for one expense","operationId":"expense_activity_expenses__expense_id__activity_get","parameters":[{"name":"expense_id","in":"path","required":true,"schema":{"type":"string","title":"Expense Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/comments":{"post":{"tags":["Comments"],"summary":"Post a comment on a document","operationId":"create_comment_comments_post","parameters":[{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommentPublicCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Comments"],"summary":"List comments (filter by entity_type + entity_id)","operationId":"list_comments_comments_get","parameters":[{"name":"entity_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Type"}},{"name":"entity_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Id"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Per Page"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/comments/{comment_id}":{"get":{"tags":["Comments"],"summary":"Get one comment","operationId":"get_comment_comments__comment_id__get","parameters":[{"name":"comment_id","in":"path","required":true,"schema":{"type":"string","title":"Comment Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}},"put":{"tags":["Comments"],"summary":"Edit a comment (author only)","description":"Updates the body. Only the original author can edit — anyone else gets 403 `auth.insufficient_scope`. For audit purposes, `last_modified_time` reflects the most recent edit.","operationId":"update_comment_comments__comment_id__put","parameters":[{"name":"comment_id","in":"path","required":true,"schema":{"type":"string","title":"Comment Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommentPublicUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Comments"],"summary":"Delete a comment (author only)","operationId":"delete_comment_comments__comment_id__delete","parameters":[{"name":"comment_id","in":"path","required":true,"schema":{"type":"string","title":"Comment Id"}},{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"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"}}}}}}},"/bulk/invoices":{"post":{"tags":["Bulk"],"summary":"Bulk-create up to 50 invoices (partial-failure tolerant)","description":"Each item is created in its own savepoint — one bad row does not roll back the rest of the batch. Response is HTTP 200 with a per-item results array: each row has either `{ok: true, invoice: {…}}` or `{ok: false, error: {…}}`. The same `auto_approve` flag applies per item.\n\nIdempotency: pass an `Idempotency-Key` header to make the entire batch replay-safe within 24h.","operationId":"bulk_create_invoices_bulk_invoices_post","parameters":[{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceBulkCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/bulk/bills":{"post":{"tags":["Bulk"],"summary":"Bulk-create up to 50 bills (partial-failure tolerant)","description":"Same shape as bulk invoices. Each item is created in its own savepoint so one bad row doesn't roll back the rest.","operationId":"bulk_create_bills_bulk_bills_post","parameters":[{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in.","title":"Organization Id"},"description":"standard organization scoping.\n\n* Single-org token (PAT or single-org OAuth token): optional. If supplied, must match the bound org.\n* Multi-org OAuth token (issued without `organization_id` at /authorize time): **required**. Picks which org this call targets. Must reference an org the user has active membership in."},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillBulkCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"BillBulkCreate":{"properties":{"bills":{"items":{"$ref":"#/components/schemas/BillPublicCreate"},"type":"array","maxItems":50,"minItems":1,"title":"Bills","description":"Up to 50 bills per request."}},"additionalProperties":false,"type":"object","required":["bills"],"title":"BillBulkCreate"},"BillLineItemCreate":{"properties":{"item_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Item Id","description":"Reference an Item to inherit name / purchase_rate / tax_id / hsn_or_sac / unit automatically."},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Required when `item_id` is omitted."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"hsn_or_sac":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hsn Or Sac"},"quantity":{"type":"number","minimum":0.0,"title":"Quantity","default":1.0},"unit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unit"},"rate":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Rate","description":"Per-unit cost. Inherits item.purchase_rate if omitted."},"discount":{"type":"number","minimum":0.0,"title":"Discount","default":0.0},"tax_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Id"}},"additionalProperties":false,"type":"object","title":"BillLineItemCreate","description":"Minimum input: either `item_id` (everything else auto-fills\nfrom the item master — purchase rate, hsn, unit, tax) OR\n`name` + `rate` (ad-hoc line)."},"BillPublicCreate":{"properties":{"vendor_id":{"type":"string","title":"Vendor Id","description":"Contact ID for the vendor."},"date":{"type":"string","format":"date-time","title":"Date"},"place_of_supply":{"type":"string","title":"Place Of Supply"},"line_items":{"items":{"$ref":"#/components/schemas/BillLineItemCreate"},"type":"array","minItems":1,"title":"Line Items"},"bill_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bill Number","description":"Override the auto-generated number. Must be unique per branch."},"due_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Due Date"},"reference_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reference Number"},"currency_code":{"type":"string","title":"Currency Code","default":"INR"},"exchange_rate":{"type":"number","title":"Exchange Rate","default":1.0},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"auto_approve":{"type":"boolean","title":"Auto Approve","description":"If true, the bill is created and immediately approved (status OPEN, journal posted).","default":false},"branch_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Branch Id","description":"Branch under which to record the bill. Falls back to the org's default branch when omitted."}},"additionalProperties":false,"type":"object","required":["vendor_id","date","place_of_supply","line_items"],"title":"BillPublicCreate"},"BillPublicUpdate":{"properties":{"reference_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reference Number"},"due_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Due Date"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"additionalProperties":false,"type":"object","title":"BillPublicUpdate","description":"Update only DRAFT bill header fields."},"Body_upload_attachment_attachments_post":{"properties":{"entity_type":{"type":"string","title":"Entity Type","description":"Resource type (e.g. INVOICE)"},"entity_id":{"type":"string","title":"Entity Id","description":"Resource id (e.g. inv_abc)"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["entity_type","entity_id","file"],"title":"Body_upload_attachment_attachments_post"},"CommentPublicCreate":{"properties":{"entity_type":{"type":"string","enum":["INVOICE","BILL","ESTIMATE","CREDIT_NOTE","DEBIT_NOTE","SALES_ORDER","PURCHASE_ORDER","PAYMENT","EXPENSE","CONTACT","JOURNAL"],"title":"Entity Type"},"entity_id":{"type":"string","title":"Entity Id"},"body":{"type":"string","maxLength":10000,"minLength":1,"title":"Body"}},"additionalProperties":false,"type":"object","required":["entity_type","entity_id","body"],"title":"CommentPublicCreate"},"CommentPublicUpdate":{"properties":{"body":{"type":"string","maxLength":10000,"minLength":1,"title":"Body"}},"additionalProperties":false,"type":"object","required":["body"],"title":"CommentPublicUpdate"},"ContactAddressPublic":{"properties":{"attention":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Attention","description":"Care-of / attention line on the printed address."},"address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Address","description":"Address line 1 (street, building, plot)."},"street2":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Street2","description":"Address line 2 (landmark, area, etc.)."},"city":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"City"},"state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State","description":"State name (e.g. 'Karnataka'). For GST routing use state_code."},"state_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State Code","description":"GST state code (e.g. 'IN-KA' or '29')."},"zip":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Zip"},"country":{"type":"string","title":"Country","default":"India"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"}},"additionalProperties":false,"type":"object","title":"ContactAddressPublic","description":"A billing- or shipping-address. Zoho-shaped."},"ContactPersonPublic":{"properties":{"contact_person_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Person Id","description":"Server-assigned on creation. Pass back the same id on update to identify which row to change; omit to create a new row in the same call."},"salutation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Salutation"},"first_name":{"type":"string","minLength":1,"title":"First Name"},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Name"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"mobile":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mobile"},"designation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Designation"},"department":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Department"},"is_primary":{"type":"boolean","title":"Is Primary","default":false}},"additionalProperties":false,"type":"object","required":["first_name"],"title":"ContactPersonPublic","description":"One person associated with the contact (Zoho shape, minus\nportal/role fields which are V1.1)."},"ContactPublicCreate":{"properties":{"contact_type":{"type":"string","enum":["CUSTOMER","VENDOR","BOTH"],"title":"Contact Type","default":"CUSTOMER"},"contact_name":{"type":"string","maxLength":255,"minLength":1,"title":"Contact Name"},"display_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Display Name"},"legal_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Legal Name"},"company_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Company Name"},"gst_no":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gst No"},"gst_treatment":{"type":"string","enum":["REGISTERED","UNREGISTERED","CONSUMER","COMPOSITION","OVERSEAS","SEZ","DEEMED_EXPORT"],"title":"Gst Treatment","default":"REGISTERED"},"pan":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pan"},"place_of_contact":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Place Of Contact"},"email":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Email"},"phone":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Phone"},"website":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Website"},"billing_address":{"anyOf":[{"$ref":"#/components/schemas/ContactAddressPublic"},{"type":"null"}]},"shipping_address":{"anyOf":[{"$ref":"#/components/schemas/ContactAddressPublic"},{"type":"null"}]},"contact_persons":{"items":{"$ref":"#/components/schemas/ContactPersonPublic"},"type":"array","title":"Contact Persons"},"payment_terms":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Payment Terms"},"payment_terms_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Payment Terms Label"},"opening_balance":{"type":"number","title":"Opening Balance","default":0.0},"credit_limit":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Credit Limit"},"currency_code":{"type":"string","title":"Currency Code","default":"INR"},"dedup_by":{"anyOf":[{"items":{"type":"string","enum":["gst_no","email"]},"type":"array"},{"type":"null"}],"title":"Dedup By","description":"When set, find-or-create: look up an existing contact by these natural keys (OR'd). If matched, return that contact with `reused: true`; otherwise create as normal. Allowed values: 'gst_no', 'email'."}},"additionalProperties":false,"type":"object","required":["contact_name"],"title":"ContactPublicCreate","description":"Public write-shape for POST /contacts.\n\nOnly `contact_name` is required — everything else is optional.\nAddresses and contact_persons may be omitted (empty / no-op) or\nfully populated."},"ContactPublicUpdate":{"properties":{"contact_type":{"anyOf":[{"type":"string","enum":["CUSTOMER","VENDOR","BOTH"]},{"type":"null"}],"title":"Contact Type"},"contact_name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Contact Name"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"legal_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Legal Name"},"company_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Name"},"gst_no":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gst No"},"gst_treatment":{"anyOf":[{"type":"string","enum":["REGISTERED","UNREGISTERED","CONSUMER","COMPOSITION","OVERSEAS","SEZ","DEEMED_EXPORT"]},{"type":"null"}],"title":"Gst Treatment"},"pan":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pan"},"place_of_contact":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Place Of Contact"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"website":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Website"},"billing_address":{"anyOf":[{"$ref":"#/components/schemas/ContactAddressPublic"},{"type":"null"}]},"shipping_address":{"anyOf":[{"$ref":"#/components/schemas/ContactAddressPublic"},{"type":"null"}]},"contact_persons":{"anyOf":[{"items":{"$ref":"#/components/schemas/ContactPersonPublic"},"type":"array"},{"type":"null"}],"title":"Contact Persons"},"payment_terms":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Payment Terms"},"payment_terms_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Payment Terms Label"},"opening_balance":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Opening Balance"},"credit_limit":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Credit Limit"},"currency_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency Code"}},"additionalProperties":false,"type":"object","title":"ContactPublicUpdate","description":"Public write-shape for PUT /contacts/{contact_id}.\n\nPartial — only the keys you pass are touched. For nested\nobjects, passing the whole object REPLACES it; pass `null`\nexplicitly to clear. For `contact_persons`, the list is\nREPLACED in full when supplied; omit the key to leave it\nuntouched. Each item in the list is matched by\n`contact_person_id` if present (update); items without an id\nare created."},"CreateOrgRequest":{"properties":{"name":{"type":"string","title":"Name"},"state":{"type":"string","title":"State"},"ownerEmail":{"type":"string","title":"Owneremail"},"ownerName":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ownername"},"gstin":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gstin"},"pan":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pan"},"currency":{"type":"string","title":"Currency","default":"INR"},"fyStartMonth":{"type":"integer","maximum":12.0,"minimum":1.0,"title":"Fystartmonth","default":4},"externalRef":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Externalref"},"tokenDescription":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tokendescription"},"scopes":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Scopes"},"isTest":{"type":"boolean","title":"Istest","default":false}},"type":"object","required":["name","state","ownerEmail"],"title":"CreateOrgRequest"},"CreditNoteLineItemCreate":{"properties":{"item_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Item Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"hsn_or_sac":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hsn Or Sac"},"quantity":{"type":"number","minimum":0.0,"title":"Quantity","default":1.0},"unit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unit"},"rate":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Rate"},"discount":{"type":"number","minimum":0.0,"title":"Discount","default":0.0},"tax_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Id"},"restock":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Restock","description":"Whether to record a stock movement for this line. Defaults to True for GOODS-type items; ignored for services. Set to False to refund-only with no stock adjustment."}},"additionalProperties":false,"type":"object","title":"CreditNoteLineItemCreate","description":"Min input: either `item_id` (rate/name/tax/hsn auto-fill from\nitem master) OR `name` + `rate` (ad-hoc)."},"CreditNotePublicCreate":{"properties":{"customer_id":{"type":"string","title":"Customer Id","description":"Contact id. For a vendor-side (purchase-return) credit note, this is the vendor's contact id — combine with `bill_id` to route the GST reversal correctly."},"date":{"type":"string","format":"date-time","title":"Date"},"line_items":{"items":{"$ref":"#/components/schemas/CreditNoteLineItemCreate"},"type":"array","minItems":1,"title":"Line Items"},"branch_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Branch Id","description":"Branch under which to issue the credit note. Determines the per-branch number series (CGST Rule 46) and the supplier state for intra/inter-state tax routing. Falls back to the org's default branch when omitted."},"credit_note_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Credit Note Number"},"invoice_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Id","description":"Parent invoice to offset. Tax reversal + TDS reclaim are pro-rated against this invoice when present."},"bill_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bill Id","description":"For purchase returns: the parent bill being offset."},"reference_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reference Number"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"additionalProperties":false,"type":"object","required":["customer_id","date","line_items"],"title":"CreditNotePublicCreate"},"CreditNotePublicUpdate":{"properties":{"date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Date"},"reference_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reference Number"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"status":{"anyOf":[{"type":"string","enum":["DRAFT","ISSUED","APPLIED","CANCELLED"]},{"type":"null"}],"title":"Status"},"line_items":{"anyOf":[{"items":{"$ref":"#/components/schemas/CreditNoteLineItemCreate"},"type":"array"},{"type":"null"}],"title":"Line Items"}},"additionalProperties":false,"type":"object","title":"CreditNotePublicUpdate","description":"Update header fields on a non-applied credit note. Lines may\nbe replaced wholesale by passing `line_items` — totals are\nrecomputed server-side."},"DebitNoteLineItemCreate":{"properties":{"item_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Item Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"hsn_or_sac":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hsn Or Sac"},"quantity":{"type":"number","minimum":0.0,"title":"Quantity","default":1.0},"unit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unit"},"rate":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Rate"},"discount":{"type":"number","minimum":0.0,"title":"Discount","default":0.0},"tax_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Id"}},"additionalProperties":false,"type":"object","title":"DebitNoteLineItemCreate","description":"Min input: either `item_id` (rate/name/tax/hsn auto-fill from\nitem master) OR `name` + `rate` (ad-hoc)."},"DebitNotePublicCreate":{"properties":{"vendor_id":{"type":"string","title":"Vendor Id","description":"Contact id of the vendor."},"date":{"type":"string","format":"date-time","title":"Date"},"line_items":{"items":{"$ref":"#/components/schemas/DebitNoteLineItemCreate"},"type":"array","minItems":1,"title":"Line Items"},"branch_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Branch Id","description":"Branch under which to issue the debit note — sets the per-branch number series (CGST Rule 46) and supplier state. Falls back to the org's default branch."},"debit_note_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Debit Note Number"},"invoice_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Id","description":"Parent bill/invoice id to offset (for ITC reversal)."},"reference_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reference Number"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"additionalProperties":false,"type":"object","required":["vendor_id","date","line_items"],"title":"DebitNotePublicCreate"},"DebitNotePublicUpdate":{"properties":{"date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Date"},"reference_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reference Number"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"status":{"anyOf":[{"type":"string","enum":["DRAFT","ISSUED","APPLIED","CANCELLED"]},{"type":"null"}],"title":"Status"},"line_items":{"anyOf":[{"items":{"$ref":"#/components/schemas/DebitNoteLineItemCreate"},"type":"array"},{"type":"null"}],"title":"Line Items"}},"additionalProperties":false,"type":"object","title":"DebitNotePublicUpdate","description":"Update header fields. Lines may be replaced wholesale by\npassing `line_items` — totals are recomputed server-side."},"EchoRequest":{"properties":{"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"}},"additionalProperties":false,"type":"object","title":"EchoRequest"},"EmailRequest":{"properties":{"to":{"items":{"type":"string"},"type":"array","minItems":1,"title":"To"},"cc":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Cc"},"bcc":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Bcc"},"subject":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Subject"},"body_html":{"anyOf":[{"type":"string","maxLength":50000},{"type":"null"}],"title":"Body Html"},"attach_pdf":{"type":"boolean","title":"Attach Pdf","default":true}},"additionalProperties":false,"type":"object","required":["to"],"title":"EmailRequest"},"EstimateLineItemCreate":{"properties":{"item_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Item Id","description":"Reference an Item to inherit name / selling_price / tax_id / hsn_or_sac / unit automatically."},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Required when `item_id` is omitted."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"hsn_or_sac":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hsn Or Sac"},"quantity":{"type":"number","minimum":0.0,"title":"Quantity","default":1.0},"unit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unit"},"rate":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Rate","description":"Per-unit price. Inherits item.selling_price if omitted."},"discount":{"type":"number","minimum":0.0,"title":"Discount","default":0.0},"tax_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Id"}},"additionalProperties":false,"type":"object","title":"EstimateLineItemCreate","description":"Minimum input: either `item_id` (everything else auto-fills\nfrom the item master — selling rate, hsn, unit, tax) OR\n`name` + `rate` (ad-hoc line)."},"EstimatePublicCreate":{"properties":{"customer_id":{"type":"string","title":"Customer Id","description":"Contact ID for the customer."},"date":{"type":"string","format":"date-time","title":"Date"},"line_items":{"items":{"$ref":"#/components/schemas/EstimateLineItemCreate"},"type":"array","minItems":1,"title":"Line Items"},"branch_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Branch Id","description":"Branch under which to issue the estimate — sets the per-branch number series and supplier state. Falls back to the org's default branch."},"estimate_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Estimate Number","description":"Override the auto-generated number. Must be unique per org."},"expiry_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expiry Date"},"reference_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reference Number"},"place_of_supply":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Place Of Supply","description":"GST state code (e.g. IN-KA). Defaults to the customer's place_of_contact."},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"additionalProperties":false,"type":"object","required":["customer_id","date","line_items"],"title":"EstimatePublicCreate"},"EstimatePublicUpdate":{"properties":{"date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Date"},"expiry_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expiry Date"},"reference_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reference Number"},"place_of_supply":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Place Of Supply"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"status":{"anyOf":[{"type":"string","enum":["DRAFT","SENT","ACCEPTED","DECLINED","CONVERTED","CANCELLED"]},{"type":"null"}],"title":"Status","description":"Set to SENT to mark issued, DECLINED to mark rejected. Use POST /accept or POST /convert for ACCEPTED / CONVERTED."}},"additionalProperties":false,"type":"object","title":"EstimatePublicUpdate","description":"Update only DRAFT estimate header fields. Line edits require recreate."},"ExpenseLineItemCreate":{"properties":{"account_id":{"type":"string","title":"Account Id"},"amount":{"type":"number","exclusiveMinimum":0.0,"title":"Amount"},"tax_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Id"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"}},"additionalProperties":false,"type":"object","required":["account_id","amount"],"title":"ExpenseLineItemCreate"},"ExpensePublicCreate":{"properties":{"date":{"type":"string","format":"date-time","title":"Date"},"account_id":{"type":"string","title":"Account Id","description":"Expense account (or first line's account)."},"paid_through_account_id":{"type":"string","title":"Paid Through Account Id","description":"Bank / cash account."},"amount":{"type":"number","minimum":0.0,"title":"Amount","description":"Required only when `line_items` is omitted."},"vendor_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Id"},"tax_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Id"},"mode":{"type":"string","enum":["CASH","BANK","CARD","UPI","CHEQUE","OTHER"],"title":"Mode","default":"CASH"},"is_inclusive_tax":{"type":"boolean","title":"Is Inclusive Tax","default":false},"gst_treatment":{"anyOf":[{"type":"string","enum":["REGISTERED","UNREGISTERED","CONSUMER","OVERSEAS","SEZ"]},{"type":"null"}],"title":"Gst Treatment"},"reference_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reference Number"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"line_items":{"anyOf":[{"items":{"$ref":"#/components/schemas/ExpenseLineItemCreate"},"type":"array"},{"type":"null"}],"title":"Line Items","description":"Itemised breakdown. When supplied, the per-line account_id / tax_id override the header values; the journal debits each line's account at its taxable value."},"is_rcm":{"type":"boolean","title":"Is Rcm","default":false},"rcm_rate":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Rcm Rate","description":"Self-assessed GST rate under reverse-charge (§9(3)/(4))."},"itc_blocked_reason":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}],"title":"Itc Blocked Reason"}},"additionalProperties":false,"type":"object","required":["date","account_id","paid_through_account_id","amount"],"title":"ExpensePublicCreate"},"ExpensePublicUpdate":{"properties":{"date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Date"},"account_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Id"},"paid_through_account_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Paid Through Account Id"},"amount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Amount"},"vendor_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Id"},"tax_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Id"},"mode":{"anyOf":[{"type":"string","enum":["CASH","BANK","CARD","UPI","CHEQUE","OTHER"]},{"type":"null"}],"title":"Mode"},"is_inclusive_tax":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Inclusive Tax"},"gst_treatment":{"anyOf":[{"type":"string","enum":["REGISTERED","UNREGISTERED","CONSUMER","OVERSEAS","SEZ"]},{"type":"null"}],"title":"Gst Treatment"},"reference_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reference Number"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"line_items":{"anyOf":[{"items":{"$ref":"#/components/schemas/ExpenseLineItemCreate"},"type":"array"},{"type":"null"}],"title":"Line Items"},"is_rcm":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Rcm"},"rcm_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Rcm Rate"},"itc_blocked_reason":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}],"title":"Itc Blocked Reason"}},"additionalProperties":false,"type":"object","title":"ExpensePublicUpdate"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"InvoiceBulkCreate":{"properties":{"invoices":{"items":{"$ref":"#/components/schemas/InvoicePublicCreate"},"type":"array","maxItems":50,"minItems":1,"title":"Invoices","description":"Up to 50 invoices per request."}},"additionalProperties":false,"type":"object","required":["invoices"],"title":"InvoiceBulkCreate"},"InvoiceLineItemCreate":{"properties":{"item_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Item Id","description":"Reference an Item to inherit name / rate / tax_id / hsn_or_sac / unit automatically. Pass any of those fields explicitly to override the item's defaults."},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Line description. Required when `item_id` is omitted; otherwise inherits from the item's name."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"hsn_or_sac":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hsn Or Sac"},"quantity":{"type":"number","minimum":0.0,"title":"Quantity","default":1.0},"unit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unit"},"rate":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Rate","description":"Per-unit price. Inherits item.rate if omitted."},"discount":{"type":"number","minimum":0.0,"title":"Discount","default":0.0},"tax_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Id"},"account_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Id","description":"Revenue ledger to post this line's credit against. Useful for ad-hoc lines (no `item_id`) where there's no item-level default. Get valid account ids from `GET /accounts` filtered to INCOME types. When omitted, the line falls back to item.account_id, then to the org's default Sales account."}},"additionalProperties":false,"type":"object","title":"InvoiceLineItemCreate","description":"Minimum input: either `item_id` (everything else auto-fills\nfrom the item master) OR `name` + `rate` (ad-hoc line).\n\nAnything you do pass overrides the auto-fill."},"InvoicePublicCreate":{"properties":{"customer_id":{"type":"string","title":"Customer Id","description":"Contact ID for the customer."},"date":{"type":"string","format":"date-time","title":"Date","description":"Invoice date."},"place_of_supply":{"type":"string","title":"Place Of Supply","description":"GST state — canonical IN-XX (also accepts '29', 'Karnataka', '29-Karnataka')."},"line_items":{"items":{"$ref":"#/components/schemas/InvoiceLineItemCreate"},"type":"array","minItems":1,"title":"Line Items"},"invoice_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Number","description":"Override the auto-generated number. Must be unique per branch."},"due_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Due Date"},"reference_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reference Number"},"currency_code":{"type":"string","title":"Currency Code","default":"INR"},"exchange_rate":{"type":"number","title":"Exchange Rate","default":1.0},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"round_off":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Round Off","description":"Manual round-off adjustment. Positive = rounded UP (income side), negative = rounded DOWN (expense side). Leave NULL to let the org's `roundInvoiceTotals` preference auto-calculate it (rounds the grand total to the nearest rupee by default; `roundingMethod` can be `nearest`/`up`/`down`)."},"salesperson_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Salesperson Id","description":"Tag this invoice with a salesperson. Accepts either a `salespersons.id` (preferred, fetch via GET /salespersons) or a `users.id` for org members. If `salesperson_name` is omitted, the catalog/user name is auto-filled."},"salesperson_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Salesperson Name","description":"Override label for the salesperson on the PDF. Defaults to the catalog/user name when `salesperson_id` is provided."},"auto_approve":{"type":"boolean","title":"Auto Approve","description":"If true, the invoice is created and immediately approved (status SENT, journal posted).","default":false},"series_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Series Name","description":"Invoice number series to consume (e.g. 'default', 'export', 'rcm'). Branch-scoped. Falls back to 'default' when omitted. Use GET /invoices/series to list available."},"branch_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Branch Id","description":"Branch under which to issue the invoice. Determines which series sequence is consumed and which state is used for intra/inter-state tax routing. Falls back to the org's default branch when omitted."}},"additionalProperties":false,"type":"object","required":["customer_id","date","place_of_supply","line_items"],"title":"InvoicePublicCreate"},"InvoicePublicUpdate":{"properties":{"reference_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reference Number"},"due_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Due Date"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"salesperson_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Salesperson Id","description":"Re-tag the invoice. Pass empty string to clear."},"salesperson_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Salesperson Name"}},"additionalProperties":false,"type":"object","title":"InvoicePublicUpdate","description":"Update only DRAFT invoice header fields. Use /void to cancel."},"ItemPublicCreate":{"properties":{"item_name":{"type":"string","maxLength":255,"minLength":1,"title":"Item Name"},"sku":{"type":"string","maxLength":64,"minLength":1,"title":"Sku"},"item_type":{"type":"string","enum":["GOODS","SERVICE"],"title":"Item Type","default":"GOODS"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"hsn_or_sac":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hsn Or Sac"},"unit":{"type":"string","title":"Unit","default":"NOS"},"rate":{"type":"number","minimum":0.0,"title":"Rate","default":0.0},"purchase_rate":{"type":"number","minimum":0.0,"title":"Purchase Rate","default":0.0},"tax_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Id"}},"additionalProperties":false,"type":"object","required":["item_name","sku"],"title":"ItemPublicCreate"},"ItemPublicUpdate":{"properties":{"item_name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Item Name"},"sku":{"anyOf":[{"type":"string","maxLength":64,"minLength":1},{"type":"null"}],"title":"Sku"},"item_type":{"anyOf":[{"type":"string","enum":["GOODS","SERVICE"]},{"type":"null"}],"title":"Item Type"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"hsn_or_sac":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hsn Or Sac"},"unit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unit"},"rate":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Rate"},"purchase_rate":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Purchase Rate"},"tax_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Id"}},"additionalProperties":false,"type":"object","title":"ItemPublicUpdate"},"JournalLineCreate":{"properties":{"account_id":{"type":"string","title":"Account Id","description":"GL account from /accounts."},"debit":{"type":"number","minimum":0.0,"title":"Debit","default":0.0},"credit":{"type":"number","minimum":0.0,"title":"Credit","default":0.0},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"additionalProperties":false,"type":"object","required":["account_id"],"title":"JournalLineCreate"},"JournalPublicCreate":{"properties":{"date":{"type":"string","format":"date-time","title":"Date"},"memo":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Memo"},"contact_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Id","description":"Optional contact to associate (for contact-scoped reports)."},"lines":{"items":{"$ref":"#/components/schemas/JournalLineCreate"},"type":"array","minItems":2,"title":"Lines"}},"additionalProperties":false,"type":"object","required":["date","lines"],"title":"JournalPublicCreate","description":"Create a manual journal entry. Debits MUST equal credits."},"PaymentAllocationInput":{"properties":{"invoice_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Id"},"bill_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bill Id"},"amount":{"type":"number","exclusiveMinimum":0.0,"title":"Amount"}},"additionalProperties":false,"type":"object","required":["amount"],"title":"PaymentAllocationInput","description":"One allocation row on a single-call create-and-apply payment.\n\nFor INCOMING set `invoice_id`; for OUTGOING set `bill_id`. The\nother field must be omitted. Sum of `amount` across allocations\nmay not exceed the payment's `amount`."},"PaymentApplyRequest":{"properties":{"invoice_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Id"},"bill_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bill Id"},"amount":{"type":"number","exclusiveMinimum":0.0,"title":"Amount"}},"additionalProperties":false,"type":"object","required":["amount"],"title":"PaymentApplyRequest","description":"Apply (allocate) part or all of a payment to an invoice/bill.\n\nFor INCOMING payments, supply `invoice_id`. For OUTGOING, supply\n`bill_id`. The other field must be omitted."},"PaymentPublicCreate":{"properties":{"flow":{"type":"string","enum":["INCOMING","OUTGOING"],"title":"Flow","description":"INCOMING = receipt from a customer (Dr Bank / Cr AR). OUTGOING = payment to a vendor (Dr AP / Cr Bank)."},"contact_id":{"type":"string","title":"Contact Id","description":"Customer for INCOMING, vendor for OUTGOING."},"date":{"type":"string","format":"date-time","title":"Date"},"amount":{"type":"number","exclusiveMinimum":0.0,"title":"Amount"},"mode":{"type":"string","enum":["CASH","BANK_TRANSFER","CHEQUE","UPI","CREDIT_CARD","DEBIT_CARD","NET_BANKING"],"title":"Mode","default":"BANK_TRANSFER"},"payment_type":{"type":"string","enum":["REGULAR","ADVANCE","REFUND"],"title":"Payment Type","default":"REGULAR"},"reference_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reference Number"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"currency_code":{"type":"string","title":"Currency Code","default":"INR"},"exchange_rate":{"type":"number","title":"Exchange Rate","default":1.0},"bank_charges":{"type":"number","title":"Bank Charges","default":0.0},"tds_amount":{"type":"number","title":"Tds Amount","default":0.0},"bank_account_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bank Account Id","description":"Bank or Cash account that receives (INCOMING) or pays out (OUTGOING) the money. Get the id from `GET /accounts` filtered to types BANK or CASH. When omitted, the first BANK/CASH account in the org is used — fine for single-bank orgs, but multi-bank setups must specify."},"allocations":{"anyOf":[{"items":{"$ref":"#/components/schemas/PaymentAllocationInput"},"type":"array"},{"type":"null"}],"title":"Allocations","description":"Optional. Allocate the payment to one or more invoices (INCOMING) or bills (OUTGOING) in the same call. Each row must have `invoice_id` XOR `bill_id` matching the payment flow. Sum of amounts may not exceed `amount`."}},"additionalProperties":false,"type":"object","required":["flow","contact_id","date","amount"],"title":"PaymentPublicCreate"},"PaymentPublicUpdate":{"properties":{"flow":{"anyOf":[{"type":"string","enum":["INCOMING","OUTGOING"]},{"type":"null"}],"title":"Flow","description":"Direction used when re-posting the journal. Inferred from the payment's allocations when omitted."},"contact_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Id"},"date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Date"},"amount":{"anyOf":[{"type":"number","exclusiveMinimum":0.0},{"type":"null"}],"title":"Amount"},"mode":{"anyOf":[{"type":"string","enum":["CASH","BANK_TRANSFER","CHEQUE","UPI","CREDIT_CARD","DEBIT_CARD","NET_BANKING"]},{"type":"null"}],"title":"Mode"},"reference_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reference Number"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"currency_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency Code"},"exchange_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Exchange Rate"},"bank_charges":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Bank Charges"},"bank_account_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bank Account Id","description":"Move the receipt/payment to a different BANK/CASH account."}},"additionalProperties":false,"type":"object","title":"PaymentPublicUpdate","description":"Update a payment/receipt. All fields optional — only what you send is\nchanged, and the journal entry is re-posted to reflect it. Changing the\namount while the payment is applied to invoices/bills is rejected (409):\nunapply first, update, then re-apply."},"ProvisionOrgRequest":{"properties":{"name":{"type":"string","title":"Name","description":"Organisation / business name"},"state":{"type":"string","title":"State","description":"Primary state — any shape, stored as IN-XX"},"ownerEmail":{"type":"string","title":"Owneremail"},"ownerName":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ownername"},"gstin":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gstin"},"pan":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pan"},"currency":{"type":"string","title":"Currency","default":"INR"},"fyStartMonth":{"type":"integer","maximum":12.0,"minimum":1.0,"title":"Fystartmonth","default":4},"externalRef":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Externalref"},"tokenDescription":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tokendescription"},"scopes":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Scopes"},"isTest":{"type":"boolean","title":"Istest","default":false}},"type":"object","required":["name","state","ownerEmail"],"title":"ProvisionOrgRequest"},"PurchaseOrderLineItemCreate":{"properties":{"item_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Item Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"hsn_or_sac":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hsn Or Sac"},"quantity":{"type":"number","minimum":0.0,"title":"Quantity","default":1.0},"unit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unit"},"rate":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Rate"},"discount":{"type":"number","minimum":0.0,"title":"Discount","default":0.0},"tax_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Id"}},"additionalProperties":false,"type":"object","title":"PurchaseOrderLineItemCreate"},"PurchaseOrderPublicCreate":{"properties":{"vendor_id":{"type":"string","title":"Vendor Id"},"date":{"type":"string","format":"date-time","title":"Date"},"line_items":{"items":{"$ref":"#/components/schemas/PurchaseOrderLineItemCreate"},"type":"array","minItems":1,"title":"Line Items"},"purchase_order_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Purchase Order Number"},"expected_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expected Date"},"reference_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reference Number"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"status":{"type":"string","enum":["DRAFT","OPEN","BILLED","CANCELLED"],"title":"Status","default":"DRAFT"}},"additionalProperties":false,"type":"object","required":["vendor_id","date","line_items"],"title":"PurchaseOrderPublicCreate"},"PurchaseOrderPublicUpdate":{"properties":{"date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Date"},"expected_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expected Date"},"reference_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reference Number"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"status":{"anyOf":[{"type":"string","enum":["DRAFT","OPEN","BILLED","CANCELLED"]},{"type":"null"}],"title":"Status"}},"additionalProperties":false,"type":"object","title":"PurchaseOrderPublicUpdate"},"RecurringPublicCreate":{"properties":{"entity_type":{"type":"string","enum":["INVOICE","BILL","EXPENSE","JOURNAL"],"title":"Entity Type","description":"What kind of document this schedule emits."},"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"frequency":{"type":"string","enum":["DAILY","WEEKLY","MONTHLY","QUARTERLY","YEARLY"],"title":"Frequency"},"interval":{"type":"integer","minimum":1.0,"title":"Interval","description":"Every <interval> <frequency> units (e.g. every 2 WEEKLY).","default":1},"start_date":{"type":"string","format":"date","title":"Start Date"},"end_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"End Date"},"template_entity_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Template Entity Id","description":"Clone this existing document on every run. Mutually exclusive with template_payload."},"template_payload":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Template Payload","description":"Inline JSON template if you don't want to clone an existing doc."},"max_runs":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Max Runs"},"auto_charge":{"type":"boolean","title":"Auto Charge","default":false},"is_active":{"type":"boolean","title":"Is Active","default":true}},"additionalProperties":false,"type":"object","required":["entity_type","name","frequency","start_date"],"title":"RecurringPublicCreate"},"RecurringPublicUpdate":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"frequency":{"anyOf":[{"type":"string","enum":["DAILY","WEEKLY","MONTHLY","QUARTERLY","YEARLY"]},{"type":"null"}],"title":"Frequency"},"interval":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Interval"},"start_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Start Date"},"end_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"End Date"},"next_run_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Next Run At"},"template_entity_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Template Entity Id"},"template_payload":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Template Payload"},"max_runs":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Runs"},"auto_charge":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Auto Charge"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"}},"additionalProperties":false,"type":"object","title":"RecurringPublicUpdate"},"SalesOrderLineItemCreate":{"properties":{"item_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Item Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"hsn_or_sac":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hsn Or Sac"},"quantity":{"type":"number","minimum":0.0,"title":"Quantity","default":1.0},"unit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unit"},"rate":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Rate"},"discount":{"type":"number","minimum":0.0,"title":"Discount","default":0.0},"tax_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Id"}},"additionalProperties":false,"type":"object","title":"SalesOrderLineItemCreate"},"SalesOrderPublicCreate":{"properties":{"customer_id":{"type":"string","title":"Customer Id"},"date":{"type":"string","format":"date-time","title":"Date"},"line_items":{"items":{"$ref":"#/components/schemas/SalesOrderLineItemCreate"},"type":"array","minItems":1,"title":"Line Items"},"sales_order_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sales Order Number"},"shipment_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Shipment Date"},"reference_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reference Number"},"place_of_supply":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Place Of Supply"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"additionalProperties":false,"type":"object","required":["customer_id","date","line_items"],"title":"SalesOrderPublicCreate"},"SalesOrderPublicUpdate":{"properties":{"date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Date"},"shipment_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Shipment Date"},"reference_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reference Number"},"place_of_supply":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Place Of Supply"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"status":{"anyOf":[{"type":"string","enum":["DRAFT","OPEN","PARTIALLY_INVOICED","INVOICED","CLOSED","CANCELLED"]},{"type":"null"}],"title":"Status"}},"additionalProperties":false,"type":"object","title":"SalesOrderPublicUpdate"},"SalespersonPublicCreate":{"properties":{"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name"},"email":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Email"},"phone":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"title":"Phone"},"is_active":{"type":"boolean","title":"Is Active","default":true}},"additionalProperties":false,"type":"object","required":["name"],"title":"SalespersonPublicCreate"},"SalespersonPublicUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":200,"minLength":1},{"type":"null"}],"title":"Name"},"email":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Email"},"phone":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"title":"Phone"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"}},"additionalProperties":false,"type":"object","title":"SalespersonPublicUpdate","description":"Partial update — all fields optional."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"aibk_pat_… or aibk_oat_…","description":"Personal Access Tokens are minted from Settings → Developer in the UI. OAuth-issued access tokens come from the /oauth/token endpoint."}}},"servers":[{"url":"/api/public/v1","description":"Same host as the docs (this server)."}],"security":[{"BearerAuth":[]}]}