{"openapi":"3.0.0","x-id":["stub-server.handler/api"],"info":{"title":"stub Connect API","description":"openapi3 docs with [malli](https://github.com/metosin/malli) and reitit-ring","version":"1.0.1"},"paths":{"/mcp":{"post":{"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Send MCP JSON-RPC message (root endpoint)","description":"Main MCP endpoint at /mcp root. Accepts same JSON-RPC messages as /mcp/message. Supports token or apikey in tool arguments, or an API key sent as Authorization: Bearer <key>.","tags":["MCP (Model Context Protocol)"],"requestBody":{"description":"JSON-RPC 2.0 request envelope.","content":{"application/json":{"schema":{"type":"object","properties":{"jsonrpc":{"type":"string","description":"JSON-RPC protocol version","example":"2.0"},"id":{"description":"Request id (number or string); omitted for notifications"},"method":{"type":"string","description":"MCP method, e.g. initialize, tools/list, tools/call"},"params":{"type":"object","description":"Method parameters"}}},"example":{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"list_clients","arguments":{"token":"token_v2:..."}}}}}}},"options":{"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"tags":["MCP (Model Context Protocol)"]}},"/mcp/token":{"post":{"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Exchange API key for short-lived token","description":"Trade an MCP API key for a 1-hour token. Use this token in tool calls.","tags":["MCP (Model Context Protocol)"],"requestBody":{"description":"API key to exchange for a short-lived MCP token. The apikey may alternatively be supplied via an Authorization: Bearer header or an ?apikey query parameter.","content":{"application/json":{"schema":{"type":"object","properties":{"apikey":{"type":"string","description":"MCP API key (sk_test_v2:...)"}}},"example":{"apikey":"sk_test_..."}}}}},"options":{"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"tags":["MCP (Model Context Protocol)"]}},"/mcp/message":{"post":{"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Send MCP JSON-RPC message (deprecated alias of POST /mcp)","description":"Deprecated alias of POST /mcp. Supports token or apikey in tool arguments, or an API key sent as Authorization: Bearer <key>.","tags":["MCP (Model Context Protocol)"],"requestBody":{"description":"JSON-RPC 2.0 request envelope.","content":{"application/json":{"schema":{"type":"object","properties":{"jsonrpc":{"type":"string","description":"JSON-RPC protocol version","example":"2.0"},"id":{"description":"Request id (number or string); omitted for notifications"},"method":{"type":"string","description":"MCP method, e.g. initialize, tools/list, tools/call"},"params":{"type":"object","description":"Method parameters"}}},"example":{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"list_clients","arguments":{"token":"token_v2:..."}}}}}},"deprecated":true},"options":{"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"tags":["MCP (Model Context Protocol)"]}},"/mcp/sse":{"get":{"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Server-Sent Events stream for MCP","tags":["MCP (Model Context Protocol)"]}},"/api/profile":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Get profile","tags":["user profile"]}},"/api/profile/verify":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Start identity verification for the signed-in person","tags":["user profile"]}},"/api/auth/test":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string"},"password":{"type":"string"}},"required":["email","password"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"email":{"type":"string"},"password":{"type":"string"}},"required":["email","password"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"email":{"type":"string"},"password":{"type":"string"}},"required":["email","password"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"email":{"type":"string"},"password":{"type":"string"}},"required":["email","password"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Get token for test accounts. Email address must contain 'test'.","tags":["api access"]}},"/api/user/add":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"email":{"type":"string"},"role":{"oneOf":[{"type":"string","enum":["administrator","editor","sales","viewer","custom"]},{"type":"null"}]},"makeowner":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"grants":{"oneOf":[{"type":"object","additionalProperties":{"type":"array","items":{}}},{"type":"null"}]},"data":{"oneOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]}},"required":["token","email"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"email":{"type":"string"},"role":{"oneOf":[{"type":"string","enum":["administrator","editor","sales","viewer","custom"]},{"type":"null"}]},"makeowner":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"grants":{"oneOf":[{"type":"object","additionalProperties":{"type":"array","items":{}}},{"type":"null"}]},"data":{"oneOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]}},"required":["token","email"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"email":{"type":"string"},"role":{"oneOf":[{"type":"string","enum":["administrator","editor","sales","viewer","custom"]},{"type":"null"}]},"makeowner":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"grants":{"oneOf":[{"type":"object","additionalProperties":{"type":"array","items":{}}},{"type":"null"}]},"data":{"oneOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]}},"required":["token","email"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"email":{"type":"string"},"role":{"oneOf":[{"type":"string","enum":["administrator","editor","sales","viewer","custom"]},{"type":"null"}]},"makeowner":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"grants":{"oneOf":[{"type":"object","additionalProperties":{"type":"array","items":{}}},{"type":"null"}]},"data":{"oneOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]}},"required":["token","email"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Add user","tags":["user management"]}},"/api/user/create":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string"},"password":{"type":"string"},"firstname":{"oneOf":[{"type":"string"},{"type":"null"}]},"lastname":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["email","password"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"email":{"type":"string"},"password":{"type":"string"},"firstname":{"oneOf":[{"type":"string"},{"type":"null"}]},"lastname":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["email","password"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"email":{"type":"string"},"password":{"type":"string"},"firstname":{"oneOf":[{"type":"string"},{"type":"null"}]},"lastname":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["email","password"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"email":{"type":"string"},"password":{"type":"string"},"firstname":{"oneOf":[{"type":"string"},{"type":"null"}]},"lastname":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["email","password"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create user","tags":["user management"]}},"/api/user/update":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string","enum":["administrator","editor","sales","viewer","custom"]},{"type":"null"}]},"grants":{"oneOf":[{"type":"object","additionalProperties":{"type":"array","items":{}}},{"type":"null"}]},"data":{"oneOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string","enum":["administrator","editor","sales","viewer","custom"]},{"type":"null"}]},"grants":{"oneOf":[{"type":"object","additionalProperties":{"type":"array","items":{}}},{"type":"null"}]},"data":{"oneOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string","enum":["administrator","editor","sales","viewer","custom"]},{"type":"null"}]},"grants":{"oneOf":[{"type":"object","additionalProperties":{"type":"array","items":{}}},{"type":"null"}]},"data":{"oneOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string","enum":["administrator","editor","sales","viewer","custom"]},{"type":"null"}]},"grants":{"oneOf":[{"type":"object","additionalProperties":{"type":"array","items":{}}},{"type":"null"}]},"data":{"oneOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Update user","tags":["user management"]}},"/api/user/permissions":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Custom role feature catalogue","description":"The features a Custom member can be granted, the scopes the caller may grant on each, every predefined role expressed as grants, the roles the caller may give (assignable) and the ids of the members they may change (changeable).","tags":["user management"]}},"/api/user/remove":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Remove user","tags":["user management"]}},"/api/user/make-owner":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Make user an owner","tags":["user management"]}},"/api/user/remove-as-owner":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"profileuid":{"type":"string"},"id":{"type":"string"},"newrole":{"oneOf":[{"type":"string","enum":["","administrator","editor","sales","viewer","custom"]},{"type":"null"}]},"grants":{"oneOf":[{"type":"object","additionalProperties":{"type":"array","items":{}}},{"type":"null"}]},"data":{"oneOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"profileuid":{"type":"string"},"id":{"type":"string"},"newrole":{"oneOf":[{"type":"string","enum":["","administrator","editor","sales","viewer","custom"]},{"type":"null"}]},"grants":{"oneOf":[{"type":"object","additionalProperties":{"type":"array","items":{}}},{"type":"null"}]},"data":{"oneOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"profileuid":{"type":"string"},"id":{"type":"string"},"newrole":{"oneOf":[{"type":"string","enum":["","administrator","editor","sales","viewer","custom"]},{"type":"null"}]},"grants":{"oneOf":[{"type":"object","additionalProperties":{"type":"array","items":{}}},{"type":"null"}]},"data":{"oneOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"profileuid":{"type":"string"},"id":{"type":"string"},"newrole":{"oneOf":[{"type":"string","enum":["","administrator","editor","sales","viewer","custom"]},{"type":"null"}]},"grants":{"oneOf":[{"type":"object","additionalProperties":{"type":"array","items":{}}},{"type":"null"}]},"data":{"oneOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Remove as owner and make user an editor","tags":["user management"]}},"/api/user/pull-a-zuckerberg":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"profileuid":{"type":"string"},"id":{"type":"string"},"newrole":{"oneOf":[{"type":"string","enum":["","administrator","editor","sales","viewer","custom"]},{"type":"null"}]},"grants":{"oneOf":[{"type":"object","additionalProperties":{"type":"array","items":{}}},{"type":"null"}]},"data":{"oneOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"profileuid":{"type":"string"},"id":{"type":"string"},"newrole":{"oneOf":[{"type":"string","enum":["","administrator","editor","sales","viewer","custom"]},{"type":"null"}]},"grants":{"oneOf":[{"type":"object","additionalProperties":{"type":"array","items":{}}},{"type":"null"}]},"data":{"oneOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"profileuid":{"type":"string"},"id":{"type":"string"},"newrole":{"oneOf":[{"type":"string","enum":["","administrator","editor","sales","viewer","custom"]},{"type":"null"}]},"grants":{"oneOf":[{"type":"object","additionalProperties":{"type":"array","items":{}}},{"type":"null"}]},"data":{"oneOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"profileuid":{"type":"string"},"id":{"type":"string"},"newrole":{"oneOf":[{"type":"string","enum":["","administrator","editor","sales","viewer","custom"]},{"type":"null"}]},"grants":{"oneOf":[{"type":"object","additionalProperties":{"type":"array","items":{}}},{"type":"null"}]},"data":{"oneOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Remove as owner and make user an editor","tags":["user management"]}},"/api/user/deactivate":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Deactivate user","tags":["user management"]}},"/api/user/leave":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string"}},"required":["token","businessid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string"}},"required":["token","businessid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string"}},"required":["token","businessid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string"}},"required":["token","businessid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Leave business","tags":["user management"]}},"/api/user/subscribe":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string"},"firstname":{"oneOf":[{"type":"string"},{"type":"null"}]},"lastname":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["email"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"email":{"type":"string"},"firstname":{"oneOf":[{"type":"string"},{"type":"null"}]},"lastname":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["email"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"email":{"type":"string"},"firstname":{"oneOf":[{"type":"string"},{"type":"null"}]},"lastname":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["email"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"email":{"type":"string"},"firstname":{"oneOf":[{"type":"string"},{"type":"null"}]},"lastname":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["email"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"subscribe to our mailing list","tags":["user management"]}},"/api/business/add":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"business":{"type":"string"},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"industry":{"oneOf":[{"type":"string"},{"type":"null"}]},"utmid":{"description":"Marketing attribution: utm_id of the signup campaign.","oneOf":[{"type":"string"},{"type":"null"}]},"utmsource":{"description":"Marketing attribution: utm_source.","oneOf":[{"type":"string"},{"type":"null"}]},"utmmedium":{"description":"Marketing attribution: utm_medium.","oneOf":[{"type":"string"},{"type":"null"}]},"utmcampaign":{"description":"Marketing attribution: utm_campaign — the campaign name (utmid carries the id).","oneOf":[{"type":"string"},{"type":"null"}]},"utmcontent":{"description":"Marketing attribution: utm_content (creative within a campaign).","oneOf":[{"type":"string"},{"type":"null"}]},"utmterm":{"description":"Marketing attribution: utm_term (paid-search keyword).","oneOf":[{"type":"string"},{"type":"null"}]},"landingpage":{"description":"Slug of the /lp/ campaign page the signup arrived on (prefix stripped).","oneOf":[{"type":"string"},{"type":"null"}]},"clickid":{"description":"Ad-platform click ID (gclid/fbclid/ttclid/... value) for returning the conversion to the platform.","oneOf":[{"type":"string"},{"type":"null"}]},"clickidtype":{"description":"Which platform :clickid came from — gclid/gbraid/wbraid/fbclid/ttclid/oppref/li_fat_id. Free string, not a server-enforced enum.","oneOf":[{"type":"string"},{"type":"null"}]},"clickidat":{"description":"ISO-8601 capture time of :clickid (client clock, already filtered to <=90 days at source).","oneOf":[{"type":"string"},{"type":"null"}]},"referrer":{"description":"How the business was referred (referral source).","oneOf":[{"type":"string"},{"type":"null"}]},"consent":{"description":"Measurement/analytics consent timestamp (ISO 8601), sent only when the owner gave consent (POPIA). Omit for the no-consent state.","oneOf":[{"type":"string"},{"type":"null"}]},"consentip":{"description":"IP address the measurement consent was given from (POPIA); pairs with :consent, and may be omitted when the client could not determine it.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["business"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"business":{"type":"string"},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"industry":{"oneOf":[{"type":"string"},{"type":"null"}]},"utmid":{"description":"Marketing attribution: utm_id of the signup campaign.","oneOf":[{"type":"string"},{"type":"null"}]},"utmsource":{"description":"Marketing attribution: utm_source.","oneOf":[{"type":"string"},{"type":"null"}]},"utmmedium":{"description":"Marketing attribution: utm_medium.","oneOf":[{"type":"string"},{"type":"null"}]},"utmcampaign":{"description":"Marketing attribution: utm_campaign — the campaign name (utmid carries the id).","oneOf":[{"type":"string"},{"type":"null"}]},"utmcontent":{"description":"Marketing attribution: utm_content (creative within a campaign).","oneOf":[{"type":"string"},{"type":"null"}]},"utmterm":{"description":"Marketing attribution: utm_term (paid-search keyword).","oneOf":[{"type":"string"},{"type":"null"}]},"landingpage":{"description":"Slug of the /lp/ campaign page the signup arrived on (prefix stripped).","oneOf":[{"type":"string"},{"type":"null"}]},"clickid":{"description":"Ad-platform click ID (gclid/fbclid/ttclid/... value) for returning the conversion to the platform.","oneOf":[{"type":"string"},{"type":"null"}]},"clickidtype":{"description":"Which platform :clickid came from — gclid/gbraid/wbraid/fbclid/ttclid/oppref/li_fat_id. Free string, not a server-enforced enum.","oneOf":[{"type":"string"},{"type":"null"}]},"clickidat":{"description":"ISO-8601 capture time of :clickid (client clock, already filtered to <=90 days at source).","oneOf":[{"type":"string"},{"type":"null"}]},"referrer":{"description":"How the business was referred (referral source).","oneOf":[{"type":"string"},{"type":"null"}]},"consent":{"description":"Measurement/analytics consent timestamp (ISO 8601), sent only when the owner gave consent (POPIA). Omit for the no-consent state.","oneOf":[{"type":"string"},{"type":"null"}]},"consentip":{"description":"IP address the measurement consent was given from (POPIA); pairs with :consent, and may be omitted when the client could not determine it.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["business"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"business":{"type":"string"},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"industry":{"oneOf":[{"type":"string"},{"type":"null"}]},"utmid":{"description":"Marketing attribution: utm_id of the signup campaign.","oneOf":[{"type":"string"},{"type":"null"}]},"utmsource":{"description":"Marketing attribution: utm_source.","oneOf":[{"type":"string"},{"type":"null"}]},"utmmedium":{"description":"Marketing attribution: utm_medium.","oneOf":[{"type":"string"},{"type":"null"}]},"utmcampaign":{"description":"Marketing attribution: utm_campaign — the campaign name (utmid carries the id).","oneOf":[{"type":"string"},{"type":"null"}]},"utmcontent":{"description":"Marketing attribution: utm_content (creative within a campaign).","oneOf":[{"type":"string"},{"type":"null"}]},"utmterm":{"description":"Marketing attribution: utm_term (paid-search keyword).","oneOf":[{"type":"string"},{"type":"null"}]},"landingpage":{"description":"Slug of the /lp/ campaign page the signup arrived on (prefix stripped).","oneOf":[{"type":"string"},{"type":"null"}]},"clickid":{"description":"Ad-platform click ID (gclid/fbclid/ttclid/... value) for returning the conversion to the platform.","oneOf":[{"type":"string"},{"type":"null"}]},"clickidtype":{"description":"Which platform :clickid came from — gclid/gbraid/wbraid/fbclid/ttclid/oppref/li_fat_id. Free string, not a server-enforced enum.","oneOf":[{"type":"string"},{"type":"null"}]},"clickidat":{"description":"ISO-8601 capture time of :clickid (client clock, already filtered to <=90 days at source).","oneOf":[{"type":"string"},{"type":"null"}]},"referrer":{"description":"How the business was referred (referral source).","oneOf":[{"type":"string"},{"type":"null"}]},"consent":{"description":"Measurement/analytics consent timestamp (ISO 8601), sent only when the owner gave consent (POPIA). Omit for the no-consent state.","oneOf":[{"type":"string"},{"type":"null"}]},"consentip":{"description":"IP address the measurement consent was given from (POPIA); pairs with :consent, and may be omitted when the client could not determine it.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["business"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"business":{"type":"string"},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"industry":{"oneOf":[{"type":"string"},{"type":"null"}]},"utmid":{"description":"Marketing attribution: utm_id of the signup campaign.","oneOf":[{"type":"string"},{"type":"null"}]},"utmsource":{"description":"Marketing attribution: utm_source.","oneOf":[{"type":"string"},{"type":"null"}]},"utmmedium":{"description":"Marketing attribution: utm_medium.","oneOf":[{"type":"string"},{"type":"null"}]},"utmcampaign":{"description":"Marketing attribution: utm_campaign — the campaign name (utmid carries the id).","oneOf":[{"type":"string"},{"type":"null"}]},"utmcontent":{"description":"Marketing attribution: utm_content (creative within a campaign).","oneOf":[{"type":"string"},{"type":"null"}]},"utmterm":{"description":"Marketing attribution: utm_term (paid-search keyword).","oneOf":[{"type":"string"},{"type":"null"}]},"landingpage":{"description":"Slug of the /lp/ campaign page the signup arrived on (prefix stripped).","oneOf":[{"type":"string"},{"type":"null"}]},"clickid":{"description":"Ad-platform click ID (gclid/fbclid/ttclid/... value) for returning the conversion to the platform.","oneOf":[{"type":"string"},{"type":"null"}]},"clickidtype":{"description":"Which platform :clickid came from — gclid/gbraid/wbraid/fbclid/ttclid/oppref/li_fat_id. Free string, not a server-enforced enum.","oneOf":[{"type":"string"},{"type":"null"}]},"clickidat":{"description":"ISO-8601 capture time of :clickid (client clock, already filtered to <=90 days at source).","oneOf":[{"type":"string"},{"type":"null"}]},"referrer":{"description":"How the business was referred (referral source).","oneOf":[{"type":"string"},{"type":"null"}]},"consent":{"description":"Measurement/analytics consent timestamp (ISO 8601), sent only when the owner gave consent (POPIA). Omit for the no-consent state.","oneOf":[{"type":"string"},{"type":"null"}]},"consentip":{"description":"IP address the measurement consent was given from (POPIA); pairs with :consent, and may be omitted when the client could not determine it.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["business"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Add business profile","tags":["business management"]}},"/api/business/create":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"business":{"description":"Trading / display name of the new business.","type":"string"},"firstname":{"description":"Owner's first name.","type":"string"},"lastname":{"description":"Owner's last name.","type":"string"},"email":{"description":"Owner's email address; becomes the login and where verification is sent.","type":"string"},"phone":{"description":"Owner / business contact phone number.","oneOf":[{"type":"string"},{"type":"null"}]},"password":{"description":"Password for the new owner account (plaintext over TLS; hashed server-side).","type":"string"},"openingbalance":{"description":"Opening cash / bank balance carried into the books, in the base currency.","oneOf":[{"type":"number"},{"type":"null"}]},"experience":{"description":"Founder's business / industry experience (label).","oneOf":[{"type":"string"},{"type":"null"}]},"financialstartday":{"description":"Day of the month the financial year starts (1-31).","oneOf":[{"type":"number"},{"type":"null"}]},"financialstartmonth":{"description":"Month the financial year starts: a month name (MARCH) or its number 1-12.","oneOf":[{"anyOf":[{"type":"string"},{"type":"integer"}]},{"type":"null"}]},"customizations":{"description":"JSON string of initial UI / branding customizations.","oneOf":[{"type":"string"},{"type":"null"}]},"referrer":{"description":"How the business was referred (referral source).","oneOf":[{"type":"string"},{"type":"null"}]},"product":{"description":"Whether the business sells products (goods).","oneOf":[{"type":"boolean"},{"type":"null"}]},"service":{"description":"Whether the business sells services.","oneOf":[{"type":"boolean"},{"type":"null"}]},"charity":{"description":"Whether the business is a charity / non-profit.","oneOf":[{"type":"boolean"},{"type":"null"}]},"source":{"description":"Signup source / channel.","oneOf":[{"type":"string"},{"type":"null"}]},"trial":{"description":"Whether to start the account on a trial plan.","oneOf":[{"type":"boolean"},{"type":"null"}]},"utmid":{"description":"Marketing attribution: utm_id of the signup campaign.","oneOf":[{"type":"string"},{"type":"null"}]},"utmsource":{"description":"Marketing attribution: utm_source.","oneOf":[{"type":"string"},{"type":"null"}]},"utmmedium":{"description":"Marketing attribution: utm_medium.","oneOf":[{"type":"string"},{"type":"null"}]},"utmcampaign":{"description":"Marketing attribution: utm_campaign — the campaign name (utmid carries the id).","oneOf":[{"type":"string"},{"type":"null"}]},"utmcontent":{"description":"Marketing attribution: utm_content (creative within a campaign).","oneOf":[{"type":"string"},{"type":"null"}]},"utmterm":{"description":"Marketing attribution: utm_term (paid-search keyword).","oneOf":[{"type":"string"},{"type":"null"}]},"landingpage":{"description":"Slug of the /lp/ campaign page the signup arrived on (prefix stripped).","oneOf":[{"type":"string"},{"type":"null"}]},"clickid":{"description":"Ad-platform click ID (gclid/fbclid/ttclid/... value) for returning the conversion to the platform.","oneOf":[{"type":"string"},{"type":"null"}]},"clickidtype":{"description":"Which platform :clickid came from — gclid/gbraid/wbraid/fbclid/ttclid/oppref/li_fat_id. Free string, not a server-enforced enum.","oneOf":[{"type":"string"},{"type":"null"}]},"clickidat":{"description":"ISO-8601 capture time of :clickid (client clock, already filtered to <=90 days at source).","oneOf":[{"type":"string"},{"type":"null"}]},"consent":{"description":"Measurement/analytics consent timestamp (ISO 8601), sent only when the founder gave consent (POPIA). Omit for the no-consent state.","oneOf":[{"type":"string"},{"type":"null"}]},"consentip":{"description":"IP address the measurement consent was given from (POPIA); pairs with :consent.","oneOf":[{"type":"string"},{"type":"null"}]},"installkey":{"description":"One-time key from an app-initiated OAuth callback, to attach the new business to that app install.","oneOf":[{"type":"string"},{"type":"null"}]},"region":{"description":"The region the founder picked at sign-up, as stub-web shows it. Saved as :business/region. PROD-3639.","oneOf":[{"type":"string"},{"type":"null"}]},"jurisdiction":{"description":"The country the new business keeps the rules of, as a two-letter ISO 3166-1 code. PROD-3601.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["business","firstname","lastname","email","password"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"business":{"description":"Trading / display name of the new business.","type":"string"},"firstname":{"description":"Owner's first name.","type":"string"},"lastname":{"description":"Owner's last name.","type":"string"},"email":{"description":"Owner's email address; becomes the login and where verification is sent.","type":"string"},"phone":{"description":"Owner / business contact phone number.","oneOf":[{"type":"string"},{"type":"null"}]},"password":{"description":"Password for the new owner account (plaintext over TLS; hashed server-side).","type":"string"},"openingbalance":{"description":"Opening cash / bank balance carried into the books, in the base currency.","oneOf":[{"type":"number"},{"type":"null"}]},"experience":{"description":"Founder's business / industry experience (label).","oneOf":[{"type":"string"},{"type":"null"}]},"financialstartday":{"description":"Day of the month the financial year starts (1-31).","oneOf":[{"type":"number"},{"type":"null"}]},"financialstartmonth":{"description":"Month the financial year starts: a month name (MARCH) or its number 1-12.","oneOf":[{"anyOf":[{"type":"string"},{"type":"integer"}]},{"type":"null"}]},"customizations":{"description":"JSON string of initial UI / branding customizations.","oneOf":[{"type":"string"},{"type":"null"}]},"referrer":{"description":"How the business was referred (referral source).","oneOf":[{"type":"string"},{"type":"null"}]},"product":{"description":"Whether the business sells products (goods).","oneOf":[{"type":"boolean"},{"type":"null"}]},"service":{"description":"Whether the business sells services.","oneOf":[{"type":"boolean"},{"type":"null"}]},"charity":{"description":"Whether the business is a charity / non-profit.","oneOf":[{"type":"boolean"},{"type":"null"}]},"source":{"description":"Signup source / channel.","oneOf":[{"type":"string"},{"type":"null"}]},"trial":{"description":"Whether to start the account on a trial plan.","oneOf":[{"type":"boolean"},{"type":"null"}]},"utmid":{"description":"Marketing attribution: utm_id of the signup campaign.","oneOf":[{"type":"string"},{"type":"null"}]},"utmsource":{"description":"Marketing attribution: utm_source.","oneOf":[{"type":"string"},{"type":"null"}]},"utmmedium":{"description":"Marketing attribution: utm_medium.","oneOf":[{"type":"string"},{"type":"null"}]},"utmcampaign":{"description":"Marketing attribution: utm_campaign — the campaign name (utmid carries the id).","oneOf":[{"type":"string"},{"type":"null"}]},"utmcontent":{"description":"Marketing attribution: utm_content (creative within a campaign).","oneOf":[{"type":"string"},{"type":"null"}]},"utmterm":{"description":"Marketing attribution: utm_term (paid-search keyword).","oneOf":[{"type":"string"},{"type":"null"}]},"landingpage":{"description":"Slug of the /lp/ campaign page the signup arrived on (prefix stripped).","oneOf":[{"type":"string"},{"type":"null"}]},"clickid":{"description":"Ad-platform click ID (gclid/fbclid/ttclid/... value) for returning the conversion to the platform.","oneOf":[{"type":"string"},{"type":"null"}]},"clickidtype":{"description":"Which platform :clickid came from — gclid/gbraid/wbraid/fbclid/ttclid/oppref/li_fat_id. Free string, not a server-enforced enum.","oneOf":[{"type":"string"},{"type":"null"}]},"clickidat":{"description":"ISO-8601 capture time of :clickid (client clock, already filtered to <=90 days at source).","oneOf":[{"type":"string"},{"type":"null"}]},"consent":{"description":"Measurement/analytics consent timestamp (ISO 8601), sent only when the founder gave consent (POPIA). Omit for the no-consent state.","oneOf":[{"type":"string"},{"type":"null"}]},"consentip":{"description":"IP address the measurement consent was given from (POPIA); pairs with :consent.","oneOf":[{"type":"string"},{"type":"null"}]},"installkey":{"description":"One-time key from an app-initiated OAuth callback, to attach the new business to that app install.","oneOf":[{"type":"string"},{"type":"null"}]},"region":{"description":"The region the founder picked at sign-up, as stub-web shows it. Saved as :business/region. PROD-3639.","oneOf":[{"type":"string"},{"type":"null"}]},"jurisdiction":{"description":"The country the new business keeps the rules of, as a two-letter ISO 3166-1 code. PROD-3601.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["business","firstname","lastname","email","password"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"business":{"description":"Trading / display name of the new business.","type":"string"},"firstname":{"description":"Owner's first name.","type":"string"},"lastname":{"description":"Owner's last name.","type":"string"},"email":{"description":"Owner's email address; becomes the login and where verification is sent.","type":"string"},"phone":{"description":"Owner / business contact phone number.","oneOf":[{"type":"string"},{"type":"null"}]},"password":{"description":"Password for the new owner account (plaintext over TLS; hashed server-side).","type":"string"},"openingbalance":{"description":"Opening cash / bank balance carried into the books, in the base currency.","oneOf":[{"type":"number"},{"type":"null"}]},"experience":{"description":"Founder's business / industry experience (label).","oneOf":[{"type":"string"},{"type":"null"}]},"financialstartday":{"description":"Day of the month the financial year starts (1-31).","oneOf":[{"type":"number"},{"type":"null"}]},"financialstartmonth":{"description":"Month the financial year starts: a month name (MARCH) or its number 1-12.","oneOf":[{"anyOf":[{"type":"string"},{"type":"integer"}]},{"type":"null"}]},"customizations":{"description":"JSON string of initial UI / branding customizations.","oneOf":[{"type":"string"},{"type":"null"}]},"referrer":{"description":"How the business was referred (referral source).","oneOf":[{"type":"string"},{"type":"null"}]},"product":{"description":"Whether the business sells products (goods).","oneOf":[{"type":"boolean"},{"type":"null"}]},"service":{"description":"Whether the business sells services.","oneOf":[{"type":"boolean"},{"type":"null"}]},"charity":{"description":"Whether the business is a charity / non-profit.","oneOf":[{"type":"boolean"},{"type":"null"}]},"source":{"description":"Signup source / channel.","oneOf":[{"type":"string"},{"type":"null"}]},"trial":{"description":"Whether to start the account on a trial plan.","oneOf":[{"type":"boolean"},{"type":"null"}]},"utmid":{"description":"Marketing attribution: utm_id of the signup campaign.","oneOf":[{"type":"string"},{"type":"null"}]},"utmsource":{"description":"Marketing attribution: utm_source.","oneOf":[{"type":"string"},{"type":"null"}]},"utmmedium":{"description":"Marketing attribution: utm_medium.","oneOf":[{"type":"string"},{"type":"null"}]},"utmcampaign":{"description":"Marketing attribution: utm_campaign — the campaign name (utmid carries the id).","oneOf":[{"type":"string"},{"type":"null"}]},"utmcontent":{"description":"Marketing attribution: utm_content (creative within a campaign).","oneOf":[{"type":"string"},{"type":"null"}]},"utmterm":{"description":"Marketing attribution: utm_term (paid-search keyword).","oneOf":[{"type":"string"},{"type":"null"}]},"landingpage":{"description":"Slug of the /lp/ campaign page the signup arrived on (prefix stripped).","oneOf":[{"type":"string"},{"type":"null"}]},"clickid":{"description":"Ad-platform click ID (gclid/fbclid/ttclid/... value) for returning the conversion to the platform.","oneOf":[{"type":"string"},{"type":"null"}]},"clickidtype":{"description":"Which platform :clickid came from — gclid/gbraid/wbraid/fbclid/ttclid/oppref/li_fat_id. Free string, not a server-enforced enum.","oneOf":[{"type":"string"},{"type":"null"}]},"clickidat":{"description":"ISO-8601 capture time of :clickid (client clock, already filtered to <=90 days at source).","oneOf":[{"type":"string"},{"type":"null"}]},"consent":{"description":"Measurement/analytics consent timestamp (ISO 8601), sent only when the founder gave consent (POPIA). Omit for the no-consent state.","oneOf":[{"type":"string"},{"type":"null"}]},"consentip":{"description":"IP address the measurement consent was given from (POPIA); pairs with :consent.","oneOf":[{"type":"string"},{"type":"null"}]},"installkey":{"description":"One-time key from an app-initiated OAuth callback, to attach the new business to that app install.","oneOf":[{"type":"string"},{"type":"null"}]},"region":{"description":"The region the founder picked at sign-up, as stub-web shows it. Saved as :business/region. PROD-3639.","oneOf":[{"type":"string"},{"type":"null"}]},"jurisdiction":{"description":"The country the new business keeps the rules of, as a two-letter ISO 3166-1 code. PROD-3601.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["business","firstname","lastname","email","password"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"business":{"description":"Trading / display name of the new business.","type":"string"},"firstname":{"description":"Owner's first name.","type":"string"},"lastname":{"description":"Owner's last name.","type":"string"},"email":{"description":"Owner's email address; becomes the login and where verification is sent.","type":"string"},"phone":{"description":"Owner / business contact phone number.","oneOf":[{"type":"string"},{"type":"null"}]},"password":{"description":"Password for the new owner account (plaintext over TLS; hashed server-side).","type":"string"},"openingbalance":{"description":"Opening cash / bank balance carried into the books, in the base currency.","oneOf":[{"type":"number"},{"type":"null"}]},"experience":{"description":"Founder's business / industry experience (label).","oneOf":[{"type":"string"},{"type":"null"}]},"financialstartday":{"description":"Day of the month the financial year starts (1-31).","oneOf":[{"type":"number"},{"type":"null"}]},"financialstartmonth":{"description":"Month the financial year starts: a month name (MARCH) or its number 1-12.","oneOf":[{"anyOf":[{"type":"string"},{"type":"integer"}]},{"type":"null"}]},"customizations":{"description":"JSON string of initial UI / branding customizations.","oneOf":[{"type":"string"},{"type":"null"}]},"referrer":{"description":"How the business was referred (referral source).","oneOf":[{"type":"string"},{"type":"null"}]},"product":{"description":"Whether the business sells products (goods).","oneOf":[{"type":"boolean"},{"type":"null"}]},"service":{"description":"Whether the business sells services.","oneOf":[{"type":"boolean"},{"type":"null"}]},"charity":{"description":"Whether the business is a charity / non-profit.","oneOf":[{"type":"boolean"},{"type":"null"}]},"source":{"description":"Signup source / channel.","oneOf":[{"type":"string"},{"type":"null"}]},"trial":{"description":"Whether to start the account on a trial plan.","oneOf":[{"type":"boolean"},{"type":"null"}]},"utmid":{"description":"Marketing attribution: utm_id of the signup campaign.","oneOf":[{"type":"string"},{"type":"null"}]},"utmsource":{"description":"Marketing attribution: utm_source.","oneOf":[{"type":"string"},{"type":"null"}]},"utmmedium":{"description":"Marketing attribution: utm_medium.","oneOf":[{"type":"string"},{"type":"null"}]},"utmcampaign":{"description":"Marketing attribution: utm_campaign — the campaign name (utmid carries the id).","oneOf":[{"type":"string"},{"type":"null"}]},"utmcontent":{"description":"Marketing attribution: utm_content (creative within a campaign).","oneOf":[{"type":"string"},{"type":"null"}]},"utmterm":{"description":"Marketing attribution: utm_term (paid-search keyword).","oneOf":[{"type":"string"},{"type":"null"}]},"landingpage":{"description":"Slug of the /lp/ campaign page the signup arrived on (prefix stripped).","oneOf":[{"type":"string"},{"type":"null"}]},"clickid":{"description":"Ad-platform click ID (gclid/fbclid/ttclid/... value) for returning the conversion to the platform.","oneOf":[{"type":"string"},{"type":"null"}]},"clickidtype":{"description":"Which platform :clickid came from — gclid/gbraid/wbraid/fbclid/ttclid/oppref/li_fat_id. Free string, not a server-enforced enum.","oneOf":[{"type":"string"},{"type":"null"}]},"clickidat":{"description":"ISO-8601 capture time of :clickid (client clock, already filtered to <=90 days at source).","oneOf":[{"type":"string"},{"type":"null"}]},"consent":{"description":"Measurement/analytics consent timestamp (ISO 8601), sent only when the founder gave consent (POPIA). Omit for the no-consent state.","oneOf":[{"type":"string"},{"type":"null"}]},"consentip":{"description":"IP address the measurement consent was given from (POPIA); pairs with :consent.","oneOf":[{"type":"string"},{"type":"null"}]},"installkey":{"description":"One-time key from an app-initiated OAuth callback, to attach the new business to that app install.","oneOf":[{"type":"string"},{"type":"null"}]},"region":{"description":"The region the founder picked at sign-up, as stub-web shows it. Saved as :business/region. PROD-3639.","oneOf":[{"type":"string"},{"type":"null"}]},"jurisdiction":{"description":"The country the new business keeps the rules of, as a two-letter ISO 3166-1 code. PROD-3601.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["business","firstname","lastname","email","password"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create business profile","tags":["business management"]}},"/api/business/confirm":{"get":{"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Confirm business email","tags":["business management"]}},"/api/business/confirm-email":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string"},"otp":{"type":"string"}},"required":["email","otp"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"email":{"type":"string"},"otp":{"type":"string"}},"required":["email","otp"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"email":{"type":"string"},"otp":{"type":"string"}},"required":["email","otp"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"email":{"type":"string"},"otp":{"type":"string"}},"required":["email","otp"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Confirm business email","tags":["business management"]}},"/api/business/refresh":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Clear the business's cached data so the next read recomputes from source. Call when data appears stale — e.g. a recent change isn't reflected in reads.","tags":["business management"]}},"/api/business/rotate-apikey":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Rotate the business API key. Invalidates the current key and every previously-issued key for this business, then returns a fresh one. Use when a key may be compromised.","tags":["business management"]}},"/api/business/mcp-connections":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"List this business's active MCP (AI assistant) connections. Each entry is one OAuth grant the owner approved; revoking is a separate call.","tags":["business management"]}},"/api/business/mcp-connections/revoke-all":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Revoke EVERY active MCP (AI assistant) connection for this business. Existing access tokens stop refreshing; any already-issued one expires within the hour.","tags":["business management"]}},"/api/business/mcp-connections/revoke":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"connectionid":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","connectionid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"connectionid":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","connectionid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"connectionid":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","connectionid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"connectionid":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","connectionid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Revoke a single MCP (AI assistant) connection by its connection id. Existing access tokens stop refreshing; any already-issued one expires within the hour.","tags":["business management"]}},"/api/business/delete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Delete business and profile","tags":["business management"]}},"/api/business/change-email":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string"},"token":{"type":"string"}},"required":["email","token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"email":{"type":"string"},"token":{"type":"string"}},"required":["email","token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"email":{"type":"string"},"token":{"type":"string"}},"required":["email","token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"email":{"type":"string"},"token":{"type":"string"}},"required":["email","token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Change businessemail","tags":["business management"]}},"/api/business/delete-business-only":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Delete business only","tags":["business management"]}},"/api/business/request-reset":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Request business data reset","tags":["business management"]}},"/api/business/confirm-reset":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"otp":{"type":"string"}},"required":["token","otp"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"otp":{"type":"string"}},"required":["token","otp"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"otp":{"type":"string"}},"required":["token","otp"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"otp":{"type":"string"}},"required":["token","otp"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Confirm business data reset with OTP","tags":["business management"]}},"/api/business/verify":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Start business verification (FICA) before enabling payments","tags":["business management"]}},"/api/business/trust":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"The business's trust profile — the six checks that gate payments in and out, and where this business stands on each","tags":["business management"]}},"/api/business/verify-business":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"registrationnumber":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"registrationnumber":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"registrationnumber":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"registrationnumber":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Start verification of the business itself — returns the hosted link that verifies the company","tags":["business management"]}},"/api/business/kyb":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Where the business's company-document check stands","tags":["business management"]}},"/api/business/kyb/submit":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"folderid":{"type":"string"},"documents":{"type":"array","items":{"type":"object","properties":{"fileid":{"type":"string"},"kind":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["fileid"],"additionalProperties":false}}},"required":["token","folderid","documents"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"folderid":{"type":"string"},"documents":{"type":"array","items":{"type":"object","properties":{"fileid":{"type":"string"},"kind":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["fileid"],"additionalProperties":false}}},"required":["token","folderid","documents"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"folderid":{"type":"string"},"documents":{"type":"array","items":{"type":"object","properties":{"fileid":{"type":"string"},"kind":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["fileid"],"additionalProperties":false}}},"required":["token","folderid","documents"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"folderid":{"type":"string"},"documents":{"type":"array","items":{"type":"object","properties":{"fileid":{"type":"string"},"kind":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["fileid"],"additionalProperties":false}}},"required":["token","folderid","documents"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Point the company check at documents in a locked vault folder","tags":["business management"]}},"/api/business/update":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"This business's id. Optional — defaults to the authenticated token's own business; supply only to target a specific business.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Trading / display name of the business.","oneOf":[{"type":"string"},{"type":"null"}]},"tag":{"description":"Unique public vanity tag/slug for the business (used in its public page URL and for segmentation).","oneOf":[{"type":"string"},{"type":"null"}]},"vanitypageaction":{"description":"Call-to-action mode for the business's public vanity page, e.g. \"donate\" or \"pay\".","oneOf":[{"type":"string"},{"type":"null"}]},"about":{"description":"Short description / bio of the business shown on public pages.","oneOf":[{"type":"string"},{"type":"null"}]},"twitchid":{"description":"Twitch channel id, for the Twitch / streamer integration.","oneOf":[{"type":"string"},{"type":"null"}]},"invoicenotes":{"description":"Default notes text placed on new invoices.","oneOf":[{"type":"string"},{"type":"null"}]},"paymentterms":{"description":"Default payment terms in whole days (0-365); a new invoice's due date defaults to its date plus this. PROD-3628.","oneOf":[{"type":"integer","minimum":0,"maximum":365},{"type":"null"}]},"invoicemessage":{"description":"Default customer-facing message on new invoices.","oneOf":[{"type":"string"},{"type":"null"}]},"quotenotes":{"description":"Default notes text placed on new quotes.","oneOf":[{"type":"string"},{"type":"null"}]},"quotemessage":{"description":"Default customer-facing message on new quotes.","oneOf":[{"type":"string"},{"type":"null"}]},"logo":{"description":"Business logo image URL (or data URI).","oneOf":[{"type":"string"},{"type":"null"}]},"website":{"description":"Business website URL.","oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"description":"Business contact phone number.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"description":"Street address line 1.","oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"description":"Street address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"description":"Suburb.","oneOf":[{"type":"string"},{"type":"null"}]},"city":{"description":"City / town.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"description":"Postal / ZIP code.","oneOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"Country (name or code).","oneOf":[{"type":"string"},{"type":"null"}]},"region":{"description":"State / province / region.","oneOf":[{"type":"string"},{"type":"null"}]},"industry":{"description":"Industry the business operates in.","oneOf":[{"type":"string"},{"type":"null"}]},"employees":{"description":"Number of employees (as a label / band).","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"Business base currency, ISO 4217 (e.g. \"ZAR\", \"USD\").","oneOf":[{"type":"string"},{"type":"null"}]},"turnover":{"description":"Annual turnover in the base currency.","oneOf":[{"type":"number"},{"type":"null"}]},"openingbalance":{"description":"Opening cash / bank balance carried into the books, in the base currency.","oneOf":[{"type":"number"},{"type":"null"}]},"age":{"description":"Age of the business (label, e.g. how long it has been trading).","oneOf":[{"type":"string"},{"type":"null"}]},"experience":{"description":"Founder's business / industry experience (label).","oneOf":[{"type":"string"},{"type":"null"}]},"financialstartday":{"description":"Day of the month the financial year starts (1-31).","oneOf":[{"type":"number"},{"type":"null"}]},"financialstartmonth":{"description":"Month the financial year starts: a month name (MARCH) or its number 1-12.","oneOf":[{"anyOf":[{"type":"string"},{"type":"integer"}]},{"type":"null"}]},"registrationnumber":{"description":"Company registration number.","oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"description":"VAT registration number.","oneOf":[{"type":"string"},{"type":"null"}]},"incometaxnumber":{"description":"Income-tax reference number.","oneOf":[{"type":"string"},{"type":"null"}]},"vatbasis":{"description":"When VAT lands on a return: invoice (the default) or payments.","oneOf":[{"type":"string","enum":["invoice","payments"]},{"type":"null"}]},"payenumber":{"description":"PAYE (payroll income-tax) reference number.","oneOf":[{"type":"string"},{"type":"null"}]},"uifnumber":{"description":"UIF (unemployment insurance fund) reference number.","oneOf":[{"type":"string"},{"type":"null"}]},"sdlnumber":{"description":"SDL (skills development levy) reference number.","oneOf":[{"type":"string"},{"type":"null"}]},"taxregime":{"description":"Tax regime the business is registered under.","oneOf":[{"type":"string"},{"type":"null"}]},"tradesourcecode":{"description":"SARS trade / source code classifying the business's main activity.","oneOf":[{"type":"string"},{"type":"null"}]},"accountname":{"description":"Bank account holder name shown on invoices.","oneOf":[{"type":"string"},{"type":"null"}]},"bank":{"description":"Bank name for the account shown on invoices.","oneOf":[{"type":"string"},{"type":"null"}]},"accountnumber":{"description":"Bank account number shown on invoices.","oneOf":[{"type":"string"},{"type":"null"}]},"accounttype":{"description":"Bank account type (e.g. \"cheque\", \"savings\").","oneOf":[{"type":"string"},{"type":"null"}]},"branchcode":{"description":"Bank branch code shown on invoices.","oneOf":[{"type":"string"},{"type":"null"}]},"showbank":{"description":"Whether to show the business's bank details on invoices.","oneOf":[{"type":"boolean"},{"type":"null"}]},"invoicebankid":{"description":"Id of the bank account to display on invoices.","oneOf":[{"type":"string"},{"type":"null"}]},"paymentbankid":{"description":"Id of the bank account payments are collected into.","oneOf":[{"type":"string"},{"type":"null"}]},"streamelementsid":{"description":"StreamElements account id, for the StreamElements integration.","oneOf":[{"type":"string"},{"type":"null"}]},"streamelementsjwt":{"description":"StreamElements JWT credential for the integration.","oneOf":[{"type":"string"},{"type":"null"}]},"customizations":{"description":"JSON string of UI / branding customizations for the business.","oneOf":[{"type":"string"},{"type":"null"}]},"webhook":{"description":"Webhook URL to notify on business events.","oneOf":[{"type":"string"},{"type":"null"}]},"invoiceoffset":{"description":"Starting offset added to auto-generated invoice numbers.","oneOf":[{"type":"number"},{"type":"null"}]},"featurepreview":{"description":"Whether the business opts into preview / beta features.","oneOf":[{"type":"boolean"},{"type":"null"}]},"paymentpagename":{"description":"Display name shown on the hosted payment page.","oneOf":[{"type":"string"},{"type":"null"}]},"paymentpagelogo":{"description":"Logo image URL shown on the hosted payment page.","oneOf":[{"type":"string"},{"type":"null"}]},"alert":{"oneOf":[{"type":"string"},{"type":"null"}]},"salestax":{"description":"Whether sales tax / VAT is enabled for the business.","oneOf":[{"type":"boolean"},{"type":"null"}]},"salestaxrecoverable":{"description":"Whether input sales tax / VAT is recoverable for the business.","oneOf":[{"type":"boolean"},{"type":"null"}]},"salestaxnumber":{"description":"Sales-tax / VAT registration number.","oneOf":[{"type":"string"},{"type":"null"}]},"salestaxrate":{"description":"Default sales-tax / VAT rate as a decimal fraction (e.g. 0.15 = 15%).","oneOf":[{"type":"number"},{"type":"null"}]},"salestaxexclusive":{"description":"Default for whether new invoice / product line items are entered VAT-exclusive (price shown ex-VAT, tax added on top) rather than inclusive.","oneOf":[{"type":"boolean"},{"type":"null"}]},"autofxadjustment":{"description":"When true, settle_bills books the FX gain/loss line on a cross-currency bill payment (within 3%) without asking for confirmation. Off by default: the line is proposed and the user confirms it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"referrer":{"description":"How the business was referred (referral source).","oneOf":[{"type":"string"},{"type":"null"}]},"paymentpagedisabled":{"description":"Whether the public payment page is disabled.","oneOf":[{"type":"boolean"},{"type":"null"}]},"product":{"description":"Whether the business sells products (goods).","oneOf":[{"type":"boolean"},{"type":"null"}]},"service":{"description":"Whether the business sells services.","oneOf":[{"type":"boolean"},{"type":"null"}]},"charity":{"description":"Whether the business is a charity / non-profit.","oneOf":[{"type":"boolean"},{"type":"null"}]},"invoicetitle":{"description":"Default heading / title used on invoices.","oneOf":[{"type":"string"},{"type":"null"}]},"quotetitle":{"description":"Default heading / title used on quotes (e.g. \"Quote\", \"Estimate\", \"Cost Estimate\"). Offered from the business locale's own quoteTitles list; unset renders the built-in \"Quote\".","oneOf":[{"type":"string"},{"type":"null"}]},"proofofdelivery":{"description":"Whether proof-of-delivery capture is enabled.","oneOf":[{"type":"boolean"},{"type":"null"}]},"lastreviewed":{"description":"Date the business's books were last reviewed (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"details":{"description":"Nested profile details. Currently carries the legal entity type and the subscription billing contact.","oneOf":[{"type":"object","properties":{"entitytype":{"description":"Legal entity type of the business (validated against the business's locale-specific options).","oneOf":[{"type":"string"},{"type":"null"}]},"billingcontact":{"description":"Owner-maintained billing/receipt email for this business's own stub subscription (PROD-1158). Blank or \"$delete\" clears it; unset falls back to the business email.","oneOf":[{"type":"string"},{"type":"null"}]},"region":{"description":"State / province / region, as stub-web sends it.","oneOf":[{"type":"string"},{"type":"null"}]},"paymentterms":{"description":"Default payment terms in whole days (0-365); a new invoice's due date defaults to its date plus this. PROD-3628.","oneOf":[{"type":"integer","minimum":0,"maximum":365},{"type":"null"}]},"jurisdiction":{"description":"The country the business keeps the rules of, as a two-letter ISO 3166-1 code; stub-web's region picker sends its pick here. Omitted, a save resolves it from region and country. PROD-3601.","oneOf":[{"type":"string"},{"type":"null"}]},"registrations":{"description":"Statutory registration numbers as a keyed map (locale slug -> value), e.g. {\"paye\": \"7610...\"}. Replace semantics: send the whole map; the server stores it verbatim, capped at 32 keys (key ^[a-z0-9_]{1,32}$, value <=64 chars). PROD-1343.","oneOf":[{"type":"object","additionalProperties":{"oneOf":[{"type":"string"},{"type":"null"}]}},{"type":"null"}]},"payrollsettings":{"description":"The business's answers to its country's payroll pack: `settings[].id` -> value, plus \"jurisdiction\" -> a `jurisdictions[].code`. Replace semantics: send the whole map. A key or value the pack does not declare is refused {error, reason \"payrollsettings-invalid\", message} and nothing changes. PROD-2403. To change one setting with a confirm step, use save_payroll_settings.","oneOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"This business's id. Optional — defaults to the authenticated token's own business; supply only to target a specific business.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Trading / display name of the business.","oneOf":[{"type":"string"},{"type":"null"}]},"tag":{"description":"Unique public vanity tag/slug for the business (used in its public page URL and for segmentation).","oneOf":[{"type":"string"},{"type":"null"}]},"vanitypageaction":{"description":"Call-to-action mode for the business's public vanity page, e.g. \"donate\" or \"pay\".","oneOf":[{"type":"string"},{"type":"null"}]},"about":{"description":"Short description / bio of the business shown on public pages.","oneOf":[{"type":"string"},{"type":"null"}]},"twitchid":{"description":"Twitch channel id, for the Twitch / streamer integration.","oneOf":[{"type":"string"},{"type":"null"}]},"invoicenotes":{"description":"Default notes text placed on new invoices.","oneOf":[{"type":"string"},{"type":"null"}]},"paymentterms":{"description":"Default payment terms in whole days (0-365); a new invoice's due date defaults to its date plus this. PROD-3628.","oneOf":[{"type":"integer","minimum":0,"maximum":365},{"type":"null"}]},"invoicemessage":{"description":"Default customer-facing message on new invoices.","oneOf":[{"type":"string"},{"type":"null"}]},"quotenotes":{"description":"Default notes text placed on new quotes.","oneOf":[{"type":"string"},{"type":"null"}]},"quotemessage":{"description":"Default customer-facing message on new quotes.","oneOf":[{"type":"string"},{"type":"null"}]},"logo":{"description":"Business logo image URL (or data URI).","oneOf":[{"type":"string"},{"type":"null"}]},"website":{"description":"Business website URL.","oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"description":"Business contact phone number.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"description":"Street address line 1.","oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"description":"Street address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"description":"Suburb.","oneOf":[{"type":"string"},{"type":"null"}]},"city":{"description":"City / town.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"description":"Postal / ZIP code.","oneOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"Country (name or code).","oneOf":[{"type":"string"},{"type":"null"}]},"region":{"description":"State / province / region.","oneOf":[{"type":"string"},{"type":"null"}]},"industry":{"description":"Industry the business operates in.","oneOf":[{"type":"string"},{"type":"null"}]},"employees":{"description":"Number of employees (as a label / band).","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"Business base currency, ISO 4217 (e.g. \"ZAR\", \"USD\").","oneOf":[{"type":"string"},{"type":"null"}]},"turnover":{"description":"Annual turnover in the base currency.","oneOf":[{"type":"number"},{"type":"null"}]},"openingbalance":{"description":"Opening cash / bank balance carried into the books, in the base currency.","oneOf":[{"type":"number"},{"type":"null"}]},"age":{"description":"Age of the business (label, e.g. how long it has been trading).","oneOf":[{"type":"string"},{"type":"null"}]},"experience":{"description":"Founder's business / industry experience (label).","oneOf":[{"type":"string"},{"type":"null"}]},"financialstartday":{"description":"Day of the month the financial year starts (1-31).","oneOf":[{"type":"number"},{"type":"null"}]},"financialstartmonth":{"description":"Month the financial year starts: a month name (MARCH) or its number 1-12.","oneOf":[{"anyOf":[{"type":"string"},{"type":"integer"}]},{"type":"null"}]},"registrationnumber":{"description":"Company registration number.","oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"description":"VAT registration number.","oneOf":[{"type":"string"},{"type":"null"}]},"incometaxnumber":{"description":"Income-tax reference number.","oneOf":[{"type":"string"},{"type":"null"}]},"vatbasis":{"description":"When VAT lands on a return: invoice (the default) or payments.","oneOf":[{"type":"string","enum":["invoice","payments"]},{"type":"null"}]},"payenumber":{"description":"PAYE (payroll income-tax) reference number.","oneOf":[{"type":"string"},{"type":"null"}]},"uifnumber":{"description":"UIF (unemployment insurance fund) reference number.","oneOf":[{"type":"string"},{"type":"null"}]},"sdlnumber":{"description":"SDL (skills development levy) reference number.","oneOf":[{"type":"string"},{"type":"null"}]},"taxregime":{"description":"Tax regime the business is registered under.","oneOf":[{"type":"string"},{"type":"null"}]},"tradesourcecode":{"description":"SARS trade / source code classifying the business's main activity.","oneOf":[{"type":"string"},{"type":"null"}]},"accountname":{"description":"Bank account holder name shown on invoices.","oneOf":[{"type":"string"},{"type":"null"}]},"bank":{"description":"Bank name for the account shown on invoices.","oneOf":[{"type":"string"},{"type":"null"}]},"accountnumber":{"description":"Bank account number shown on invoices.","oneOf":[{"type":"string"},{"type":"null"}]},"accounttype":{"description":"Bank account type (e.g. \"cheque\", \"savings\").","oneOf":[{"type":"string"},{"type":"null"}]},"branchcode":{"description":"Bank branch code shown on invoices.","oneOf":[{"type":"string"},{"type":"null"}]},"showbank":{"description":"Whether to show the business's bank details on invoices.","oneOf":[{"type":"boolean"},{"type":"null"}]},"invoicebankid":{"description":"Id of the bank account to display on invoices.","oneOf":[{"type":"string"},{"type":"null"}]},"paymentbankid":{"description":"Id of the bank account payments are collected into.","oneOf":[{"type":"string"},{"type":"null"}]},"streamelementsid":{"description":"StreamElements account id, for the StreamElements integration.","oneOf":[{"type":"string"},{"type":"null"}]},"streamelementsjwt":{"description":"StreamElements JWT credential for the integration.","oneOf":[{"type":"string"},{"type":"null"}]},"customizations":{"description":"JSON string of UI / branding customizations for the business.","oneOf":[{"type":"string"},{"type":"null"}]},"webhook":{"description":"Webhook URL to notify on business events.","oneOf":[{"type":"string"},{"type":"null"}]},"invoiceoffset":{"description":"Starting offset added to auto-generated invoice numbers.","oneOf":[{"type":"number"},{"type":"null"}]},"featurepreview":{"description":"Whether the business opts into preview / beta features.","oneOf":[{"type":"boolean"},{"type":"null"}]},"paymentpagename":{"description":"Display name shown on the hosted payment page.","oneOf":[{"type":"string"},{"type":"null"}]},"paymentpagelogo":{"description":"Logo image URL shown on the hosted payment page.","oneOf":[{"type":"string"},{"type":"null"}]},"alert":{"oneOf":[{"type":"string"},{"type":"null"}]},"salestax":{"description":"Whether sales tax / VAT is enabled for the business.","oneOf":[{"type":"boolean"},{"type":"null"}]},"salestaxrecoverable":{"description":"Whether input sales tax / VAT is recoverable for the business.","oneOf":[{"type":"boolean"},{"type":"null"}]},"salestaxnumber":{"description":"Sales-tax / VAT registration number.","oneOf":[{"type":"string"},{"type":"null"}]},"salestaxrate":{"description":"Default sales-tax / VAT rate as a decimal fraction (e.g. 0.15 = 15%).","oneOf":[{"type":"number"},{"type":"null"}]},"salestaxexclusive":{"description":"Default for whether new invoice / product line items are entered VAT-exclusive (price shown ex-VAT, tax added on top) rather than inclusive.","oneOf":[{"type":"boolean"},{"type":"null"}]},"autofxadjustment":{"description":"When true, settle_bills books the FX gain/loss line on a cross-currency bill payment (within 3%) without asking for confirmation. Off by default: the line is proposed and the user confirms it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"referrer":{"description":"How the business was referred (referral source).","oneOf":[{"type":"string"},{"type":"null"}]},"paymentpagedisabled":{"description":"Whether the public payment page is disabled.","oneOf":[{"type":"boolean"},{"type":"null"}]},"product":{"description":"Whether the business sells products (goods).","oneOf":[{"type":"boolean"},{"type":"null"}]},"service":{"description":"Whether the business sells services.","oneOf":[{"type":"boolean"},{"type":"null"}]},"charity":{"description":"Whether the business is a charity / non-profit.","oneOf":[{"type":"boolean"},{"type":"null"}]},"invoicetitle":{"description":"Default heading / title used on invoices.","oneOf":[{"type":"string"},{"type":"null"}]},"quotetitle":{"description":"Default heading / title used on quotes (e.g. \"Quote\", \"Estimate\", \"Cost Estimate\"). Offered from the business locale's own quoteTitles list; unset renders the built-in \"Quote\".","oneOf":[{"type":"string"},{"type":"null"}]},"proofofdelivery":{"description":"Whether proof-of-delivery capture is enabled.","oneOf":[{"type":"boolean"},{"type":"null"}]},"lastreviewed":{"description":"Date the business's books were last reviewed (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"details":{"description":"Nested profile details. Currently carries the legal entity type and the subscription billing contact.","oneOf":[{"type":"object","properties":{"entitytype":{"description":"Legal entity type of the business (validated against the business's locale-specific options).","oneOf":[{"type":"string"},{"type":"null"}]},"billingcontact":{"description":"Owner-maintained billing/receipt email for this business's own stub subscription (PROD-1158). Blank or \"$delete\" clears it; unset falls back to the business email.","oneOf":[{"type":"string"},{"type":"null"}]},"region":{"description":"State / province / region, as stub-web sends it.","oneOf":[{"type":"string"},{"type":"null"}]},"paymentterms":{"description":"Default payment terms in whole days (0-365); a new invoice's due date defaults to its date plus this. PROD-3628.","oneOf":[{"type":"integer","minimum":0,"maximum":365},{"type":"null"}]},"jurisdiction":{"description":"The country the business keeps the rules of, as a two-letter ISO 3166-1 code; stub-web's region picker sends its pick here. Omitted, a save resolves it from region and country. PROD-3601.","oneOf":[{"type":"string"},{"type":"null"}]},"registrations":{"description":"Statutory registration numbers as a keyed map (locale slug -> value), e.g. {\"paye\": \"7610...\"}. Replace semantics: send the whole map; the server stores it verbatim, capped at 32 keys (key ^[a-z0-9_]{1,32}$, value <=64 chars). PROD-1343.","oneOf":[{"type":"object","additionalProperties":{"oneOf":[{"type":"string"},{"type":"null"}]}},{"type":"null"}]},"payrollsettings":{"description":"The business's answers to its country's payroll pack: `settings[].id` -> value, plus \"jurisdiction\" -> a `jurisdictions[].code`. Replace semantics: send the whole map. A key or value the pack does not declare is refused {error, reason \"payrollsettings-invalid\", message} and nothing changes. PROD-2403. To change one setting with a confirm step, use save_payroll_settings.","oneOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"This business's id. Optional — defaults to the authenticated token's own business; supply only to target a specific business.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Trading / display name of the business.","oneOf":[{"type":"string"},{"type":"null"}]},"tag":{"description":"Unique public vanity tag/slug for the business (used in its public page URL and for segmentation).","oneOf":[{"type":"string"},{"type":"null"}]},"vanitypageaction":{"description":"Call-to-action mode for the business's public vanity page, e.g. \"donate\" or \"pay\".","oneOf":[{"type":"string"},{"type":"null"}]},"about":{"description":"Short description / bio of the business shown on public pages.","oneOf":[{"type":"string"},{"type":"null"}]},"twitchid":{"description":"Twitch channel id, for the Twitch / streamer integration.","oneOf":[{"type":"string"},{"type":"null"}]},"invoicenotes":{"description":"Default notes text placed on new invoices.","oneOf":[{"type":"string"},{"type":"null"}]},"paymentterms":{"description":"Default payment terms in whole days (0-365); a new invoice's due date defaults to its date plus this. PROD-3628.","oneOf":[{"type":"integer","minimum":0,"maximum":365},{"type":"null"}]},"invoicemessage":{"description":"Default customer-facing message on new invoices.","oneOf":[{"type":"string"},{"type":"null"}]},"quotenotes":{"description":"Default notes text placed on new quotes.","oneOf":[{"type":"string"},{"type":"null"}]},"quotemessage":{"description":"Default customer-facing message on new quotes.","oneOf":[{"type":"string"},{"type":"null"}]},"logo":{"description":"Business logo image URL (or data URI).","oneOf":[{"type":"string"},{"type":"null"}]},"website":{"description":"Business website URL.","oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"description":"Business contact phone number.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"description":"Street address line 1.","oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"description":"Street address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"description":"Suburb.","oneOf":[{"type":"string"},{"type":"null"}]},"city":{"description":"City / town.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"description":"Postal / ZIP code.","oneOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"Country (name or code).","oneOf":[{"type":"string"},{"type":"null"}]},"region":{"description":"State / province / region.","oneOf":[{"type":"string"},{"type":"null"}]},"industry":{"description":"Industry the business operates in.","oneOf":[{"type":"string"},{"type":"null"}]},"employees":{"description":"Number of employees (as a label / band).","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"Business base currency, ISO 4217 (e.g. \"ZAR\", \"USD\").","oneOf":[{"type":"string"},{"type":"null"}]},"turnover":{"description":"Annual turnover in the base currency.","oneOf":[{"type":"number"},{"type":"null"}]},"openingbalance":{"description":"Opening cash / bank balance carried into the books, in the base currency.","oneOf":[{"type":"number"},{"type":"null"}]},"age":{"description":"Age of the business (label, e.g. how long it has been trading).","oneOf":[{"type":"string"},{"type":"null"}]},"experience":{"description":"Founder's business / industry experience (label).","oneOf":[{"type":"string"},{"type":"null"}]},"financialstartday":{"description":"Day of the month the financial year starts (1-31).","oneOf":[{"type":"number"},{"type":"null"}]},"financialstartmonth":{"description":"Month the financial year starts: a month name (MARCH) or its number 1-12.","oneOf":[{"anyOf":[{"type":"string"},{"type":"integer"}]},{"type":"null"}]},"registrationnumber":{"description":"Company registration number.","oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"description":"VAT registration number.","oneOf":[{"type":"string"},{"type":"null"}]},"incometaxnumber":{"description":"Income-tax reference number.","oneOf":[{"type":"string"},{"type":"null"}]},"vatbasis":{"description":"When VAT lands on a return: invoice (the default) or payments.","oneOf":[{"type":"string","enum":["invoice","payments"]},{"type":"null"}]},"payenumber":{"description":"PAYE (payroll income-tax) reference number.","oneOf":[{"type":"string"},{"type":"null"}]},"uifnumber":{"description":"UIF (unemployment insurance fund) reference number.","oneOf":[{"type":"string"},{"type":"null"}]},"sdlnumber":{"description":"SDL (skills development levy) reference number.","oneOf":[{"type":"string"},{"type":"null"}]},"taxregime":{"description":"Tax regime the business is registered under.","oneOf":[{"type":"string"},{"type":"null"}]},"tradesourcecode":{"description":"SARS trade / source code classifying the business's main activity.","oneOf":[{"type":"string"},{"type":"null"}]},"accountname":{"description":"Bank account holder name shown on invoices.","oneOf":[{"type":"string"},{"type":"null"}]},"bank":{"description":"Bank name for the account shown on invoices.","oneOf":[{"type":"string"},{"type":"null"}]},"accountnumber":{"description":"Bank account number shown on invoices.","oneOf":[{"type":"string"},{"type":"null"}]},"accounttype":{"description":"Bank account type (e.g. \"cheque\", \"savings\").","oneOf":[{"type":"string"},{"type":"null"}]},"branchcode":{"description":"Bank branch code shown on invoices.","oneOf":[{"type":"string"},{"type":"null"}]},"showbank":{"description":"Whether to show the business's bank details on invoices.","oneOf":[{"type":"boolean"},{"type":"null"}]},"invoicebankid":{"description":"Id of the bank account to display on invoices.","oneOf":[{"type":"string"},{"type":"null"}]},"paymentbankid":{"description":"Id of the bank account payments are collected into.","oneOf":[{"type":"string"},{"type":"null"}]},"streamelementsid":{"description":"StreamElements account id, for the StreamElements integration.","oneOf":[{"type":"string"},{"type":"null"}]},"streamelementsjwt":{"description":"StreamElements JWT credential for the integration.","oneOf":[{"type":"string"},{"type":"null"}]},"customizations":{"description":"JSON string of UI / branding customizations for the business.","oneOf":[{"type":"string"},{"type":"null"}]},"webhook":{"description":"Webhook URL to notify on business events.","oneOf":[{"type":"string"},{"type":"null"}]},"invoiceoffset":{"description":"Starting offset added to auto-generated invoice numbers.","oneOf":[{"type":"number"},{"type":"null"}]},"featurepreview":{"description":"Whether the business opts into preview / beta features.","oneOf":[{"type":"boolean"},{"type":"null"}]},"paymentpagename":{"description":"Display name shown on the hosted payment page.","oneOf":[{"type":"string"},{"type":"null"}]},"paymentpagelogo":{"description":"Logo image URL shown on the hosted payment page.","oneOf":[{"type":"string"},{"type":"null"}]},"alert":{"oneOf":[{"type":"string"},{"type":"null"}]},"salestax":{"description":"Whether sales tax / VAT is enabled for the business.","oneOf":[{"type":"boolean"},{"type":"null"}]},"salestaxrecoverable":{"description":"Whether input sales tax / VAT is recoverable for the business.","oneOf":[{"type":"boolean"},{"type":"null"}]},"salestaxnumber":{"description":"Sales-tax / VAT registration number.","oneOf":[{"type":"string"},{"type":"null"}]},"salestaxrate":{"description":"Default sales-tax / VAT rate as a decimal fraction (e.g. 0.15 = 15%).","oneOf":[{"type":"number"},{"type":"null"}]},"salestaxexclusive":{"description":"Default for whether new invoice / product line items are entered VAT-exclusive (price shown ex-VAT, tax added on top) rather than inclusive.","oneOf":[{"type":"boolean"},{"type":"null"}]},"autofxadjustment":{"description":"When true, settle_bills books the FX gain/loss line on a cross-currency bill payment (within 3%) without asking for confirmation. Off by default: the line is proposed and the user confirms it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"referrer":{"description":"How the business was referred (referral source).","oneOf":[{"type":"string"},{"type":"null"}]},"paymentpagedisabled":{"description":"Whether the public payment page is disabled.","oneOf":[{"type":"boolean"},{"type":"null"}]},"product":{"description":"Whether the business sells products (goods).","oneOf":[{"type":"boolean"},{"type":"null"}]},"service":{"description":"Whether the business sells services.","oneOf":[{"type":"boolean"},{"type":"null"}]},"charity":{"description":"Whether the business is a charity / non-profit.","oneOf":[{"type":"boolean"},{"type":"null"}]},"invoicetitle":{"description":"Default heading / title used on invoices.","oneOf":[{"type":"string"},{"type":"null"}]},"quotetitle":{"description":"Default heading / title used on quotes (e.g. \"Quote\", \"Estimate\", \"Cost Estimate\"). Offered from the business locale's own quoteTitles list; unset renders the built-in \"Quote\".","oneOf":[{"type":"string"},{"type":"null"}]},"proofofdelivery":{"description":"Whether proof-of-delivery capture is enabled.","oneOf":[{"type":"boolean"},{"type":"null"}]},"lastreviewed":{"description":"Date the business's books were last reviewed (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"details":{"description":"Nested profile details. Currently carries the legal entity type and the subscription billing contact.","oneOf":[{"type":"object","properties":{"entitytype":{"description":"Legal entity type of the business (validated against the business's locale-specific options).","oneOf":[{"type":"string"},{"type":"null"}]},"billingcontact":{"description":"Owner-maintained billing/receipt email for this business's own stub subscription (PROD-1158). Blank or \"$delete\" clears it; unset falls back to the business email.","oneOf":[{"type":"string"},{"type":"null"}]},"region":{"description":"State / province / region, as stub-web sends it.","oneOf":[{"type":"string"},{"type":"null"}]},"paymentterms":{"description":"Default payment terms in whole days (0-365); a new invoice's due date defaults to its date plus this. PROD-3628.","oneOf":[{"type":"integer","minimum":0,"maximum":365},{"type":"null"}]},"jurisdiction":{"description":"The country the business keeps the rules of, as a two-letter ISO 3166-1 code; stub-web's region picker sends its pick here. Omitted, a save resolves it from region and country. PROD-3601.","oneOf":[{"type":"string"},{"type":"null"}]},"registrations":{"description":"Statutory registration numbers as a keyed map (locale slug -> value), e.g. {\"paye\": \"7610...\"}. Replace semantics: send the whole map; the server stores it verbatim, capped at 32 keys (key ^[a-z0-9_]{1,32}$, value <=64 chars). PROD-1343.","oneOf":[{"type":"object","additionalProperties":{"oneOf":[{"type":"string"},{"type":"null"}]}},{"type":"null"}]},"payrollsettings":{"description":"The business's answers to its country's payroll pack: `settings[].id` -> value, plus \"jurisdiction\" -> a `jurisdictions[].code`. Replace semantics: send the whole map. A key or value the pack does not declare is refused {error, reason \"payrollsettings-invalid\", message} and nothing changes. PROD-2403. To change one setting with a confirm step, use save_payroll_settings.","oneOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"This business's id. Optional — defaults to the authenticated token's own business; supply only to target a specific business.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Trading / display name of the business.","oneOf":[{"type":"string"},{"type":"null"}]},"tag":{"description":"Unique public vanity tag/slug for the business (used in its public page URL and for segmentation).","oneOf":[{"type":"string"},{"type":"null"}]},"vanitypageaction":{"description":"Call-to-action mode for the business's public vanity page, e.g. \"donate\" or \"pay\".","oneOf":[{"type":"string"},{"type":"null"}]},"about":{"description":"Short description / bio of the business shown on public pages.","oneOf":[{"type":"string"},{"type":"null"}]},"twitchid":{"description":"Twitch channel id, for the Twitch / streamer integration.","oneOf":[{"type":"string"},{"type":"null"}]},"invoicenotes":{"description":"Default notes text placed on new invoices.","oneOf":[{"type":"string"},{"type":"null"}]},"paymentterms":{"description":"Default payment terms in whole days (0-365); a new invoice's due date defaults to its date plus this. PROD-3628.","oneOf":[{"type":"integer","minimum":0,"maximum":365},{"type":"null"}]},"invoicemessage":{"description":"Default customer-facing message on new invoices.","oneOf":[{"type":"string"},{"type":"null"}]},"quotenotes":{"description":"Default notes text placed on new quotes.","oneOf":[{"type":"string"},{"type":"null"}]},"quotemessage":{"description":"Default customer-facing message on new quotes.","oneOf":[{"type":"string"},{"type":"null"}]},"logo":{"description":"Business logo image URL (or data URI).","oneOf":[{"type":"string"},{"type":"null"}]},"website":{"description":"Business website URL.","oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"description":"Business contact phone number.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"description":"Street address line 1.","oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"description":"Street address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"description":"Suburb.","oneOf":[{"type":"string"},{"type":"null"}]},"city":{"description":"City / town.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"description":"Postal / ZIP code.","oneOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"Country (name or code).","oneOf":[{"type":"string"},{"type":"null"}]},"region":{"description":"State / province / region.","oneOf":[{"type":"string"},{"type":"null"}]},"industry":{"description":"Industry the business operates in.","oneOf":[{"type":"string"},{"type":"null"}]},"employees":{"description":"Number of employees (as a label / band).","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"Business base currency, ISO 4217 (e.g. \"ZAR\", \"USD\").","oneOf":[{"type":"string"},{"type":"null"}]},"turnover":{"description":"Annual turnover in the base currency.","oneOf":[{"type":"number"},{"type":"null"}]},"openingbalance":{"description":"Opening cash / bank balance carried into the books, in the base currency.","oneOf":[{"type":"number"},{"type":"null"}]},"age":{"description":"Age of the business (label, e.g. how long it has been trading).","oneOf":[{"type":"string"},{"type":"null"}]},"experience":{"description":"Founder's business / industry experience (label).","oneOf":[{"type":"string"},{"type":"null"}]},"financialstartday":{"description":"Day of the month the financial year starts (1-31).","oneOf":[{"type":"number"},{"type":"null"}]},"financialstartmonth":{"description":"Month the financial year starts: a month name (MARCH) or its number 1-12.","oneOf":[{"anyOf":[{"type":"string"},{"type":"integer"}]},{"type":"null"}]},"registrationnumber":{"description":"Company registration number.","oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"description":"VAT registration number.","oneOf":[{"type":"string"},{"type":"null"}]},"incometaxnumber":{"description":"Income-tax reference number.","oneOf":[{"type":"string"},{"type":"null"}]},"vatbasis":{"description":"When VAT lands on a return: invoice (the default) or payments.","oneOf":[{"type":"string","enum":["invoice","payments"]},{"type":"null"}]},"payenumber":{"description":"PAYE (payroll income-tax) reference number.","oneOf":[{"type":"string"},{"type":"null"}]},"uifnumber":{"description":"UIF (unemployment insurance fund) reference number.","oneOf":[{"type":"string"},{"type":"null"}]},"sdlnumber":{"description":"SDL (skills development levy) reference number.","oneOf":[{"type":"string"},{"type":"null"}]},"taxregime":{"description":"Tax regime the business is registered under.","oneOf":[{"type":"string"},{"type":"null"}]},"tradesourcecode":{"description":"SARS trade / source code classifying the business's main activity.","oneOf":[{"type":"string"},{"type":"null"}]},"accountname":{"description":"Bank account holder name shown on invoices.","oneOf":[{"type":"string"},{"type":"null"}]},"bank":{"description":"Bank name for the account shown on invoices.","oneOf":[{"type":"string"},{"type":"null"}]},"accountnumber":{"description":"Bank account number shown on invoices.","oneOf":[{"type":"string"},{"type":"null"}]},"accounttype":{"description":"Bank account type (e.g. \"cheque\", \"savings\").","oneOf":[{"type":"string"},{"type":"null"}]},"branchcode":{"description":"Bank branch code shown on invoices.","oneOf":[{"type":"string"},{"type":"null"}]},"showbank":{"description":"Whether to show the business's bank details on invoices.","oneOf":[{"type":"boolean"},{"type":"null"}]},"invoicebankid":{"description":"Id of the bank account to display on invoices.","oneOf":[{"type":"string"},{"type":"null"}]},"paymentbankid":{"description":"Id of the bank account payments are collected into.","oneOf":[{"type":"string"},{"type":"null"}]},"streamelementsid":{"description":"StreamElements account id, for the StreamElements integration.","oneOf":[{"type":"string"},{"type":"null"}]},"streamelementsjwt":{"description":"StreamElements JWT credential for the integration.","oneOf":[{"type":"string"},{"type":"null"}]},"customizations":{"description":"JSON string of UI / branding customizations for the business.","oneOf":[{"type":"string"},{"type":"null"}]},"webhook":{"description":"Webhook URL to notify on business events.","oneOf":[{"type":"string"},{"type":"null"}]},"invoiceoffset":{"description":"Starting offset added to auto-generated invoice numbers.","oneOf":[{"type":"number"},{"type":"null"}]},"featurepreview":{"description":"Whether the business opts into preview / beta features.","oneOf":[{"type":"boolean"},{"type":"null"}]},"paymentpagename":{"description":"Display name shown on the hosted payment page.","oneOf":[{"type":"string"},{"type":"null"}]},"paymentpagelogo":{"description":"Logo image URL shown on the hosted payment page.","oneOf":[{"type":"string"},{"type":"null"}]},"alert":{"oneOf":[{"type":"string"},{"type":"null"}]},"salestax":{"description":"Whether sales tax / VAT is enabled for the business.","oneOf":[{"type":"boolean"},{"type":"null"}]},"salestaxrecoverable":{"description":"Whether input sales tax / VAT is recoverable for the business.","oneOf":[{"type":"boolean"},{"type":"null"}]},"salestaxnumber":{"description":"Sales-tax / VAT registration number.","oneOf":[{"type":"string"},{"type":"null"}]},"salestaxrate":{"description":"Default sales-tax / VAT rate as a decimal fraction (e.g. 0.15 = 15%).","oneOf":[{"type":"number"},{"type":"null"}]},"salestaxexclusive":{"description":"Default for whether new invoice / product line items are entered VAT-exclusive (price shown ex-VAT, tax added on top) rather than inclusive.","oneOf":[{"type":"boolean"},{"type":"null"}]},"autofxadjustment":{"description":"When true, settle_bills books the FX gain/loss line on a cross-currency bill payment (within 3%) without asking for confirmation. Off by default: the line is proposed and the user confirms it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"referrer":{"description":"How the business was referred (referral source).","oneOf":[{"type":"string"},{"type":"null"}]},"paymentpagedisabled":{"description":"Whether the public payment page is disabled.","oneOf":[{"type":"boolean"},{"type":"null"}]},"product":{"description":"Whether the business sells products (goods).","oneOf":[{"type":"boolean"},{"type":"null"}]},"service":{"description":"Whether the business sells services.","oneOf":[{"type":"boolean"},{"type":"null"}]},"charity":{"description":"Whether the business is a charity / non-profit.","oneOf":[{"type":"boolean"},{"type":"null"}]},"invoicetitle":{"description":"Default heading / title used on invoices.","oneOf":[{"type":"string"},{"type":"null"}]},"quotetitle":{"description":"Default heading / title used on quotes (e.g. \"Quote\", \"Estimate\", \"Cost Estimate\"). Offered from the business locale's own quoteTitles list; unset renders the built-in \"Quote\".","oneOf":[{"type":"string"},{"type":"null"}]},"proofofdelivery":{"description":"Whether proof-of-delivery capture is enabled.","oneOf":[{"type":"boolean"},{"type":"null"}]},"lastreviewed":{"description":"Date the business's books were last reviewed (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"details":{"description":"Nested profile details. Currently carries the legal entity type and the subscription billing contact.","oneOf":[{"type":"object","properties":{"entitytype":{"description":"Legal entity type of the business (validated against the business's locale-specific options).","oneOf":[{"type":"string"},{"type":"null"}]},"billingcontact":{"description":"Owner-maintained billing/receipt email for this business's own stub subscription (PROD-1158). Blank or \"$delete\" clears it; unset falls back to the business email.","oneOf":[{"type":"string"},{"type":"null"}]},"region":{"description":"State / province / region, as stub-web sends it.","oneOf":[{"type":"string"},{"type":"null"}]},"paymentterms":{"description":"Default payment terms in whole days (0-365); a new invoice's due date defaults to its date plus this. PROD-3628.","oneOf":[{"type":"integer","minimum":0,"maximum":365},{"type":"null"}]},"jurisdiction":{"description":"The country the business keeps the rules of, as a two-letter ISO 3166-1 code; stub-web's region picker sends its pick here. Omitted, a save resolves it from region and country. PROD-3601.","oneOf":[{"type":"string"},{"type":"null"}]},"registrations":{"description":"Statutory registration numbers as a keyed map (locale slug -> value), e.g. {\"paye\": \"7610...\"}. Replace semantics: send the whole map; the server stores it verbatim, capped at 32 keys (key ^[a-z0-9_]{1,32}$, value <=64 chars). PROD-1343.","oneOf":[{"type":"object","additionalProperties":{"oneOf":[{"type":"string"},{"type":"null"}]}},{"type":"null"}]},"payrollsettings":{"description":"The business's answers to its country's payroll pack: `settings[].id` -> value, plus \"jurisdiction\" -> a `jurisdictions[].code`. Replace semantics: send the whole map. A key or value the pack does not declare is refused {error, reason \"payrollsettings-invalid\", message} and nothing changes. PROD-2403. To change one setting with a confirm step, use save_payroll_settings.","oneOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Update the business's own profile fields (name, contact details, industry, currency, tax rate, and the like). To change only the free-text description use set_business_description, or only a single tag use set_business_tag.","tags":["business management"]}},"/api/business/smtp":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"host":{"type":"string"},"port":{"type":"integer"},"username":{"type":"string"},"secret":{"type":"string"},"fromaddress":{"type":"string"},"fromname":{"oneOf":[{"type":"string"},{"type":"null"}]},"security":{"oneOf":[{"type":"string"},{"type":"null"}]},"enabled":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","host","port","username","secret","fromaddress"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"host":{"type":"string"},"port":{"type":"integer"},"username":{"type":"string"},"secret":{"type":"string"},"fromaddress":{"type":"string"},"fromname":{"oneOf":[{"type":"string"},{"type":"null"}]},"security":{"oneOf":[{"type":"string"},{"type":"null"}]},"enabled":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","host","port","username","secret","fromaddress"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"host":{"type":"string"},"port":{"type":"integer"},"username":{"type":"string"},"secret":{"type":"string"},"fromaddress":{"type":"string"},"fromname":{"oneOf":[{"type":"string"},{"type":"null"}]},"security":{"oneOf":[{"type":"string"},{"type":"null"}]},"enabled":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","host","port","username","secret","fromaddress"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"host":{"type":"string"},"port":{"type":"integer"},"username":{"type":"string"},"secret":{"type":"string"},"fromaddress":{"type":"string"},"fromname":{"oneOf":[{"type":"string"},{"type":"null"}]},"security":{"oneOf":[{"type":"string"},{"type":"null"}]},"enabled":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","host","port","username","secret","fromaddress"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Save the business's custom SMTP configuration for outbound documents","tags":["business management"]}},"/api/business/smtp/test":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"host":{"type":"string"},"port":{"type":"integer"},"username":{"type":"string"},"secret":{"type":"string"},"fromaddress":{"type":"string"},"fromname":{"oneOf":[{"type":"string"},{"type":"null"}]},"security":{"oneOf":[{"type":"string"},{"type":"null"}]},"to":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","host","port","username","secret","fromaddress"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"host":{"type":"string"},"port":{"type":"integer"},"username":{"type":"string"},"secret":{"type":"string"},"fromaddress":{"type":"string"},"fromname":{"oneOf":[{"type":"string"},{"type":"null"}]},"security":{"oneOf":[{"type":"string"},{"type":"null"}]},"to":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","host","port","username","secret","fromaddress"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"host":{"type":"string"},"port":{"type":"integer"},"username":{"type":"string"},"secret":{"type":"string"},"fromaddress":{"type":"string"},"fromname":{"oneOf":[{"type":"string"},{"type":"null"}]},"security":{"oneOf":[{"type":"string"},{"type":"null"}]},"to":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","host","port","username","secret","fromaddress"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"host":{"type":"string"},"port":{"type":"integer"},"username":{"type":"string"},"secret":{"type":"string"},"fromaddress":{"type":"string"},"fromname":{"oneOf":[{"type":"string"},{"type":"null"}]},"security":{"oneOf":[{"type":"string"},{"type":"null"}]},"to":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","host","port","username","secret","fromaddress"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Send a test email through the supplied SMTP configuration and mark it verified on success","tags":["business management"]}},"/api/business/smtp/clear":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Remove the business's custom SMTP configuration, reverting to stub's default sender","tags":["business management"]}},"/api/business/whatwedo":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"whatwedo":{"description":"A short free-text description of what the business does (its trade/industry in the owner's words).","type":"string"}},"required":["token","whatwedo"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"whatwedo":{"description":"A short free-text description of what the business does (its trade/industry in the owner's words).","type":"string"}},"required":["token","whatwedo"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"whatwedo":{"description":"A short free-text description of what the business does (its trade/industry in the owner's words).","type":"string"}},"required":["token","whatwedo"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"whatwedo":{"description":"A short free-text description of what the business does (its trade/industry in the owner's words).","type":"string"}},"required":["token","whatwedo"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Set ONLY the free-text 'what we do' description used to classify the business; for name, contact, currency or tax fields, use update_business. This is used to classify the business and tailor its dashboard/defaults.","tags":["business management"]}},"/api/business/get":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"rollup":{"description":"Serve the list records rolled up: \"day\" or \"complete\" (docs/ROLLUPS.md). Any other value of any type, and any MCP tool call, is served the whole business."}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"rollup":{"description":"Serve the list records rolled up: \"day\" or \"complete\" (docs/ROLLUPS.md). Any other value of any type, and any MCP tool call, is served the whole business."}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"rollup":{"description":"Serve the list records rolled up: \"day\" or \"complete\" (docs/ROLLUPS.md). Any other value of any type, and any MCP tool call, is served the whole business."}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"rollup":{"description":"Serve the list records rolled up: \"day\" or \"complete\" (docs/ROLLUPS.md). Any other value of any type, and any MCP tool call, is served the whole business."}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Get business profile","tags":["business management"]}},"/api/business/slim/get":{"get":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Get business profile","tags":["business management"]},"patch":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Get business profile","tags":["business management"]},"trace":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Get business profile","tags":["business management"]},"connect":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Get business profile","tags":["business management"]},"delete":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Get business profile","tags":["business management"]},"head":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Get business profile","tags":["business management"]},"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Get business profile","tags":["business management"]},"options":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Get business profile","tags":["business management"]},"put":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Get business profile","tags":["business management"]}},"/api/business/features":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"The business's server-authored capabilities: its effective plan and the feature keywords in force (PROD-1228, P3.1). Read-only; lets the frontend render only entitled features and retire FE-side plan/premium inference.","tags":["business management"]}},"/api/business/get/{property}":{"post":{"parameters":[{"in":"path","name":"property","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Get business property","tags":["business management"]}},"/api/business/mcp-get":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"One-call business overview: profile + financial summary + feature/usage context. This bundles get_business_profile and get_financial_summary — call those individually if you need only one part.","tags":["business management"]}},"/api/business/get/{property}/{id}":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Get business property","tags":["business management"]}},"/api/business/bank-profile-status":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Report the business's bank-connection profile without pulling any transactions. Returns :providers (live Yodlee provider-link + per-dataset refresh health) AND :bankfeeds (each bank feed install's health, the answer the app shows — Capitec, GoCardless, Investec, Stripe and the other bank-connection apps, Yodlee included: `status` is live, pending, attention, failing or off, or unknown with `reason` \"unavailable\" when the health could not be read just now, `reason` names why, `statusmessage` is the sentence the customer sees, `lastsynced` the last clean pull; no live external call). A business with no Yodlee link still gets its :bankfeeds; only a business with no bank connection at all returns an explanatory :message, NOT an error.","tags":["business management"]}},"/api/business/prepare":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string"}},"required":["email"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"email":{"type":"string"}},"required":["email"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"email":{"type":"string"}},"required":["email"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"email":{"type":"string"}},"required":["email"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Prepare business profile","tags":["business management"]}},"/api/business/insights":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Per-month financial insights and per-account period figures for the business.","tags":["business management"]}},"/api/business/subscription/start":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"callback":{"type":"string"},"billingemail":{"type":"string"},"plan":{"description":"Plan key to subscribe to — one of sneaky, steady, growing, established. Omitted means the configured default. Validated before the merchant is sent to save a card, and refused with the same codes /api/billing/plan uses.","oneOf":[{"type":"string"},{"type":"null"}]},"discountcode":{"description":"A customer-entered discount/promotion code. Optional; validated at Stripe before the merchant is sent to save a card, and re-validated when the subscription is actually created. Refused with :invalid-discount, :expired-discount or :discount-ineligible, never charged against silently.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","callback"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"callback":{"type":"string"},"billingemail":{"type":"string"},"plan":{"description":"Plan key to subscribe to — one of sneaky, steady, growing, established. Omitted means the configured default. Validated before the merchant is sent to save a card, and refused with the same codes /api/billing/plan uses.","oneOf":[{"type":"string"},{"type":"null"}]},"discountcode":{"description":"A customer-entered discount/promotion code. Optional; validated at Stripe before the merchant is sent to save a card, and re-validated when the subscription is actually created. Refused with :invalid-discount, :expired-discount or :discount-ineligible, never charged against silently.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","callback"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"callback":{"type":"string"},"billingemail":{"type":"string"},"plan":{"description":"Plan key to subscribe to — one of sneaky, steady, growing, established. Omitted means the configured default. Validated before the merchant is sent to save a card, and refused with the same codes /api/billing/plan uses.","oneOf":[{"type":"string"},{"type":"null"}]},"discountcode":{"description":"A customer-entered discount/promotion code. Optional; validated at Stripe before the merchant is sent to save a card, and re-validated when the subscription is actually created. Refused with :invalid-discount, :expired-discount or :discount-ineligible, never charged against silently.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","callback"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"callback":{"type":"string"},"billingemail":{"type":"string"},"plan":{"description":"Plan key to subscribe to — one of sneaky, steady, growing, established. Omitted means the configured default. Validated before the merchant is sent to save a card, and refused with the same codes /api/billing/plan uses.","oneOf":[{"type":"string"},{"type":"null"}]},"discountcode":{"description":"A customer-entered discount/promotion code. Optional; validated at Stripe before the merchant is sent to save a card, and re-validated when the subscription is actually created. Refused with :invalid-discount, :expired-discount or :discount-ineligible, never charged against silently.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","callback"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Subscribe business to plan then go to callback url","tags":["business management"]}},"/api/business/subscription/create":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"callback":{"type":"string"},"billingemail":{"type":"string"},"plan":{"description":"Plan key to subscribe to — one of sneaky, steady, growing, established. Omitted means the configured default. Validated before the merchant is sent to save a card, and refused with the same codes /api/billing/plan uses.","oneOf":[{"type":"string"},{"type":"null"}]},"discountcode":{"description":"A customer-entered discount/promotion code. Optional; validated at Stripe before the merchant is sent to save a card, and re-validated when the subscription is actually created. Refused with :invalid-discount, :expired-discount or :discount-ineligible, never charged against silently.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","callback"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"callback":{"type":"string"},"billingemail":{"type":"string"},"plan":{"description":"Plan key to subscribe to — one of sneaky, steady, growing, established. Omitted means the configured default. Validated before the merchant is sent to save a card, and refused with the same codes /api/billing/plan uses.","oneOf":[{"type":"string"},{"type":"null"}]},"discountcode":{"description":"A customer-entered discount/promotion code. Optional; validated at Stripe before the merchant is sent to save a card, and re-validated when the subscription is actually created. Refused with :invalid-discount, :expired-discount or :discount-ineligible, never charged against silently.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","callback"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"callback":{"type":"string"},"billingemail":{"type":"string"},"plan":{"description":"Plan key to subscribe to — one of sneaky, steady, growing, established. Omitted means the configured default. Validated before the merchant is sent to save a card, and refused with the same codes /api/billing/plan uses.","oneOf":[{"type":"string"},{"type":"null"}]},"discountcode":{"description":"A customer-entered discount/promotion code. Optional; validated at Stripe before the merchant is sent to save a card, and re-validated when the subscription is actually created. Refused with :invalid-discount, :expired-discount or :discount-ineligible, never charged against silently.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","callback"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"callback":{"type":"string"},"billingemail":{"type":"string"},"plan":{"description":"Plan key to subscribe to — one of sneaky, steady, growing, established. Omitted means the configured default. Validated before the merchant is sent to save a card, and refused with the same codes /api/billing/plan uses.","oneOf":[{"type":"string"},{"type":"null"}]},"discountcode":{"description":"A customer-entered discount/promotion code. Optional; validated at Stripe before the merchant is sent to save a card, and re-validated when the subscription is actually created. Refused with :invalid-discount, :expired-discount or :discount-ineligible, never charged against silently.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","callback"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Subscribe business to plan then go to callback url","tags":["business management"]}},"/api/business/subscription/card-first":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"callback":{"type":"string"},"billingemail":{"type":"string"},"plan":{"description":"Plan key to subscribe to — one of sneaky, steady, growing, established. Omitted means the configured default. Validated before the merchant is sent to save a card, and refused with the same codes /api/billing/plan uses.","oneOf":[{"type":"string"},{"type":"null"}]},"discountcode":{"description":"A customer-entered discount/promotion code. Optional; validated at Stripe before the merchant is sent to save a card, and re-validated when the subscription is actually created. Refused with :invalid-discount, :expired-discount or :discount-ineligible, never charged against silently.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","callback"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"callback":{"type":"string"},"billingemail":{"type":"string"},"plan":{"description":"Plan key to subscribe to — one of sneaky, steady, growing, established. Omitted means the configured default. Validated before the merchant is sent to save a card, and refused with the same codes /api/billing/plan uses.","oneOf":[{"type":"string"},{"type":"null"}]},"discountcode":{"description":"A customer-entered discount/promotion code. Optional; validated at Stripe before the merchant is sent to save a card, and re-validated when the subscription is actually created. Refused with :invalid-discount, :expired-discount or :discount-ineligible, never charged against silently.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","callback"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"callback":{"type":"string"},"billingemail":{"type":"string"},"plan":{"description":"Plan key to subscribe to — one of sneaky, steady, growing, established. Omitted means the configured default. Validated before the merchant is sent to save a card, and refused with the same codes /api/billing/plan uses.","oneOf":[{"type":"string"},{"type":"null"}]},"discountcode":{"description":"A customer-entered discount/promotion code. Optional; validated at Stripe before the merchant is sent to save a card, and re-validated when the subscription is actually created. Refused with :invalid-discount, :expired-discount or :discount-ineligible, never charged against silently.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","callback"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"callback":{"type":"string"},"billingemail":{"type":"string"},"plan":{"description":"Plan key to subscribe to — one of sneaky, steady, growing, established. Omitted means the configured default. Validated before the merchant is sent to save a card, and refused with the same codes /api/billing/plan uses.","oneOf":[{"type":"string"},{"type":"null"}]},"discountcode":{"description":"A customer-entered discount/promotion code. Optional; validated at Stripe before the merchant is sent to save a card, and re-validated when the subscription is actually created. Refused with :invalid-discount, :expired-discount or :discount-ineligible, never charged against silently.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","callback"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Save a card first, then create the subscription on it — no charge at checkout","tags":["business management"]}},"/api/business/subscription/state":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Subscription state: live, paused, and the card it bills","tags":["business management"]}},"/api/business/subscription/pause":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Pause collection, keeping the subscription and its billing anchor","tags":["business management"]}},"/api/business/subscription/resume":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Resume collection on a paused subscription","tags":["business management"]}},"/api/business/subscription/paynow":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Collect the outstanding invoice now instead of waiting for Stripe's next dunning attempt","tags":["business management"]}},"/api/business/subscription/manage":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"callback":{"type":"string"},"billingemail":{"type":"string"},"plan":{"description":"Plan key to subscribe to — one of sneaky, steady, growing, established. Omitted means the configured default. Validated before the merchant is sent to save a card, and refused with the same codes /api/billing/plan uses.","oneOf":[{"type":"string"},{"type":"null"}]},"discountcode":{"description":"A customer-entered discount/promotion code. Optional; validated at Stripe before the merchant is sent to save a card, and re-validated when the subscription is actually created. Refused with :invalid-discount, :expired-discount or :discount-ineligible, never charged against silently.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","callback"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"callback":{"type":"string"},"billingemail":{"type":"string"},"plan":{"description":"Plan key to subscribe to — one of sneaky, steady, growing, established. Omitted means the configured default. Validated before the merchant is sent to save a card, and refused with the same codes /api/billing/plan uses.","oneOf":[{"type":"string"},{"type":"null"}]},"discountcode":{"description":"A customer-entered discount/promotion code. Optional; validated at Stripe before the merchant is sent to save a card, and re-validated when the subscription is actually created. Refused with :invalid-discount, :expired-discount or :discount-ineligible, never charged against silently.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","callback"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"callback":{"type":"string"},"billingemail":{"type":"string"},"plan":{"description":"Plan key to subscribe to — one of sneaky, steady, growing, established. Omitted means the configured default. Validated before the merchant is sent to save a card, and refused with the same codes /api/billing/plan uses.","oneOf":[{"type":"string"},{"type":"null"}]},"discountcode":{"description":"A customer-entered discount/promotion code. Optional; validated at Stripe before the merchant is sent to save a card, and re-validated when the subscription is actually created. Refused with :invalid-discount, :expired-discount or :discount-ineligible, never charged against silently.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","callback"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"callback":{"type":"string"},"billingemail":{"type":"string"},"plan":{"description":"Plan key to subscribe to — one of sneaky, steady, growing, established. Omitted means the configured default. Validated before the merchant is sent to save a card, and refused with the same codes /api/billing/plan uses.","oneOf":[{"type":"string"},{"type":"null"}]},"discountcode":{"description":"A customer-entered discount/promotion code. Optional; validated at Stripe before the merchant is sent to save a card, and re-validated when the subscription is actually created. Refused with :invalid-discount, :expired-discount or :discount-ineligible, never charged against silently.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","callback"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Manage plan then go to callback url","tags":["business management"]}},"/api/business/subscription/cancel":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Cancel subscription","tags":["business management"]}},"/api/business/subscription/billing-date":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"date":{"type":"string"},"preview":{"type":"boolean"}},"required":["token","date"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"date":{"type":"string"},"preview":{"type":"boolean"}},"required":["token","date"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"date":{"type":"string"},"preview":{"type":"boolean"}},"required":["token","date"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"date":{"type":"string"},"preview":{"type":"boolean"}},"required":["token","date"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Change the subscription billing date; the pro-rata difference folds into the next invoice","tags":["business management"]}},"/api/business/subscription/invoices":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"List Stripe subscription invoices with downloadable tax-invoice PDFs","tags":["business management"]}},"/api/business/subscription/details":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Current Stripe subscription pricing and status for the settings card","tags":["business management"]}},"/api/business/subscription/usage":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"days":{"oneOf":[{"type":"integer"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"days":{"oneOf":[{"type":"integer"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"days":{"oneOf":[{"type":"integer"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"days":{"oneOf":[{"type":"integer"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Action consumption for the settings card: what stub did for the business over the trailing window (default 30 days) in customer units, the credits it moved, and the current balance","tags":["business management"]}},"/api/business/storefront/{uid}":{"get":{"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Get business storefront","tags":["business management"]}},"/api/business/get-by-tag/{tag}":{"get":{"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Get business details by tag","tags":["business management"]}},"/api/business/get-by-tag/{tag}/{product}":{"get":{"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Get business details by tag","tags":["business management"]}},"/api/business/set-tag":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"tag":{"description":"The business tag/segment label to set on this business (drives segmentation and routing).","type":"string"}},"required":["token","tag"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"tag":{"description":"The business tag/segment label to set on this business (drives segmentation and routing).","type":"string"}},"required":["token","tag"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"tag":{"description":"The business tag/segment label to set on this business (drives segmentation and routing).","type":"string"}},"required":["token","tag"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"tag":{"description":"The business tag/segment label to set on this business (drives segmentation and routing).","type":"string"}},"required":["token","tag"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Set the single segmentation tag/label on the business itself (drives segmentation and routing). Use only to tag the business entity; to change the business's free-text description use set_business_description, and to tag individual records (transactions, invoices, expenses) use set_entity_tags.","tags":["business management"]}},"/api/business/credit-referrer":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"tag":{"description":"The business tag/segment label to set on this business (drives segmentation and routing).","type":"string"}},"required":["token","tag"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"tag":{"description":"The business tag/segment label to set on this business (drives segmentation and routing).","type":"string"}},"required":["token","tag"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"tag":{"description":"The business tag/segment label to set on this business (drives segmentation and routing).","type":"string"}},"required":["token","tag"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"tag":{"description":"The business tag/segment label to set on this business (drives segmentation and routing).","type":"string"}},"required":["token","tag"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Credit referrer","tags":["business management"]}},"/api/business/yodlee-passthrough":{"post":{"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Send data to yodlee","tags":["business management"]}},"/api/business/delink-streamelements":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Remove streamelements integration","tags":["business management"]}},"/api/business/permissions":{"get":{"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Get the signed-in member's resolved permission matrix","tags":["business management"]}},"/api/business/rollup/list":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"rollup":{"description":"\"day\" or \"complete\".","type":"string"},"list":{"description":"The list page: sales, expenses or transactions.","type":"string"},"from":{"description":"First day, YYYY-MM-DD.","oneOf":[{"type":"string"},{"type":"null"}]},"to":{"description":"Last day, YYYY-MM-DD.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","rollup","list"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"rollup":{"description":"\"day\" or \"complete\".","type":"string"},"list":{"description":"The list page: sales, expenses or transactions.","type":"string"},"from":{"description":"First day, YYYY-MM-DD.","oneOf":[{"type":"string"},{"type":"null"}]},"to":{"description":"Last day, YYYY-MM-DD.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","rollup","list"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"rollup":{"description":"\"day\" or \"complete\".","type":"string"},"list":{"description":"The list page: sales, expenses or transactions.","type":"string"},"from":{"description":"First day, YYYY-MM-DD.","oneOf":[{"type":"string"},{"type":"null"}]},"to":{"description":"Last day, YYYY-MM-DD.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","rollup","list"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"rollup":{"description":"\"day\" or \"complete\".","type":"string"},"list":{"description":"The list page: sales, expenses or transactions.","type":"string"},"from":{"description":"First day, YYYY-MM-DD.","oneOf":[{"type":"string"},{"type":"null"}]},"to":{"description":"Last day, YYYY-MM-DD.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","rollup","list"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Get what one list page shows under a rollup strategy: its rows, and the records that stayed records, for a range of days.","tags":["business management"]}},"/api/business/rollup/get":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"A rollup id from business/get's `rollups`.","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"A rollup id from business/get's `rollups`.","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"A rollup id from business/get's `rollups`.","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"A rollup id from business/get's `rollups`.","type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Get the records behind one rollup of business/get, as the caller is served them.","tags":["business management"]}},"/api/business/verification":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Where the business stands on the five steps that verify it: each owner's identity, two-factor sign-in, the bank account and the company documents. Read-only.","tags":["business management"]}},"/api/business/verification/parts":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"The four parts of the verification modal, with the owners, shares and account details only an owner sees","tags":["business management"]}},"/api/business/verification/remind":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"uid":{"type":"string"}},"required":["token","uid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"uid":{"type":"string"}},"required":["token","uid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"uid":{"type":"string"}},"required":["token","uid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"uid":{"type":"string"}},"required":["token","uid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Email a co-owner a link to verify their own identity","tags":["business management"]}},"/api/business/payments/enablement":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Enable payments for your account: whether the bank account syncs, sign-in has two-factor or a passkey, and a card is on file for stub's fees","tags":["business management"]}},"/api/business/payments/fee-agreement":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"agree":{"type":"boolean"}},"required":["token","agree"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"agree":{"type":"boolean"}},"required":["token","agree"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"agree":{"type":"boolean"}},"required":["token","agree"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"agree":{"type":"boolean"}},"required":["token","agree"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Agree to stub's payment fees, billed to a card linked to the account: records the dated agreement for the business. Owner or administrator, as enabling stub payments is","tags":["business management"]}},"/api/business/kyb/folder":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"The Company documents folder, made on first use","tags":["business management"]}},"/api/business/kyb/verifying":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"The files the business's verification stands on","tags":["business management"]}},"/api/business/ownership/owners":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"owners":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"share":{"anyOf":[{"type":"string"},{"type":"number"}]}},"required":["name","share"],"additionalProperties":false}}},"required":["token","owners"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"owners":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"share":{"anyOf":[{"type":"string"},{"type":"number"}]}},"required":["name","share"],"additionalProperties":false}}},"required":["token","owners"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"owners":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"share":{"anyOf":[{"type":"string"},{"type":"number"}]}},"required":["name","share"],"additionalProperties":false}}},"required":["token","owners"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"owners":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"share":{"anyOf":[{"type":"string"},{"type":"number"}]}},"required":["name","share"],"additionalProperties":false}}},"required":["token","owners"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Declare who owns the business: everyone with 5% or more","tags":["business management"]}},"/api/business/ownership/submit":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"folderid":{"type":"string"},"documents":{"type":"array","items":{"type":"object","properties":{"fileid":{"type":"string"}},"required":["fileid"],"additionalProperties":false}}},"required":["token","folderid","documents"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"folderid":{"type":"string"},"documents":{"type":"array","items":{"type":"object","properties":{"fileid":{"type":"string"}},"required":["fileid"],"additionalProperties":false}}},"required":["token","folderid","documents"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"folderid":{"type":"string"},"documents":{"type":"array","items":{"type":"object","properties":{"fileid":{"type":"string"}},"required":["fileid"],"additionalProperties":false}}},"required":["token","folderid","documents"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"folderid":{"type":"string"},"documents":{"type":"array","items":{"type":"object","properties":{"fileid":{"type":"string"}},"required":["fileid"],"additionalProperties":false}}},"required":["token","folderid","documents"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Point the ownership check at the document that shows who owns the shares","tags":["business management"]}},"/api/billing/overview":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"This billing period's action usage (for the plan's Stripe billing line items use get_subscription): actions used against the plan allowance plus the extra actions top-ups and grants add (limit, left; `extra-granted` is the part of `extra` stub granted free, and only the rest was bought, so never call a grant purchased), when the allowance resets, the prepaid balance in cents and actions, whether the plan allowance is spent or the business is out, usage by kind of work, `days` (this period's counted actions by SAST day, split into askstub, workflows and other; days with none are left out), and the hours saved. When `sponsored` is true the business is not metered, so `limit`, `left` and `out?` are not a real cap; when `trial` is true it has no paid plan yet. `billedby` names who bills the business: \"stripe\", or a partner such as \"shopify\" that takes the payment itself, so stub asks it for no card. `trialends` is the day its trial ends while it is on one, the partner's own date for a partner trial. `plan-label` is the plan by the name the customer sees; `legacy` true means a grandfathered plan whose allowance differs from the pricing page. `period-topups` lists this period's top-ups oldest first: `at` (SAST date and time), `actions` (what it adds at today's rate, rounded down, so they can sum to less than `extra`), `credit-cents` (what it added to the balance, not the price paid) and `kind` (purchase, or a grant from stub, which counts in `extra` but not as bought). A top-up bought after a low-balance warning does not make that warning wrong: compare the top-up's `at` with the time of the warning before you say a count was wrong.","tags":["billing"]}},"/api/billing/plans":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"The business's plan, what it includes, what each plan includes and the trial days left; for actions used this period use get_action_usage, and for the plan's billing line items use get_subscription. `plan`: the plan they are on by its customer name, whether it is legacy, its price, `status` and `trialing`; `trial` (trialists only) has the start and end dates, `days_left` and `actions_cap`, the actions a trial period grants; `features` is what is on today, `lacks` each plan-gated feature they do not have with the lowest plan that has it, and `not_by_plan` what a card and verification turn on instead; `automatic_bank_sync` and `history_limit_months` are this business's sync terms. `plans`: every live plan cheapest first with its `features`, what it `adds` over the plan below, its actions and seats, and the free plan's `limits`. Prices for other plans are not here: look them up in the guide. A feature no plan lists is on every plan.","tags":["billing"]}},"/api/billing/subscription":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"The business's stub subscription and its billing line items, and whether it still bills; for what their plan includes, what each plan includes and trial days left, use get_plan; for the actions used this period and what is left, use get_action_usage. `subscription` is the billing line items. `status` is active, cancelling, cancelled, lapsed, trial, trial ended or free. When `cancelled` (the day they cancelled) is set there is no `next_billing`: no further charge is due, and `ends_on` is the last day of the paid period. Otherwise `next_billing` is the next charge date of a live subscription. For the business's own profile use get_business_profile, and for its trading financials use get_financial_summary.","tags":["billing"]}},"/api/billing/usage":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"period":{"oneOf":[{"type":"string"},{"type":"null"}]},"month":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"period":{"oneOf":[{"type":"string"},{"type":"null"}]},"month":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"period":{"oneOf":[{"type":"string"},{"type":"null"}]},"month":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"period":{"oneOf":[{"type":"string"},{"type":"null"}]},"month":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"By-action usage breakdown in customer wording: the billing-anchored week by default (period 'week'), or a legacy calendar month when 'month' is passed without 'period'","tags":["billing"]}},"/api/billing/statement":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"month":{"oneOf":[{"type":"string"},{"type":"null"}]},"offset":{"oneOf":[{"type":"integer"},{"type":"null"}]},"limit":{"oneOf":[{"type":"integer"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"month":{"oneOf":[{"type":"string"},{"type":"null"}]},"offset":{"oneOf":[{"type":"integer"},{"type":"null"}]},"limit":{"oneOf":[{"type":"integer"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"month":{"oneOf":[{"type":"string"},{"type":"null"}]},"offset":{"oneOf":[{"type":"integer"},{"type":"null"}]},"limit":{"oneOf":[{"type":"integer"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"month":{"oneOf":[{"type":"string"},{"type":"null"}]},"offset":{"oneOf":[{"type":"integer"},{"type":"null"}]},"limit":{"oneOf":[{"type":"integer"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"One page of a month's action statement, newest first — every action, its customer label, quantity and timestamp","tags":["billing"]}},"/api/billing/topup":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"bundle":{"description":"The id of the action bundle to buy (overview :topup :bundles).","oneOf":[{"type":"string"},{"type":"null"}]},"idempotencykey":{"description":"Client-minted, one per attempt (a retry of the same attempt reuses it). Falls back to the Idempotency-Key header.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"bundle":{"description":"The id of the action bundle to buy (overview :topup :bundles).","oneOf":[{"type":"string"},{"type":"null"}]},"idempotencykey":{"description":"Client-minted, one per attempt (a retry of the same attempt reuses it). Falls back to the Idempotency-Key header.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"bundle":{"description":"The id of the action bundle to buy (overview :topup :bundles).","oneOf":[{"type":"string"},{"type":"null"}]},"idempotencykey":{"description":"Client-minted, one per attempt (a retry of the same attempt reuses it). Falls back to the Idempotency-Key header.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"bundle":{"description":"The id of the action bundle to buy (overview :topup :bundles).","oneOf":[{"type":"string"},{"type":"null"}]},"idempotencykey":{"description":"Client-minted, one per attempt (a retry of the same attempt reuses it). Falls back to the Idempotency-Key header.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Buy an action bundle: charge the `bundle`'s price on the card on file as a one-off Stripe invoice, and credit the rand balance once paid","tags":["billing"]}},"/api/billing/autotopup":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"enabled":{"description":"Turn automatic top-up on or off.","oneOf":[{"type":"boolean"},{"type":"null"}]},"amount-cents":{"description":"ZAR cents charged each time the balance runs low (overview :topup :min-cents / :max-cents).","oneOf":[{"type":"integer"},{"type":"null"}]},"monthly-cap-cents":{"description":"Most ZAR cents of automatic top-ups per billing period; at least amount-cents.","oneOf":[{"type":"integer"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"enabled":{"description":"Turn automatic top-up on or off.","oneOf":[{"type":"boolean"},{"type":"null"}]},"amount-cents":{"description":"ZAR cents charged each time the balance runs low (overview :topup :min-cents / :max-cents).","oneOf":[{"type":"integer"},{"type":"null"}]},"monthly-cap-cents":{"description":"Most ZAR cents of automatic top-ups per billing period; at least amount-cents.","oneOf":[{"type":"integer"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"enabled":{"description":"Turn automatic top-up on or off.","oneOf":[{"type":"boolean"},{"type":"null"}]},"amount-cents":{"description":"ZAR cents charged each time the balance runs low (overview :topup :min-cents / :max-cents).","oneOf":[{"type":"integer"},{"type":"null"}]},"monthly-cap-cents":{"description":"Most ZAR cents of automatic top-ups per billing period; at least amount-cents.","oneOf":[{"type":"integer"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"enabled":{"description":"Turn automatic top-up on or off.","oneOf":[{"type":"boolean"},{"type":"null"}]},"amount-cents":{"description":"ZAR cents charged each time the balance runs low (overview :topup :min-cents / :max-cents).","oneOf":[{"type":"integer"},{"type":"null"}]},"monthly-cap-cents":{"description":"Most ZAR cents of automatic top-ups per billing period; at least amount-cents.","oneOf":[{"type":"integer"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Set automatic top-up: charge `amount-cents` on the card on file whenever the rand balance runs low, at most `monthly-cap-cents` a billing period. Opt-in; a declined card turns it off","tags":["billing"]}},"/api/billing/topup/estimate":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"cents":{"description":"ZAR cents to estimate.","type":"integer"}},"required":["token","cents"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"cents":{"description":"ZAR cents to estimate.","type":"integer"}},"required":["token","cents"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"cents":{"description":"ZAR cents to estimate.","type":"integer"}},"required":["token","cents"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"cents":{"description":"ZAR cents to estimate.","type":"integer"}},"required":["token","cents"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Estimate a rand top-up: the actions `cents` buys at today's rate and the work it saves. Commits nothing","tags":["billing"]}},"/api/billing/topup/quote":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"bundle":{"description":"The id of the action bundle to price (overview :topup :bundles).","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"bundle":{"description":"The id of the action bundle to price (overview :topup :bundles).","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"bundle":{"description":"The id of the action bundle to price (overview :topup :bundles).","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"bundle":{"description":"The id of the action bundle to price (overview :topup :bundles).","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Price an action bundle: what `bundle` costs, the actions it buys and the rands it adds to the balance. Commits nothing","tags":["billing"]}},"/api/billing/discount":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"discountcode":{"description":"The discount/promotion code the customer typed. Checked at Stripe and put through the same refusals that apply when it is spent, but nothing is created and nothing is charged.","type":"string"},"plan":{"description":"The plan the customer is looking at, when they have picked one. Only used to refuse a code on a downgrade, which is scheduled with nothing to invoice today. Omitted means judge the code on its own.","oneOf":[{"type":"string"},{"type":"null"}]},"connecting":{"description":"Price a partner code that waits on a bank connection as if the connection were made today, so a plan card can show what connecting unlocks. Spending the code still needs the connection.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","discountcode"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"discountcode":{"description":"The discount/promotion code the customer typed. Checked at Stripe and put through the same refusals that apply when it is spent, but nothing is created and nothing is charged.","type":"string"},"plan":{"description":"The plan the customer is looking at, when they have picked one. Only used to refuse a code on a downgrade, which is scheduled with nothing to invoice today. Omitted means judge the code on its own.","oneOf":[{"type":"string"},{"type":"null"}]},"connecting":{"description":"Price a partner code that waits on a bank connection as if the connection were made today, so a plan card can show what connecting unlocks. Spending the code still needs the connection.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","discountcode"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"discountcode":{"description":"The discount/promotion code the customer typed. Checked at Stripe and put through the same refusals that apply when it is spent, but nothing is created and nothing is charged.","type":"string"},"plan":{"description":"The plan the customer is looking at, when they have picked one. Only used to refuse a code on a downgrade, which is scheduled with nothing to invoice today. Omitted means judge the code on its own.","oneOf":[{"type":"string"},{"type":"null"}]},"connecting":{"description":"Price a partner code that waits on a bank connection as if the connection were made today, so a plan card can show what connecting unlocks. Spending the code still needs the connection.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","discountcode"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"discountcode":{"description":"The discount/promotion code the customer typed. Checked at Stripe and put through the same refusals that apply when it is spent, but nothing is created and nothing is charged.","type":"string"},"plan":{"description":"The plan the customer is looking at, when they have picked one. Only used to refuse a code on a downgrade, which is scheduled with nothing to invoice today. Omitted means judge the code on its own.","oneOf":[{"type":"string"},{"type":"null"}]},"connecting":{"description":"Price a partner code that waits on a bank connection as if the connection were made today, so a plan card can show what connecting unlocks. Spending the code still needs the connection.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","discountcode"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"What a discount code is worth: check it at Stripe and say what it takes off, without creating a subscription or charging anything","tags":["billing"]}},"/api/billing/offer":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"The partner offer the billing page shows this business, if any: its key, the next step (subscribe or connect-capitec), the code and the plans it is on","tags":["billing"]}},"/api/billing/offer/dismiss":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"key":{"oneOf":[{"type":"string"},{"type":"null"}]},"step":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"key":{"oneOf":[{"type":"string"},{"type":"null"}]},"step":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"key":{"oneOf":[{"type":"string"},{"type":"null"}]},"step":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"key":{"oneOf":[{"type":"string"},{"type":"null"}]},"step":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Dismiss one step of a partner offer, so the billing page stops showing it until the offer has a new step to show","tags":["billing"]}},"/api/billing/shopify-plan":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"shop":{"type":"string"},"plan_handle":{"type":"string"}},"required":["shop","plan_handle"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"shop":{"type":"string"},"plan_handle":{"type":"string"}},"required":["shop","plan_handle"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"shop":{"type":"string"},"plan_handle":{"type":"string"}},"required":["shop","plan_handle"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"shop":{"type":"string"},"plan_handle":{"type":"string"}},"required":["shop","plan_handle"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Confirm the plan a merchant chose on Shopify's pricing page and start it on stub","tags":["billing"]}},"/api/billing/shopify-plan-url":{"post":{"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Record a Shopify-billed business's plan, or give Shopify's plan page when there is none yet; a Shopify-billed business always gets the page to change its plan","tags":["billing"]}},"/api/billing/plan":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"plan":{"description":"Plan key to move to — one of sneaky, steady, growing, established. Read through logic.plans/canonical, so a retired key still resolves.","type":"string"},"confirm":{"description":"Required only when leaving a grandfathered plan, which cannot be returned to. Without it that one case is refused with confirm-required and the price being given up.","oneOf":[{"type":"boolean"},{"type":"null"}]},"discountcode":{"description":"A customer-entered discount/promotion code, applied to the upgrade being invoiced now. Only honoured on an upgrade — a downgrade is scheduled with nothing to invoice today, and Stripe forbids an amount-restricted code on any subscription update at all, so one is refused outright rather than sent and rejected at the till.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","plan"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"plan":{"description":"Plan key to move to — one of sneaky, steady, growing, established. Read through logic.plans/canonical, so a retired key still resolves.","type":"string"},"confirm":{"description":"Required only when leaving a grandfathered plan, which cannot be returned to. Without it that one case is refused with confirm-required and the price being given up.","oneOf":[{"type":"boolean"},{"type":"null"}]},"discountcode":{"description":"A customer-entered discount/promotion code, applied to the upgrade being invoiced now. Only honoured on an upgrade — a downgrade is scheduled with nothing to invoice today, and Stripe forbids an amount-restricted code on any subscription update at all, so one is refused outright rather than sent and rejected at the till.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","plan"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"plan":{"description":"Plan key to move to — one of sneaky, steady, growing, established. Read through logic.plans/canonical, so a retired key still resolves.","type":"string"},"confirm":{"description":"Required only when leaving a grandfathered plan, which cannot be returned to. Without it that one case is refused with confirm-required and the price being given up.","oneOf":[{"type":"boolean"},{"type":"null"}]},"discountcode":{"description":"A customer-entered discount/promotion code, applied to the upgrade being invoiced now. Only honoured on an upgrade — a downgrade is scheduled with nothing to invoice today, and Stripe forbids an amount-restricted code on any subscription update at all, so one is refused outright rather than sent and rejected at the till.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","plan"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"plan":{"description":"Plan key to move to — one of sneaky, steady, growing, established. Read through logic.plans/canonical, so a retired key still resolves.","type":"string"},"confirm":{"description":"Required only when leaving a grandfathered plan, which cannot be returned to. Without it that one case is refused with confirm-required and the price being given up.","oneOf":[{"type":"boolean"},{"type":"null"}]},"discountcode":{"description":"A customer-entered discount/promotion code, applied to the upgrade being invoiced now. Only honoured on an upgrade — a downgrade is scheduled with nothing to invoice today, and Stripe forbids an amount-restricted code on any subscription update at all, so one is refused outright rather than sent and rejected at the till.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","plan"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Change plan on the card already on file: an upgrade takes effect now and Stripe invoices the pro-rated difference, a downgrade is scheduled for the end of the paid period","tags":["billing"]}},"/api/offer/signup":{"get":{"parameters":[{"in":"query","name":"referrer","required":false,"schema":{"oneOf":[{"type":"string"},{"type":"null"}]}}],"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"The signup page's heading and logo file name for a visitor arriving with `referrer`, or null. Public.","tags":["billing"]}},"/api/card/status":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"The card on file for claim cover: brand, last four and expiry","tags":["card"]}},"/api/card/setup":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"callback":{"description":"URL Stripe Checkout returns to once the card is saved.","type":"string"},"cancelcallback":{"description":"URL to return to if the merchant abandons the form.","oneOf":[{"type":"string"},{"type":"null"}]},"cardonly":{"description":"Offer card only, no Link wallet: payment fees need a card.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","callback"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"callback":{"description":"URL Stripe Checkout returns to once the card is saved.","type":"string"},"cancelcallback":{"description":"URL to return to if the merchant abandons the form.","oneOf":[{"type":"string"},{"type":"null"}]},"cardonly":{"description":"Offer card only, no Link wallet: payment fees need a card.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","callback"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"callback":{"description":"URL Stripe Checkout returns to once the card is saved.","type":"string"},"cancelcallback":{"description":"URL to return to if the merchant abandons the form.","oneOf":[{"type":"string"},{"type":"null"}]},"cardonly":{"description":"Offer card only, no Link wallet: payment fees need a card.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","callback"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"callback":{"description":"URL Stripe Checkout returns to once the card is saved.","type":"string"},"cancelcallback":{"description":"URL to return to if the merchant abandons the form.","oneOf":[{"type":"string"},{"type":"null"}]},"cardonly":{"description":"Offer card only, no Link wallet: payment fees need a card.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","callback"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Start Stripe Checkout to save a card on file; the webhook records it once Stripe confirms","tags":["card"]}},"/api/card/remove":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Detach the saved card. Refused while any claim hold is still open against it","tags":["card"]}},"/api/chat/turn/{turnid}/events":{"get":{"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Replay a turn's streamed events from a seq cursor","tags":["Ask stub — turns"]}},"/api/chat/turn/{turnid}/undo":{"post":{"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Reverse every write a turn's tools made","tags":["Ask stub — turns"]}},"/api/chat/turn/{turnid}/stop":{"post":{"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Stop a streaming turn before its next hop or tool call","tags":["Ask stub — turns"]}},"/api/chat/turn":{"post":{"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Run one conversation turn, streaming typed SSE events","description":"Body {prompt, attachments?, conversation?, confirm?, carryon?, answer?, page?, steps?, topups?, rerun?, datasets?, from?}. With no conversation the turn opens a new one (on the summary of `from` when its turn_end offered newchat), and turn_start carries its id. A turn still going at 10 minutes sums up and ends turn_end status paused with a prompt; carryon: <that turn id> continues it (prompt optional), or answers 409 not-paused. A turn that asked ends turn_end status awaiting-answer with a question; answer: {question-id, choice | choices | text} answers it, or answers 409 not-awaiting / 400 bad-answer. turn_end nomodel: true marks a reply no model wrote; rerun: true asks again on the model. Holds the connection and streams turn_start / block_start / text_delta / tool_progress / block_end / turn_end events, each carrying a monotonic seq. Reconnect with GET /api/chat/turn/:turnid/events?after=<seq>.","tags":["Ask stub — turns"]}},"/api/chat/conversations":{"get":{"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"List this business's conversations, most recent first","description":"Summaries only, no turns. Archived conversations are excluded unless ?archived=true.","tags":["Ask stub — turns"]}},"/api/chat/conversation/{conversationid}":{"get":{"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"One conversation with its turn tree","tags":["Ask stub — turns"]}},"/api/chat/conversation/{conversationid}/archive":{"post":{"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Archive a conversation (soft delete)","tags":["Ask stub — turns"]}},"/api/chat/turn/{turnid}/rating":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"rating":{"oneOf":[{"type":"string","enum":["up","down"]},{"type":"null"}]}},"required":["rating"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"rating":{"oneOf":[{"type":"string","enum":["up","down"]},{"type":"null"}]}},"required":["rating"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"rating":{"oneOf":[{"type":"string","enum":["up","down"]},{"type":"null"}]}},"required":["rating"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"rating":{"oneOf":[{"type":"string","enum":["up","down"]},{"type":"null"}]}},"required":["rating"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Rate a turn's answer, thumbs up or down","description":"Body {rating: \"up\" | \"down\" | null}. Null clears it. Only assistant turns can be rated.","tags":["Ask stub — turns"]}},"/api/data/static":{"get":{"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Static data for income and expenses","tags":["data feeds"]}},"/api/data/rates":{"get":{"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Forex rates with USD as the base","tags":["data feeds"]}},"/api/data/exchange-rate":{"get":{"parameters":[{"in":"query","name":"date","required":true,"schema":{"type":"string"}},{"in":"query","name":"from","required":true,"schema":{"type":"string"}},{"in":"query","name":"to","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Historical exchange rate for a currency pair","tags":["data feeds"]}},"/api/data/dummy":{"get":{"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Generate dummy data","tags":["data feeds"]}},"/api/data/banks":{"get":{"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"List of supported banks","tags":["data feeds"]}},"/api/data/bank-sync-status":{"get":{"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"List of supported banks","tags":["data feeds"]}},"/api/data/fortune":{"get":{"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Get's a random quote","tags":["data feeds"]}},"/api/data/assets":{"get":{"parameters":[{"in":"query","name":"token","required":true,"schema":{"type":"string"}},{"in":"query","name":"path","required":true,"schema":{"type":"string"}},{"in":"query","name":"downloadfilename","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Retrieve asset","tags":["data feeds"]}},"/api/data/assets/{filename}":{"get":{"parameters":[{"in":"query","name":"token","required":true,"schema":{"type":"string"}},{"in":"query","name":"path","required":true,"schema":{"type":"string"}},{"in":"query","name":"downloadfilename","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Retrieve asset","tags":["data feeds"]}},"/api/data/upload":{"post":{"requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"},"id":{"type":"string"},"type":{"type":"string"},"token":{"type":"string"}},"required":["file","id","type","token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"upload asset","tags":["data feeds"]}},"/api/expense/create":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Expense id. Present → update that expense; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name / description of the expense.","oneOf":[{"type":"string"},{"type":"null"}]},"supplier":{"description":"Supplier id, or an exact supplier name to resolve (see list_suppliers).","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"quantity":{"description":"Number of units.","oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"description":"Unit amount before quantity/tax, in the record's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"total":{"description":"Total including quantity. Used only when amount is omitted: amount becomes total ÷ quantity, and must come to whole cents. If amount is also sent, amount wins.","oneOf":[{"type":"number"},{"type":"null"}]},"date":{"description":"Expense date (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"paid":{"description":"Whether this expense has been paid.","oneOf":[{"type":"boolean"},{"type":"null"}]},"paiddate":{"description":"Date payment was made (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"showquantity":{"description":"Whether to display the quantity column on the document.","oneOf":[{"type":"boolean"},{"type":"null"}]},"transactionid":{"description":"Bank transaction id to reconcile this expense against.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Manual FX rate to the business base currency; omit to use the stored/auto rate.","oneOf":[{"type":"number"},{"type":"null"}]},"method":{"description":"Payment method as free text (e.g. \"cash\", \"card\", \"eft\") — no fixed set.","oneOf":[{"type":"string"},{"type":"null"}]},"alert":{"description":"Alert/reminder note to surface on this expense.","oneOf":[{"type":"string"},{"type":"null"}]},"bankaccountid":{"description":"Bank account id the money moved through (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"ai":{"description":"Internal: set when the expense was produced by AI enrichment.","oneOf":[{"type":"boolean"},{"type":"null"}]},"salestax":{"description":"Whether sales tax (VAT) applies. May also be an array of salestax refs.","oneOf":[{},{"type":"null"}]},"salestaxpercent":{"description":"Sales tax rate as a percentage (e.g. 15 for 15%).","oneOf":[{"type":"number"},{"type":"null"}]},"salestaxamount":{"description":"Explicit sales tax amount; used instead of the percentage when salestaxuseamount is true.","oneOf":[{"type":"number"},{"type":"null"}]},"salestaxuseamount":{"description":"When true, use salestaxamount as the tax figure instead of computing from the percentage.","oneOf":[{"type":"boolean"},{"type":"null"}]},"accountid":{"description":"Chart-of-accounts category account id, or an exact account name to resolve (see list_accounts). Set to a bill / purchase order / GRN document id (cont-…) to record this expense as a payment against that document. Set to a customer id (cli-…) to record a refund paid to that customer: it posts once to Receivables, tagged to the customer, with no VAT, and draws down their credit balance.","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"description":"Base/control account id override; rarely needed — defaults from the category.","oneOf":[{"type":"string"},{"type":"null"}]},"split":{"description":"Whether this expense is one line of a split transaction.","oneOf":[{"type":"boolean"},{"type":"null"}]},"groupid":{"description":"Group id linking split lines of one real-world transaction together.","oneOf":[{"type":"string"},{"type":"null"}]},"unlink":{"description":"Pass the id of a currently-linked transaction/document to detach it.","oneOf":[{"type":"string"},{"type":"null"}]},"taglist":{"description":"Tag ids to set on this expense (replaces the existing set).","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Expense id. Present → update that expense; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name / description of the expense.","oneOf":[{"type":"string"},{"type":"null"}]},"supplier":{"description":"Supplier id, or an exact supplier name to resolve (see list_suppliers).","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"quantity":{"description":"Number of units.","oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"description":"Unit amount before quantity/tax, in the record's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"total":{"description":"Total including quantity. Used only when amount is omitted: amount becomes total ÷ quantity, and must come to whole cents. If amount is also sent, amount wins.","oneOf":[{"type":"number"},{"type":"null"}]},"date":{"description":"Expense date (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"paid":{"description":"Whether this expense has been paid.","oneOf":[{"type":"boolean"},{"type":"null"}]},"paiddate":{"description":"Date payment was made (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"showquantity":{"description":"Whether to display the quantity column on the document.","oneOf":[{"type":"boolean"},{"type":"null"}]},"transactionid":{"description":"Bank transaction id to reconcile this expense against.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Manual FX rate to the business base currency; omit to use the stored/auto rate.","oneOf":[{"type":"number"},{"type":"null"}]},"method":{"description":"Payment method as free text (e.g. \"cash\", \"card\", \"eft\") — no fixed set.","oneOf":[{"type":"string"},{"type":"null"}]},"alert":{"description":"Alert/reminder note to surface on this expense.","oneOf":[{"type":"string"},{"type":"null"}]},"bankaccountid":{"description":"Bank account id the money moved through (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"ai":{"description":"Internal: set when the expense was produced by AI enrichment.","oneOf":[{"type":"boolean"},{"type":"null"}]},"salestax":{"description":"Whether sales tax (VAT) applies. May also be an array of salestax refs.","oneOf":[{},{"type":"null"}]},"salestaxpercent":{"description":"Sales tax rate as a percentage (e.g. 15 for 15%).","oneOf":[{"type":"number"},{"type":"null"}]},"salestaxamount":{"description":"Explicit sales tax amount; used instead of the percentage when salestaxuseamount is true.","oneOf":[{"type":"number"},{"type":"null"}]},"salestaxuseamount":{"description":"When true, use salestaxamount as the tax figure instead of computing from the percentage.","oneOf":[{"type":"boolean"},{"type":"null"}]},"accountid":{"description":"Chart-of-accounts category account id, or an exact account name to resolve (see list_accounts). Set to a bill / purchase order / GRN document id (cont-…) to record this expense as a payment against that document. Set to a customer id (cli-…) to record a refund paid to that customer: it posts once to Receivables, tagged to the customer, with no VAT, and draws down their credit balance.","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"description":"Base/control account id override; rarely needed — defaults from the category.","oneOf":[{"type":"string"},{"type":"null"}]},"split":{"description":"Whether this expense is one line of a split transaction.","oneOf":[{"type":"boolean"},{"type":"null"}]},"groupid":{"description":"Group id linking split lines of one real-world transaction together.","oneOf":[{"type":"string"},{"type":"null"}]},"unlink":{"description":"Pass the id of a currently-linked transaction/document to detach it.","oneOf":[{"type":"string"},{"type":"null"}]},"taglist":{"description":"Tag ids to set on this expense (replaces the existing set).","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Expense id. Present → update that expense; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name / description of the expense.","oneOf":[{"type":"string"},{"type":"null"}]},"supplier":{"description":"Supplier id, or an exact supplier name to resolve (see list_suppliers).","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"quantity":{"description":"Number of units.","oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"description":"Unit amount before quantity/tax, in the record's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"total":{"description":"Total including quantity. Used only when amount is omitted: amount becomes total ÷ quantity, and must come to whole cents. If amount is also sent, amount wins.","oneOf":[{"type":"number"},{"type":"null"}]},"date":{"description":"Expense date (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"paid":{"description":"Whether this expense has been paid.","oneOf":[{"type":"boolean"},{"type":"null"}]},"paiddate":{"description":"Date payment was made (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"showquantity":{"description":"Whether to display the quantity column on the document.","oneOf":[{"type":"boolean"},{"type":"null"}]},"transactionid":{"description":"Bank transaction id to reconcile this expense against.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Manual FX rate to the business base currency; omit to use the stored/auto rate.","oneOf":[{"type":"number"},{"type":"null"}]},"method":{"description":"Payment method as free text (e.g. \"cash\", \"card\", \"eft\") — no fixed set.","oneOf":[{"type":"string"},{"type":"null"}]},"alert":{"description":"Alert/reminder note to surface on this expense.","oneOf":[{"type":"string"},{"type":"null"}]},"bankaccountid":{"description":"Bank account id the money moved through (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"ai":{"description":"Internal: set when the expense was produced by AI enrichment.","oneOf":[{"type":"boolean"},{"type":"null"}]},"salestax":{"description":"Whether sales tax (VAT) applies. May also be an array of salestax refs.","oneOf":[{},{"type":"null"}]},"salestaxpercent":{"description":"Sales tax rate as a percentage (e.g. 15 for 15%).","oneOf":[{"type":"number"},{"type":"null"}]},"salestaxamount":{"description":"Explicit sales tax amount; used instead of the percentage when salestaxuseamount is true.","oneOf":[{"type":"number"},{"type":"null"}]},"salestaxuseamount":{"description":"When true, use salestaxamount as the tax figure instead of computing from the percentage.","oneOf":[{"type":"boolean"},{"type":"null"}]},"accountid":{"description":"Chart-of-accounts category account id, or an exact account name to resolve (see list_accounts). Set to a bill / purchase order / GRN document id (cont-…) to record this expense as a payment against that document. Set to a customer id (cli-…) to record a refund paid to that customer: it posts once to Receivables, tagged to the customer, with no VAT, and draws down their credit balance.","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"description":"Base/control account id override; rarely needed — defaults from the category.","oneOf":[{"type":"string"},{"type":"null"}]},"split":{"description":"Whether this expense is one line of a split transaction.","oneOf":[{"type":"boolean"},{"type":"null"}]},"groupid":{"description":"Group id linking split lines of one real-world transaction together.","oneOf":[{"type":"string"},{"type":"null"}]},"unlink":{"description":"Pass the id of a currently-linked transaction/document to detach it.","oneOf":[{"type":"string"},{"type":"null"}]},"taglist":{"description":"Tag ids to set on this expense (replaces the existing set).","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Expense id. Present → update that expense; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name / description of the expense.","oneOf":[{"type":"string"},{"type":"null"}]},"supplier":{"description":"Supplier id, or an exact supplier name to resolve (see list_suppliers).","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"quantity":{"description":"Number of units.","oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"description":"Unit amount before quantity/tax, in the record's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"total":{"description":"Total including quantity. Used only when amount is omitted: amount becomes total ÷ quantity, and must come to whole cents. If amount is also sent, amount wins.","oneOf":[{"type":"number"},{"type":"null"}]},"date":{"description":"Expense date (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"paid":{"description":"Whether this expense has been paid.","oneOf":[{"type":"boolean"},{"type":"null"}]},"paiddate":{"description":"Date payment was made (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"showquantity":{"description":"Whether to display the quantity column on the document.","oneOf":[{"type":"boolean"},{"type":"null"}]},"transactionid":{"description":"Bank transaction id to reconcile this expense against.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Manual FX rate to the business base currency; omit to use the stored/auto rate.","oneOf":[{"type":"number"},{"type":"null"}]},"method":{"description":"Payment method as free text (e.g. \"cash\", \"card\", \"eft\") — no fixed set.","oneOf":[{"type":"string"},{"type":"null"}]},"alert":{"description":"Alert/reminder note to surface on this expense.","oneOf":[{"type":"string"},{"type":"null"}]},"bankaccountid":{"description":"Bank account id the money moved through (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"ai":{"description":"Internal: set when the expense was produced by AI enrichment.","oneOf":[{"type":"boolean"},{"type":"null"}]},"salestax":{"description":"Whether sales tax (VAT) applies. May also be an array of salestax refs.","oneOf":[{},{"type":"null"}]},"salestaxpercent":{"description":"Sales tax rate as a percentage (e.g. 15 for 15%).","oneOf":[{"type":"number"},{"type":"null"}]},"salestaxamount":{"description":"Explicit sales tax amount; used instead of the percentage when salestaxuseamount is true.","oneOf":[{"type":"number"},{"type":"null"}]},"salestaxuseamount":{"description":"When true, use salestaxamount as the tax figure instead of computing from the percentage.","oneOf":[{"type":"boolean"},{"type":"null"}]},"accountid":{"description":"Chart-of-accounts category account id, or an exact account name to resolve (see list_accounts). Set to a bill / purchase order / GRN document id (cont-…) to record this expense as a payment against that document. Set to a customer id (cli-…) to record a refund paid to that customer: it posts once to Receivables, tagged to the customer, with no VAT, and draws down their credit balance.","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"description":"Base/control account id override; rarely needed — defaults from the category.","oneOf":[{"type":"string"},{"type":"null"}]},"split":{"description":"Whether this expense is one line of a split transaction.","oneOf":[{"type":"boolean"},{"type":"null"}]},"groupid":{"description":"Group id linking split lines of one real-world transaction together.","oneOf":[{"type":"string"},{"type":"null"}]},"unlink":{"description":"Pass the id of a currently-linked transaction/document to detach it.","oneOf":[{"type":"string"},{"type":"null"}]},"taglist":{"description":"Tag ids to set on this expense (replaces the existing set).","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Record an expense. Returns the new expense id. To pay a bill / purchase order / GRN, set accountid to that document's id. To record several at once, prefer create_income_expenses_bulk — one call instead of many.","tags":["expense management"]}},"/api/expense/update":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Expense id. Present → update that expense; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name / description of the expense.","oneOf":[{"type":"string"},{"type":"null"}]},"supplier":{"description":"Supplier id, or an exact supplier name to resolve (see list_suppliers).","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"quantity":{"description":"Number of units.","oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"description":"Unit amount before quantity/tax, in the record's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"total":{"description":"Total including quantity. Used only when amount is omitted: amount becomes total ÷ quantity, and must come to whole cents. If amount is also sent, amount wins.","oneOf":[{"type":"number"},{"type":"null"}]},"date":{"description":"Expense date (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"paid":{"description":"Whether this expense has been paid.","oneOf":[{"type":"boolean"},{"type":"null"}]},"paiddate":{"description":"Date payment was made (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"showquantity":{"description":"Whether to display the quantity column on the document.","oneOf":[{"type":"boolean"},{"type":"null"}]},"transactionid":{"description":"Bank transaction id to reconcile this expense against.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Manual FX rate to the business base currency; omit to use the stored/auto rate.","oneOf":[{"type":"number"},{"type":"null"}]},"method":{"description":"Payment method as free text (e.g. \"cash\", \"card\", \"eft\") — no fixed set.","oneOf":[{"type":"string"},{"type":"null"}]},"alert":{"description":"Alert/reminder note to surface on this expense.","oneOf":[{"type":"string"},{"type":"null"}]},"bankaccountid":{"description":"Bank account id the money moved through (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"ai":{"description":"Internal: set when the expense was produced by AI enrichment.","oneOf":[{"type":"boolean"},{"type":"null"}]},"salestax":{"description":"Whether sales tax (VAT) applies. May also be an array of salestax refs.","oneOf":[{},{"type":"null"}]},"salestaxpercent":{"description":"Sales tax rate as a percentage (e.g. 15 for 15%).","oneOf":[{"type":"number"},{"type":"null"}]},"salestaxamount":{"description":"Explicit sales tax amount; used instead of the percentage when salestaxuseamount is true.","oneOf":[{"type":"number"},{"type":"null"}]},"salestaxuseamount":{"description":"When true, use salestaxamount as the tax figure instead of computing from the percentage.","oneOf":[{"type":"boolean"},{"type":"null"}]},"accountid":{"description":"Chart-of-accounts category account id, or an exact account name to resolve (see list_accounts). Set to a bill / purchase order / GRN document id (cont-…) to record this expense as a payment against that document. Set to a customer id (cli-…) to record a refund paid to that customer: it posts once to Receivables, tagged to the customer, with no VAT, and draws down their credit balance.","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"description":"Base/control account id override; rarely needed — defaults from the category.","oneOf":[{"type":"string"},{"type":"null"}]},"split":{"description":"Whether this expense is one line of a split transaction.","oneOf":[{"type":"boolean"},{"type":"null"}]},"groupid":{"description":"Group id linking split lines of one real-world transaction together.","oneOf":[{"type":"string"},{"type":"null"}]},"unlink":{"description":"Pass the id of a currently-linked transaction/document to detach it.","oneOf":[{"type":"string"},{"type":"null"}]},"taglist":{"description":"Tag ids to set on this expense (replaces the existing set).","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Expense id. Present → update that expense; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name / description of the expense.","oneOf":[{"type":"string"},{"type":"null"}]},"supplier":{"description":"Supplier id, or an exact supplier name to resolve (see list_suppliers).","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"quantity":{"description":"Number of units.","oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"description":"Unit amount before quantity/tax, in the record's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"total":{"description":"Total including quantity. Used only when amount is omitted: amount becomes total ÷ quantity, and must come to whole cents. If amount is also sent, amount wins.","oneOf":[{"type":"number"},{"type":"null"}]},"date":{"description":"Expense date (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"paid":{"description":"Whether this expense has been paid.","oneOf":[{"type":"boolean"},{"type":"null"}]},"paiddate":{"description":"Date payment was made (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"showquantity":{"description":"Whether to display the quantity column on the document.","oneOf":[{"type":"boolean"},{"type":"null"}]},"transactionid":{"description":"Bank transaction id to reconcile this expense against.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Manual FX rate to the business base currency; omit to use the stored/auto rate.","oneOf":[{"type":"number"},{"type":"null"}]},"method":{"description":"Payment method as free text (e.g. \"cash\", \"card\", \"eft\") — no fixed set.","oneOf":[{"type":"string"},{"type":"null"}]},"alert":{"description":"Alert/reminder note to surface on this expense.","oneOf":[{"type":"string"},{"type":"null"}]},"bankaccountid":{"description":"Bank account id the money moved through (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"ai":{"description":"Internal: set when the expense was produced by AI enrichment.","oneOf":[{"type":"boolean"},{"type":"null"}]},"salestax":{"description":"Whether sales tax (VAT) applies. May also be an array of salestax refs.","oneOf":[{},{"type":"null"}]},"salestaxpercent":{"description":"Sales tax rate as a percentage (e.g. 15 for 15%).","oneOf":[{"type":"number"},{"type":"null"}]},"salestaxamount":{"description":"Explicit sales tax amount; used instead of the percentage when salestaxuseamount is true.","oneOf":[{"type":"number"},{"type":"null"}]},"salestaxuseamount":{"description":"When true, use salestaxamount as the tax figure instead of computing from the percentage.","oneOf":[{"type":"boolean"},{"type":"null"}]},"accountid":{"description":"Chart-of-accounts category account id, or an exact account name to resolve (see list_accounts). Set to a bill / purchase order / GRN document id (cont-…) to record this expense as a payment against that document. Set to a customer id (cli-…) to record a refund paid to that customer: it posts once to Receivables, tagged to the customer, with no VAT, and draws down their credit balance.","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"description":"Base/control account id override; rarely needed — defaults from the category.","oneOf":[{"type":"string"},{"type":"null"}]},"split":{"description":"Whether this expense is one line of a split transaction.","oneOf":[{"type":"boolean"},{"type":"null"}]},"groupid":{"description":"Group id linking split lines of one real-world transaction together.","oneOf":[{"type":"string"},{"type":"null"}]},"unlink":{"description":"Pass the id of a currently-linked transaction/document to detach it.","oneOf":[{"type":"string"},{"type":"null"}]},"taglist":{"description":"Tag ids to set on this expense (replaces the existing set).","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Expense id. Present → update that expense; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name / description of the expense.","oneOf":[{"type":"string"},{"type":"null"}]},"supplier":{"description":"Supplier id, or an exact supplier name to resolve (see list_suppliers).","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"quantity":{"description":"Number of units.","oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"description":"Unit amount before quantity/tax, in the record's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"total":{"description":"Total including quantity. Used only when amount is omitted: amount becomes total ÷ quantity, and must come to whole cents. If amount is also sent, amount wins.","oneOf":[{"type":"number"},{"type":"null"}]},"date":{"description":"Expense date (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"paid":{"description":"Whether this expense has been paid.","oneOf":[{"type":"boolean"},{"type":"null"}]},"paiddate":{"description":"Date payment was made (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"showquantity":{"description":"Whether to display the quantity column on the document.","oneOf":[{"type":"boolean"},{"type":"null"}]},"transactionid":{"description":"Bank transaction id to reconcile this expense against.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Manual FX rate to the business base currency; omit to use the stored/auto rate.","oneOf":[{"type":"number"},{"type":"null"}]},"method":{"description":"Payment method as free text (e.g. \"cash\", \"card\", \"eft\") — no fixed set.","oneOf":[{"type":"string"},{"type":"null"}]},"alert":{"description":"Alert/reminder note to surface on this expense.","oneOf":[{"type":"string"},{"type":"null"}]},"bankaccountid":{"description":"Bank account id the money moved through (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"ai":{"description":"Internal: set when the expense was produced by AI enrichment.","oneOf":[{"type":"boolean"},{"type":"null"}]},"salestax":{"description":"Whether sales tax (VAT) applies. May also be an array of salestax refs.","oneOf":[{},{"type":"null"}]},"salestaxpercent":{"description":"Sales tax rate as a percentage (e.g. 15 for 15%).","oneOf":[{"type":"number"},{"type":"null"}]},"salestaxamount":{"description":"Explicit sales tax amount; used instead of the percentage when salestaxuseamount is true.","oneOf":[{"type":"number"},{"type":"null"}]},"salestaxuseamount":{"description":"When true, use salestaxamount as the tax figure instead of computing from the percentage.","oneOf":[{"type":"boolean"},{"type":"null"}]},"accountid":{"description":"Chart-of-accounts category account id, or an exact account name to resolve (see list_accounts). Set to a bill / purchase order / GRN document id (cont-…) to record this expense as a payment against that document. Set to a customer id (cli-…) to record a refund paid to that customer: it posts once to Receivables, tagged to the customer, with no VAT, and draws down their credit balance.","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"description":"Base/control account id override; rarely needed — defaults from the category.","oneOf":[{"type":"string"},{"type":"null"}]},"split":{"description":"Whether this expense is one line of a split transaction.","oneOf":[{"type":"boolean"},{"type":"null"}]},"groupid":{"description":"Group id linking split lines of one real-world transaction together.","oneOf":[{"type":"string"},{"type":"null"}]},"unlink":{"description":"Pass the id of a currently-linked transaction/document to detach it.","oneOf":[{"type":"string"},{"type":"null"}]},"taglist":{"description":"Tag ids to set on this expense (replaces the existing set).","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Expense id. Present → update that expense; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name / description of the expense.","oneOf":[{"type":"string"},{"type":"null"}]},"supplier":{"description":"Supplier id, or an exact supplier name to resolve (see list_suppliers).","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"quantity":{"description":"Number of units.","oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"description":"Unit amount before quantity/tax, in the record's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"total":{"description":"Total including quantity. Used only when amount is omitted: amount becomes total ÷ quantity, and must come to whole cents. If amount is also sent, amount wins.","oneOf":[{"type":"number"},{"type":"null"}]},"date":{"description":"Expense date (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"paid":{"description":"Whether this expense has been paid.","oneOf":[{"type":"boolean"},{"type":"null"}]},"paiddate":{"description":"Date payment was made (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"showquantity":{"description":"Whether to display the quantity column on the document.","oneOf":[{"type":"boolean"},{"type":"null"}]},"transactionid":{"description":"Bank transaction id to reconcile this expense against.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Manual FX rate to the business base currency; omit to use the stored/auto rate.","oneOf":[{"type":"number"},{"type":"null"}]},"method":{"description":"Payment method as free text (e.g. \"cash\", \"card\", \"eft\") — no fixed set.","oneOf":[{"type":"string"},{"type":"null"}]},"alert":{"description":"Alert/reminder note to surface on this expense.","oneOf":[{"type":"string"},{"type":"null"}]},"bankaccountid":{"description":"Bank account id the money moved through (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"ai":{"description":"Internal: set when the expense was produced by AI enrichment.","oneOf":[{"type":"boolean"},{"type":"null"}]},"salestax":{"description":"Whether sales tax (VAT) applies. May also be an array of salestax refs.","oneOf":[{},{"type":"null"}]},"salestaxpercent":{"description":"Sales tax rate as a percentage (e.g. 15 for 15%).","oneOf":[{"type":"number"},{"type":"null"}]},"salestaxamount":{"description":"Explicit sales tax amount; used instead of the percentage when salestaxuseamount is true.","oneOf":[{"type":"number"},{"type":"null"}]},"salestaxuseamount":{"description":"When true, use salestaxamount as the tax figure instead of computing from the percentage.","oneOf":[{"type":"boolean"},{"type":"null"}]},"accountid":{"description":"Chart-of-accounts category account id, or an exact account name to resolve (see list_accounts). Set to a bill / purchase order / GRN document id (cont-…) to record this expense as a payment against that document. Set to a customer id (cli-…) to record a refund paid to that customer: it posts once to Receivables, tagged to the customer, with no VAT, and draws down their credit balance.","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"description":"Base/control account id override; rarely needed — defaults from the category.","oneOf":[{"type":"string"},{"type":"null"}]},"split":{"description":"Whether this expense is one line of a split transaction.","oneOf":[{"type":"boolean"},{"type":"null"}]},"groupid":{"description":"Group id linking split lines of one real-world transaction together.","oneOf":[{"type":"string"},{"type":"null"}]},"unlink":{"description":"Pass the id of a currently-linked transaction/document to detach it.","oneOf":[{"type":"string"},{"type":"null"}]},"taglist":{"description":"Tag ids to set on this expense (replaces the existing set).","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Update an expense record by id. Setting accountid to a purchase document's id links the expense as a payment against that bill / purchase order / GRN. To recategorise or relink several expenses at once, send save_expense an items array.","tags":["expense management"]}},"/api/expense/save":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Expense id. Present → update that expense; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name / description of the expense.","oneOf":[{"type":"string"},{"type":"null"}]},"supplier":{"description":"Supplier id, or an exact supplier name to resolve (see list_suppliers).","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"quantity":{"description":"Number of units.","oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"description":"Unit amount before quantity/tax, in the record's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"total":{"description":"Total including quantity. Used only when amount is omitted: amount becomes total ÷ quantity, and must come to whole cents. If amount is also sent, amount wins.","oneOf":[{"type":"number"},{"type":"null"}]},"date":{"description":"Expense date (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"paid":{"description":"Whether this expense has been paid.","oneOf":[{"type":"boolean"},{"type":"null"}]},"paiddate":{"description":"Date payment was made (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"showquantity":{"description":"Whether to display the quantity column on the document.","oneOf":[{"type":"boolean"},{"type":"null"}]},"transactionid":{"description":"Bank transaction id to reconcile this expense against.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Manual FX rate to the business base currency; omit to use the stored/auto rate.","oneOf":[{"type":"number"},{"type":"null"}]},"method":{"description":"Payment method as free text (e.g. \"cash\", \"card\", \"eft\") — no fixed set.","oneOf":[{"type":"string"},{"type":"null"}]},"alert":{"description":"Alert/reminder note to surface on this expense.","oneOf":[{"type":"string"},{"type":"null"}]},"bankaccountid":{"description":"Bank account id the money moved through (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"ai":{"description":"Internal: set when the expense was produced by AI enrichment.","oneOf":[{"type":"boolean"},{"type":"null"}]},"salestax":{"description":"VAT on this expense, as an array of sales tax refs: [{\"parentid\": \"<sales tax id>\"}], with ids from list_sales_taxes. Each ref attaches that tax as a VAT row. true alone adds no VAT and is refused, unless the expense already has a VAT row. To add one tax to many saved expenses, use add_salestax_to_entities. Omit it, or send false or [], for no VAT.","oneOf":[{},{"type":"null"}]},"accountid":{"description":"Chart-of-accounts category account id, or an exact account name to resolve (see list_accounts). Set to a bill / purchase order / GRN document id (cont-…) to record this expense as a payment against that document. Set to a customer id (cli-…) to record a refund paid to that customer: it posts once to Receivables, tagged to the customer, with no VAT, and draws down their credit balance.","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"description":"Base/control account id override; rarely needed — defaults from the category.","oneOf":[{"type":"string"},{"type":"null"}]},"split":{"description":"Whether this expense is one line of a split transaction.","oneOf":[{"type":"boolean"},{"type":"null"}]},"groupid":{"description":"Group id linking split lines of one real-world transaction together.","oneOf":[{"type":"string"},{"type":"null"}]},"unlink":{"description":"Pass the id of a currently-linked transaction/document to detach it.","oneOf":[{"type":"string"},{"type":"null"}]},"taglist":{"description":"Tag ids to set on this expense (replaces the existing set).","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"items":{"description":"Vector of expense objects to create/update in one all-or-nothing batch. Preferred over repeated calls. Each item with an id updates; each without creates.","type":"array","items":{"type":"object","properties":{"id":{"description":"Expense id. Present → update that expense; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name / description of the expense.","oneOf":[{"type":"string"},{"type":"null"}]},"supplier":{"description":"Supplier id, or an exact supplier name to resolve (see list_suppliers).","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"quantity":{"description":"Number of units.","oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"description":"Unit amount before quantity/tax, in the record's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"total":{"description":"Total including quantity. Used only when amount is omitted: amount becomes total ÷ quantity, and must come to whole cents. If amount is also sent, amount wins.","oneOf":[{"type":"number"},{"type":"null"}]},"date":{"description":"Expense date (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"paid":{"description":"Whether this expense has been paid.","oneOf":[{"type":"boolean"},{"type":"null"}]},"paiddate":{"description":"Date payment was made (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"showquantity":{"description":"Whether to display the quantity column on the document.","oneOf":[{"type":"boolean"},{"type":"null"}]},"transactionid":{"description":"Bank transaction id to reconcile this expense against.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Manual FX rate to the business base currency; omit to use the stored/auto rate.","oneOf":[{"type":"number"},{"type":"null"}]},"method":{"description":"Payment method as free text (e.g. \"cash\", \"card\", \"eft\") — no fixed set.","oneOf":[{"type":"string"},{"type":"null"}]},"alert":{"description":"Alert/reminder note to surface on this expense.","oneOf":[{"type":"string"},{"type":"null"}]},"bankaccountid":{"description":"Bank account id the money moved through (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"ai":{"description":"Internal: set when the expense was produced by AI enrichment.","oneOf":[{"type":"boolean"},{"type":"null"}]},"salestax":{"description":"VAT on this expense, as an array of sales tax refs: [{\"parentid\": \"<sales tax id>\"}], with ids from list_sales_taxes. Each ref attaches that tax as a VAT row. true alone adds no VAT and is refused, unless the expense already has a VAT row. To add one tax to many saved expenses, use add_salestax_to_entities. Omit it, or send false or [], for no VAT.","oneOf":[{},{"type":"null"}]},"accountid":{"description":"Chart-of-accounts category account id, or an exact account name to resolve (see list_accounts). Set to a bill / purchase order / GRN document id (cont-…) to record this expense as a payment against that document. Set to a customer id (cli-…) to record a refund paid to that customer: it posts once to Receivables, tagged to the customer, with no VAT, and draws down their credit balance.","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"description":"Base/control account id override; rarely needed — defaults from the category.","oneOf":[{"type":"string"},{"type":"null"}]},"split":{"description":"Whether this expense is one line of a split transaction.","oneOf":[{"type":"boolean"},{"type":"null"}]},"groupid":{"description":"Group id linking split lines of one real-world transaction together.","oneOf":[{"type":"string"},{"type":"null"}]},"unlink":{"description":"Pass the id of a currently-linked transaction/document to detach it.","oneOf":[{"type":"string"},{"type":"null"}]},"taglist":{"description":"Tag ids to set on this expense (replaces the existing set).","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"additionalProperties":false}}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Expense id. Present → update that expense; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name / description of the expense.","oneOf":[{"type":"string"},{"type":"null"}]},"supplier":{"description":"Supplier id, or an exact supplier name to resolve (see list_suppliers).","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"quantity":{"description":"Number of units.","oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"description":"Unit amount before quantity/tax, in the record's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"total":{"description":"Total including quantity. Used only when amount is omitted: amount becomes total ÷ quantity, and must come to whole cents. If amount is also sent, amount wins.","oneOf":[{"type":"number"},{"type":"null"}]},"date":{"description":"Expense date (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"paid":{"description":"Whether this expense has been paid.","oneOf":[{"type":"boolean"},{"type":"null"}]},"paiddate":{"description":"Date payment was made (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"showquantity":{"description":"Whether to display the quantity column on the document.","oneOf":[{"type":"boolean"},{"type":"null"}]},"transactionid":{"description":"Bank transaction id to reconcile this expense against.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Manual FX rate to the business base currency; omit to use the stored/auto rate.","oneOf":[{"type":"number"},{"type":"null"}]},"method":{"description":"Payment method as free text (e.g. \"cash\", \"card\", \"eft\") — no fixed set.","oneOf":[{"type":"string"},{"type":"null"}]},"alert":{"description":"Alert/reminder note to surface on this expense.","oneOf":[{"type":"string"},{"type":"null"}]},"bankaccountid":{"description":"Bank account id the money moved through (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"ai":{"description":"Internal: set when the expense was produced by AI enrichment.","oneOf":[{"type":"boolean"},{"type":"null"}]},"salestax":{"description":"VAT on this expense, as an array of sales tax refs: [{\"parentid\": \"<sales tax id>\"}], with ids from list_sales_taxes. Each ref attaches that tax as a VAT row. true alone adds no VAT and is refused, unless the expense already has a VAT row. To add one tax to many saved expenses, use add_salestax_to_entities. Omit it, or send false or [], for no VAT.","oneOf":[{},{"type":"null"}]},"accountid":{"description":"Chart-of-accounts category account id, or an exact account name to resolve (see list_accounts). Set to a bill / purchase order / GRN document id (cont-…) to record this expense as a payment against that document. Set to a customer id (cli-…) to record a refund paid to that customer: it posts once to Receivables, tagged to the customer, with no VAT, and draws down their credit balance.","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"description":"Base/control account id override; rarely needed — defaults from the category.","oneOf":[{"type":"string"},{"type":"null"}]},"split":{"description":"Whether this expense is one line of a split transaction.","oneOf":[{"type":"boolean"},{"type":"null"}]},"groupid":{"description":"Group id linking split lines of one real-world transaction together.","oneOf":[{"type":"string"},{"type":"null"}]},"unlink":{"description":"Pass the id of a currently-linked transaction/document to detach it.","oneOf":[{"type":"string"},{"type":"null"}]},"taglist":{"description":"Tag ids to set on this expense (replaces the existing set).","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"items":{"description":"Vector of expense objects to create/update in one all-or-nothing batch. Preferred over repeated calls. Each item with an id updates; each without creates.","type":"array","items":{"type":"object","properties":{"id":{"description":"Expense id. Present → update that expense; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name / description of the expense.","oneOf":[{"type":"string"},{"type":"null"}]},"supplier":{"description":"Supplier id, or an exact supplier name to resolve (see list_suppliers).","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"quantity":{"description":"Number of units.","oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"description":"Unit amount before quantity/tax, in the record's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"total":{"description":"Total including quantity. Used only when amount is omitted: amount becomes total ÷ quantity, and must come to whole cents. If amount is also sent, amount wins.","oneOf":[{"type":"number"},{"type":"null"}]},"date":{"description":"Expense date (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"paid":{"description":"Whether this expense has been paid.","oneOf":[{"type":"boolean"},{"type":"null"}]},"paiddate":{"description":"Date payment was made (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"showquantity":{"description":"Whether to display the quantity column on the document.","oneOf":[{"type":"boolean"},{"type":"null"}]},"transactionid":{"description":"Bank transaction id to reconcile this expense against.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Manual FX rate to the business base currency; omit to use the stored/auto rate.","oneOf":[{"type":"number"},{"type":"null"}]},"method":{"description":"Payment method as free text (e.g. \"cash\", \"card\", \"eft\") — no fixed set.","oneOf":[{"type":"string"},{"type":"null"}]},"alert":{"description":"Alert/reminder note to surface on this expense.","oneOf":[{"type":"string"},{"type":"null"}]},"bankaccountid":{"description":"Bank account id the money moved through (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"ai":{"description":"Internal: set when the expense was produced by AI enrichment.","oneOf":[{"type":"boolean"},{"type":"null"}]},"salestax":{"description":"VAT on this expense, as an array of sales tax refs: [{\"parentid\": \"<sales tax id>\"}], with ids from list_sales_taxes. Each ref attaches that tax as a VAT row. true alone adds no VAT and is refused, unless the expense already has a VAT row. To add one tax to many saved expenses, use add_salestax_to_entities. Omit it, or send false or [], for no VAT.","oneOf":[{},{"type":"null"}]},"accountid":{"description":"Chart-of-accounts category account id, or an exact account name to resolve (see list_accounts). Set to a bill / purchase order / GRN document id (cont-…) to record this expense as a payment against that document. Set to a customer id (cli-…) to record a refund paid to that customer: it posts once to Receivables, tagged to the customer, with no VAT, and draws down their credit balance.","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"description":"Base/control account id override; rarely needed — defaults from the category.","oneOf":[{"type":"string"},{"type":"null"}]},"split":{"description":"Whether this expense is one line of a split transaction.","oneOf":[{"type":"boolean"},{"type":"null"}]},"groupid":{"description":"Group id linking split lines of one real-world transaction together.","oneOf":[{"type":"string"},{"type":"null"}]},"unlink":{"description":"Pass the id of a currently-linked transaction/document to detach it.","oneOf":[{"type":"string"},{"type":"null"}]},"taglist":{"description":"Tag ids to set on this expense (replaces the existing set).","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"additionalProperties":false}}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Expense id. Present → update that expense; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name / description of the expense.","oneOf":[{"type":"string"},{"type":"null"}]},"supplier":{"description":"Supplier id, or an exact supplier name to resolve (see list_suppliers).","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"quantity":{"description":"Number of units.","oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"description":"Unit amount before quantity/tax, in the record's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"total":{"description":"Total including quantity. Used only when amount is omitted: amount becomes total ÷ quantity, and must come to whole cents. If amount is also sent, amount wins.","oneOf":[{"type":"number"},{"type":"null"}]},"date":{"description":"Expense date (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"paid":{"description":"Whether this expense has been paid.","oneOf":[{"type":"boolean"},{"type":"null"}]},"paiddate":{"description":"Date payment was made (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"showquantity":{"description":"Whether to display the quantity column on the document.","oneOf":[{"type":"boolean"},{"type":"null"}]},"transactionid":{"description":"Bank transaction id to reconcile this expense against.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Manual FX rate to the business base currency; omit to use the stored/auto rate.","oneOf":[{"type":"number"},{"type":"null"}]},"method":{"description":"Payment method as free text (e.g. \"cash\", \"card\", \"eft\") — no fixed set.","oneOf":[{"type":"string"},{"type":"null"}]},"alert":{"description":"Alert/reminder note to surface on this expense.","oneOf":[{"type":"string"},{"type":"null"}]},"bankaccountid":{"description":"Bank account id the money moved through (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"ai":{"description":"Internal: set when the expense was produced by AI enrichment.","oneOf":[{"type":"boolean"},{"type":"null"}]},"salestax":{"description":"VAT on this expense, as an array of sales tax refs: [{\"parentid\": \"<sales tax id>\"}], with ids from list_sales_taxes. Each ref attaches that tax as a VAT row. true alone adds no VAT and is refused, unless the expense already has a VAT row. To add one tax to many saved expenses, use add_salestax_to_entities. Omit it, or send false or [], for no VAT.","oneOf":[{},{"type":"null"}]},"accountid":{"description":"Chart-of-accounts category account id, or an exact account name to resolve (see list_accounts). Set to a bill / purchase order / GRN document id (cont-…) to record this expense as a payment against that document. Set to a customer id (cli-…) to record a refund paid to that customer: it posts once to Receivables, tagged to the customer, with no VAT, and draws down their credit balance.","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"description":"Base/control account id override; rarely needed — defaults from the category.","oneOf":[{"type":"string"},{"type":"null"}]},"split":{"description":"Whether this expense is one line of a split transaction.","oneOf":[{"type":"boolean"},{"type":"null"}]},"groupid":{"description":"Group id linking split lines of one real-world transaction together.","oneOf":[{"type":"string"},{"type":"null"}]},"unlink":{"description":"Pass the id of a currently-linked transaction/document to detach it.","oneOf":[{"type":"string"},{"type":"null"}]},"taglist":{"description":"Tag ids to set on this expense (replaces the existing set).","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"items":{"description":"Vector of expense objects to create/update in one all-or-nothing batch. Preferred over repeated calls. Each item with an id updates; each without creates.","type":"array","items":{"type":"object","properties":{"id":{"description":"Expense id. Present → update that expense; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name / description of the expense.","oneOf":[{"type":"string"},{"type":"null"}]},"supplier":{"description":"Supplier id, or an exact supplier name to resolve (see list_suppliers).","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"quantity":{"description":"Number of units.","oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"description":"Unit amount before quantity/tax, in the record's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"total":{"description":"Total including quantity. Used only when amount is omitted: amount becomes total ÷ quantity, and must come to whole cents. If amount is also sent, amount wins.","oneOf":[{"type":"number"},{"type":"null"}]},"date":{"description":"Expense date (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"paid":{"description":"Whether this expense has been paid.","oneOf":[{"type":"boolean"},{"type":"null"}]},"paiddate":{"description":"Date payment was made (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"showquantity":{"description":"Whether to display the quantity column on the document.","oneOf":[{"type":"boolean"},{"type":"null"}]},"transactionid":{"description":"Bank transaction id to reconcile this expense against.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Manual FX rate to the business base currency; omit to use the stored/auto rate.","oneOf":[{"type":"number"},{"type":"null"}]},"method":{"description":"Payment method as free text (e.g. \"cash\", \"card\", \"eft\") — no fixed set.","oneOf":[{"type":"string"},{"type":"null"}]},"alert":{"description":"Alert/reminder note to surface on this expense.","oneOf":[{"type":"string"},{"type":"null"}]},"bankaccountid":{"description":"Bank account id the money moved through (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"ai":{"description":"Internal: set when the expense was produced by AI enrichment.","oneOf":[{"type":"boolean"},{"type":"null"}]},"salestax":{"description":"VAT on this expense, as an array of sales tax refs: [{\"parentid\": \"<sales tax id>\"}], with ids from list_sales_taxes. Each ref attaches that tax as a VAT row. true alone adds no VAT and is refused, unless the expense already has a VAT row. To add one tax to many saved expenses, use add_salestax_to_entities. Omit it, or send false or [], for no VAT.","oneOf":[{},{"type":"null"}]},"accountid":{"description":"Chart-of-accounts category account id, or an exact account name to resolve (see list_accounts). Set to a bill / purchase order / GRN document id (cont-…) to record this expense as a payment against that document. Set to a customer id (cli-…) to record a refund paid to that customer: it posts once to Receivables, tagged to the customer, with no VAT, and draws down their credit balance.","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"description":"Base/control account id override; rarely needed — defaults from the category.","oneOf":[{"type":"string"},{"type":"null"}]},"split":{"description":"Whether this expense is one line of a split transaction.","oneOf":[{"type":"boolean"},{"type":"null"}]},"groupid":{"description":"Group id linking split lines of one real-world transaction together.","oneOf":[{"type":"string"},{"type":"null"}]},"unlink":{"description":"Pass the id of a currently-linked transaction/document to detach it.","oneOf":[{"type":"string"},{"type":"null"}]},"taglist":{"description":"Tag ids to set on this expense (replaces the existing set).","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"additionalProperties":false}}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Expense id. Present → update that expense; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name / description of the expense.","oneOf":[{"type":"string"},{"type":"null"}]},"supplier":{"description":"Supplier id, or an exact supplier name to resolve (see list_suppliers).","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"quantity":{"description":"Number of units.","oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"description":"Unit amount before quantity/tax, in the record's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"total":{"description":"Total including quantity. Used only when amount is omitted: amount becomes total ÷ quantity, and must come to whole cents. If amount is also sent, amount wins.","oneOf":[{"type":"number"},{"type":"null"}]},"date":{"description":"Expense date (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"paid":{"description":"Whether this expense has been paid.","oneOf":[{"type":"boolean"},{"type":"null"}]},"paiddate":{"description":"Date payment was made (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"showquantity":{"description":"Whether to display the quantity column on the document.","oneOf":[{"type":"boolean"},{"type":"null"}]},"transactionid":{"description":"Bank transaction id to reconcile this expense against.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Manual FX rate to the business base currency; omit to use the stored/auto rate.","oneOf":[{"type":"number"},{"type":"null"}]},"method":{"description":"Payment method as free text (e.g. \"cash\", \"card\", \"eft\") — no fixed set.","oneOf":[{"type":"string"},{"type":"null"}]},"alert":{"description":"Alert/reminder note to surface on this expense.","oneOf":[{"type":"string"},{"type":"null"}]},"bankaccountid":{"description":"Bank account id the money moved through (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"ai":{"description":"Internal: set when the expense was produced by AI enrichment.","oneOf":[{"type":"boolean"},{"type":"null"}]},"salestax":{"description":"VAT on this expense, as an array of sales tax refs: [{\"parentid\": \"<sales tax id>\"}], with ids from list_sales_taxes. Each ref attaches that tax as a VAT row. true alone adds no VAT and is refused, unless the expense already has a VAT row. To add one tax to many saved expenses, use add_salestax_to_entities. Omit it, or send false or [], for no VAT.","oneOf":[{},{"type":"null"}]},"accountid":{"description":"Chart-of-accounts category account id, or an exact account name to resolve (see list_accounts). Set to a bill / purchase order / GRN document id (cont-…) to record this expense as a payment against that document. Set to a customer id (cli-…) to record a refund paid to that customer: it posts once to Receivables, tagged to the customer, with no VAT, and draws down their credit balance.","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"description":"Base/control account id override; rarely needed — defaults from the category.","oneOf":[{"type":"string"},{"type":"null"}]},"split":{"description":"Whether this expense is one line of a split transaction.","oneOf":[{"type":"boolean"},{"type":"null"}]},"groupid":{"description":"Group id linking split lines of one real-world transaction together.","oneOf":[{"type":"string"},{"type":"null"}]},"unlink":{"description":"Pass the id of a currently-linked transaction/document to detach it.","oneOf":[{"type":"string"},{"type":"null"}]},"taglist":{"description":"Tag ids to set on this expense (replaces the existing set).","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"items":{"description":"Vector of expense objects to create/update in one all-or-nothing batch. Preferred over repeated calls. Each item with an id updates; each without creates.","type":"array","items":{"type":"object","properties":{"id":{"description":"Expense id. Present → update that expense; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name / description of the expense.","oneOf":[{"type":"string"},{"type":"null"}]},"supplier":{"description":"Supplier id, or an exact supplier name to resolve (see list_suppliers).","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"quantity":{"description":"Number of units.","oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"description":"Unit amount before quantity/tax, in the record's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"total":{"description":"Total including quantity. Used only when amount is omitted: amount becomes total ÷ quantity, and must come to whole cents. If amount is also sent, amount wins.","oneOf":[{"type":"number"},{"type":"null"}]},"date":{"description":"Expense date (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"paid":{"description":"Whether this expense has been paid.","oneOf":[{"type":"boolean"},{"type":"null"}]},"paiddate":{"description":"Date payment was made (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"showquantity":{"description":"Whether to display the quantity column on the document.","oneOf":[{"type":"boolean"},{"type":"null"}]},"transactionid":{"description":"Bank transaction id to reconcile this expense against.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Manual FX rate to the business base currency; omit to use the stored/auto rate.","oneOf":[{"type":"number"},{"type":"null"}]},"method":{"description":"Payment method as free text (e.g. \"cash\", \"card\", \"eft\") — no fixed set.","oneOf":[{"type":"string"},{"type":"null"}]},"alert":{"description":"Alert/reminder note to surface on this expense.","oneOf":[{"type":"string"},{"type":"null"}]},"bankaccountid":{"description":"Bank account id the money moved through (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"ai":{"description":"Internal: set when the expense was produced by AI enrichment.","oneOf":[{"type":"boolean"},{"type":"null"}]},"salestax":{"description":"VAT on this expense, as an array of sales tax refs: [{\"parentid\": \"<sales tax id>\"}], with ids from list_sales_taxes. Each ref attaches that tax as a VAT row. true alone adds no VAT and is refused, unless the expense already has a VAT row. To add one tax to many saved expenses, use add_salestax_to_entities. Omit it, or send false or [], for no VAT.","oneOf":[{},{"type":"null"}]},"accountid":{"description":"Chart-of-accounts category account id, or an exact account name to resolve (see list_accounts). Set to a bill / purchase order / GRN document id (cont-…) to record this expense as a payment against that document. Set to a customer id (cli-…) to record a refund paid to that customer: it posts once to Receivables, tagged to the customer, with no VAT, and draws down their credit balance.","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"description":"Base/control account id override; rarely needed — defaults from the category.","oneOf":[{"type":"string"},{"type":"null"}]},"split":{"description":"Whether this expense is one line of a split transaction.","oneOf":[{"type":"boolean"},{"type":"null"}]},"groupid":{"description":"Group id linking split lines of one real-world transaction together.","oneOf":[{"type":"string"},{"type":"null"}]},"unlink":{"description":"Pass the id of a currently-linked transaction/document to detach it.","oneOf":[{"type":"string"},{"type":"null"}]},"taglist":{"description":"Tag ids to set on this expense (replaces the existing set).","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"additionalProperties":false}}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Record spending that is NOT settling a document, or edit an existing expense's ACCOUNTING ENTRY (category, supplier, tax); to pay a bill or PO prefer record_document_payment (one document) or settle_bills (several), and to change the BANK LINE itself (its description, ignored flag or notes) use update_transaction. For one expense, send its fields inline (pass an `id` to update, omit to create). To create/update many at once, send an `items` array — this is preferred over repeated calls: the whole batch is one all-or-nothing transaction with a single ledger recompute. Each item with an `id` updates; each without creates. To pay a bill / purchase order / GRN, set accountid to that document's id. Use create_income_expenses_bulk to add income and expenses together in one transaction.","tags":["expense management"]}},"/api/expense/update-many":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"expenses":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"deleted":{"description":"true bins this expense (soft delete, reversible); false restores a binned one. Omit to leave its bin state untouched.","type":"boolean"},"alert":{"type":"string"},"accountid":{"description":"Chart-of-accounts category account id, or an exact account name to resolve (see list_accounts). Set to a bill / purchase order / GRN document id (cont-…) to record this expense as a payment against that document. Set to a customer id (cli-…) to record a refund paid to that customer: it posts once to Receivables, tagged to the customer, with no VAT, and draws down their credit balance.","type":"string"},"baseaccountid":{"type":"string"},"supplier":{"type":"string"},"split":{"type":"boolean"},"groupid":{"oneOf":[{"type":"string"},{"type":"null"}]},"unlink":{"type":"string"}},"required":["id"],"additionalProperties":false}}},"required":["token","expenses"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"expenses":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"deleted":{"description":"true bins this expense (soft delete, reversible); false restores a binned one. Omit to leave its bin state untouched.","type":"boolean"},"alert":{"type":"string"},"accountid":{"description":"Chart-of-accounts category account id, or an exact account name to resolve (see list_accounts). Set to a bill / purchase order / GRN document id (cont-…) to record this expense as a payment against that document. Set to a customer id (cli-…) to record a refund paid to that customer: it posts once to Receivables, tagged to the customer, with no VAT, and draws down their credit balance.","type":"string"},"baseaccountid":{"type":"string"},"supplier":{"type":"string"},"split":{"type":"boolean"},"groupid":{"oneOf":[{"type":"string"},{"type":"null"}]},"unlink":{"type":"string"}},"required":["id"],"additionalProperties":false}}},"required":["token","expenses"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"expenses":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"deleted":{"description":"true bins this expense (soft delete, reversible); false restores a binned one. Omit to leave its bin state untouched.","type":"boolean"},"alert":{"type":"string"},"accountid":{"description":"Chart-of-accounts category account id, or an exact account name to resolve (see list_accounts). Set to a bill / purchase order / GRN document id (cont-…) to record this expense as a payment against that document. Set to a customer id (cli-…) to record a refund paid to that customer: it posts once to Receivables, tagged to the customer, with no VAT, and draws down their credit balance.","type":"string"},"baseaccountid":{"type":"string"},"supplier":{"type":"string"},"split":{"type":"boolean"},"groupid":{"oneOf":[{"type":"string"},{"type":"null"}]},"unlink":{"type":"string"}},"required":["id"],"additionalProperties":false}}},"required":["token","expenses"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"expenses":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"deleted":{"description":"true bins this expense (soft delete, reversible); false restores a binned one. Omit to leave its bin state untouched.","type":"boolean"},"alert":{"type":"string"},"accountid":{"description":"Chart-of-accounts category account id, or an exact account name to resolve (see list_accounts). Set to a bill / purchase order / GRN document id (cont-…) to record this expense as a payment against that document. Set to a customer id (cli-…) to record a refund paid to that customer: it posts once to Receivables, tagged to the customer, with no VAT, and draws down their credit balance.","type":"string"},"baseaccountid":{"type":"string"},"supplier":{"type":"string"},"split":{"type":"boolean"},"groupid":{"oneOf":[{"type":"string"},{"type":"null"}]},"unlink":{"type":"string"}},"required":["id"],"additionalProperties":false}}},"required":["token","expenses"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Update many expenses in one call (stub-web; off the MCP surface, where save_expense items covers it). Per-item fields are limited to recategorising and linking (accountid, baseaccountid, supplier, split, groupid, alert, unlink); setting accountid to a purchase document's id links the expense as a payment against that bill / purchase order / GRN. To create expenses or edit fields beyond recategorising/linking, use save_expense.","tags":["expense management"]}},"/api/expense/delete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"One expense id to delete.","type":"string"},"ids":{"description":"Up to 250 expense ids to delete in one call. Partial success: ids this business does not own, already deleted, or unknown are skipped and listed in errors.","type":"array","items":{"type":"string"},"minItems":1,"maxItems":250}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"One expense id to delete.","type":"string"},"ids":{"description":"Up to 250 expense ids to delete in one call. Partial success: ids this business does not own, already deleted, or unknown are skipped and listed in errors.","type":"array","items":{"type":"string"},"minItems":1,"maxItems":250}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"One expense id to delete.","type":"string"},"ids":{"description":"Up to 250 expense ids to delete in one call. Partial success: ids this business does not own, already deleted, or unknown are skipped and listed in errors.","type":"array","items":{"type":"string"},"minItems":1,"maxItems":250}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"One expense id to delete.","type":"string"},"ids":{"description":"Up to 250 expense ids to delete in one call. Partial success: ids this business does not own, already deleted, or unknown are skipped and listed in errors.","type":"array","items":{"type":"string"},"minItems":1,"maxItems":250}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Delete one expense or many to the bin (soft-delete, restorable). Send `id` for one expense, which returns {error}. Or send `ids` (up to 250) to delete many in one call, which returns {error, deleted: [id ...], errors: [{id, message} ...]}. That is partial success: ids this business does not own, already deleted, or unknown are skipped and listed in errors, and error is true only when nothing was deleted. The ledger recomputes, so linked bills and transactions stay consistent. An expense whose accountid is an asset's id is that asset's purchase: deleting it takes that cost and the depreciation built on it off the asset, so profit moves, and the result's message names the asset. Tell the user that before asking to delete one. Confirm with the user before deleting.","tags":["expense management"]}},"/me":{"get":{"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"tags":["health check"]},"head":{"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"tags":["health check"]}},"/api/hello":{"get":{"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"tags":["health check"]},"head":{"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"tags":["health check"]}},"/api/ready":{"get":{"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"tags":["health check"]}},"/api/exception":{"get":{"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"tags":["exception check"]}},"/api/income/create":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"client":{"oneOf":[{"type":"string"},{"type":"null"}]},"product":{"oneOf":[{"type":"string"},{"type":"null"}]},"date":{"oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"category":{"oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"invoiceid":{"oneOf":[{"type":"string"},{"type":"null"}]},"incometype":{"oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"oneOf":[{"type":"number"},{"type":"null"}]},"alert":{"oneOf":[{"type":"string"},{"type":"null"}]},"method":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"assetid":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"Chart-of-accounts income category account id, or an exact account name to resolve (see list_accounts). Set to a supplier id (sup-…) to record a refund paid by that supplier: it posts once to Payables, tagged to the supplier, with no VAT, and draws down the credit they owe.","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"transactionid":{"oneOf":[{"type":"string"},{"type":"null"}]},"split":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"groupid":{"oneOf":[{"type":"string"},{"type":"null"}]},"unlink":{"description":"Id of a currently-linked invoice/asset to detach. Sent by the Sales-page allocation controls on every re-categorisation; ignored unless it is an invoice/asset id.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"client":{"oneOf":[{"type":"string"},{"type":"null"}]},"product":{"oneOf":[{"type":"string"},{"type":"null"}]},"date":{"oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"category":{"oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"invoiceid":{"oneOf":[{"type":"string"},{"type":"null"}]},"incometype":{"oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"oneOf":[{"type":"number"},{"type":"null"}]},"alert":{"oneOf":[{"type":"string"},{"type":"null"}]},"method":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"assetid":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"Chart-of-accounts income category account id, or an exact account name to resolve (see list_accounts). Set to a supplier id (sup-…) to record a refund paid by that supplier: it posts once to Payables, tagged to the supplier, with no VAT, and draws down the credit they owe.","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"transactionid":{"oneOf":[{"type":"string"},{"type":"null"}]},"split":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"groupid":{"oneOf":[{"type":"string"},{"type":"null"}]},"unlink":{"description":"Id of a currently-linked invoice/asset to detach. Sent by the Sales-page allocation controls on every re-categorisation; ignored unless it is an invoice/asset id.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"client":{"oneOf":[{"type":"string"},{"type":"null"}]},"product":{"oneOf":[{"type":"string"},{"type":"null"}]},"date":{"oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"category":{"oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"invoiceid":{"oneOf":[{"type":"string"},{"type":"null"}]},"incometype":{"oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"oneOf":[{"type":"number"},{"type":"null"}]},"alert":{"oneOf":[{"type":"string"},{"type":"null"}]},"method":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"assetid":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"Chart-of-accounts income category account id, or an exact account name to resolve (see list_accounts). Set to a supplier id (sup-…) to record a refund paid by that supplier: it posts once to Payables, tagged to the supplier, with no VAT, and draws down the credit they owe.","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"transactionid":{"oneOf":[{"type":"string"},{"type":"null"}]},"split":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"groupid":{"oneOf":[{"type":"string"},{"type":"null"}]},"unlink":{"description":"Id of a currently-linked invoice/asset to detach. Sent by the Sales-page allocation controls on every re-categorisation; ignored unless it is an invoice/asset id.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"client":{"oneOf":[{"type":"string"},{"type":"null"}]},"product":{"oneOf":[{"type":"string"},{"type":"null"}]},"date":{"oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"category":{"oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"invoiceid":{"oneOf":[{"type":"string"},{"type":"null"}]},"incometype":{"oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"oneOf":[{"type":"number"},{"type":"null"}]},"alert":{"oneOf":[{"type":"string"},{"type":"null"}]},"method":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"assetid":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"Chart-of-accounts income category account id, or an exact account name to resolve (see list_accounts). Set to a supplier id (sup-…) to record a refund paid by that supplier: it posts once to Payables, tagged to the supplier, with no VAT, and draws down the credit they owe.","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"transactionid":{"oneOf":[{"type":"string"},{"type":"null"}]},"split":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"groupid":{"oneOf":[{"type":"string"},{"type":"null"}]},"unlink":{"description":"Id of a currently-linked invoice/asset to detach. Sent by the Sales-page allocation controls on every re-categorisation; ignored unless it is an invoice/asset id.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Record a source of income. Returns the new income id. To record several at once, prefer create_income_expenses_bulk — one call instead of many.","tags":["income management"]}},"/api/income/update":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"client":{"oneOf":[{"type":"string"},{"type":"null"}]},"product":{"oneOf":[{"type":"string"},{"type":"null"}]},"date":{"oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"category":{"oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"invoiceid":{"oneOf":[{"type":"string"},{"type":"null"}]},"incometype":{"oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"oneOf":[{"type":"number"},{"type":"null"}]},"alert":{"oneOf":[{"type":"string"},{"type":"null"}]},"method":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"assetid":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"Chart-of-accounts income category account id, or an exact account name to resolve (see list_accounts). Set to a supplier id (sup-…) to record a refund paid by that supplier: it posts once to Payables, tagged to the supplier, with no VAT, and draws down the credit they owe.","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"transactionid":{"oneOf":[{"type":"string"},{"type":"null"}]},"split":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"groupid":{"oneOf":[{"type":"string"},{"type":"null"}]},"unlink":{"description":"Id of a currently-linked invoice/asset to detach. Sent by the Sales-page allocation controls on every re-categorisation; ignored unless it is an invoice/asset id.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"client":{"oneOf":[{"type":"string"},{"type":"null"}]},"product":{"oneOf":[{"type":"string"},{"type":"null"}]},"date":{"oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"category":{"oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"invoiceid":{"oneOf":[{"type":"string"},{"type":"null"}]},"incometype":{"oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"oneOf":[{"type":"number"},{"type":"null"}]},"alert":{"oneOf":[{"type":"string"},{"type":"null"}]},"method":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"assetid":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"Chart-of-accounts income category account id, or an exact account name to resolve (see list_accounts). Set to a supplier id (sup-…) to record a refund paid by that supplier: it posts once to Payables, tagged to the supplier, with no VAT, and draws down the credit they owe.","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"transactionid":{"oneOf":[{"type":"string"},{"type":"null"}]},"split":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"groupid":{"oneOf":[{"type":"string"},{"type":"null"}]},"unlink":{"description":"Id of a currently-linked invoice/asset to detach. Sent by the Sales-page allocation controls on every re-categorisation; ignored unless it is an invoice/asset id.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"client":{"oneOf":[{"type":"string"},{"type":"null"}]},"product":{"oneOf":[{"type":"string"},{"type":"null"}]},"date":{"oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"category":{"oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"invoiceid":{"oneOf":[{"type":"string"},{"type":"null"}]},"incometype":{"oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"oneOf":[{"type":"number"},{"type":"null"}]},"alert":{"oneOf":[{"type":"string"},{"type":"null"}]},"method":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"assetid":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"Chart-of-accounts income category account id, or an exact account name to resolve (see list_accounts). Set to a supplier id (sup-…) to record a refund paid by that supplier: it posts once to Payables, tagged to the supplier, with no VAT, and draws down the credit they owe.","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"transactionid":{"oneOf":[{"type":"string"},{"type":"null"}]},"split":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"groupid":{"oneOf":[{"type":"string"},{"type":"null"}]},"unlink":{"description":"Id of a currently-linked invoice/asset to detach. Sent by the Sales-page allocation controls on every re-categorisation; ignored unless it is an invoice/asset id.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"client":{"oneOf":[{"type":"string"},{"type":"null"}]},"product":{"oneOf":[{"type":"string"},{"type":"null"}]},"date":{"oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"category":{"oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"invoiceid":{"oneOf":[{"type":"string"},{"type":"null"}]},"incometype":{"oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"oneOf":[{"type":"number"},{"type":"null"}]},"alert":{"oneOf":[{"type":"string"},{"type":"null"}]},"method":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"assetid":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"Chart-of-accounts income category account id, or an exact account name to resolve (see list_accounts). Set to a supplier id (sup-…) to record a refund paid by that supplier: it posts once to Payables, tagged to the supplier, with no VAT, and draws down the credit they owe.","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"transactionid":{"oneOf":[{"type":"string"},{"type":"null"}]},"split":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"groupid":{"oneOf":[{"type":"string"},{"type":"null"}]},"unlink":{"description":"Id of a currently-linked invoice/asset to detach. Sent by the Sales-page allocation controls on every re-categorisation; ignored unless it is an invoice/asset id.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Update an income record by id. To recategorise or relink several income records at once, send save_income an items array.","tags":["income management"]}},"/api/income/save":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Income id. Present → update that income; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name / description of the income.","oneOf":[{"type":"string"},{"type":"null"}]},"client":{"description":"Client id, or an exact client name to resolve (see list_clients).","oneOf":[{"type":"string"},{"type":"null"}]},"product":{"description":"Product id this income is for (see list_products).","oneOf":[{"type":"string"},{"type":"null"}]},"date":{"description":"Income date (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"category":{"description":"Income category name; forced to \"Sales\" when linked to an invoice.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Unit amount before quantity/tax, in the record's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"invoiceid":{"description":"Invoice id this income pays toward.","oneOf":[{"type":"string"},{"type":"null"}]},"incometype":{"description":"Income type/classification label.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Manual FX rate to the business base currency; omit to use the stored/auto rate.","oneOf":[{"type":"number"},{"type":"null"}]},"alert":{"description":"Alert/reminder note to surface on this income.","oneOf":[{"type":"string"},{"type":"null"}]},"method":{"description":"Payment method as free text (e.g. \"cash\", \"card\", \"eft\") — no fixed set.","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"assetid":{"description":"Asset id to link this income to (e.g. proceeds from an asset).","oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"Chart-of-accounts income category account id, or an exact account name to resolve (see list_accounts). Set to a supplier id (sup-…) to record a refund paid by that supplier: it posts once to Payables, tagged to the supplier, with no VAT, and draws down the credit they owe.","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"description":"Base/control account id override; rarely needed — defaults from the category.","oneOf":[{"type":"string"},{"type":"null"}]},"transactionid":{"description":"Bank transaction id to reconcile this income against.","oneOf":[{"type":"string"},{"type":"null"}]},"split":{"description":"Whether this income is one line of a split transaction.","oneOf":[{"type":"boolean"},{"type":"null"}]},"groupid":{"description":"Group id linking split lines of one real-world transaction together.","oneOf":[{"type":"string"},{"type":"null"}]},"unlink":{"description":"Id of a currently-linked invoice/asset to detach from this income. Ignored unless it is an invoice/asset id.","oneOf":[{"type":"string"},{"type":"null"}]},"items":{"description":"Vector of income objects to create/update in one all-or-nothing batch. Preferred over repeated calls. Each item with an id updates; each without creates.","type":"array","items":{"type":"object","properties":{"id":{"description":"Income id. Present → update that income; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name / description of the income.","oneOf":[{"type":"string"},{"type":"null"}]},"client":{"description":"Client id, or an exact client name to resolve (see list_clients).","oneOf":[{"type":"string"},{"type":"null"}]},"product":{"description":"Product id this income is for (see list_products).","oneOf":[{"type":"string"},{"type":"null"}]},"date":{"description":"Income date (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"category":{"description":"Income category name; forced to \"Sales\" when linked to an invoice.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Unit amount before quantity/tax, in the record's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"invoiceid":{"description":"Invoice id this income pays toward.","oneOf":[{"type":"string"},{"type":"null"}]},"incometype":{"description":"Income type/classification label.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Manual FX rate to the business base currency; omit to use the stored/auto rate.","oneOf":[{"type":"number"},{"type":"null"}]},"alert":{"description":"Alert/reminder note to surface on this income.","oneOf":[{"type":"string"},{"type":"null"}]},"method":{"description":"Payment method as free text (e.g. \"cash\", \"card\", \"eft\") — no fixed set.","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"bankaccountid":{"description":"Bank account id the money moved through (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"split":{"description":"Whether this income is one line of a split transaction.","oneOf":[{"type":"boolean"},{"type":"null"}]},"groupid":{"description":"Group id linking split lines of one real-world transaction together.","oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Income id. Present → update that income; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name / description of the income.","oneOf":[{"type":"string"},{"type":"null"}]},"client":{"description":"Client id, or an exact client name to resolve (see list_clients).","oneOf":[{"type":"string"},{"type":"null"}]},"product":{"description":"Product id this income is for (see list_products).","oneOf":[{"type":"string"},{"type":"null"}]},"date":{"description":"Income date (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"category":{"description":"Income category name; forced to \"Sales\" when linked to an invoice.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Unit amount before quantity/tax, in the record's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"invoiceid":{"description":"Invoice id this income pays toward.","oneOf":[{"type":"string"},{"type":"null"}]},"incometype":{"description":"Income type/classification label.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Manual FX rate to the business base currency; omit to use the stored/auto rate.","oneOf":[{"type":"number"},{"type":"null"}]},"alert":{"description":"Alert/reminder note to surface on this income.","oneOf":[{"type":"string"},{"type":"null"}]},"method":{"description":"Payment method as free text (e.g. \"cash\", \"card\", \"eft\") — no fixed set.","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"assetid":{"description":"Asset id to link this income to (e.g. proceeds from an asset).","oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"Chart-of-accounts income category account id, or an exact account name to resolve (see list_accounts). Set to a supplier id (sup-…) to record a refund paid by that supplier: it posts once to Payables, tagged to the supplier, with no VAT, and draws down the credit they owe.","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"description":"Base/control account id override; rarely needed — defaults from the category.","oneOf":[{"type":"string"},{"type":"null"}]},"transactionid":{"description":"Bank transaction id to reconcile this income against.","oneOf":[{"type":"string"},{"type":"null"}]},"split":{"description":"Whether this income is one line of a split transaction.","oneOf":[{"type":"boolean"},{"type":"null"}]},"groupid":{"description":"Group id linking split lines of one real-world transaction together.","oneOf":[{"type":"string"},{"type":"null"}]},"unlink":{"description":"Id of a currently-linked invoice/asset to detach from this income. Ignored unless it is an invoice/asset id.","oneOf":[{"type":"string"},{"type":"null"}]},"items":{"description":"Vector of income objects to create/update in one all-or-nothing batch. Preferred over repeated calls. Each item with an id updates; each without creates.","type":"array","items":{"type":"object","properties":{"id":{"description":"Income id. Present → update that income; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name / description of the income.","oneOf":[{"type":"string"},{"type":"null"}]},"client":{"description":"Client id, or an exact client name to resolve (see list_clients).","oneOf":[{"type":"string"},{"type":"null"}]},"product":{"description":"Product id this income is for (see list_products).","oneOf":[{"type":"string"},{"type":"null"}]},"date":{"description":"Income date (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"category":{"description":"Income category name; forced to \"Sales\" when linked to an invoice.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Unit amount before quantity/tax, in the record's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"invoiceid":{"description":"Invoice id this income pays toward.","oneOf":[{"type":"string"},{"type":"null"}]},"incometype":{"description":"Income type/classification label.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Manual FX rate to the business base currency; omit to use the stored/auto rate.","oneOf":[{"type":"number"},{"type":"null"}]},"alert":{"description":"Alert/reminder note to surface on this income.","oneOf":[{"type":"string"},{"type":"null"}]},"method":{"description":"Payment method as free text (e.g. \"cash\", \"card\", \"eft\") — no fixed set.","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"bankaccountid":{"description":"Bank account id the money moved through (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"split":{"description":"Whether this income is one line of a split transaction.","oneOf":[{"type":"boolean"},{"type":"null"}]},"groupid":{"description":"Group id linking split lines of one real-world transaction together.","oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Income id. Present → update that income; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name / description of the income.","oneOf":[{"type":"string"},{"type":"null"}]},"client":{"description":"Client id, or an exact client name to resolve (see list_clients).","oneOf":[{"type":"string"},{"type":"null"}]},"product":{"description":"Product id this income is for (see list_products).","oneOf":[{"type":"string"},{"type":"null"}]},"date":{"description":"Income date (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"category":{"description":"Income category name; forced to \"Sales\" when linked to an invoice.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Unit amount before quantity/tax, in the record's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"invoiceid":{"description":"Invoice id this income pays toward.","oneOf":[{"type":"string"},{"type":"null"}]},"incometype":{"description":"Income type/classification label.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Manual FX rate to the business base currency; omit to use the stored/auto rate.","oneOf":[{"type":"number"},{"type":"null"}]},"alert":{"description":"Alert/reminder note to surface on this income.","oneOf":[{"type":"string"},{"type":"null"}]},"method":{"description":"Payment method as free text (e.g. \"cash\", \"card\", \"eft\") — no fixed set.","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"assetid":{"description":"Asset id to link this income to (e.g. proceeds from an asset).","oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"Chart-of-accounts income category account id, or an exact account name to resolve (see list_accounts). Set to a supplier id (sup-…) to record a refund paid by that supplier: it posts once to Payables, tagged to the supplier, with no VAT, and draws down the credit they owe.","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"description":"Base/control account id override; rarely needed — defaults from the category.","oneOf":[{"type":"string"},{"type":"null"}]},"transactionid":{"description":"Bank transaction id to reconcile this income against.","oneOf":[{"type":"string"},{"type":"null"}]},"split":{"description":"Whether this income is one line of a split transaction.","oneOf":[{"type":"boolean"},{"type":"null"}]},"groupid":{"description":"Group id linking split lines of one real-world transaction together.","oneOf":[{"type":"string"},{"type":"null"}]},"unlink":{"description":"Id of a currently-linked invoice/asset to detach from this income. Ignored unless it is an invoice/asset id.","oneOf":[{"type":"string"},{"type":"null"}]},"items":{"description":"Vector of income objects to create/update in one all-or-nothing batch. Preferred over repeated calls. Each item with an id updates; each without creates.","type":"array","items":{"type":"object","properties":{"id":{"description":"Income id. Present → update that income; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name / description of the income.","oneOf":[{"type":"string"},{"type":"null"}]},"client":{"description":"Client id, or an exact client name to resolve (see list_clients).","oneOf":[{"type":"string"},{"type":"null"}]},"product":{"description":"Product id this income is for (see list_products).","oneOf":[{"type":"string"},{"type":"null"}]},"date":{"description":"Income date (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"category":{"description":"Income category name; forced to \"Sales\" when linked to an invoice.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Unit amount before quantity/tax, in the record's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"invoiceid":{"description":"Invoice id this income pays toward.","oneOf":[{"type":"string"},{"type":"null"}]},"incometype":{"description":"Income type/classification label.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Manual FX rate to the business base currency; omit to use the stored/auto rate.","oneOf":[{"type":"number"},{"type":"null"}]},"alert":{"description":"Alert/reminder note to surface on this income.","oneOf":[{"type":"string"},{"type":"null"}]},"method":{"description":"Payment method as free text (e.g. \"cash\", \"card\", \"eft\") — no fixed set.","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"bankaccountid":{"description":"Bank account id the money moved through (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"split":{"description":"Whether this income is one line of a split transaction.","oneOf":[{"type":"boolean"},{"type":"null"}]},"groupid":{"description":"Group id linking split lines of one real-world transaction together.","oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Income id. Present → update that income; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name / description of the income.","oneOf":[{"type":"string"},{"type":"null"}]},"client":{"description":"Client id, or an exact client name to resolve (see list_clients).","oneOf":[{"type":"string"},{"type":"null"}]},"product":{"description":"Product id this income is for (see list_products).","oneOf":[{"type":"string"},{"type":"null"}]},"date":{"description":"Income date (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"category":{"description":"Income category name; forced to \"Sales\" when linked to an invoice.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Unit amount before quantity/tax, in the record's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"invoiceid":{"description":"Invoice id this income pays toward.","oneOf":[{"type":"string"},{"type":"null"}]},"incometype":{"description":"Income type/classification label.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Manual FX rate to the business base currency; omit to use the stored/auto rate.","oneOf":[{"type":"number"},{"type":"null"}]},"alert":{"description":"Alert/reminder note to surface on this income.","oneOf":[{"type":"string"},{"type":"null"}]},"method":{"description":"Payment method as free text (e.g. \"cash\", \"card\", \"eft\") — no fixed set.","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"assetid":{"description":"Asset id to link this income to (e.g. proceeds from an asset).","oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"Chart-of-accounts income category account id, or an exact account name to resolve (see list_accounts). Set to a supplier id (sup-…) to record a refund paid by that supplier: it posts once to Payables, tagged to the supplier, with no VAT, and draws down the credit they owe.","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"description":"Base/control account id override; rarely needed — defaults from the category.","oneOf":[{"type":"string"},{"type":"null"}]},"transactionid":{"description":"Bank transaction id to reconcile this income against.","oneOf":[{"type":"string"},{"type":"null"}]},"split":{"description":"Whether this income is one line of a split transaction.","oneOf":[{"type":"boolean"},{"type":"null"}]},"groupid":{"description":"Group id linking split lines of one real-world transaction together.","oneOf":[{"type":"string"},{"type":"null"}]},"unlink":{"description":"Id of a currently-linked invoice/asset to detach from this income. Ignored unless it is an invoice/asset id.","oneOf":[{"type":"string"},{"type":"null"}]},"items":{"description":"Vector of income objects to create/update in one all-or-nothing batch. Preferred over repeated calls. Each item with an id updates; each without creates.","type":"array","items":{"type":"object","properties":{"id":{"description":"Income id. Present → update that income; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name / description of the income.","oneOf":[{"type":"string"},{"type":"null"}]},"client":{"description":"Client id, or an exact client name to resolve (see list_clients).","oneOf":[{"type":"string"},{"type":"null"}]},"product":{"description":"Product id this income is for (see list_products).","oneOf":[{"type":"string"},{"type":"null"}]},"date":{"description":"Income date (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"category":{"description":"Income category name; forced to \"Sales\" when linked to an invoice.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Unit amount before quantity/tax, in the record's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"invoiceid":{"description":"Invoice id this income pays toward.","oneOf":[{"type":"string"},{"type":"null"}]},"incometype":{"description":"Income type/classification label.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Manual FX rate to the business base currency; omit to use the stored/auto rate.","oneOf":[{"type":"number"},{"type":"null"}]},"alert":{"description":"Alert/reminder note to surface on this income.","oneOf":[{"type":"string"},{"type":"null"}]},"method":{"description":"Payment method as free text (e.g. \"cash\", \"card\", \"eft\") — no fixed set.","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"bankaccountid":{"description":"Bank account id the money moved through (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"split":{"description":"Whether this income is one line of a split transaction.","oneOf":[{"type":"boolean"},{"type":"null"}]},"groupid":{"description":"Group id linking split lines of one real-world transaction together.","oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create or edit income ACCOUNTING ENTRIES (category, client, tax); to change the BANK LINE itself (its description, ignored flag or notes) use update_transaction, and to record a payment against an invoice prefer record_document_payment. When the bank line that paid the invoice already has its own income (its `$incomeids` in list_transactions), settle by saving that income with `id` = the income and `accountid` = the invoice id instead, so the payment is not counted twice. For one, send its fields inline (pass an `id` to update, omit to create). To create/update many at once, send an `items` array — preferred over repeated calls: the whole batch is one all-or-nothing transaction with a single ledger recompute. Each item with an `id` updates; each without creates. Use create_income_expenses_bulk to add income and expenses together in one transaction.","tags":["income management"]}},"/api/income/update-many":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"income":{"type":"array","items":{"type":"object","properties":{"id":{"description":"Id of the existing income record to update.","type":"string"},"deleted":{"description":"true bins this income (soft delete, reversible); false restores a binned one. Omit to leave its bin state untouched.","type":"boolean"},"alert":{"description":"Alert/reminder note to surface on this income.","type":"string"},"accountid":{"description":"Chart-of-accounts income category account id, or an exact account name to resolve (see list_accounts). Set to a supplier id (sup-…) to record a refund paid by that supplier: it posts once to Payables, tagged to the supplier, with no VAT, and draws down the credit they owe.","type":"string"},"baseaccountid":{"description":"Base/control account id override; rarely needed — defaults from the category.","type":"string"},"client":{"description":"Client id, or an exact client name to resolve (see list_clients).","type":"string"},"split":{"description":"Whether this income is one line of a split transaction.","type":"boolean"},"groupid":{"description":"Group id linking split lines of one real-world transaction together.","oneOf":[{"type":"string"},{"type":"null"}]},"unlink":{"description":"Pass the id of a currently-linked invoice/asset to detach it. To detach a linked transaction, use unlink_income_transaction.","type":"string"}},"required":["id"],"additionalProperties":false}}},"required":["token","income"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"income":{"type":"array","items":{"type":"object","properties":{"id":{"description":"Id of the existing income record to update.","type":"string"},"deleted":{"description":"true bins this income (soft delete, reversible); false restores a binned one. Omit to leave its bin state untouched.","type":"boolean"},"alert":{"description":"Alert/reminder note to surface on this income.","type":"string"},"accountid":{"description":"Chart-of-accounts income category account id, or an exact account name to resolve (see list_accounts). Set to a supplier id (sup-…) to record a refund paid by that supplier: it posts once to Payables, tagged to the supplier, with no VAT, and draws down the credit they owe.","type":"string"},"baseaccountid":{"description":"Base/control account id override; rarely needed — defaults from the category.","type":"string"},"client":{"description":"Client id, or an exact client name to resolve (see list_clients).","type":"string"},"split":{"description":"Whether this income is one line of a split transaction.","type":"boolean"},"groupid":{"description":"Group id linking split lines of one real-world transaction together.","oneOf":[{"type":"string"},{"type":"null"}]},"unlink":{"description":"Pass the id of a currently-linked invoice/asset to detach it. To detach a linked transaction, use unlink_income_transaction.","type":"string"}},"required":["id"],"additionalProperties":false}}},"required":["token","income"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"income":{"type":"array","items":{"type":"object","properties":{"id":{"description":"Id of the existing income record to update.","type":"string"},"deleted":{"description":"true bins this income (soft delete, reversible); false restores a binned one. Omit to leave its bin state untouched.","type":"boolean"},"alert":{"description":"Alert/reminder note to surface on this income.","type":"string"},"accountid":{"description":"Chart-of-accounts income category account id, or an exact account name to resolve (see list_accounts). Set to a supplier id (sup-…) to record a refund paid by that supplier: it posts once to Payables, tagged to the supplier, with no VAT, and draws down the credit they owe.","type":"string"},"baseaccountid":{"description":"Base/control account id override; rarely needed — defaults from the category.","type":"string"},"client":{"description":"Client id, or an exact client name to resolve (see list_clients).","type":"string"},"split":{"description":"Whether this income is one line of a split transaction.","type":"boolean"},"groupid":{"description":"Group id linking split lines of one real-world transaction together.","oneOf":[{"type":"string"},{"type":"null"}]},"unlink":{"description":"Pass the id of a currently-linked invoice/asset to detach it. To detach a linked transaction, use unlink_income_transaction.","type":"string"}},"required":["id"],"additionalProperties":false}}},"required":["token","income"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"income":{"type":"array","items":{"type":"object","properties":{"id":{"description":"Id of the existing income record to update.","type":"string"},"deleted":{"description":"true bins this income (soft delete, reversible); false restores a binned one. Omit to leave its bin state untouched.","type":"boolean"},"alert":{"description":"Alert/reminder note to surface on this income.","type":"string"},"accountid":{"description":"Chart-of-accounts income category account id, or an exact account name to resolve (see list_accounts). Set to a supplier id (sup-…) to record a refund paid by that supplier: it posts once to Payables, tagged to the supplier, with no VAT, and draws down the credit they owe.","type":"string"},"baseaccountid":{"description":"Base/control account id override; rarely needed — defaults from the category.","type":"string"},"client":{"description":"Client id, or an exact client name to resolve (see list_clients).","type":"string"},"split":{"description":"Whether this income is one line of a split transaction.","type":"boolean"},"groupid":{"description":"Group id linking split lines of one real-world transaction together.","oneOf":[{"type":"string"},{"type":"null"}]},"unlink":{"description":"Pass the id of a currently-linked invoice/asset to detach it. To detach a linked transaction, use unlink_income_transaction.","type":"string"}},"required":["id"],"additionalProperties":false}}},"required":["token","income"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Update many income records in one call (stub-web; off the MCP surface, where save_income items covers it). Per-item fields are limited to recategorising and linking (accountid, baseaccountid, client, split, groupid, alert, unlink). To create income or edit fields beyond recategorising/linking, use save_income.","tags":["income management"]}},"/api/income/delete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"One income id to delete.","type":"string"},"ids":{"description":"Up to 250 income ids to delete in one call. Partial success: ids this business does not own, already deleted, or unknown are skipped and listed in errors.","type":"array","items":{"type":"string"},"minItems":1,"maxItems":250}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"One income id to delete.","type":"string"},"ids":{"description":"Up to 250 income ids to delete in one call. Partial success: ids this business does not own, already deleted, or unknown are skipped and listed in errors.","type":"array","items":{"type":"string"},"minItems":1,"maxItems":250}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"One income id to delete.","type":"string"},"ids":{"description":"Up to 250 income ids to delete in one call. Partial success: ids this business does not own, already deleted, or unknown are skipped and listed in errors.","type":"array","items":{"type":"string"},"minItems":1,"maxItems":250}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"One income id to delete.","type":"string"},"ids":{"description":"Up to 250 income ids to delete in one call. Partial success: ids this business does not own, already deleted, or unknown are skipped and listed in errors.","type":"array","items":{"type":"string"},"minItems":1,"maxItems":250}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Delete one income record or many to the bin (soft-delete, restorable). Send `id` for one record, which returns {error}. Or send `ids` (up to 250) to delete many in one call, which returns {error, deleted: [id ...], errors: [{id, message} ...]}. That is partial success: ids this business does not own, already deleted, or unknown are skipped and listed in errors, and error is true only when nothing was deleted. The ledger recomputes, so a linked invoice's outstanding is restored. Confirm with the user before deleting.","tags":["income management"]}},"/api/income/unlink-transaction":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the income record to detach from its bank transaction.","type":"string"},"transactionid":{"description":"Id of the currently-linked bank transaction.","type":"string"}},"required":["token","id","transactionid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the income record to detach from its bank transaction.","type":"string"},"transactionid":{"description":"Id of the currently-linked bank transaction.","type":"string"}},"required":["token","id","transactionid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the income record to detach from its bank transaction.","type":"string"},"transactionid":{"description":"Id of the currently-linked bank transaction.","type":"string"}},"required":["token","id","transactionid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the income record to detach from its bank transaction.","type":"string"},"transactionid":{"description":"Id of the currently-linked bank transaction.","type":"string"}},"required":["token","id","transactionid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Detach an income record from its bank transaction. Safe to call even if the transaction was already deleted without being unlinked first.","tags":["income management"]}},"/api/client/create":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress":{"description":"Postal address line 1, e.g. a PO Box.","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress2":{"description":"Postal address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"postalsuburb":{"description":"Postal address suburb.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcity":{"description":"Postal address city.","oneOf":[{"type":"string"},{"type":"null"}]},"postalpostalcode":{"description":"Postal address postal code.","oneOf":[{"type":"string"},{"type":"null"}]},"documentaddress":{"description":"Which address documents print: physical (default) or postal.","oneOf":[{"type":"string","enum":["physical","postal"]},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"contacts":{"description":"The full list of contact people, each {id, name, email, phone, role, ondocuments}. It replaces the stored list: a person left out is removed. Leave the key out to keep the stored list; send [] to clear it. A contact with no customer or supplier role keeps its people too, and they move onto the role it gains. A contact that is both a customer and a supplier holds one list, read back as people.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The contact person id. Send it to keep and update that person; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"ondocuments":{"description":"True to send documents to this person.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"website":{"description":"Client website, e.g. www.example.co.za. Trimmed; a blank string clears it, null leaves it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]},"contactname":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactemail":{"oneOf":[{"type":"string"},{"type":"null"}]},"number":{"description":"Main telephone (landline) number of the client, beside the contact person's contactnumber. Trimmed; a blank value on update clears it.","oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"hidden":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"customercode":{"oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"oneOf":[{"type":"number"},{"type":"null"}]},"clearcreditlimit":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"clearopeningbalance":{"description":"Reserved, mirrors update_bank_account: when true the opening-date confirmation below is not asked.","oneOf":[{"type":"boolean"},{"type":"null"}]},"confirm":{"description":"PROD-1950: required only to save an opening date that is LATER than the customer's own earliest invoice or receipt. Without it that one case is refused, unwritten, with code confirm-required plus earliesttransactiondate and transactionsbefore, so the caller can show what the date would exclude from the debtors balance and let the user override it.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress":{"description":"Postal address line 1, e.g. a PO Box.","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress2":{"description":"Postal address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"postalsuburb":{"description":"Postal address suburb.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcity":{"description":"Postal address city.","oneOf":[{"type":"string"},{"type":"null"}]},"postalpostalcode":{"description":"Postal address postal code.","oneOf":[{"type":"string"},{"type":"null"}]},"documentaddress":{"description":"Which address documents print: physical (default) or postal.","oneOf":[{"type":"string","enum":["physical","postal"]},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"contacts":{"description":"The full list of contact people, each {id, name, email, phone, role, ondocuments}. It replaces the stored list: a person left out is removed. Leave the key out to keep the stored list; send [] to clear it. A contact with no customer or supplier role keeps its people too, and they move onto the role it gains. A contact that is both a customer and a supplier holds one list, read back as people.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The contact person id. Send it to keep and update that person; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"ondocuments":{"description":"True to send documents to this person.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"website":{"description":"Client website, e.g. www.example.co.za. Trimmed; a blank string clears it, null leaves it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]},"contactname":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactemail":{"oneOf":[{"type":"string"},{"type":"null"}]},"number":{"description":"Main telephone (landline) number of the client, beside the contact person's contactnumber. Trimmed; a blank value on update clears it.","oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"hidden":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"customercode":{"oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"oneOf":[{"type":"number"},{"type":"null"}]},"clearcreditlimit":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"clearopeningbalance":{"description":"Reserved, mirrors update_bank_account: when true the opening-date confirmation below is not asked.","oneOf":[{"type":"boolean"},{"type":"null"}]},"confirm":{"description":"PROD-1950: required only to save an opening date that is LATER than the customer's own earliest invoice or receipt. Without it that one case is refused, unwritten, with code confirm-required plus earliesttransactiondate and transactionsbefore, so the caller can show what the date would exclude from the debtors balance and let the user override it.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress":{"description":"Postal address line 1, e.g. a PO Box.","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress2":{"description":"Postal address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"postalsuburb":{"description":"Postal address suburb.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcity":{"description":"Postal address city.","oneOf":[{"type":"string"},{"type":"null"}]},"postalpostalcode":{"description":"Postal address postal code.","oneOf":[{"type":"string"},{"type":"null"}]},"documentaddress":{"description":"Which address documents print: physical (default) or postal.","oneOf":[{"type":"string","enum":["physical","postal"]},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"contacts":{"description":"The full list of contact people, each {id, name, email, phone, role, ondocuments}. It replaces the stored list: a person left out is removed. Leave the key out to keep the stored list; send [] to clear it. A contact with no customer or supplier role keeps its people too, and they move onto the role it gains. A contact that is both a customer and a supplier holds one list, read back as people.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The contact person id. Send it to keep and update that person; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"ondocuments":{"description":"True to send documents to this person.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"website":{"description":"Client website, e.g. www.example.co.za. Trimmed; a blank string clears it, null leaves it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]},"contactname":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactemail":{"oneOf":[{"type":"string"},{"type":"null"}]},"number":{"description":"Main telephone (landline) number of the client, beside the contact person's contactnumber. Trimmed; a blank value on update clears it.","oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"hidden":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"customercode":{"oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"oneOf":[{"type":"number"},{"type":"null"}]},"clearcreditlimit":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"clearopeningbalance":{"description":"Reserved, mirrors update_bank_account: when true the opening-date confirmation below is not asked.","oneOf":[{"type":"boolean"},{"type":"null"}]},"confirm":{"description":"PROD-1950: required only to save an opening date that is LATER than the customer's own earliest invoice or receipt. Without it that one case is refused, unwritten, with code confirm-required plus earliesttransactiondate and transactionsbefore, so the caller can show what the date would exclude from the debtors balance and let the user override it.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress":{"description":"Postal address line 1, e.g. a PO Box.","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress2":{"description":"Postal address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"postalsuburb":{"description":"Postal address suburb.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcity":{"description":"Postal address city.","oneOf":[{"type":"string"},{"type":"null"}]},"postalpostalcode":{"description":"Postal address postal code.","oneOf":[{"type":"string"},{"type":"null"}]},"documentaddress":{"description":"Which address documents print: physical (default) or postal.","oneOf":[{"type":"string","enum":["physical","postal"]},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"contacts":{"description":"The full list of contact people, each {id, name, email, phone, role, ondocuments}. It replaces the stored list: a person left out is removed. Leave the key out to keep the stored list; send [] to clear it. A contact with no customer or supplier role keeps its people too, and they move onto the role it gains. A contact that is both a customer and a supplier holds one list, read back as people.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The contact person id. Send it to keep and update that person; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"ondocuments":{"description":"True to send documents to this person.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"website":{"description":"Client website, e.g. www.example.co.za. Trimmed; a blank string clears it, null leaves it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]},"contactname":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactemail":{"oneOf":[{"type":"string"},{"type":"null"}]},"number":{"description":"Main telephone (landline) number of the client, beside the contact person's contactnumber. Trimmed; a blank value on update clears it.","oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"hidden":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"customercode":{"oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"oneOf":[{"type":"number"},{"type":"null"}]},"clearcreditlimit":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"clearopeningbalance":{"description":"Reserved, mirrors update_bank_account: when true the opening-date confirmation below is not asked.","oneOf":[{"type":"boolean"},{"type":"null"}]},"confirm":{"description":"PROD-1950: required only to save an opening date that is LATER than the customer's own earliest invoice or receipt. Without it that one case is refused, unwritten, with code confirm-required plus earliesttransactiondate and transactionsbefore, so the caller can show what the date would exclude from the debtors balance and let the user override it.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create a customer. Returns the new client id.","tags":["client management"]}},"/api/client/update":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress":{"description":"Postal address line 1, e.g. a PO Box.","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress2":{"description":"Postal address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"postalsuburb":{"description":"Postal address suburb.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcity":{"description":"Postal address city.","oneOf":[{"type":"string"},{"type":"null"}]},"postalpostalcode":{"description":"Postal address postal code.","oneOf":[{"type":"string"},{"type":"null"}]},"documentaddress":{"description":"Which address documents print: physical (default) or postal.","oneOf":[{"type":"string","enum":["physical","postal"]},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"contacts":{"description":"The full list of contact people, each {id, name, email, phone, role, ondocuments}. It replaces the stored list: a person left out is removed. Leave the key out to keep the stored list; send [] to clear it. A contact with no customer or supplier role keeps its people too, and they move onto the role it gains. A contact that is both a customer and a supplier holds one list, read back as people.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The contact person id. Send it to keep and update that person; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"ondocuments":{"description":"True to send documents to this person.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"website":{"description":"Client website, e.g. www.example.co.za. Trimmed; a blank string clears it, null leaves it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]},"contactname":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactemail":{"oneOf":[{"type":"string"},{"type":"null"}]},"number":{"description":"Main telephone (landline) number of the client, beside the contact person's contactnumber. Trimmed; a blank value on update clears it.","oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"hidden":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"customercode":{"oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"oneOf":[{"type":"number"},{"type":"null"}]},"clearcreditlimit":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"clearopeningbalance":{"description":"Reserved, mirrors update_bank_account: when true the opening-date confirmation below is not asked.","oneOf":[{"type":"boolean"},{"type":"null"}]},"confirm":{"description":"PROD-1950: required only to save an opening date that is LATER than the customer's own earliest invoice or receipt. Without it that one case is refused, unwritten, with code confirm-required plus earliesttransactiondate and transactionsbefore, so the caller can show what the date would exclude from the debtors balance and let the user override it.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress":{"description":"Postal address line 1, e.g. a PO Box.","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress2":{"description":"Postal address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"postalsuburb":{"description":"Postal address suburb.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcity":{"description":"Postal address city.","oneOf":[{"type":"string"},{"type":"null"}]},"postalpostalcode":{"description":"Postal address postal code.","oneOf":[{"type":"string"},{"type":"null"}]},"documentaddress":{"description":"Which address documents print: physical (default) or postal.","oneOf":[{"type":"string","enum":["physical","postal"]},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"contacts":{"description":"The full list of contact people, each {id, name, email, phone, role, ondocuments}. It replaces the stored list: a person left out is removed. Leave the key out to keep the stored list; send [] to clear it. A contact with no customer or supplier role keeps its people too, and they move onto the role it gains. A contact that is both a customer and a supplier holds one list, read back as people.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The contact person id. Send it to keep and update that person; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"ondocuments":{"description":"True to send documents to this person.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"website":{"description":"Client website, e.g. www.example.co.za. Trimmed; a blank string clears it, null leaves it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]},"contactname":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactemail":{"oneOf":[{"type":"string"},{"type":"null"}]},"number":{"description":"Main telephone (landline) number of the client, beside the contact person's contactnumber. Trimmed; a blank value on update clears it.","oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"hidden":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"customercode":{"oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"oneOf":[{"type":"number"},{"type":"null"}]},"clearcreditlimit":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"clearopeningbalance":{"description":"Reserved, mirrors update_bank_account: when true the opening-date confirmation below is not asked.","oneOf":[{"type":"boolean"},{"type":"null"}]},"confirm":{"description":"PROD-1950: required only to save an opening date that is LATER than the customer's own earliest invoice or receipt. Without it that one case is refused, unwritten, with code confirm-required plus earliesttransactiondate and transactionsbefore, so the caller can show what the date would exclude from the debtors balance and let the user override it.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress":{"description":"Postal address line 1, e.g. a PO Box.","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress2":{"description":"Postal address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"postalsuburb":{"description":"Postal address suburb.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcity":{"description":"Postal address city.","oneOf":[{"type":"string"},{"type":"null"}]},"postalpostalcode":{"description":"Postal address postal code.","oneOf":[{"type":"string"},{"type":"null"}]},"documentaddress":{"description":"Which address documents print: physical (default) or postal.","oneOf":[{"type":"string","enum":["physical","postal"]},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"contacts":{"description":"The full list of contact people, each {id, name, email, phone, role, ondocuments}. It replaces the stored list: a person left out is removed. Leave the key out to keep the stored list; send [] to clear it. A contact with no customer or supplier role keeps its people too, and they move onto the role it gains. A contact that is both a customer and a supplier holds one list, read back as people.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The contact person id. Send it to keep and update that person; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"ondocuments":{"description":"True to send documents to this person.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"website":{"description":"Client website, e.g. www.example.co.za. Trimmed; a blank string clears it, null leaves it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]},"contactname":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactemail":{"oneOf":[{"type":"string"},{"type":"null"}]},"number":{"description":"Main telephone (landline) number of the client, beside the contact person's contactnumber. Trimmed; a blank value on update clears it.","oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"hidden":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"customercode":{"oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"oneOf":[{"type":"number"},{"type":"null"}]},"clearcreditlimit":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"clearopeningbalance":{"description":"Reserved, mirrors update_bank_account: when true the opening-date confirmation below is not asked.","oneOf":[{"type":"boolean"},{"type":"null"}]},"confirm":{"description":"PROD-1950: required only to save an opening date that is LATER than the customer's own earliest invoice or receipt. Without it that one case is refused, unwritten, with code confirm-required plus earliesttransactiondate and transactionsbefore, so the caller can show what the date would exclude from the debtors balance and let the user override it.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress":{"description":"Postal address line 1, e.g. a PO Box.","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress2":{"description":"Postal address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"postalsuburb":{"description":"Postal address suburb.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcity":{"description":"Postal address city.","oneOf":[{"type":"string"},{"type":"null"}]},"postalpostalcode":{"description":"Postal address postal code.","oneOf":[{"type":"string"},{"type":"null"}]},"documentaddress":{"description":"Which address documents print: physical (default) or postal.","oneOf":[{"type":"string","enum":["physical","postal"]},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"contacts":{"description":"The full list of contact people, each {id, name, email, phone, role, ondocuments}. It replaces the stored list: a person left out is removed. Leave the key out to keep the stored list; send [] to clear it. A contact with no customer or supplier role keeps its people too, and they move onto the role it gains. A contact that is both a customer and a supplier holds one list, read back as people.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The contact person id. Send it to keep and update that person; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"ondocuments":{"description":"True to send documents to this person.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"website":{"description":"Client website, e.g. www.example.co.za. Trimmed; a blank string clears it, null leaves it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]},"contactname":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactemail":{"oneOf":[{"type":"string"},{"type":"null"}]},"number":{"description":"Main telephone (landline) number of the client, beside the contact person's contactnumber. Trimmed; a blank value on update clears it.","oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"hidden":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"customercode":{"oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"oneOf":[{"type":"number"},{"type":"null"}]},"clearcreditlimit":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"clearopeningbalance":{"description":"Reserved, mirrors update_bank_account: when true the opening-date confirmation below is not asked.","oneOf":[{"type":"boolean"},{"type":"null"}]},"confirm":{"description":"PROD-1950: required only to save an opening date that is LATER than the customer's own earliest invoice or receipt. Without it that one case is refused, unwritten, with code confirm-required plus earliesttransactiondate and transactionsbefore, so the caller can show what the date would exclude from the debtors balance and let the user override it.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Update an existing customer by id. An opening date later than the customer's own earliest invoice or receipt is refused, unwritten, with code confirm-required until the same call is repeated with confirm true.","tags":["client management"]}},"/api/client/save":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Client id. Present → update that client; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"tags":{"description":"Category or group names to tag it with (a Sage customer category, say). A tag with the same name is reused; a missing one is made.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"name":{"description":"Display name / description of the client.","oneOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Client email address.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"description":"Street address line 1.","oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"description":"Street address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"description":"Suburb or district.","oneOf":[{"type":"string"},{"type":"null"}]},"city":{"description":"City.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"description":"Postal or ZIP code.","oneOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"Client country (ISO code or name).","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress":{"description":"Postal address line 1, e.g. a PO Box.","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress2":{"description":"Postal address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"postalsuburb":{"description":"Postal address suburb.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcity":{"description":"Postal address city.","oneOf":[{"type":"string"},{"type":"null"}]},"postalpostalcode":{"description":"Postal address postal code.","oneOf":[{"type":"string"},{"type":"null"}]},"documentaddress":{"description":"Which address documents print: physical (default) or postal.","oneOf":[{"type":"string","enum":["physical","postal"]},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"contacts":{"description":"The full list of contact people, each {id, name, email, phone, role, ondocuments}. It replaces the stored list: a person left out is removed. Leave the key out to keep the stored list; send [] to clear it. A contact with no customer or supplier role keeps its people too, and they move onto the role it gains. A contact that is both a customer and a supplier holds one list, read back as people.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The contact person id. Send it to keep and update that person; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"ondocuments":{"description":"True to send documents to this person.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"website":{"description":"Client website, e.g. www.example.co.za. Trimmed; a blank string clears it, null leaves it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]},"contactname":{"description":"Name of the primary contact person.","oneOf":[{"type":"string"},{"type":"null"}]},"contactemail":{"description":"Email of the primary contact person.","oneOf":[{"type":"string"},{"type":"null"}]},"number":{"description":"Main telephone (landline) number of the client, beside the contact person's contactnumber. Trimmed; a blank value on update clears it.","oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"description":"Phone number of the primary contact person.","oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"description":"VAT / tax registration number.","oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"description":"Business registration number.","oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"description":"Whether this client is marked as a favourite.","oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"description":"Whether this client is archived. Archiving is a status flag only: the server stores it and still returns archived clients on every list, report and total. The apps filter on it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"hidden":{"description":"Whether this client is hidden from lists.","oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"description":"Opening balance amount carried for this client at openingdate.","oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"description":"Date the opening balance applies from (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"customercode":{"description":"Your internal customer/account code for this client.","oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"description":"Most this customer may owe, in base currency. Changing or clearing a stored limit needs Customers Add & edit.","oneOf":[{"type":"number"},{"type":"null"}]},"clearcreditlimit":{"description":"When true, removes the stored credit limit.","oneOf":[{"type":"boolean"},{"type":"null"}]},"items":{"description":"Vector of client objects to create/update in one all-or-nothing batch. Preferred over repeated calls. Each item with an id updates; each without creates.","type":"array","items":{"type":"object","properties":{"id":{"description":"Client id. Present → update that client; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"tags":{"description":"Category or group names to tag it with (a Sage customer category, say). A tag with the same name is reused; a missing one is made.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"name":{"description":"Display name / description of the client.","oneOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Client email address.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"description":"Street address line 1.","oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"description":"Street address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"description":"Suburb or district.","oneOf":[{"type":"string"},{"type":"null"}]},"city":{"description":"City.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"description":"Postal or ZIP code.","oneOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"Client country (ISO code or name).","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress":{"description":"Postal address line 1, e.g. a PO Box.","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress2":{"description":"Postal address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"postalsuburb":{"description":"Postal address suburb.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcity":{"description":"Postal address city.","oneOf":[{"type":"string"},{"type":"null"}]},"postalpostalcode":{"description":"Postal address postal code.","oneOf":[{"type":"string"},{"type":"null"}]},"documentaddress":{"description":"Which address documents print: physical (default) or postal.","oneOf":[{"type":"string","enum":["physical","postal"]},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"contacts":{"description":"The full list of contact people, each {id, name, email, phone, role, ondocuments}. It replaces the stored list: a person left out is removed. Leave the key out to keep the stored list; send [] to clear it. A contact with no customer or supplier role keeps its people too, and they move onto the role it gains. A contact that is both a customer and a supplier holds one list, read back as people.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The contact person id. Send it to keep and update that person; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"ondocuments":{"description":"True to send documents to this person.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"website":{"description":"Client website, e.g. www.example.co.za. Trimmed; a blank string clears it, null leaves it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]},"contactname":{"description":"Name of the primary contact person.","oneOf":[{"type":"string"},{"type":"null"}]},"contactemail":{"description":"Email of the primary contact person.","oneOf":[{"type":"string"},{"type":"null"}]},"number":{"description":"Main telephone (landline) number of the client, beside the contact person's contactnumber. Trimmed; a blank value on update clears it.","oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"description":"Phone number of the primary contact person.","oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"description":"VAT / tax registration number.","oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"description":"Business registration number.","oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"description":"Whether this client is marked as a favourite.","oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"description":"Whether this client is archived. Archiving is a status flag only: the server stores it and still returns archived clients on every list, report and total. The apps filter on it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"hidden":{"description":"Whether this client is hidden from lists.","oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"description":"Opening balance amount carried for this client at openingdate.","oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"description":"Date the opening balance applies from (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"customercode":{"description":"Your internal customer/account code for this client.","oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"description":"Most this customer may owe, in base currency. Changing or clearing a stored limit needs Customers Add & edit.","oneOf":[{"type":"number"},{"type":"null"}]},"clearcreditlimit":{"description":"When true, removes the stored credit limit.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false}},"clearopeningbalance":{"description":"Reserved, mirrors update_bank_account: when true the opening-date confirmation below is not asked.","oneOf":[{"type":"boolean"},{"type":"null"}]},"confirm":{"description":"PROD-1950: required only to save an opening date that is LATER than the customer's own earliest invoice or receipt. Without it that one case is refused, unwritten, with code confirm-required plus earliesttransactiondate and transactionsbefore, so the caller can show what the date would exclude from the debtors balance and let the user override it.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Client id. Present → update that client; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"tags":{"description":"Category or group names to tag it with (a Sage customer category, say). A tag with the same name is reused; a missing one is made.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"name":{"description":"Display name / description of the client.","oneOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Client email address.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"description":"Street address line 1.","oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"description":"Street address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"description":"Suburb or district.","oneOf":[{"type":"string"},{"type":"null"}]},"city":{"description":"City.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"description":"Postal or ZIP code.","oneOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"Client country (ISO code or name).","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress":{"description":"Postal address line 1, e.g. a PO Box.","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress2":{"description":"Postal address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"postalsuburb":{"description":"Postal address suburb.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcity":{"description":"Postal address city.","oneOf":[{"type":"string"},{"type":"null"}]},"postalpostalcode":{"description":"Postal address postal code.","oneOf":[{"type":"string"},{"type":"null"}]},"documentaddress":{"description":"Which address documents print: physical (default) or postal.","oneOf":[{"type":"string","enum":["physical","postal"]},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"contacts":{"description":"The full list of contact people, each {id, name, email, phone, role, ondocuments}. It replaces the stored list: a person left out is removed. Leave the key out to keep the stored list; send [] to clear it. A contact with no customer or supplier role keeps its people too, and they move onto the role it gains. A contact that is both a customer and a supplier holds one list, read back as people.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The contact person id. Send it to keep and update that person; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"ondocuments":{"description":"True to send documents to this person.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"website":{"description":"Client website, e.g. www.example.co.za. Trimmed; a blank string clears it, null leaves it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]},"contactname":{"description":"Name of the primary contact person.","oneOf":[{"type":"string"},{"type":"null"}]},"contactemail":{"description":"Email of the primary contact person.","oneOf":[{"type":"string"},{"type":"null"}]},"number":{"description":"Main telephone (landline) number of the client, beside the contact person's contactnumber. Trimmed; a blank value on update clears it.","oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"description":"Phone number of the primary contact person.","oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"description":"VAT / tax registration number.","oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"description":"Business registration number.","oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"description":"Whether this client is marked as a favourite.","oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"description":"Whether this client is archived. Archiving is a status flag only: the server stores it and still returns archived clients on every list, report and total. The apps filter on it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"hidden":{"description":"Whether this client is hidden from lists.","oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"description":"Opening balance amount carried for this client at openingdate.","oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"description":"Date the opening balance applies from (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"customercode":{"description":"Your internal customer/account code for this client.","oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"description":"Most this customer may owe, in base currency. Changing or clearing a stored limit needs Customers Add & edit.","oneOf":[{"type":"number"},{"type":"null"}]},"clearcreditlimit":{"description":"When true, removes the stored credit limit.","oneOf":[{"type":"boolean"},{"type":"null"}]},"items":{"description":"Vector of client objects to create/update in one all-or-nothing batch. Preferred over repeated calls. Each item with an id updates; each without creates.","type":"array","items":{"type":"object","properties":{"id":{"description":"Client id. Present → update that client; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"tags":{"description":"Category or group names to tag it with (a Sage customer category, say). A tag with the same name is reused; a missing one is made.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"name":{"description":"Display name / description of the client.","oneOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Client email address.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"description":"Street address line 1.","oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"description":"Street address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"description":"Suburb or district.","oneOf":[{"type":"string"},{"type":"null"}]},"city":{"description":"City.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"description":"Postal or ZIP code.","oneOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"Client country (ISO code or name).","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress":{"description":"Postal address line 1, e.g. a PO Box.","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress2":{"description":"Postal address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"postalsuburb":{"description":"Postal address suburb.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcity":{"description":"Postal address city.","oneOf":[{"type":"string"},{"type":"null"}]},"postalpostalcode":{"description":"Postal address postal code.","oneOf":[{"type":"string"},{"type":"null"}]},"documentaddress":{"description":"Which address documents print: physical (default) or postal.","oneOf":[{"type":"string","enum":["physical","postal"]},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"contacts":{"description":"The full list of contact people, each {id, name, email, phone, role, ondocuments}. It replaces the stored list: a person left out is removed. Leave the key out to keep the stored list; send [] to clear it. A contact with no customer or supplier role keeps its people too, and they move onto the role it gains. A contact that is both a customer and a supplier holds one list, read back as people.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The contact person id. Send it to keep and update that person; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"ondocuments":{"description":"True to send documents to this person.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"website":{"description":"Client website, e.g. www.example.co.za. Trimmed; a blank string clears it, null leaves it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]},"contactname":{"description":"Name of the primary contact person.","oneOf":[{"type":"string"},{"type":"null"}]},"contactemail":{"description":"Email of the primary contact person.","oneOf":[{"type":"string"},{"type":"null"}]},"number":{"description":"Main telephone (landline) number of the client, beside the contact person's contactnumber. Trimmed; a blank value on update clears it.","oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"description":"Phone number of the primary contact person.","oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"description":"VAT / tax registration number.","oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"description":"Business registration number.","oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"description":"Whether this client is marked as a favourite.","oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"description":"Whether this client is archived. Archiving is a status flag only: the server stores it and still returns archived clients on every list, report and total. The apps filter on it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"hidden":{"description":"Whether this client is hidden from lists.","oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"description":"Opening balance amount carried for this client at openingdate.","oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"description":"Date the opening balance applies from (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"customercode":{"description":"Your internal customer/account code for this client.","oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"description":"Most this customer may owe, in base currency. Changing or clearing a stored limit needs Customers Add & edit.","oneOf":[{"type":"number"},{"type":"null"}]},"clearcreditlimit":{"description":"When true, removes the stored credit limit.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false}},"clearopeningbalance":{"description":"Reserved, mirrors update_bank_account: when true the opening-date confirmation below is not asked.","oneOf":[{"type":"boolean"},{"type":"null"}]},"confirm":{"description":"PROD-1950: required only to save an opening date that is LATER than the customer's own earliest invoice or receipt. Without it that one case is refused, unwritten, with code confirm-required plus earliesttransactiondate and transactionsbefore, so the caller can show what the date would exclude from the debtors balance and let the user override it.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Client id. Present → update that client; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"tags":{"description":"Category or group names to tag it with (a Sage customer category, say). A tag with the same name is reused; a missing one is made.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"name":{"description":"Display name / description of the client.","oneOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Client email address.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"description":"Street address line 1.","oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"description":"Street address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"description":"Suburb or district.","oneOf":[{"type":"string"},{"type":"null"}]},"city":{"description":"City.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"description":"Postal or ZIP code.","oneOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"Client country (ISO code or name).","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress":{"description":"Postal address line 1, e.g. a PO Box.","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress2":{"description":"Postal address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"postalsuburb":{"description":"Postal address suburb.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcity":{"description":"Postal address city.","oneOf":[{"type":"string"},{"type":"null"}]},"postalpostalcode":{"description":"Postal address postal code.","oneOf":[{"type":"string"},{"type":"null"}]},"documentaddress":{"description":"Which address documents print: physical (default) or postal.","oneOf":[{"type":"string","enum":["physical","postal"]},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"contacts":{"description":"The full list of contact people, each {id, name, email, phone, role, ondocuments}. It replaces the stored list: a person left out is removed. Leave the key out to keep the stored list; send [] to clear it. A contact with no customer or supplier role keeps its people too, and they move onto the role it gains. A contact that is both a customer and a supplier holds one list, read back as people.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The contact person id. Send it to keep and update that person; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"ondocuments":{"description":"True to send documents to this person.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"website":{"description":"Client website, e.g. www.example.co.za. Trimmed; a blank string clears it, null leaves it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]},"contactname":{"description":"Name of the primary contact person.","oneOf":[{"type":"string"},{"type":"null"}]},"contactemail":{"description":"Email of the primary contact person.","oneOf":[{"type":"string"},{"type":"null"}]},"number":{"description":"Main telephone (landline) number of the client, beside the contact person's contactnumber. Trimmed; a blank value on update clears it.","oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"description":"Phone number of the primary contact person.","oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"description":"VAT / tax registration number.","oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"description":"Business registration number.","oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"description":"Whether this client is marked as a favourite.","oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"description":"Whether this client is archived. Archiving is a status flag only: the server stores it and still returns archived clients on every list, report and total. The apps filter on it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"hidden":{"description":"Whether this client is hidden from lists.","oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"description":"Opening balance amount carried for this client at openingdate.","oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"description":"Date the opening balance applies from (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"customercode":{"description":"Your internal customer/account code for this client.","oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"description":"Most this customer may owe, in base currency. Changing or clearing a stored limit needs Customers Add & edit.","oneOf":[{"type":"number"},{"type":"null"}]},"clearcreditlimit":{"description":"When true, removes the stored credit limit.","oneOf":[{"type":"boolean"},{"type":"null"}]},"items":{"description":"Vector of client objects to create/update in one all-or-nothing batch. Preferred over repeated calls. Each item with an id updates; each without creates.","type":"array","items":{"type":"object","properties":{"id":{"description":"Client id. Present → update that client; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"tags":{"description":"Category or group names to tag it with (a Sage customer category, say). A tag with the same name is reused; a missing one is made.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"name":{"description":"Display name / description of the client.","oneOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Client email address.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"description":"Street address line 1.","oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"description":"Street address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"description":"Suburb or district.","oneOf":[{"type":"string"},{"type":"null"}]},"city":{"description":"City.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"description":"Postal or ZIP code.","oneOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"Client country (ISO code or name).","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress":{"description":"Postal address line 1, e.g. a PO Box.","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress2":{"description":"Postal address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"postalsuburb":{"description":"Postal address suburb.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcity":{"description":"Postal address city.","oneOf":[{"type":"string"},{"type":"null"}]},"postalpostalcode":{"description":"Postal address postal code.","oneOf":[{"type":"string"},{"type":"null"}]},"documentaddress":{"description":"Which address documents print: physical (default) or postal.","oneOf":[{"type":"string","enum":["physical","postal"]},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"contacts":{"description":"The full list of contact people, each {id, name, email, phone, role, ondocuments}. It replaces the stored list: a person left out is removed. Leave the key out to keep the stored list; send [] to clear it. A contact with no customer or supplier role keeps its people too, and they move onto the role it gains. A contact that is both a customer and a supplier holds one list, read back as people.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The contact person id. Send it to keep and update that person; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"ondocuments":{"description":"True to send documents to this person.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"website":{"description":"Client website, e.g. www.example.co.za. Trimmed; a blank string clears it, null leaves it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]},"contactname":{"description":"Name of the primary contact person.","oneOf":[{"type":"string"},{"type":"null"}]},"contactemail":{"description":"Email of the primary contact person.","oneOf":[{"type":"string"},{"type":"null"}]},"number":{"description":"Main telephone (landline) number of the client, beside the contact person's contactnumber. Trimmed; a blank value on update clears it.","oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"description":"Phone number of the primary contact person.","oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"description":"VAT / tax registration number.","oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"description":"Business registration number.","oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"description":"Whether this client is marked as a favourite.","oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"description":"Whether this client is archived. Archiving is a status flag only: the server stores it and still returns archived clients on every list, report and total. The apps filter on it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"hidden":{"description":"Whether this client is hidden from lists.","oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"description":"Opening balance amount carried for this client at openingdate.","oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"description":"Date the opening balance applies from (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"customercode":{"description":"Your internal customer/account code for this client.","oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"description":"Most this customer may owe, in base currency. Changing or clearing a stored limit needs Customers Add & edit.","oneOf":[{"type":"number"},{"type":"null"}]},"clearcreditlimit":{"description":"When true, removes the stored credit limit.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false}},"clearopeningbalance":{"description":"Reserved, mirrors update_bank_account: when true the opening-date confirmation below is not asked.","oneOf":[{"type":"boolean"},{"type":"null"}]},"confirm":{"description":"PROD-1950: required only to save an opening date that is LATER than the customer's own earliest invoice or receipt. Without it that one case is refused, unwritten, with code confirm-required plus earliesttransactiondate and transactionsbefore, so the caller can show what the date would exclude from the debtors balance and let the user override it.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Client id. Present → update that client; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"tags":{"description":"Category or group names to tag it with (a Sage customer category, say). A tag with the same name is reused; a missing one is made.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"name":{"description":"Display name / description of the client.","oneOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Client email address.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"description":"Street address line 1.","oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"description":"Street address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"description":"Suburb or district.","oneOf":[{"type":"string"},{"type":"null"}]},"city":{"description":"City.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"description":"Postal or ZIP code.","oneOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"Client country (ISO code or name).","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress":{"description":"Postal address line 1, e.g. a PO Box.","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress2":{"description":"Postal address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"postalsuburb":{"description":"Postal address suburb.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcity":{"description":"Postal address city.","oneOf":[{"type":"string"},{"type":"null"}]},"postalpostalcode":{"description":"Postal address postal code.","oneOf":[{"type":"string"},{"type":"null"}]},"documentaddress":{"description":"Which address documents print: physical (default) or postal.","oneOf":[{"type":"string","enum":["physical","postal"]},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"contacts":{"description":"The full list of contact people, each {id, name, email, phone, role, ondocuments}. It replaces the stored list: a person left out is removed. Leave the key out to keep the stored list; send [] to clear it. A contact with no customer or supplier role keeps its people too, and they move onto the role it gains. A contact that is both a customer and a supplier holds one list, read back as people.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The contact person id. Send it to keep and update that person; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"ondocuments":{"description":"True to send documents to this person.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"website":{"description":"Client website, e.g. www.example.co.za. Trimmed; a blank string clears it, null leaves it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]},"contactname":{"description":"Name of the primary contact person.","oneOf":[{"type":"string"},{"type":"null"}]},"contactemail":{"description":"Email of the primary contact person.","oneOf":[{"type":"string"},{"type":"null"}]},"number":{"description":"Main telephone (landline) number of the client, beside the contact person's contactnumber. Trimmed; a blank value on update clears it.","oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"description":"Phone number of the primary contact person.","oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"description":"VAT / tax registration number.","oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"description":"Business registration number.","oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"description":"Whether this client is marked as a favourite.","oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"description":"Whether this client is archived. Archiving is a status flag only: the server stores it and still returns archived clients on every list, report and total. The apps filter on it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"hidden":{"description":"Whether this client is hidden from lists.","oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"description":"Opening balance amount carried for this client at openingdate.","oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"description":"Date the opening balance applies from (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"customercode":{"description":"Your internal customer/account code for this client.","oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"description":"Most this customer may owe, in base currency. Changing or clearing a stored limit needs Customers Add & edit.","oneOf":[{"type":"number"},{"type":"null"}]},"clearcreditlimit":{"description":"When true, removes the stored credit limit.","oneOf":[{"type":"boolean"},{"type":"null"}]},"items":{"description":"Vector of client objects to create/update in one all-or-nothing batch. Preferred over repeated calls. Each item with an id updates; each without creates.","type":"array","items":{"type":"object","properties":{"id":{"description":"Client id. Present → update that client; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"tags":{"description":"Category or group names to tag it with (a Sage customer category, say). A tag with the same name is reused; a missing one is made.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"name":{"description":"Display name / description of the client.","oneOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Client email address.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"description":"Street address line 1.","oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"description":"Street address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"description":"Suburb or district.","oneOf":[{"type":"string"},{"type":"null"}]},"city":{"description":"City.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"description":"Postal or ZIP code.","oneOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"Client country (ISO code or name).","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress":{"description":"Postal address line 1, e.g. a PO Box.","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress2":{"description":"Postal address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"postalsuburb":{"description":"Postal address suburb.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcity":{"description":"Postal address city.","oneOf":[{"type":"string"},{"type":"null"}]},"postalpostalcode":{"description":"Postal address postal code.","oneOf":[{"type":"string"},{"type":"null"}]},"documentaddress":{"description":"Which address documents print: physical (default) or postal.","oneOf":[{"type":"string","enum":["physical","postal"]},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"contacts":{"description":"The full list of contact people, each {id, name, email, phone, role, ondocuments}. It replaces the stored list: a person left out is removed. Leave the key out to keep the stored list; send [] to clear it. A contact with no customer or supplier role keeps its people too, and they move onto the role it gains. A contact that is both a customer and a supplier holds one list, read back as people.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The contact person id. Send it to keep and update that person; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"ondocuments":{"description":"True to send documents to this person.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"website":{"description":"Client website, e.g. www.example.co.za. Trimmed; a blank string clears it, null leaves it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]},"contactname":{"description":"Name of the primary contact person.","oneOf":[{"type":"string"},{"type":"null"}]},"contactemail":{"description":"Email of the primary contact person.","oneOf":[{"type":"string"},{"type":"null"}]},"number":{"description":"Main telephone (landline) number of the client, beside the contact person's contactnumber. Trimmed; a blank value on update clears it.","oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"description":"Phone number of the primary contact person.","oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"description":"VAT / tax registration number.","oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"description":"Business registration number.","oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"description":"Whether this client is marked as a favourite.","oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"description":"Whether this client is archived. Archiving is a status flag only: the server stores it and still returns archived clients on every list, report and total. The apps filter on it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"hidden":{"description":"Whether this client is hidden from lists.","oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"description":"Opening balance amount carried for this client at openingdate.","oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"description":"Date the opening balance applies from (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"customercode":{"description":"Your internal customer/account code for this client.","oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"description":"Most this customer may owe, in base currency. Changing or clearing a stored limit needs Customers Add & edit.","oneOf":[{"type":"number"},{"type":"null"}]},"clearcreditlimit":{"description":"When true, removes the stored credit limit.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false}},"clearopeningbalance":{"description":"Reserved, mirrors update_bank_account: when true the opening-date confirmation below is not asked.","oneOf":[{"type":"boolean"},{"type":"null"}]},"confirm":{"description":"PROD-1950: required only to save an opening date that is LATER than the customer's own earliest invoice or receipt. Without it that one case is refused, unwritten, with code confirm-required plus earliesttransactiondate and transactionsbefore, so the caller can show what the date would exclude from the debtors balance and let the user override it.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create or update a customer. Pass an `id` to update that customer; omit `id` to create a new one. Returns the new client id on create. Updating an existing customer with an opening date later than its own earliest invoice or receipt is refused, unwritten, with code confirm-required until the same call is repeated with confirm true. To create/update many at once, send an `items` array — one all-or-nothing transaction with a single ledger recompute; each item with an `id` updates, each without creates.","tags":["client management"]}},"/api/client/create-bulk":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"items":{"description":"Up to 100 customers to create, in file order. Partial success: a row that is refused is listed in errors and the rest are saved.","type":"array","items":{"type":"object","properties":{"line":{"description":"The row's line in the customer's file, as read_file_rows numbers it. Echoed back on its result so a refusal names the line. Leave it out for rows read from a PDF's text.","oneOf":[{"type":"integer"},{"type":"null"}]},"tags":{"description":"Category or group names to tag it with (a Sage customer category, say). A tag with the same name is reused; a missing one is made.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"name":{"description":"Display name / description of the client.","oneOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Client email address.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"description":"Street address line 1.","oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"description":"Street address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"description":"Suburb or district.","oneOf":[{"type":"string"},{"type":"null"}]},"city":{"description":"City.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"description":"Postal or ZIP code.","oneOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"Client country (ISO code or name).","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress":{"description":"Postal address line 1, e.g. a PO Box.","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress2":{"description":"Postal address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"postalsuburb":{"description":"Postal address suburb.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcity":{"description":"Postal address city.","oneOf":[{"type":"string"},{"type":"null"}]},"postalpostalcode":{"description":"Postal address postal code.","oneOf":[{"type":"string"},{"type":"null"}]},"documentaddress":{"description":"Which address documents print: physical (default) or postal.","oneOf":[{"type":"string","enum":["physical","postal"]},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"contacts":{"description":"The full list of contact people, each {id, name, email, phone, role, ondocuments}. It replaces the stored list: a person left out is removed. Leave the key out to keep the stored list; send [] to clear it. A contact with no customer or supplier role keeps its people too, and they move onto the role it gains. A contact that is both a customer and a supplier holds one list, read back as people.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The contact person id. Send it to keep and update that person; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"ondocuments":{"description":"True to send documents to this person.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"website":{"description":"Client website, e.g. www.example.co.za. Trimmed; a blank string clears it, null leaves it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]},"contactname":{"description":"Name of the primary contact person.","oneOf":[{"type":"string"},{"type":"null"}]},"contactemail":{"description":"Email of the primary contact person.","oneOf":[{"type":"string"},{"type":"null"}]},"number":{"description":"Main telephone (landline) number of the client, beside the contact person's contactnumber. Trimmed; a blank value on update clears it.","oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"description":"Phone number of the primary contact person.","oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"description":"VAT / tax registration number.","oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"description":"Business registration number.","oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"description":"Whether this client is marked as a favourite.","oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"description":"Whether this client is archived. Archiving is a status flag only: the server stores it and still returns archived clients on every list, report and total. The apps filter on it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"hidden":{"description":"Whether this client is hidden from lists.","oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"description":"Opening balance amount carried for this client at openingdate.","oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"description":"Date the opening balance applies from (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"customercode":{"description":"Your internal customer/account code for this client.","oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"description":"Most this customer may owe, in base currency. Changing or clearing a stored limit needs Customers Add & edit.","oneOf":[{"type":"number"},{"type":"null"}]},"clearcreditlimit":{"description":"When true, removes the stored credit limit.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"minItems":1,"maxItems":100}},"required":["token","items"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"items":{"description":"Up to 100 customers to create, in file order. Partial success: a row that is refused is listed in errors and the rest are saved.","type":"array","items":{"type":"object","properties":{"line":{"description":"The row's line in the customer's file, as read_file_rows numbers it. Echoed back on its result so a refusal names the line. Leave it out for rows read from a PDF's text.","oneOf":[{"type":"integer"},{"type":"null"}]},"tags":{"description":"Category or group names to tag it with (a Sage customer category, say). A tag with the same name is reused; a missing one is made.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"name":{"description":"Display name / description of the client.","oneOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Client email address.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"description":"Street address line 1.","oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"description":"Street address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"description":"Suburb or district.","oneOf":[{"type":"string"},{"type":"null"}]},"city":{"description":"City.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"description":"Postal or ZIP code.","oneOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"Client country (ISO code or name).","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress":{"description":"Postal address line 1, e.g. a PO Box.","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress2":{"description":"Postal address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"postalsuburb":{"description":"Postal address suburb.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcity":{"description":"Postal address city.","oneOf":[{"type":"string"},{"type":"null"}]},"postalpostalcode":{"description":"Postal address postal code.","oneOf":[{"type":"string"},{"type":"null"}]},"documentaddress":{"description":"Which address documents print: physical (default) or postal.","oneOf":[{"type":"string","enum":["physical","postal"]},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"contacts":{"description":"The full list of contact people, each {id, name, email, phone, role, ondocuments}. It replaces the stored list: a person left out is removed. Leave the key out to keep the stored list; send [] to clear it. A contact with no customer or supplier role keeps its people too, and they move onto the role it gains. A contact that is both a customer and a supplier holds one list, read back as people.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The contact person id. Send it to keep and update that person; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"ondocuments":{"description":"True to send documents to this person.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"website":{"description":"Client website, e.g. www.example.co.za. Trimmed; a blank string clears it, null leaves it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]},"contactname":{"description":"Name of the primary contact person.","oneOf":[{"type":"string"},{"type":"null"}]},"contactemail":{"description":"Email of the primary contact person.","oneOf":[{"type":"string"},{"type":"null"}]},"number":{"description":"Main telephone (landline) number of the client, beside the contact person's contactnumber. Trimmed; a blank value on update clears it.","oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"description":"Phone number of the primary contact person.","oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"description":"VAT / tax registration number.","oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"description":"Business registration number.","oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"description":"Whether this client is marked as a favourite.","oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"description":"Whether this client is archived. Archiving is a status flag only: the server stores it and still returns archived clients on every list, report and total. The apps filter on it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"hidden":{"description":"Whether this client is hidden from lists.","oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"description":"Opening balance amount carried for this client at openingdate.","oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"description":"Date the opening balance applies from (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"customercode":{"description":"Your internal customer/account code for this client.","oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"description":"Most this customer may owe, in base currency. Changing or clearing a stored limit needs Customers Add & edit.","oneOf":[{"type":"number"},{"type":"null"}]},"clearcreditlimit":{"description":"When true, removes the stored credit limit.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"minItems":1,"maxItems":100}},"required":["token","items"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"items":{"description":"Up to 100 customers to create, in file order. Partial success: a row that is refused is listed in errors and the rest are saved.","type":"array","items":{"type":"object","properties":{"line":{"description":"The row's line in the customer's file, as read_file_rows numbers it. Echoed back on its result so a refusal names the line. Leave it out for rows read from a PDF's text.","oneOf":[{"type":"integer"},{"type":"null"}]},"tags":{"description":"Category or group names to tag it with (a Sage customer category, say). A tag with the same name is reused; a missing one is made.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"name":{"description":"Display name / description of the client.","oneOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Client email address.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"description":"Street address line 1.","oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"description":"Street address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"description":"Suburb or district.","oneOf":[{"type":"string"},{"type":"null"}]},"city":{"description":"City.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"description":"Postal or ZIP code.","oneOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"Client country (ISO code or name).","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress":{"description":"Postal address line 1, e.g. a PO Box.","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress2":{"description":"Postal address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"postalsuburb":{"description":"Postal address suburb.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcity":{"description":"Postal address city.","oneOf":[{"type":"string"},{"type":"null"}]},"postalpostalcode":{"description":"Postal address postal code.","oneOf":[{"type":"string"},{"type":"null"}]},"documentaddress":{"description":"Which address documents print: physical (default) or postal.","oneOf":[{"type":"string","enum":["physical","postal"]},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"contacts":{"description":"The full list of contact people, each {id, name, email, phone, role, ondocuments}. It replaces the stored list: a person left out is removed. Leave the key out to keep the stored list; send [] to clear it. A contact with no customer or supplier role keeps its people too, and they move onto the role it gains. A contact that is both a customer and a supplier holds one list, read back as people.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The contact person id. Send it to keep and update that person; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"ondocuments":{"description":"True to send documents to this person.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"website":{"description":"Client website, e.g. www.example.co.za. Trimmed; a blank string clears it, null leaves it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]},"contactname":{"description":"Name of the primary contact person.","oneOf":[{"type":"string"},{"type":"null"}]},"contactemail":{"description":"Email of the primary contact person.","oneOf":[{"type":"string"},{"type":"null"}]},"number":{"description":"Main telephone (landline) number of the client, beside the contact person's contactnumber. Trimmed; a blank value on update clears it.","oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"description":"Phone number of the primary contact person.","oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"description":"VAT / tax registration number.","oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"description":"Business registration number.","oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"description":"Whether this client is marked as a favourite.","oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"description":"Whether this client is archived. Archiving is a status flag only: the server stores it and still returns archived clients on every list, report and total. The apps filter on it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"hidden":{"description":"Whether this client is hidden from lists.","oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"description":"Opening balance amount carried for this client at openingdate.","oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"description":"Date the opening balance applies from (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"customercode":{"description":"Your internal customer/account code for this client.","oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"description":"Most this customer may owe, in base currency. Changing or clearing a stored limit needs Customers Add & edit.","oneOf":[{"type":"number"},{"type":"null"}]},"clearcreditlimit":{"description":"When true, removes the stored credit limit.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"minItems":1,"maxItems":100}},"required":["token","items"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"items":{"description":"Up to 100 customers to create, in file order. Partial success: a row that is refused is listed in errors and the rest are saved.","type":"array","items":{"type":"object","properties":{"line":{"description":"The row's line in the customer's file, as read_file_rows numbers it. Echoed back on its result so a refusal names the line. Leave it out for rows read from a PDF's text.","oneOf":[{"type":"integer"},{"type":"null"}]},"tags":{"description":"Category or group names to tag it with (a Sage customer category, say). A tag with the same name is reused; a missing one is made.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"name":{"description":"Display name / description of the client.","oneOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Client email address.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"description":"Street address line 1.","oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"description":"Street address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"description":"Suburb or district.","oneOf":[{"type":"string"},{"type":"null"}]},"city":{"description":"City.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"description":"Postal or ZIP code.","oneOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"Client country (ISO code or name).","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress":{"description":"Postal address line 1, e.g. a PO Box.","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress2":{"description":"Postal address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"postalsuburb":{"description":"Postal address suburb.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcity":{"description":"Postal address city.","oneOf":[{"type":"string"},{"type":"null"}]},"postalpostalcode":{"description":"Postal address postal code.","oneOf":[{"type":"string"},{"type":"null"}]},"documentaddress":{"description":"Which address documents print: physical (default) or postal.","oneOf":[{"type":"string","enum":["physical","postal"]},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"contacts":{"description":"The full list of contact people, each {id, name, email, phone, role, ondocuments}. It replaces the stored list: a person left out is removed. Leave the key out to keep the stored list; send [] to clear it. A contact with no customer or supplier role keeps its people too, and they move onto the role it gains. A contact that is both a customer and a supplier holds one list, read back as people.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The contact person id. Send it to keep and update that person; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"ondocuments":{"description":"True to send documents to this person.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"website":{"description":"Client website, e.g. www.example.co.za. Trimmed; a blank string clears it, null leaves it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]},"contactname":{"description":"Name of the primary contact person.","oneOf":[{"type":"string"},{"type":"null"}]},"contactemail":{"description":"Email of the primary contact person.","oneOf":[{"type":"string"},{"type":"null"}]},"number":{"description":"Main telephone (landline) number of the client, beside the contact person's contactnumber. Trimmed; a blank value on update clears it.","oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"description":"Phone number of the primary contact person.","oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"description":"VAT / tax registration number.","oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"description":"Business registration number.","oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"description":"Whether this client is marked as a favourite.","oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"description":"Whether this client is archived. Archiving is a status flag only: the server stores it and still returns archived clients on every list, report and total. The apps filter on it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"hidden":{"description":"Whether this client is hidden from lists.","oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"description":"Opening balance amount carried for this client at openingdate.","oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"description":"Date the opening balance applies from (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"customercode":{"description":"Your internal customer/account code for this client.","oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"description":"Most this customer may owe, in base currency. Changing or clearing a stored limit needs Customers Add & edit.","oneOf":[{"type":"number"},{"type":"null"}]},"clearcreditlimit":{"description":"When true, removes the stored credit limit.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"minItems":1,"maxItems":100}},"required":["token","items"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create many customers from a list, such as a page of rows read with read_file_rows. Up to 100 a call; for a longer list call again with the next page. Partial success: returns {error, message, created: [{line, id, name}], matched: [{line, id, name}], errors: [{line, name, message}]}. A row whose name matches a customer already in stub is matched, not added twice, and fills only blank details. A refused row is listed in errors with the reason and the rest are saved. error is true only when no row was created or matched. Show the entrepreneur a preview and get one confirm before you call it. To change an existing customer use save_client.","tags":["client management"]}},"/api/client/delete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"One client id to delete.","type":"string"},"ids":{"description":"Up to 1000 client ids to delete in one transaction. Partial success: ids this business does not own, already deleted, or still linked (unless force) are skipped and listed in errors.","type":"array","items":{"type":"string"},"minItems":1,"maxItems":1000},"force":{"description":"Delete even when the client still has linked (non-deleted) quotes/invoices. Default false: the delete is refused when links exist, so linked documents aren't orphaned (PROD-555).","type":"boolean"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"One client id to delete.","type":"string"},"ids":{"description":"Up to 1000 client ids to delete in one transaction. Partial success: ids this business does not own, already deleted, or still linked (unless force) are skipped and listed in errors.","type":"array","items":{"type":"string"},"minItems":1,"maxItems":1000},"force":{"description":"Delete even when the client still has linked (non-deleted) quotes/invoices. Default false: the delete is refused when links exist, so linked documents aren't orphaned (PROD-555).","type":"boolean"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"One client id to delete.","type":"string"},"ids":{"description":"Up to 1000 client ids to delete in one transaction. Partial success: ids this business does not own, already deleted, or still linked (unless force) are skipped and listed in errors.","type":"array","items":{"type":"string"},"minItems":1,"maxItems":1000},"force":{"description":"Delete even when the client still has linked (non-deleted) quotes/invoices. Default false: the delete is refused when links exist, so linked documents aren't orphaned (PROD-555).","type":"boolean"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"One client id to delete.","type":"string"},"ids":{"description":"Up to 1000 client ids to delete in one transaction. Partial success: ids this business does not own, already deleted, or still linked (unless force) are skipped and listed in errors.","type":"array","items":{"type":"string"},"minItems":1,"maxItems":1000},"force":{"description":"Delete even when the client still has linked (non-deleted) quotes/invoices. Default false: the delete is refused when links exist, so linked documents aren't orphaned (PROD-555).","type":"boolean"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Delete one customer or many to the bin (soft-delete, restorable). Send `id` for one customer, which returns {error}. Or send `ids` (up to 1000) to delete many in one transaction, which returns {error, deleted: [id ...], errors: [{id, message} ...]}. That is partial success: ids this business does not own, already deleted, or still linked to quotes/invoices are skipped and listed in errors, and error is true only when nothing was deleted. By default a customer with linked (non-deleted) quotes/invoices is refused so those documents aren't orphaned. Pass force:true to override, or archive via update_client.","tags":["client management"]}},"/api/client/update-many":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"clients":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress":{"description":"Postal address line 1, e.g. a PO Box.","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress2":{"description":"Postal address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"postalsuburb":{"description":"Postal address suburb.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcity":{"description":"Postal address city.","oneOf":[{"type":"string"},{"type":"null"}]},"postalpostalcode":{"description":"Postal address postal code.","oneOf":[{"type":"string"},{"type":"null"}]},"documentaddress":{"description":"Which address documents print: physical (default) or postal.","oneOf":[{"type":"string","enum":["physical","postal"]},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"contacts":{"description":"The full list of contact people, each {id, name, email, phone, role, ondocuments}. It replaces the stored list: a person left out is removed. Leave the key out to keep the stored list; send [] to clear it. A contact with no customer or supplier role keeps its people too, and they move onto the role it gains. A contact that is both a customer and a supplier holds one list, read back as people.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The contact person id. Send it to keep and update that person; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"ondocuments":{"description":"True to send documents to this person.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"website":{"description":"Client website, e.g. www.example.co.za. Trimmed; a blank string clears it, null leaves it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]},"contactname":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactemail":{"oneOf":[{"type":"string"},{"type":"null"}]},"number":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"hidden":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"customercode":{"oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"oneOf":[{"type":"number"},{"type":"null"}]}},"required":["id"],"additionalProperties":false}}},"required":["token","clients"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"clients":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress":{"description":"Postal address line 1, e.g. a PO Box.","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress2":{"description":"Postal address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"postalsuburb":{"description":"Postal address suburb.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcity":{"description":"Postal address city.","oneOf":[{"type":"string"},{"type":"null"}]},"postalpostalcode":{"description":"Postal address postal code.","oneOf":[{"type":"string"},{"type":"null"}]},"documentaddress":{"description":"Which address documents print: physical (default) or postal.","oneOf":[{"type":"string","enum":["physical","postal"]},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"contacts":{"description":"The full list of contact people, each {id, name, email, phone, role, ondocuments}. It replaces the stored list: a person left out is removed. Leave the key out to keep the stored list; send [] to clear it. A contact with no customer or supplier role keeps its people too, and they move onto the role it gains. A contact that is both a customer and a supplier holds one list, read back as people.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The contact person id. Send it to keep and update that person; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"ondocuments":{"description":"True to send documents to this person.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"website":{"description":"Client website, e.g. www.example.co.za. Trimmed; a blank string clears it, null leaves it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]},"contactname":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactemail":{"oneOf":[{"type":"string"},{"type":"null"}]},"number":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"hidden":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"customercode":{"oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"oneOf":[{"type":"number"},{"type":"null"}]}},"required":["id"],"additionalProperties":false}}},"required":["token","clients"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"clients":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress":{"description":"Postal address line 1, e.g. a PO Box.","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress2":{"description":"Postal address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"postalsuburb":{"description":"Postal address suburb.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcity":{"description":"Postal address city.","oneOf":[{"type":"string"},{"type":"null"}]},"postalpostalcode":{"description":"Postal address postal code.","oneOf":[{"type":"string"},{"type":"null"}]},"documentaddress":{"description":"Which address documents print: physical (default) or postal.","oneOf":[{"type":"string","enum":["physical","postal"]},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"contacts":{"description":"The full list of contact people, each {id, name, email, phone, role, ondocuments}. It replaces the stored list: a person left out is removed. Leave the key out to keep the stored list; send [] to clear it. A contact with no customer or supplier role keeps its people too, and they move onto the role it gains. A contact that is both a customer and a supplier holds one list, read back as people.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The contact person id. Send it to keep and update that person; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"ondocuments":{"description":"True to send documents to this person.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"website":{"description":"Client website, e.g. www.example.co.za. Trimmed; a blank string clears it, null leaves it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]},"contactname":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactemail":{"oneOf":[{"type":"string"},{"type":"null"}]},"number":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"hidden":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"customercode":{"oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"oneOf":[{"type":"number"},{"type":"null"}]}},"required":["id"],"additionalProperties":false}}},"required":["token","clients"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"clients":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress":{"description":"Postal address line 1, e.g. a PO Box.","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress2":{"description":"Postal address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"postalsuburb":{"description":"Postal address suburb.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcity":{"description":"Postal address city.","oneOf":[{"type":"string"},{"type":"null"}]},"postalpostalcode":{"description":"Postal address postal code.","oneOf":[{"type":"string"},{"type":"null"}]},"documentaddress":{"description":"Which address documents print: physical (default) or postal.","oneOf":[{"type":"string","enum":["physical","postal"]},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"contacts":{"description":"The full list of contact people, each {id, name, email, phone, role, ondocuments}. It replaces the stored list: a person left out is removed. Leave the key out to keep the stored list; send [] to clear it. A contact with no customer or supplier role keeps its people too, and they move onto the role it gains. A contact that is both a customer and a supplier holds one list, read back as people.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The contact person id. Send it to keep and update that person; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"ondocuments":{"description":"True to send documents to this person.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"website":{"description":"Client website, e.g. www.example.co.za. Trimmed; a blank string clears it, null leaves it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]},"contactname":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactemail":{"oneOf":[{"type":"string"},{"type":"null"}]},"number":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"hidden":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"customercode":{"oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"oneOf":[{"type":"number"},{"type":"null"}]}},"required":["id"],"additionalProperties":false}}},"required":["token","clients"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Bulk update clients","tags":["client management"]}},"/api/client/delete-many":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"clients":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}},"required":["token","clients"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"clients":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}},"required":["token","clients"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"clients":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}},"required":["token","clients"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"clients":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}},"required":["token","clients"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Delete multiple customers in one transaction (soft-delete to bin). All-or-nothing: the whole request fails if any id is unknown or any customer still has linked (non-deleted) invoices. Body: {clients: [{id} ...]}. For a single customer use delete_client.","tags":["client management"]}},"/api/contact/create":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"name":{"description":"The contact's name. A contact with no customer or supplier role keeps every shared field and its contact people; they move onto the role it gains.","type":"string"},"roles":{"description":"Roles the contact starts with: client, supplier, employee, director, shareholder or other. Absent or empty makes a general contact. Client and supplier together are refused for now.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"starred":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"client":{"oneOf":[{"description":"The customer's own fields. Only for a contact that holds the client role.","type":"object","properties":{"customercode":{"oneOf":[{"type":"string"},{"type":"null"}]},"hidden":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"bankaccountid":{"description":"PROD-3741. :bankaccount/id of one of the business's own bank accounts this customer sees on its documents and pays into. \"$delete\" clears it back to the business default; null or omitted leaves it unchanged. An id the business does not own is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"clearcreditlimit":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"openingdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"clearopeningbalance":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]},"supplier":{"oneOf":[{"description":"The supplier's own fields. Only for a contact that holds the supplier role.","type":"object","properties":{"image":{"description":"Image URL; \"$delete\" clears it.","oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"clearcreditlimit":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"openingdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"clearopeningbalance":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]},"postaladdress":{"oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress2":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalsuburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcity":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalpostalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"documentaddress":{"oneOf":[{"type":"string","enum":["physical","postal"]},{"type":"null"}]},"contacts":{"description":"The full list of contact people, each {id, name, email, phone, role, ondocuments}. It replaces the stored list: a person left out is removed. Leave the key out to keep the stored list; send [] to clear it. A contact with no customer or supplier role keeps its people too, and they move onto the role it gains. A contact that is both a customer and a supplier holds one list, read back as people.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The contact person id. Send it to keep and update that person; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"ondocuments":{"description":"True to send documents to this person.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"bankaccounts":{"description":"PROD-3780. The contact's own bank accounts, the whole list: an entry left out is removed, [] clears, null or omitted keeps them. Exactly one is primary. Refusals: contact-bankaccount-invalid (fields names each entry's index, field and rule), contact-bankaccount-primary, contact-bankaccount-unknown, contact-bankaccount-duplicate.","oneOf":[{"type":"array","items":{"description":"PROD-3780. One of the contact's own bank accounts: where the business pays the contact. Not client.bankaccountid, the business's own account a customer pays into. Its country's bank fields label and check it.","type":"object","properties":{"id":{"description":"A stored entry's id, to keep and rewrite it. Omit for a new entry. An id not on this contact is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"ISO 3166-1 alpha-2 code. Required; it picks the bank fields that label and check the entry.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 code of the currency the account receives.","oneOf":[{"type":"string"},{"type":"null"}]},"bank":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountname":{"description":"The account holder.","oneOf":[{"type":"string"},{"type":"null"}]},"accountnumber":{"description":"The local account number. An entry needs this or an IBAN.","oneOf":[{"type":"string"},{"type":"null"}]},"iban":{"description":"Checked with mod 97.","oneOf":[{"type":"string"},{"type":"null"}]},"branchcode":{"description":"The national clearing code: ZA branch code, GB sort code, US routing number (ABA checksum), AU BSB, IN IFSC, CA transit and institution.","oneOf":[{"type":"string"},{"type":"null"}]},"swiftcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"accounttype":{"oneOf":[{"type":"string"},{"type":"null"}]},"primary":{"description":"True on the one entry a payment to the contact uses. A lone entry is primary.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactname":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactemail":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"number":{"oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"website":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","name"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"name":{"description":"The contact's name. A contact with no customer or supplier role keeps every shared field and its contact people; they move onto the role it gains.","type":"string"},"roles":{"description":"Roles the contact starts with: client, supplier, employee, director, shareholder or other. Absent or empty makes a general contact. Client and supplier together are refused for now.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"starred":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"client":{"oneOf":[{"description":"The customer's own fields. Only for a contact that holds the client role.","type":"object","properties":{"customercode":{"oneOf":[{"type":"string"},{"type":"null"}]},"hidden":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"bankaccountid":{"description":"PROD-3741. :bankaccount/id of one of the business's own bank accounts this customer sees on its documents and pays into. \"$delete\" clears it back to the business default; null or omitted leaves it unchanged. An id the business does not own is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"clearcreditlimit":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"openingdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"clearopeningbalance":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]},"supplier":{"oneOf":[{"description":"The supplier's own fields. Only for a contact that holds the supplier role.","type":"object","properties":{"image":{"description":"Image URL; \"$delete\" clears it.","oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"clearcreditlimit":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"openingdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"clearopeningbalance":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]},"postaladdress":{"oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress2":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalsuburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcity":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalpostalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"documentaddress":{"oneOf":[{"type":"string","enum":["physical","postal"]},{"type":"null"}]},"contacts":{"description":"The full list of contact people, each {id, name, email, phone, role, ondocuments}. It replaces the stored list: a person left out is removed. Leave the key out to keep the stored list; send [] to clear it. A contact with no customer or supplier role keeps its people too, and they move onto the role it gains. A contact that is both a customer and a supplier holds one list, read back as people.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The contact person id. Send it to keep and update that person; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"ondocuments":{"description":"True to send documents to this person.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"bankaccounts":{"description":"PROD-3780. The contact's own bank accounts, the whole list: an entry left out is removed, [] clears, null or omitted keeps them. Exactly one is primary. Refusals: contact-bankaccount-invalid (fields names each entry's index, field and rule), contact-bankaccount-primary, contact-bankaccount-unknown, contact-bankaccount-duplicate.","oneOf":[{"type":"array","items":{"description":"PROD-3780. One of the contact's own bank accounts: where the business pays the contact. Not client.bankaccountid, the business's own account a customer pays into. Its country's bank fields label and check it.","type":"object","properties":{"id":{"description":"A stored entry's id, to keep and rewrite it. Omit for a new entry. An id not on this contact is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"ISO 3166-1 alpha-2 code. Required; it picks the bank fields that label and check the entry.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 code of the currency the account receives.","oneOf":[{"type":"string"},{"type":"null"}]},"bank":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountname":{"description":"The account holder.","oneOf":[{"type":"string"},{"type":"null"}]},"accountnumber":{"description":"The local account number. An entry needs this or an IBAN.","oneOf":[{"type":"string"},{"type":"null"}]},"iban":{"description":"Checked with mod 97.","oneOf":[{"type":"string"},{"type":"null"}]},"branchcode":{"description":"The national clearing code: ZA branch code, GB sort code, US routing number (ABA checksum), AU BSB, IN IFSC, CA transit and institution.","oneOf":[{"type":"string"},{"type":"null"}]},"swiftcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"accounttype":{"oneOf":[{"type":"string"},{"type":"null"}]},"primary":{"description":"True on the one entry a payment to the contact uses. A lone entry is primary.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactname":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactemail":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"number":{"oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"website":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","name"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"name":{"description":"The contact's name. A contact with no customer or supplier role keeps every shared field and its contact people; they move onto the role it gains.","type":"string"},"roles":{"description":"Roles the contact starts with: client, supplier, employee, director, shareholder or other. Absent or empty makes a general contact. Client and supplier together are refused for now.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"starred":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"client":{"oneOf":[{"description":"The customer's own fields. Only for a contact that holds the client role.","type":"object","properties":{"customercode":{"oneOf":[{"type":"string"},{"type":"null"}]},"hidden":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"bankaccountid":{"description":"PROD-3741. :bankaccount/id of one of the business's own bank accounts this customer sees on its documents and pays into. \"$delete\" clears it back to the business default; null or omitted leaves it unchanged. An id the business does not own is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"clearcreditlimit":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"openingdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"clearopeningbalance":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]},"supplier":{"oneOf":[{"description":"The supplier's own fields. Only for a contact that holds the supplier role.","type":"object","properties":{"image":{"description":"Image URL; \"$delete\" clears it.","oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"clearcreditlimit":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"openingdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"clearopeningbalance":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]},"postaladdress":{"oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress2":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalsuburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcity":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalpostalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"documentaddress":{"oneOf":[{"type":"string","enum":["physical","postal"]},{"type":"null"}]},"contacts":{"description":"The full list of contact people, each {id, name, email, phone, role, ondocuments}. It replaces the stored list: a person left out is removed. Leave the key out to keep the stored list; send [] to clear it. A contact with no customer or supplier role keeps its people too, and they move onto the role it gains. A contact that is both a customer and a supplier holds one list, read back as people.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The contact person id. Send it to keep and update that person; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"ondocuments":{"description":"True to send documents to this person.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"bankaccounts":{"description":"PROD-3780. The contact's own bank accounts, the whole list: an entry left out is removed, [] clears, null or omitted keeps them. Exactly one is primary. Refusals: contact-bankaccount-invalid (fields names each entry's index, field and rule), contact-bankaccount-primary, contact-bankaccount-unknown, contact-bankaccount-duplicate.","oneOf":[{"type":"array","items":{"description":"PROD-3780. One of the contact's own bank accounts: where the business pays the contact. Not client.bankaccountid, the business's own account a customer pays into. Its country's bank fields label and check it.","type":"object","properties":{"id":{"description":"A stored entry's id, to keep and rewrite it. Omit for a new entry. An id not on this contact is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"ISO 3166-1 alpha-2 code. Required; it picks the bank fields that label and check the entry.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 code of the currency the account receives.","oneOf":[{"type":"string"},{"type":"null"}]},"bank":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountname":{"description":"The account holder.","oneOf":[{"type":"string"},{"type":"null"}]},"accountnumber":{"description":"The local account number. An entry needs this or an IBAN.","oneOf":[{"type":"string"},{"type":"null"}]},"iban":{"description":"Checked with mod 97.","oneOf":[{"type":"string"},{"type":"null"}]},"branchcode":{"description":"The national clearing code: ZA branch code, GB sort code, US routing number (ABA checksum), AU BSB, IN IFSC, CA transit and institution.","oneOf":[{"type":"string"},{"type":"null"}]},"swiftcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"accounttype":{"oneOf":[{"type":"string"},{"type":"null"}]},"primary":{"description":"True on the one entry a payment to the contact uses. A lone entry is primary.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactname":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactemail":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"number":{"oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"website":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","name"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"name":{"description":"The contact's name. A contact with no customer or supplier role keeps every shared field and its contact people; they move onto the role it gains.","type":"string"},"roles":{"description":"Roles the contact starts with: client, supplier, employee, director, shareholder or other. Absent or empty makes a general contact. Client and supplier together are refused for now.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"starred":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"client":{"oneOf":[{"description":"The customer's own fields. Only for a contact that holds the client role.","type":"object","properties":{"customercode":{"oneOf":[{"type":"string"},{"type":"null"}]},"hidden":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"bankaccountid":{"description":"PROD-3741. :bankaccount/id of one of the business's own bank accounts this customer sees on its documents and pays into. \"$delete\" clears it back to the business default; null or omitted leaves it unchanged. An id the business does not own is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"clearcreditlimit":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"openingdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"clearopeningbalance":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]},"supplier":{"oneOf":[{"description":"The supplier's own fields. Only for a contact that holds the supplier role.","type":"object","properties":{"image":{"description":"Image URL; \"$delete\" clears it.","oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"clearcreditlimit":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"openingdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"clearopeningbalance":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]},"postaladdress":{"oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress2":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalsuburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcity":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalpostalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"documentaddress":{"oneOf":[{"type":"string","enum":["physical","postal"]},{"type":"null"}]},"contacts":{"description":"The full list of contact people, each {id, name, email, phone, role, ondocuments}. It replaces the stored list: a person left out is removed. Leave the key out to keep the stored list; send [] to clear it. A contact with no customer or supplier role keeps its people too, and they move onto the role it gains. A contact that is both a customer and a supplier holds one list, read back as people.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The contact person id. Send it to keep and update that person; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"ondocuments":{"description":"True to send documents to this person.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"bankaccounts":{"description":"PROD-3780. The contact's own bank accounts, the whole list: an entry left out is removed, [] clears, null or omitted keeps them. Exactly one is primary. Refusals: contact-bankaccount-invalid (fields names each entry's index, field and rule), contact-bankaccount-primary, contact-bankaccount-unknown, contact-bankaccount-duplicate.","oneOf":[{"type":"array","items":{"description":"PROD-3780. One of the contact's own bank accounts: where the business pays the contact. Not client.bankaccountid, the business's own account a customer pays into. Its country's bank fields label and check it.","type":"object","properties":{"id":{"description":"A stored entry's id, to keep and rewrite it. Omit for a new entry. An id not on this contact is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"ISO 3166-1 alpha-2 code. Required; it picks the bank fields that label and check the entry.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 code of the currency the account receives.","oneOf":[{"type":"string"},{"type":"null"}]},"bank":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountname":{"description":"The account holder.","oneOf":[{"type":"string"},{"type":"null"}]},"accountnumber":{"description":"The local account number. An entry needs this or an IBAN.","oneOf":[{"type":"string"},{"type":"null"}]},"iban":{"description":"Checked with mod 97.","oneOf":[{"type":"string"},{"type":"null"}]},"branchcode":{"description":"The national clearing code: ZA branch code, GB sort code, US routing number (ABA checksum), AU BSB, IN IFSC, CA transit and institution.","oneOf":[{"type":"string"},{"type":"null"}]},"swiftcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"accounttype":{"oneOf":[{"type":"string"},{"type":"null"}]},"primary":{"description":"True on the one entry a payment to the contact uses. A lone entry is primary.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactname":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactemail":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"number":{"oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"website":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","name"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create a contact. Every new contact gets a con… id, whatever role it starts with; a customer or supplier is found under that same id.","tags":["contact management"]}},"/api/contact/update":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the customer, supplier or contact (cli…, sup… or con…).","type":"string"},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"postaladdress":{"oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress2":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalsuburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcity":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalpostalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"documentaddress":{"oneOf":[{"type":"string","enum":["physical","postal"]},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"contacts":{"description":"The full list of contact people, each {id, name, email, phone, role, ondocuments}. It replaces the stored list: a person left out is removed. Leave the key out to keep the stored list; send [] to clear it. A contact with no customer or supplier role keeps its people too, and they move onto the role it gains. A contact that is both a customer and a supplier holds one list, read back as people.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The contact person id. Send it to keep and update that person; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"ondocuments":{"description":"True to send documents to this person.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"bankaccounts":{"description":"PROD-3780. The contact's own bank accounts, the whole list: an entry left out is removed, [] clears, null or omitted keeps them. Exactly one is primary. Refusals: contact-bankaccount-invalid (fields names each entry's index, field and rule), contact-bankaccount-primary, contact-bankaccount-unknown, contact-bankaccount-duplicate.","oneOf":[{"type":"array","items":{"description":"PROD-3780. One of the contact's own bank accounts: where the business pays the contact. Not client.bankaccountid, the business's own account a customer pays into. Its country's bank fields label and check it.","type":"object","properties":{"id":{"description":"A stored entry's id, to keep and rewrite it. Omit for a new entry. An id not on this contact is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"ISO 3166-1 alpha-2 code. Required; it picks the bank fields that label and check the entry.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 code of the currency the account receives.","oneOf":[{"type":"string"},{"type":"null"}]},"bank":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountname":{"description":"The account holder.","oneOf":[{"type":"string"},{"type":"null"}]},"accountnumber":{"description":"The local account number. An entry needs this or an IBAN.","oneOf":[{"type":"string"},{"type":"null"}]},"iban":{"description":"Checked with mod 97.","oneOf":[{"type":"string"},{"type":"null"}]},"branchcode":{"description":"The national clearing code: ZA branch code, GB sort code, US routing number (ABA checksum), AU BSB, IN IFSC, CA transit and institution.","oneOf":[{"type":"string"},{"type":"null"}]},"swiftcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"accounttype":{"oneOf":[{"type":"string"},{"type":"null"}]},"primary":{"description":"True on the one entry a payment to the contact uses. A lone entry is primary.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]},"files":{"description":"The contact's file ids, the whole list.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"client":{"oneOf":[{"description":"The customer's own fields. Only for a contact that holds the client role.","type":"object","properties":{"customercode":{"oneOf":[{"type":"string"},{"type":"null"}]},"hidden":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"bankaccountid":{"description":"PROD-3741. :bankaccount/id of one of the business's own bank accounts this customer sees on its documents and pays into. \"$delete\" clears it back to the business default; null or omitted leaves it unchanged. An id the business does not own is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"clearcreditlimit":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"openingdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"clearopeningbalance":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]},"supplier":{"oneOf":[{"description":"The supplier's own fields. Only for a contact that holds the supplier role.","type":"object","properties":{"image":{"description":"Image URL; \"$delete\" clears it.","oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"clearcreditlimit":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"openingdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"clearopeningbalance":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]},"confirm":{"description":"Retry after confirm-required to save the opening date as sent.","oneOf":[{"type":"boolean"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactname":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactemail":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"number":{"oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"website":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the customer, supplier or contact (cli…, sup… or con…).","type":"string"},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"postaladdress":{"oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress2":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalsuburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcity":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalpostalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"documentaddress":{"oneOf":[{"type":"string","enum":["physical","postal"]},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"contacts":{"description":"The full list of contact people, each {id, name, email, phone, role, ondocuments}. It replaces the stored list: a person left out is removed. Leave the key out to keep the stored list; send [] to clear it. A contact with no customer or supplier role keeps its people too, and they move onto the role it gains. A contact that is both a customer and a supplier holds one list, read back as people.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The contact person id. Send it to keep and update that person; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"ondocuments":{"description":"True to send documents to this person.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"bankaccounts":{"description":"PROD-3780. The contact's own bank accounts, the whole list: an entry left out is removed, [] clears, null or omitted keeps them. Exactly one is primary. Refusals: contact-bankaccount-invalid (fields names each entry's index, field and rule), contact-bankaccount-primary, contact-bankaccount-unknown, contact-bankaccount-duplicate.","oneOf":[{"type":"array","items":{"description":"PROD-3780. One of the contact's own bank accounts: where the business pays the contact. Not client.bankaccountid, the business's own account a customer pays into. Its country's bank fields label and check it.","type":"object","properties":{"id":{"description":"A stored entry's id, to keep and rewrite it. Omit for a new entry. An id not on this contact is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"ISO 3166-1 alpha-2 code. Required; it picks the bank fields that label and check the entry.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 code of the currency the account receives.","oneOf":[{"type":"string"},{"type":"null"}]},"bank":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountname":{"description":"The account holder.","oneOf":[{"type":"string"},{"type":"null"}]},"accountnumber":{"description":"The local account number. An entry needs this or an IBAN.","oneOf":[{"type":"string"},{"type":"null"}]},"iban":{"description":"Checked with mod 97.","oneOf":[{"type":"string"},{"type":"null"}]},"branchcode":{"description":"The national clearing code: ZA branch code, GB sort code, US routing number (ABA checksum), AU BSB, IN IFSC, CA transit and institution.","oneOf":[{"type":"string"},{"type":"null"}]},"swiftcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"accounttype":{"oneOf":[{"type":"string"},{"type":"null"}]},"primary":{"description":"True on the one entry a payment to the contact uses. A lone entry is primary.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]},"files":{"description":"The contact's file ids, the whole list.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"client":{"oneOf":[{"description":"The customer's own fields. Only for a contact that holds the client role.","type":"object","properties":{"customercode":{"oneOf":[{"type":"string"},{"type":"null"}]},"hidden":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"bankaccountid":{"description":"PROD-3741. :bankaccount/id of one of the business's own bank accounts this customer sees on its documents and pays into. \"$delete\" clears it back to the business default; null or omitted leaves it unchanged. An id the business does not own is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"clearcreditlimit":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"openingdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"clearopeningbalance":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]},"supplier":{"oneOf":[{"description":"The supplier's own fields. Only for a contact that holds the supplier role.","type":"object","properties":{"image":{"description":"Image URL; \"$delete\" clears it.","oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"clearcreditlimit":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"openingdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"clearopeningbalance":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]},"confirm":{"description":"Retry after confirm-required to save the opening date as sent.","oneOf":[{"type":"boolean"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactname":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactemail":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"number":{"oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"website":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the customer, supplier or contact (cli…, sup… or con…).","type":"string"},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"postaladdress":{"oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress2":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalsuburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcity":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalpostalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"documentaddress":{"oneOf":[{"type":"string","enum":["physical","postal"]},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"contacts":{"description":"The full list of contact people, each {id, name, email, phone, role, ondocuments}. It replaces the stored list: a person left out is removed. Leave the key out to keep the stored list; send [] to clear it. A contact with no customer or supplier role keeps its people too, and they move onto the role it gains. A contact that is both a customer and a supplier holds one list, read back as people.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The contact person id. Send it to keep and update that person; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"ondocuments":{"description":"True to send documents to this person.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"bankaccounts":{"description":"PROD-3780. The contact's own bank accounts, the whole list: an entry left out is removed, [] clears, null or omitted keeps them. Exactly one is primary. Refusals: contact-bankaccount-invalid (fields names each entry's index, field and rule), contact-bankaccount-primary, contact-bankaccount-unknown, contact-bankaccount-duplicate.","oneOf":[{"type":"array","items":{"description":"PROD-3780. One of the contact's own bank accounts: where the business pays the contact. Not client.bankaccountid, the business's own account a customer pays into. Its country's bank fields label and check it.","type":"object","properties":{"id":{"description":"A stored entry's id, to keep and rewrite it. Omit for a new entry. An id not on this contact is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"ISO 3166-1 alpha-2 code. Required; it picks the bank fields that label and check the entry.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 code of the currency the account receives.","oneOf":[{"type":"string"},{"type":"null"}]},"bank":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountname":{"description":"The account holder.","oneOf":[{"type":"string"},{"type":"null"}]},"accountnumber":{"description":"The local account number. An entry needs this or an IBAN.","oneOf":[{"type":"string"},{"type":"null"}]},"iban":{"description":"Checked with mod 97.","oneOf":[{"type":"string"},{"type":"null"}]},"branchcode":{"description":"The national clearing code: ZA branch code, GB sort code, US routing number (ABA checksum), AU BSB, IN IFSC, CA transit and institution.","oneOf":[{"type":"string"},{"type":"null"}]},"swiftcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"accounttype":{"oneOf":[{"type":"string"},{"type":"null"}]},"primary":{"description":"True on the one entry a payment to the contact uses. A lone entry is primary.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]},"files":{"description":"The contact's file ids, the whole list.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"client":{"oneOf":[{"description":"The customer's own fields. Only for a contact that holds the client role.","type":"object","properties":{"customercode":{"oneOf":[{"type":"string"},{"type":"null"}]},"hidden":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"bankaccountid":{"description":"PROD-3741. :bankaccount/id of one of the business's own bank accounts this customer sees on its documents and pays into. \"$delete\" clears it back to the business default; null or omitted leaves it unchanged. An id the business does not own is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"clearcreditlimit":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"openingdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"clearopeningbalance":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]},"supplier":{"oneOf":[{"description":"The supplier's own fields. Only for a contact that holds the supplier role.","type":"object","properties":{"image":{"description":"Image URL; \"$delete\" clears it.","oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"clearcreditlimit":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"openingdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"clearopeningbalance":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]},"confirm":{"description":"Retry after confirm-required to save the opening date as sent.","oneOf":[{"type":"boolean"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactname":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactemail":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"number":{"oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"website":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the customer, supplier or contact (cli…, sup… or con…).","type":"string"},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"postaladdress":{"oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress2":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalsuburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcity":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalpostalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"documentaddress":{"oneOf":[{"type":"string","enum":["physical","postal"]},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"contacts":{"description":"The full list of contact people, each {id, name, email, phone, role, ondocuments}. It replaces the stored list: a person left out is removed. Leave the key out to keep the stored list; send [] to clear it. A contact with no customer or supplier role keeps its people too, and they move onto the role it gains. A contact that is both a customer and a supplier holds one list, read back as people.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The contact person id. Send it to keep and update that person; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"ondocuments":{"description":"True to send documents to this person.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"bankaccounts":{"description":"PROD-3780. The contact's own bank accounts, the whole list: an entry left out is removed, [] clears, null or omitted keeps them. Exactly one is primary. Refusals: contact-bankaccount-invalid (fields names each entry's index, field and rule), contact-bankaccount-primary, contact-bankaccount-unknown, contact-bankaccount-duplicate.","oneOf":[{"type":"array","items":{"description":"PROD-3780. One of the contact's own bank accounts: where the business pays the contact. Not client.bankaccountid, the business's own account a customer pays into. Its country's bank fields label and check it.","type":"object","properties":{"id":{"description":"A stored entry's id, to keep and rewrite it. Omit for a new entry. An id not on this contact is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"ISO 3166-1 alpha-2 code. Required; it picks the bank fields that label and check the entry.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 code of the currency the account receives.","oneOf":[{"type":"string"},{"type":"null"}]},"bank":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountname":{"description":"The account holder.","oneOf":[{"type":"string"},{"type":"null"}]},"accountnumber":{"description":"The local account number. An entry needs this or an IBAN.","oneOf":[{"type":"string"},{"type":"null"}]},"iban":{"description":"Checked with mod 97.","oneOf":[{"type":"string"},{"type":"null"}]},"branchcode":{"description":"The national clearing code: ZA branch code, GB sort code, US routing number (ABA checksum), AU BSB, IN IFSC, CA transit and institution.","oneOf":[{"type":"string"},{"type":"null"}]},"swiftcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"accounttype":{"oneOf":[{"type":"string"},{"type":"null"}]},"primary":{"description":"True on the one entry a payment to the contact uses. A lone entry is primary.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]},"files":{"description":"The contact's file ids, the whole list.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"client":{"oneOf":[{"description":"The customer's own fields. Only for a contact that holds the client role.","type":"object","properties":{"customercode":{"oneOf":[{"type":"string"},{"type":"null"}]},"hidden":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"bankaccountid":{"description":"PROD-3741. :bankaccount/id of one of the business's own bank accounts this customer sees on its documents and pays into. \"$delete\" clears it back to the business default; null or omitted leaves it unchanged. An id the business does not own is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"clearcreditlimit":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"openingdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"clearopeningbalance":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]},"supplier":{"oneOf":[{"description":"The supplier's own fields. Only for a contact that holds the supplier role.","type":"object","properties":{"image":{"description":"Image URL; \"$delete\" clears it.","oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"clearcreditlimit":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"openingdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"clearopeningbalance":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]},"confirm":{"description":"Retry after confirm-required to save the opening date as sent.","oneOf":[{"type":"boolean"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactname":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactemail":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"number":{"oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"website":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Update a customer, supplier or contact by its id alone: shared fields, and a client or supplier block for a role it holds. An opening date later than the role's own documents is refused, unwritten, with code confirm-required until the call is repeated with confirm true.","tags":["contact management"]}},"/api/contact/update-many":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"contacts":{"description":"Contacts to update in one all-or-nothing write.","type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"postaladdress":{"oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress2":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalsuburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcity":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalpostalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"documentaddress":{"oneOf":[{"type":"string","enum":["physical","postal"]},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"contacts":{"description":"The full list of contact people, each {id, name, email, phone, role, ondocuments}. It replaces the stored list: a person left out is removed. Leave the key out to keep the stored list; send [] to clear it. A contact with no customer or supplier role keeps its people too, and they move onto the role it gains. A contact that is both a customer and a supplier holds one list, read back as people.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The contact person id. Send it to keep and update that person; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"ondocuments":{"description":"True to send documents to this person.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"bankaccounts":{"description":"PROD-3780. The contact's own bank accounts, the whole list: an entry left out is removed, [] clears, null or omitted keeps them. Exactly one is primary. Refusals: contact-bankaccount-invalid (fields names each entry's index, field and rule), contact-bankaccount-primary, contact-bankaccount-unknown, contact-bankaccount-duplicate.","oneOf":[{"type":"array","items":{"description":"PROD-3780. One of the contact's own bank accounts: where the business pays the contact. Not client.bankaccountid, the business's own account a customer pays into. Its country's bank fields label and check it.","type":"object","properties":{"id":{"description":"A stored entry's id, to keep and rewrite it. Omit for a new entry. An id not on this contact is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"ISO 3166-1 alpha-2 code. Required; it picks the bank fields that label and check the entry.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 code of the currency the account receives.","oneOf":[{"type":"string"},{"type":"null"}]},"bank":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountname":{"description":"The account holder.","oneOf":[{"type":"string"},{"type":"null"}]},"accountnumber":{"description":"The local account number. An entry needs this or an IBAN.","oneOf":[{"type":"string"},{"type":"null"}]},"iban":{"description":"Checked with mod 97.","oneOf":[{"type":"string"},{"type":"null"}]},"branchcode":{"description":"The national clearing code: ZA branch code, GB sort code, US routing number (ABA checksum), AU BSB, IN IFSC, CA transit and institution.","oneOf":[{"type":"string"},{"type":"null"}]},"swiftcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"accounttype":{"oneOf":[{"type":"string"},{"type":"null"}]},"primary":{"description":"True on the one entry a payment to the contact uses. A lone entry is primary.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]},"files":{"description":"The contact's file ids, the whole list.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"client":{"oneOf":[{"description":"The customer's own fields. Only for a contact that holds the client role.","type":"object","properties":{"customercode":{"oneOf":[{"type":"string"},{"type":"null"}]},"hidden":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"bankaccountid":{"description":"PROD-3741. :bankaccount/id of one of the business's own bank accounts this customer sees on its documents and pays into. \"$delete\" clears it back to the business default; null or omitted leaves it unchanged. An id the business does not own is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"clearcreditlimit":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"openingdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"clearopeningbalance":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]},"supplier":{"oneOf":[{"description":"The supplier's own fields. Only for a contact that holds the supplier role.","type":"object","properties":{"image":{"description":"Image URL; \"$delete\" clears it.","oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"clearcreditlimit":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"openingdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"clearopeningbalance":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]},"confirm":{"description":"Retry after confirm-required to save the opening date as sent.","oneOf":[{"type":"boolean"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactname":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactemail":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"number":{"oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"website":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["id"],"additionalProperties":false}}},"required":["token","contacts"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"contacts":{"description":"Contacts to update in one all-or-nothing write.","type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"postaladdress":{"oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress2":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalsuburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcity":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalpostalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"documentaddress":{"oneOf":[{"type":"string","enum":["physical","postal"]},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"contacts":{"description":"The full list of contact people, each {id, name, email, phone, role, ondocuments}. It replaces the stored list: a person left out is removed. Leave the key out to keep the stored list; send [] to clear it. A contact with no customer or supplier role keeps its people too, and they move onto the role it gains. A contact that is both a customer and a supplier holds one list, read back as people.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The contact person id. Send it to keep and update that person; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"ondocuments":{"description":"True to send documents to this person.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"bankaccounts":{"description":"PROD-3780. The contact's own bank accounts, the whole list: an entry left out is removed, [] clears, null or omitted keeps them. Exactly one is primary. Refusals: contact-bankaccount-invalid (fields names each entry's index, field and rule), contact-bankaccount-primary, contact-bankaccount-unknown, contact-bankaccount-duplicate.","oneOf":[{"type":"array","items":{"description":"PROD-3780. One of the contact's own bank accounts: where the business pays the contact. Not client.bankaccountid, the business's own account a customer pays into. Its country's bank fields label and check it.","type":"object","properties":{"id":{"description":"A stored entry's id, to keep and rewrite it. Omit for a new entry. An id not on this contact is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"ISO 3166-1 alpha-2 code. Required; it picks the bank fields that label and check the entry.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 code of the currency the account receives.","oneOf":[{"type":"string"},{"type":"null"}]},"bank":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountname":{"description":"The account holder.","oneOf":[{"type":"string"},{"type":"null"}]},"accountnumber":{"description":"The local account number. An entry needs this or an IBAN.","oneOf":[{"type":"string"},{"type":"null"}]},"iban":{"description":"Checked with mod 97.","oneOf":[{"type":"string"},{"type":"null"}]},"branchcode":{"description":"The national clearing code: ZA branch code, GB sort code, US routing number (ABA checksum), AU BSB, IN IFSC, CA transit and institution.","oneOf":[{"type":"string"},{"type":"null"}]},"swiftcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"accounttype":{"oneOf":[{"type":"string"},{"type":"null"}]},"primary":{"description":"True on the one entry a payment to the contact uses. A lone entry is primary.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]},"files":{"description":"The contact's file ids, the whole list.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"client":{"oneOf":[{"description":"The customer's own fields. Only for a contact that holds the client role.","type":"object","properties":{"customercode":{"oneOf":[{"type":"string"},{"type":"null"}]},"hidden":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"bankaccountid":{"description":"PROD-3741. :bankaccount/id of one of the business's own bank accounts this customer sees on its documents and pays into. \"$delete\" clears it back to the business default; null or omitted leaves it unchanged. An id the business does not own is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"clearcreditlimit":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"openingdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"clearopeningbalance":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]},"supplier":{"oneOf":[{"description":"The supplier's own fields. Only for a contact that holds the supplier role.","type":"object","properties":{"image":{"description":"Image URL; \"$delete\" clears it.","oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"clearcreditlimit":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"openingdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"clearopeningbalance":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]},"confirm":{"description":"Retry after confirm-required to save the opening date as sent.","oneOf":[{"type":"boolean"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactname":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactemail":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"number":{"oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"website":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["id"],"additionalProperties":false}}},"required":["token","contacts"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"contacts":{"description":"Contacts to update in one all-or-nothing write.","type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"postaladdress":{"oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress2":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalsuburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcity":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalpostalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"documentaddress":{"oneOf":[{"type":"string","enum":["physical","postal"]},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"contacts":{"description":"The full list of contact people, each {id, name, email, phone, role, ondocuments}. It replaces the stored list: a person left out is removed. Leave the key out to keep the stored list; send [] to clear it. A contact with no customer or supplier role keeps its people too, and they move onto the role it gains. A contact that is both a customer and a supplier holds one list, read back as people.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The contact person id. Send it to keep and update that person; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"ondocuments":{"description":"True to send documents to this person.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"bankaccounts":{"description":"PROD-3780. The contact's own bank accounts, the whole list: an entry left out is removed, [] clears, null or omitted keeps them. Exactly one is primary. Refusals: contact-bankaccount-invalid (fields names each entry's index, field and rule), contact-bankaccount-primary, contact-bankaccount-unknown, contact-bankaccount-duplicate.","oneOf":[{"type":"array","items":{"description":"PROD-3780. One of the contact's own bank accounts: where the business pays the contact. Not client.bankaccountid, the business's own account a customer pays into. Its country's bank fields label and check it.","type":"object","properties":{"id":{"description":"A stored entry's id, to keep and rewrite it. Omit for a new entry. An id not on this contact is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"ISO 3166-1 alpha-2 code. Required; it picks the bank fields that label and check the entry.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 code of the currency the account receives.","oneOf":[{"type":"string"},{"type":"null"}]},"bank":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountname":{"description":"The account holder.","oneOf":[{"type":"string"},{"type":"null"}]},"accountnumber":{"description":"The local account number. An entry needs this or an IBAN.","oneOf":[{"type":"string"},{"type":"null"}]},"iban":{"description":"Checked with mod 97.","oneOf":[{"type":"string"},{"type":"null"}]},"branchcode":{"description":"The national clearing code: ZA branch code, GB sort code, US routing number (ABA checksum), AU BSB, IN IFSC, CA transit and institution.","oneOf":[{"type":"string"},{"type":"null"}]},"swiftcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"accounttype":{"oneOf":[{"type":"string"},{"type":"null"}]},"primary":{"description":"True on the one entry a payment to the contact uses. A lone entry is primary.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]},"files":{"description":"The contact's file ids, the whole list.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"client":{"oneOf":[{"description":"The customer's own fields. Only for a contact that holds the client role.","type":"object","properties":{"customercode":{"oneOf":[{"type":"string"},{"type":"null"}]},"hidden":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"bankaccountid":{"description":"PROD-3741. :bankaccount/id of one of the business's own bank accounts this customer sees on its documents and pays into. \"$delete\" clears it back to the business default; null or omitted leaves it unchanged. An id the business does not own is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"clearcreditlimit":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"openingdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"clearopeningbalance":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]},"supplier":{"oneOf":[{"description":"The supplier's own fields. Only for a contact that holds the supplier role.","type":"object","properties":{"image":{"description":"Image URL; \"$delete\" clears it.","oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"clearcreditlimit":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"openingdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"clearopeningbalance":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]},"confirm":{"description":"Retry after confirm-required to save the opening date as sent.","oneOf":[{"type":"boolean"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactname":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactemail":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"number":{"oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"website":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["id"],"additionalProperties":false}}},"required":["token","contacts"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"contacts":{"description":"Contacts to update in one all-or-nothing write.","type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"postaladdress":{"oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress2":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalsuburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcity":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalpostalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"documentaddress":{"oneOf":[{"type":"string","enum":["physical","postal"]},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"contacts":{"description":"The full list of contact people, each {id, name, email, phone, role, ondocuments}. It replaces the stored list: a person left out is removed. Leave the key out to keep the stored list; send [] to clear it. A contact with no customer or supplier role keeps its people too, and they move onto the role it gains. A contact that is both a customer and a supplier holds one list, read back as people.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The contact person id. Send it to keep and update that person; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"ondocuments":{"description":"True to send documents to this person.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"bankaccounts":{"description":"PROD-3780. The contact's own bank accounts, the whole list: an entry left out is removed, [] clears, null or omitted keeps them. Exactly one is primary. Refusals: contact-bankaccount-invalid (fields names each entry's index, field and rule), contact-bankaccount-primary, contact-bankaccount-unknown, contact-bankaccount-duplicate.","oneOf":[{"type":"array","items":{"description":"PROD-3780. One of the contact's own bank accounts: where the business pays the contact. Not client.bankaccountid, the business's own account a customer pays into. Its country's bank fields label and check it.","type":"object","properties":{"id":{"description":"A stored entry's id, to keep and rewrite it. Omit for a new entry. An id not on this contact is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"ISO 3166-1 alpha-2 code. Required; it picks the bank fields that label and check the entry.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 code of the currency the account receives.","oneOf":[{"type":"string"},{"type":"null"}]},"bank":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountname":{"description":"The account holder.","oneOf":[{"type":"string"},{"type":"null"}]},"accountnumber":{"description":"The local account number. An entry needs this or an IBAN.","oneOf":[{"type":"string"},{"type":"null"}]},"iban":{"description":"Checked with mod 97.","oneOf":[{"type":"string"},{"type":"null"}]},"branchcode":{"description":"The national clearing code: ZA branch code, GB sort code, US routing number (ABA checksum), AU BSB, IN IFSC, CA transit and institution.","oneOf":[{"type":"string"},{"type":"null"}]},"swiftcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"accounttype":{"oneOf":[{"type":"string"},{"type":"null"}]},"primary":{"description":"True on the one entry a payment to the contact uses. A lone entry is primary.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]},"files":{"description":"The contact's file ids, the whole list.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"client":{"oneOf":[{"description":"The customer's own fields. Only for a contact that holds the client role.","type":"object","properties":{"customercode":{"oneOf":[{"type":"string"},{"type":"null"}]},"hidden":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"bankaccountid":{"description":"PROD-3741. :bankaccount/id of one of the business's own bank accounts this customer sees on its documents and pays into. \"$delete\" clears it back to the business default; null or omitted leaves it unchanged. An id the business does not own is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"clearcreditlimit":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"openingdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"clearopeningbalance":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]},"supplier":{"oneOf":[{"description":"The supplier's own fields. Only for a contact that holds the supplier role.","type":"object","properties":{"image":{"description":"Image URL; \"$delete\" clears it.","oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"clearcreditlimit":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"openingdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"clearopeningbalance":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]},"confirm":{"description":"Retry after confirm-required to save the opening date as sent.","oneOf":[{"type":"boolean"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactname":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactemail":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"number":{"oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"website":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["id"],"additionalProperties":false}}},"required":["token","contacts"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Update many contacts by id in one write. Any refusal names the item's id, and nothing is written.","tags":["contact management"]}},"/api/contact/delete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the customer, supplier or contact.","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the customer, supplier or contact.","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the customer, supplier or contact.","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the customer, supplier or contact.","type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Delete a customer, supplier or contact by its id alone. Refused while it has documents.","tags":["contact management"]}},"/api/contact/delete-many":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"contacts":{"description":"Contacts to delete. Each refused id is named and the rest go.","type":"array","items":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}},"required":["token","contacts"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"contacts":{"description":"Contacts to delete. Each refused id is named and the rest go.","type":"array","items":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}},"required":["token","contacts"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"contacts":{"description":"Contacts to delete. Each refused id is named and the rest go.","type":"array","items":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}},"required":["token","contacts"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"contacts":{"description":"Contacts to delete. Each refused id is named and the rest go.","type":"array","items":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}},"required":["token","contacts"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Delete many contacts by id. Each id refused is named in errors and kept; the rest are deleted.","tags":["contact management"]}},"/api/contact/flagged/update":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the customer, supplier or contact (cli…, sup… or con…).","type":"string"},"flagged":{"description":"True to flag, false to unflag.","type":"boolean"}},"required":["token","id","flagged"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the customer, supplier or contact (cli…, sup… or con…).","type":"string"},"flagged":{"description":"True to flag, false to unflag.","type":"boolean"}},"required":["token","id","flagged"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the customer, supplier or contact (cli…, sup… or con…).","type":"string"},"flagged":{"description":"True to flag, false to unflag.","type":"boolean"}},"required":["token","id","flagged"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the customer, supplier or contact (cli…, sup… or con…).","type":"string"},"flagged":{"description":"True to flag, false to unflag.","type":"boolean"}},"required":["token","id","flagged"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Flag or unflag a customer, supplier or contact by its id alone. The flag is set once, on the one record the id names.","tags":["contact management"]}},"/api/contact/flagged/update-many":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"flagged":{"description":"Default flag for items that do not set their own.","type":"boolean"},"items":{"description":"Contacts to flag or unflag in one write.","type":"array","items":{"type":"object","properties":{"id":{"description":"Id of the customer, supplier or contact.","type":"string"},"flagged":{"description":"True to flag, false to unflag; falls back to the top-level flagged.","type":"boolean"}},"required":["id"],"additionalProperties":false}}},"required":["token","items"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"flagged":{"description":"Default flag for items that do not set their own.","type":"boolean"},"items":{"description":"Contacts to flag or unflag in one write.","type":"array","items":{"type":"object","properties":{"id":{"description":"Id of the customer, supplier or contact.","type":"string"},"flagged":{"description":"True to flag, false to unflag; falls back to the top-level flagged.","type":"boolean"}},"required":["id"],"additionalProperties":false}}},"required":["token","items"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"flagged":{"description":"Default flag for items that do not set their own.","type":"boolean"},"items":{"description":"Contacts to flag or unflag in one write.","type":"array","items":{"type":"object","properties":{"id":{"description":"Id of the customer, supplier or contact.","type":"string"},"flagged":{"description":"True to flag, false to unflag; falls back to the top-level flagged.","type":"boolean"}},"required":["id"],"additionalProperties":false}}},"required":["token","items"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"flagged":{"description":"Default flag for items that do not set their own.","type":"boolean"},"items":{"description":"Contacts to flag or unflag in one write.","type":"array","items":{"type":"object","properties":{"id":{"description":"Id of the customer, supplier or contact.","type":"string"},"flagged":{"description":"True to flag, false to unflag; falls back to the top-level flagged.","type":"boolean"}},"required":["id"],"additionalProperties":false}}},"required":["token","items"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Flag or unflag many customers, suppliers or contacts by id in one write. One refusal names the ids the business does not own, and nothing is written.","tags":["contact management"]}},"/api/supplier/create":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the supplier, required for updates","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Supplier or vendor name","oneOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Supplier email address","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"description":"Street address line 1","oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"description":"Street address line 2","oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"description":"Suburb or district","oneOf":[{"type":"string"},{"type":"null"}]},"city":{"description":"City","oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"description":"Postal or ZIP code","oneOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"Country","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress":{"description":"Postal address line 1, e.g. a PO Box.","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress2":{"description":"Postal address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"postalsuburb":{"description":"Postal address suburb.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcity":{"description":"Postal address city.","oneOf":[{"type":"string"},{"type":"null"}]},"postalpostalcode":{"description":"Postal address postal code.","oneOf":[{"type":"string"},{"type":"null"}]},"documentaddress":{"description":"Which address documents print: physical (default) or postal.","oneOf":[{"type":"string","enum":["physical","postal"]},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"contacts":{"description":"The full list of contact people, each {id, name, email, phone, role, ondocuments}. It replaces the stored list: a person left out is removed. Leave the key out to keep the stored list; send [] to clear it. A contact with no customer or supplier role keeps its people too, and they move onto the role it gains. A contact that is both a customer and a supplier holds one list, read back as people.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The contact person id. Send it to keep and update that person; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"ondocuments":{"description":"True to send documents to this person.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"website":{"description":"Supplier website, e.g. www.example.co.za. Trimmed; a blank string clears it, null leaves it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]},"contactname":{"description":"Name of primary contact person","oneOf":[{"type":"string"},{"type":"null"}]},"contactemail":{"description":"Email of primary contact person","oneOf":[{"type":"string"},{"type":"null"}]},"number":{"description":"Main telephone (landline) number of the supplier, beside the contact person's contactnumber. Trimmed; a blank value on update clears it.","oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"description":"Phone number of primary contact person","oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"description":"VAT/Tax registration number","oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"description":"Business registration number","oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"description":"Whether this supplier is marked as a favorite","oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"description":"Opening balance amount for the supplier","oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"description":"Opening balance date","oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"description":"Most the business means to owe this supplier, in base currency. It only warns: a bill over it still saves.","oneOf":[{"type":"number"},{"type":"null"}]},"clearcreditlimit":{"description":"When true, removes the stored supplier limit.","oneOf":[{"type":"boolean"},{"type":"null"}]},"clearopeningbalance":{"description":"Reserved, mirrors update_bank_account: when true the opening-date confirmation below is not asked.","oneOf":[{"type":"boolean"},{"type":"null"}]},"confirm":{"description":"PROD-1951: required only to save an opening date that is LATER than the supplier's own earliest bill or expense. Without it that one case is refused, unwritten, with code confirm-required plus earliesttransactiondate and transactionsbefore, so the caller can show what the date would exclude from the creditors balance and let the user override it.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the supplier, required for updates","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Supplier or vendor name","oneOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Supplier email address","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"description":"Street address line 1","oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"description":"Street address line 2","oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"description":"Suburb or district","oneOf":[{"type":"string"},{"type":"null"}]},"city":{"description":"City","oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"description":"Postal or ZIP code","oneOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"Country","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress":{"description":"Postal address line 1, e.g. a PO Box.","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress2":{"description":"Postal address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"postalsuburb":{"description":"Postal address suburb.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcity":{"description":"Postal address city.","oneOf":[{"type":"string"},{"type":"null"}]},"postalpostalcode":{"description":"Postal address postal code.","oneOf":[{"type":"string"},{"type":"null"}]},"documentaddress":{"description":"Which address documents print: physical (default) or postal.","oneOf":[{"type":"string","enum":["physical","postal"]},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"contacts":{"description":"The full list of contact people, each {id, name, email, phone, role, ondocuments}. It replaces the stored list: a person left out is removed. Leave the key out to keep the stored list; send [] to clear it. A contact with no customer or supplier role keeps its people too, and they move onto the role it gains. A contact that is both a customer and a supplier holds one list, read back as people.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The contact person id. Send it to keep and update that person; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"ondocuments":{"description":"True to send documents to this person.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"website":{"description":"Supplier website, e.g. www.example.co.za. Trimmed; a blank string clears it, null leaves it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]},"contactname":{"description":"Name of primary contact person","oneOf":[{"type":"string"},{"type":"null"}]},"contactemail":{"description":"Email of primary contact person","oneOf":[{"type":"string"},{"type":"null"}]},"number":{"description":"Main telephone (landline) number of the supplier, beside the contact person's contactnumber. Trimmed; a blank value on update clears it.","oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"description":"Phone number of primary contact person","oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"description":"VAT/Tax registration number","oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"description":"Business registration number","oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"description":"Whether this supplier is marked as a favorite","oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"description":"Opening balance amount for the supplier","oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"description":"Opening balance date","oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"description":"Most the business means to owe this supplier, in base currency. It only warns: a bill over it still saves.","oneOf":[{"type":"number"},{"type":"null"}]},"clearcreditlimit":{"description":"When true, removes the stored supplier limit.","oneOf":[{"type":"boolean"},{"type":"null"}]},"clearopeningbalance":{"description":"Reserved, mirrors update_bank_account: when true the opening-date confirmation below is not asked.","oneOf":[{"type":"boolean"},{"type":"null"}]},"confirm":{"description":"PROD-1951: required only to save an opening date that is LATER than the supplier's own earliest bill or expense. Without it that one case is refused, unwritten, with code confirm-required plus earliesttransactiondate and transactionsbefore, so the caller can show what the date would exclude from the creditors balance and let the user override it.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the supplier, required for updates","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Supplier or vendor name","oneOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Supplier email address","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"description":"Street address line 1","oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"description":"Street address line 2","oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"description":"Suburb or district","oneOf":[{"type":"string"},{"type":"null"}]},"city":{"description":"City","oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"description":"Postal or ZIP code","oneOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"Country","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress":{"description":"Postal address line 1, e.g. a PO Box.","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress2":{"description":"Postal address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"postalsuburb":{"description":"Postal address suburb.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcity":{"description":"Postal address city.","oneOf":[{"type":"string"},{"type":"null"}]},"postalpostalcode":{"description":"Postal address postal code.","oneOf":[{"type":"string"},{"type":"null"}]},"documentaddress":{"description":"Which address documents print: physical (default) or postal.","oneOf":[{"type":"string","enum":["physical","postal"]},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"contacts":{"description":"The full list of contact people, each {id, name, email, phone, role, ondocuments}. It replaces the stored list: a person left out is removed. Leave the key out to keep the stored list; send [] to clear it. A contact with no customer or supplier role keeps its people too, and they move onto the role it gains. A contact that is both a customer and a supplier holds one list, read back as people.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The contact person id. Send it to keep and update that person; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"ondocuments":{"description":"True to send documents to this person.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"website":{"description":"Supplier website, e.g. www.example.co.za. Trimmed; a blank string clears it, null leaves it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]},"contactname":{"description":"Name of primary contact person","oneOf":[{"type":"string"},{"type":"null"}]},"contactemail":{"description":"Email of primary contact person","oneOf":[{"type":"string"},{"type":"null"}]},"number":{"description":"Main telephone (landline) number of the supplier, beside the contact person's contactnumber. Trimmed; a blank value on update clears it.","oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"description":"Phone number of primary contact person","oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"description":"VAT/Tax registration number","oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"description":"Business registration number","oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"description":"Whether this supplier is marked as a favorite","oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"description":"Opening balance amount for the supplier","oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"description":"Opening balance date","oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"description":"Most the business means to owe this supplier, in base currency. It only warns: a bill over it still saves.","oneOf":[{"type":"number"},{"type":"null"}]},"clearcreditlimit":{"description":"When true, removes the stored supplier limit.","oneOf":[{"type":"boolean"},{"type":"null"}]},"clearopeningbalance":{"description":"Reserved, mirrors update_bank_account: when true the opening-date confirmation below is not asked.","oneOf":[{"type":"boolean"},{"type":"null"}]},"confirm":{"description":"PROD-1951: required only to save an opening date that is LATER than the supplier's own earliest bill or expense. Without it that one case is refused, unwritten, with code confirm-required plus earliesttransactiondate and transactionsbefore, so the caller can show what the date would exclude from the creditors balance and let the user override it.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the supplier, required for updates","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Supplier or vendor name","oneOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Supplier email address","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"description":"Street address line 1","oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"description":"Street address line 2","oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"description":"Suburb or district","oneOf":[{"type":"string"},{"type":"null"}]},"city":{"description":"City","oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"description":"Postal or ZIP code","oneOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"Country","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress":{"description":"Postal address line 1, e.g. a PO Box.","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress2":{"description":"Postal address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"postalsuburb":{"description":"Postal address suburb.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcity":{"description":"Postal address city.","oneOf":[{"type":"string"},{"type":"null"}]},"postalpostalcode":{"description":"Postal address postal code.","oneOf":[{"type":"string"},{"type":"null"}]},"documentaddress":{"description":"Which address documents print: physical (default) or postal.","oneOf":[{"type":"string","enum":["physical","postal"]},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"contacts":{"description":"The full list of contact people, each {id, name, email, phone, role, ondocuments}. It replaces the stored list: a person left out is removed. Leave the key out to keep the stored list; send [] to clear it. A contact with no customer or supplier role keeps its people too, and they move onto the role it gains. A contact that is both a customer and a supplier holds one list, read back as people.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The contact person id. Send it to keep and update that person; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"ondocuments":{"description":"True to send documents to this person.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"website":{"description":"Supplier website, e.g. www.example.co.za. Trimmed; a blank string clears it, null leaves it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]},"contactname":{"description":"Name of primary contact person","oneOf":[{"type":"string"},{"type":"null"}]},"contactemail":{"description":"Email of primary contact person","oneOf":[{"type":"string"},{"type":"null"}]},"number":{"description":"Main telephone (landline) number of the supplier, beside the contact person's contactnumber. Trimmed; a blank value on update clears it.","oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"description":"Phone number of primary contact person","oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"description":"VAT/Tax registration number","oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"description":"Business registration number","oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"description":"Whether this supplier is marked as a favorite","oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"description":"Opening balance amount for the supplier","oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"description":"Opening balance date","oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"description":"Most the business means to owe this supplier, in base currency. It only warns: a bill over it still saves.","oneOf":[{"type":"number"},{"type":"null"}]},"clearcreditlimit":{"description":"When true, removes the stored supplier limit.","oneOf":[{"type":"boolean"},{"type":"null"}]},"clearopeningbalance":{"description":"Reserved, mirrors update_bank_account: when true the opening-date confirmation below is not asked.","oneOf":[{"type":"boolean"},{"type":"null"}]},"confirm":{"description":"PROD-1951: required only to save an opening date that is LATER than the supplier's own earliest bill or expense. Without it that one case is refused, unwritten, with code confirm-required plus earliesttransactiondate and transactionsbefore, so the caller can show what the date would exclude from the creditors balance and let the user override it.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create a supplier. Returns the new supplier id.","tags":["supplier management"]}},"/api/supplier/update":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the supplier, required for updates","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Supplier or vendor name","oneOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Supplier email address","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"description":"Street address line 1","oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"description":"Street address line 2","oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"description":"Suburb or district","oneOf":[{"type":"string"},{"type":"null"}]},"city":{"description":"City","oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"description":"Postal or ZIP code","oneOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"Country","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress":{"description":"Postal address line 1, e.g. a PO Box.","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress2":{"description":"Postal address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"postalsuburb":{"description":"Postal address suburb.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcity":{"description":"Postal address city.","oneOf":[{"type":"string"},{"type":"null"}]},"postalpostalcode":{"description":"Postal address postal code.","oneOf":[{"type":"string"},{"type":"null"}]},"documentaddress":{"description":"Which address documents print: physical (default) or postal.","oneOf":[{"type":"string","enum":["physical","postal"]},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"contacts":{"description":"The full list of contact people, each {id, name, email, phone, role, ondocuments}. It replaces the stored list: a person left out is removed. Leave the key out to keep the stored list; send [] to clear it. A contact with no customer or supplier role keeps its people too, and they move onto the role it gains. A contact that is both a customer and a supplier holds one list, read back as people.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The contact person id. Send it to keep and update that person; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"ondocuments":{"description":"True to send documents to this person.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"website":{"description":"Supplier website, e.g. www.example.co.za. Trimmed; a blank string clears it, null leaves it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]},"contactname":{"description":"Name of primary contact person","oneOf":[{"type":"string"},{"type":"null"}]},"contactemail":{"description":"Email of primary contact person","oneOf":[{"type":"string"},{"type":"null"}]},"number":{"description":"Main telephone (landline) number of the supplier, beside the contact person's contactnumber. Trimmed; a blank value on update clears it.","oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"description":"Phone number of primary contact person","oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"description":"VAT/Tax registration number","oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"description":"Business registration number","oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"description":"Whether this supplier is marked as a favorite","oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"description":"Opening balance amount for the supplier","oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"description":"Opening balance date","oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"description":"Most the business means to owe this supplier, in base currency. It only warns: a bill over it still saves.","oneOf":[{"type":"number"},{"type":"null"}]},"clearcreditlimit":{"description":"When true, removes the stored supplier limit.","oneOf":[{"type":"boolean"},{"type":"null"}]},"clearopeningbalance":{"description":"Reserved, mirrors update_bank_account: when true the opening-date confirmation below is not asked.","oneOf":[{"type":"boolean"},{"type":"null"}]},"confirm":{"description":"PROD-1951: required only to save an opening date that is LATER than the supplier's own earliest bill or expense. Without it that one case is refused, unwritten, with code confirm-required plus earliesttransactiondate and transactionsbefore, so the caller can show what the date would exclude from the creditors balance and let the user override it.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the supplier, required for updates","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Supplier or vendor name","oneOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Supplier email address","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"description":"Street address line 1","oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"description":"Street address line 2","oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"description":"Suburb or district","oneOf":[{"type":"string"},{"type":"null"}]},"city":{"description":"City","oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"description":"Postal or ZIP code","oneOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"Country","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress":{"description":"Postal address line 1, e.g. a PO Box.","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress2":{"description":"Postal address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"postalsuburb":{"description":"Postal address suburb.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcity":{"description":"Postal address city.","oneOf":[{"type":"string"},{"type":"null"}]},"postalpostalcode":{"description":"Postal address postal code.","oneOf":[{"type":"string"},{"type":"null"}]},"documentaddress":{"description":"Which address documents print: physical (default) or postal.","oneOf":[{"type":"string","enum":["physical","postal"]},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"contacts":{"description":"The full list of contact people, each {id, name, email, phone, role, ondocuments}. It replaces the stored list: a person left out is removed. Leave the key out to keep the stored list; send [] to clear it. A contact with no customer or supplier role keeps its people too, and they move onto the role it gains. A contact that is both a customer and a supplier holds one list, read back as people.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The contact person id. Send it to keep and update that person; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"ondocuments":{"description":"True to send documents to this person.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"website":{"description":"Supplier website, e.g. www.example.co.za. Trimmed; a blank string clears it, null leaves it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]},"contactname":{"description":"Name of primary contact person","oneOf":[{"type":"string"},{"type":"null"}]},"contactemail":{"description":"Email of primary contact person","oneOf":[{"type":"string"},{"type":"null"}]},"number":{"description":"Main telephone (landline) number of the supplier, beside the contact person's contactnumber. Trimmed; a blank value on update clears it.","oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"description":"Phone number of primary contact person","oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"description":"VAT/Tax registration number","oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"description":"Business registration number","oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"description":"Whether this supplier is marked as a favorite","oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"description":"Opening balance amount for the supplier","oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"description":"Opening balance date","oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"description":"Most the business means to owe this supplier, in base currency. It only warns: a bill over it still saves.","oneOf":[{"type":"number"},{"type":"null"}]},"clearcreditlimit":{"description":"When true, removes the stored supplier limit.","oneOf":[{"type":"boolean"},{"type":"null"}]},"clearopeningbalance":{"description":"Reserved, mirrors update_bank_account: when true the opening-date confirmation below is not asked.","oneOf":[{"type":"boolean"},{"type":"null"}]},"confirm":{"description":"PROD-1951: required only to save an opening date that is LATER than the supplier's own earliest bill or expense. Without it that one case is refused, unwritten, with code confirm-required plus earliesttransactiondate and transactionsbefore, so the caller can show what the date would exclude from the creditors balance and let the user override it.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the supplier, required for updates","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Supplier or vendor name","oneOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Supplier email address","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"description":"Street address line 1","oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"description":"Street address line 2","oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"description":"Suburb or district","oneOf":[{"type":"string"},{"type":"null"}]},"city":{"description":"City","oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"description":"Postal or ZIP code","oneOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"Country","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress":{"description":"Postal address line 1, e.g. a PO Box.","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress2":{"description":"Postal address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"postalsuburb":{"description":"Postal address suburb.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcity":{"description":"Postal address city.","oneOf":[{"type":"string"},{"type":"null"}]},"postalpostalcode":{"description":"Postal address postal code.","oneOf":[{"type":"string"},{"type":"null"}]},"documentaddress":{"description":"Which address documents print: physical (default) or postal.","oneOf":[{"type":"string","enum":["physical","postal"]},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"contacts":{"description":"The full list of contact people, each {id, name, email, phone, role, ondocuments}. It replaces the stored list: a person left out is removed. Leave the key out to keep the stored list; send [] to clear it. A contact with no customer or supplier role keeps its people too, and they move onto the role it gains. A contact that is both a customer and a supplier holds one list, read back as people.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The contact person id. Send it to keep and update that person; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"ondocuments":{"description":"True to send documents to this person.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"website":{"description":"Supplier website, e.g. www.example.co.za. Trimmed; a blank string clears it, null leaves it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]},"contactname":{"description":"Name of primary contact person","oneOf":[{"type":"string"},{"type":"null"}]},"contactemail":{"description":"Email of primary contact person","oneOf":[{"type":"string"},{"type":"null"}]},"number":{"description":"Main telephone (landline) number of the supplier, beside the contact person's contactnumber. Trimmed; a blank value on update clears it.","oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"description":"Phone number of primary contact person","oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"description":"VAT/Tax registration number","oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"description":"Business registration number","oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"description":"Whether this supplier is marked as a favorite","oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"description":"Opening balance amount for the supplier","oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"description":"Opening balance date","oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"description":"Most the business means to owe this supplier, in base currency. It only warns: a bill over it still saves.","oneOf":[{"type":"number"},{"type":"null"}]},"clearcreditlimit":{"description":"When true, removes the stored supplier limit.","oneOf":[{"type":"boolean"},{"type":"null"}]},"clearopeningbalance":{"description":"Reserved, mirrors update_bank_account: when true the opening-date confirmation below is not asked.","oneOf":[{"type":"boolean"},{"type":"null"}]},"confirm":{"description":"PROD-1951: required only to save an opening date that is LATER than the supplier's own earliest bill or expense. Without it that one case is refused, unwritten, with code confirm-required plus earliesttransactiondate and transactionsbefore, so the caller can show what the date would exclude from the creditors balance and let the user override it.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the supplier, required for updates","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Supplier or vendor name","oneOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Supplier email address","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"description":"Street address line 1","oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"description":"Street address line 2","oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"description":"Suburb or district","oneOf":[{"type":"string"},{"type":"null"}]},"city":{"description":"City","oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"description":"Postal or ZIP code","oneOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"Country","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress":{"description":"Postal address line 1, e.g. a PO Box.","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress2":{"description":"Postal address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"postalsuburb":{"description":"Postal address suburb.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcity":{"description":"Postal address city.","oneOf":[{"type":"string"},{"type":"null"}]},"postalpostalcode":{"description":"Postal address postal code.","oneOf":[{"type":"string"},{"type":"null"}]},"documentaddress":{"description":"Which address documents print: physical (default) or postal.","oneOf":[{"type":"string","enum":["physical","postal"]},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"contacts":{"description":"The full list of contact people, each {id, name, email, phone, role, ondocuments}. It replaces the stored list: a person left out is removed. Leave the key out to keep the stored list; send [] to clear it. A contact with no customer or supplier role keeps its people too, and they move onto the role it gains. A contact that is both a customer and a supplier holds one list, read back as people.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The contact person id. Send it to keep and update that person; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"ondocuments":{"description":"True to send documents to this person.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"website":{"description":"Supplier website, e.g. www.example.co.za. Trimmed; a blank string clears it, null leaves it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]},"contactname":{"description":"Name of primary contact person","oneOf":[{"type":"string"},{"type":"null"}]},"contactemail":{"description":"Email of primary contact person","oneOf":[{"type":"string"},{"type":"null"}]},"number":{"description":"Main telephone (landline) number of the supplier, beside the contact person's contactnumber. Trimmed; a blank value on update clears it.","oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"description":"Phone number of primary contact person","oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"description":"VAT/Tax registration number","oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"description":"Business registration number","oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"description":"Whether this supplier is marked as a favorite","oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"description":"Opening balance amount for the supplier","oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"description":"Opening balance date","oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"description":"Most the business means to owe this supplier, in base currency. It only warns: a bill over it still saves.","oneOf":[{"type":"number"},{"type":"null"}]},"clearcreditlimit":{"description":"When true, removes the stored supplier limit.","oneOf":[{"type":"boolean"},{"type":"null"}]},"clearopeningbalance":{"description":"Reserved, mirrors update_bank_account: when true the opening-date confirmation below is not asked.","oneOf":[{"type":"boolean"},{"type":"null"}]},"confirm":{"description":"PROD-1951: required only to save an opening date that is LATER than the supplier's own earliest bill or expense. Without it that one case is refused, unwritten, with code confirm-required plus earliesttransactiondate and transactionsbefore, so the caller can show what the date would exclude from the creditors balance and let the user override it.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Update an existing supplier by id. An opening date later than the supplier's own earliest bill or expense is refused, unwritten, with code confirm-required until the same call is repeated with confirm true.","tags":["supplier management"]}},"/api/supplier/save":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Supplier id. Present → update that supplier; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"tags":{"description":"Category or group names to tag it with (a Sage customer category, say). A tag with the same name is reused; a missing one is made.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"name":{"description":"Display name / description of the supplier.","oneOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Supplier email address.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"description":"Street address line 1.","oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"description":"Street address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"description":"Suburb or district.","oneOf":[{"type":"string"},{"type":"null"}]},"city":{"description":"City.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"description":"Postal or ZIP code.","oneOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"Supplier country (ISO code or name).","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress":{"description":"Postal address line 1, e.g. a PO Box.","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress2":{"description":"Postal address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"postalsuburb":{"description":"Postal address suburb.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcity":{"description":"Postal address city.","oneOf":[{"type":"string"},{"type":"null"}]},"postalpostalcode":{"description":"Postal address postal code.","oneOf":[{"type":"string"},{"type":"null"}]},"documentaddress":{"description":"Which address documents print: physical (default) or postal.","oneOf":[{"type":"string","enum":["physical","postal"]},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"contacts":{"description":"The full list of contact people, each {id, name, email, phone, role, ondocuments}. It replaces the stored list: a person left out is removed. Leave the key out to keep the stored list; send [] to clear it. A contact with no customer or supplier role keeps its people too, and they move onto the role it gains. A contact that is both a customer and a supplier holds one list, read back as people.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The contact person id. Send it to keep and update that person; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"ondocuments":{"description":"True to send documents to this person.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"website":{"description":"Supplier website, e.g. www.example.co.za. Trimmed; a blank string clears it, null leaves it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]},"contactname":{"description":"Name of the primary contact person.","oneOf":[{"type":"string"},{"type":"null"}]},"contactemail":{"description":"Email of the primary contact person.","oneOf":[{"type":"string"},{"type":"null"}]},"number":{"description":"Main telephone (landline) number of the supplier, beside the contact person's contactnumber. Trimmed; a blank value on update clears it.","oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"description":"Phone number of the primary contact person.","oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"description":"VAT / tax registration number.","oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"description":"Business registration number.","oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"description":"Whether this supplier is marked as a favourite.","oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"description":"Opening balance amount carried for this supplier at openingdate.","oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"description":"Date the opening balance applies from (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"description":"Most the business means to owe this supplier, in base currency. It only warns: a bill over it still saves.","oneOf":[{"type":"number"},{"type":"null"}]},"clearcreditlimit":{"description":"When true, removes the stored supplier limit.","oneOf":[{"type":"boolean"},{"type":"null"}]},"items":{"description":"Vector of supplier objects to create/update in one all-or-nothing batch. Preferred over repeated calls. Each item with an id updates; each without creates.","type":"array","items":{"type":"object","properties":{"id":{"description":"Supplier id. Present → update that supplier; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"tags":{"description":"Category or group names to tag it with (a Sage customer category, say). A tag with the same name is reused; a missing one is made.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"name":{"description":"Display name / description of the supplier.","oneOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Supplier email address.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"description":"Street address line 1.","oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"description":"Street address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"description":"Suburb or district.","oneOf":[{"type":"string"},{"type":"null"}]},"city":{"description":"City.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"description":"Postal or ZIP code.","oneOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"Supplier country (ISO code or name).","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress":{"description":"Postal address line 1, e.g. a PO Box.","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress2":{"description":"Postal address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"postalsuburb":{"description":"Postal address suburb.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcity":{"description":"Postal address city.","oneOf":[{"type":"string"},{"type":"null"}]},"postalpostalcode":{"description":"Postal address postal code.","oneOf":[{"type":"string"},{"type":"null"}]},"documentaddress":{"description":"Which address documents print: physical (default) or postal.","oneOf":[{"type":"string","enum":["physical","postal"]},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"contacts":{"description":"The full list of contact people, each {id, name, email, phone, role, ondocuments}. It replaces the stored list: a person left out is removed. Leave the key out to keep the stored list; send [] to clear it. A contact with no customer or supplier role keeps its people too, and they move onto the role it gains. A contact that is both a customer and a supplier holds one list, read back as people.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The contact person id. Send it to keep and update that person; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"ondocuments":{"description":"True to send documents to this person.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"website":{"description":"Supplier website, e.g. www.example.co.za. Trimmed; a blank string clears it, null leaves it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]},"contactname":{"description":"Name of the primary contact person.","oneOf":[{"type":"string"},{"type":"null"}]},"contactemail":{"description":"Email of the primary contact person.","oneOf":[{"type":"string"},{"type":"null"}]},"number":{"description":"Main telephone (landline) number of the supplier, beside the contact person's contactnumber. Trimmed; a blank value on update clears it.","oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"description":"Phone number of the primary contact person.","oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"description":"VAT / tax registration number.","oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"description":"Business registration number.","oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"description":"Whether this supplier is marked as a favourite.","oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"description":"Opening balance amount carried for this supplier at openingdate.","oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"description":"Date the opening balance applies from (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"description":"Most the business means to owe this supplier, in base currency. It only warns: a bill over it still saves.","oneOf":[{"type":"number"},{"type":"null"}]},"clearcreditlimit":{"description":"When true, removes the stored supplier limit.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false}},"clearopeningbalance":{"description":"Reserved, mirrors update_bank_account: when true the opening-date confirmation below is not asked.","oneOf":[{"type":"boolean"},{"type":"null"}]},"confirm":{"description":"PROD-1951: required only to save an opening date that is LATER than the supplier's own earliest bill or expense. Without it that one case is refused, unwritten, with code confirm-required plus earliesttransactiondate and transactionsbefore, so the caller can show what the date would exclude from the creditors balance and let the user override it.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Supplier id. Present → update that supplier; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"tags":{"description":"Category or group names to tag it with (a Sage customer category, say). A tag with the same name is reused; a missing one is made.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"name":{"description":"Display name / description of the supplier.","oneOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Supplier email address.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"description":"Street address line 1.","oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"description":"Street address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"description":"Suburb or district.","oneOf":[{"type":"string"},{"type":"null"}]},"city":{"description":"City.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"description":"Postal or ZIP code.","oneOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"Supplier country (ISO code or name).","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress":{"description":"Postal address line 1, e.g. a PO Box.","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress2":{"description":"Postal address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"postalsuburb":{"description":"Postal address suburb.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcity":{"description":"Postal address city.","oneOf":[{"type":"string"},{"type":"null"}]},"postalpostalcode":{"description":"Postal address postal code.","oneOf":[{"type":"string"},{"type":"null"}]},"documentaddress":{"description":"Which address documents print: physical (default) or postal.","oneOf":[{"type":"string","enum":["physical","postal"]},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"contacts":{"description":"The full list of contact people, each {id, name, email, phone, role, ondocuments}. It replaces the stored list: a person left out is removed. Leave the key out to keep the stored list; send [] to clear it. A contact with no customer or supplier role keeps its people too, and they move onto the role it gains. A contact that is both a customer and a supplier holds one list, read back as people.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The contact person id. Send it to keep and update that person; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"ondocuments":{"description":"True to send documents to this person.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"website":{"description":"Supplier website, e.g. www.example.co.za. Trimmed; a blank string clears it, null leaves it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]},"contactname":{"description":"Name of the primary contact person.","oneOf":[{"type":"string"},{"type":"null"}]},"contactemail":{"description":"Email of the primary contact person.","oneOf":[{"type":"string"},{"type":"null"}]},"number":{"description":"Main telephone (landline) number of the supplier, beside the contact person's contactnumber. Trimmed; a blank value on update clears it.","oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"description":"Phone number of the primary contact person.","oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"description":"VAT / tax registration number.","oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"description":"Business registration number.","oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"description":"Whether this supplier is marked as a favourite.","oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"description":"Opening balance amount carried for this supplier at openingdate.","oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"description":"Date the opening balance applies from (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"description":"Most the business means to owe this supplier, in base currency. It only warns: a bill over it still saves.","oneOf":[{"type":"number"},{"type":"null"}]},"clearcreditlimit":{"description":"When true, removes the stored supplier limit.","oneOf":[{"type":"boolean"},{"type":"null"}]},"items":{"description":"Vector of supplier objects to create/update in one all-or-nothing batch. Preferred over repeated calls. Each item with an id updates; each without creates.","type":"array","items":{"type":"object","properties":{"id":{"description":"Supplier id. Present → update that supplier; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"tags":{"description":"Category or group names to tag it with (a Sage customer category, say). A tag with the same name is reused; a missing one is made.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"name":{"description":"Display name / description of the supplier.","oneOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Supplier email address.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"description":"Street address line 1.","oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"description":"Street address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"description":"Suburb or district.","oneOf":[{"type":"string"},{"type":"null"}]},"city":{"description":"City.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"description":"Postal or ZIP code.","oneOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"Supplier country (ISO code or name).","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress":{"description":"Postal address line 1, e.g. a PO Box.","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress2":{"description":"Postal address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"postalsuburb":{"description":"Postal address suburb.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcity":{"description":"Postal address city.","oneOf":[{"type":"string"},{"type":"null"}]},"postalpostalcode":{"description":"Postal address postal code.","oneOf":[{"type":"string"},{"type":"null"}]},"documentaddress":{"description":"Which address documents print: physical (default) or postal.","oneOf":[{"type":"string","enum":["physical","postal"]},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"contacts":{"description":"The full list of contact people, each {id, name, email, phone, role, ondocuments}. It replaces the stored list: a person left out is removed. Leave the key out to keep the stored list; send [] to clear it. A contact with no customer or supplier role keeps its people too, and they move onto the role it gains. A contact that is both a customer and a supplier holds one list, read back as people.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The contact person id. Send it to keep and update that person; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"ondocuments":{"description":"True to send documents to this person.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"website":{"description":"Supplier website, e.g. www.example.co.za. Trimmed; a blank string clears it, null leaves it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]},"contactname":{"description":"Name of the primary contact person.","oneOf":[{"type":"string"},{"type":"null"}]},"contactemail":{"description":"Email of the primary contact person.","oneOf":[{"type":"string"},{"type":"null"}]},"number":{"description":"Main telephone (landline) number of the supplier, beside the contact person's contactnumber. Trimmed; a blank value on update clears it.","oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"description":"Phone number of the primary contact person.","oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"description":"VAT / tax registration number.","oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"description":"Business registration number.","oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"description":"Whether this supplier is marked as a favourite.","oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"description":"Opening balance amount carried for this supplier at openingdate.","oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"description":"Date the opening balance applies from (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"description":"Most the business means to owe this supplier, in base currency. It only warns: a bill over it still saves.","oneOf":[{"type":"number"},{"type":"null"}]},"clearcreditlimit":{"description":"When true, removes the stored supplier limit.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false}},"clearopeningbalance":{"description":"Reserved, mirrors update_bank_account: when true the opening-date confirmation below is not asked.","oneOf":[{"type":"boolean"},{"type":"null"}]},"confirm":{"description":"PROD-1951: required only to save an opening date that is LATER than the supplier's own earliest bill or expense. Without it that one case is refused, unwritten, with code confirm-required plus earliesttransactiondate and transactionsbefore, so the caller can show what the date would exclude from the creditors balance and let the user override it.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Supplier id. Present → update that supplier; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"tags":{"description":"Category or group names to tag it with (a Sage customer category, say). A tag with the same name is reused; a missing one is made.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"name":{"description":"Display name / description of the supplier.","oneOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Supplier email address.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"description":"Street address line 1.","oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"description":"Street address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"description":"Suburb or district.","oneOf":[{"type":"string"},{"type":"null"}]},"city":{"description":"City.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"description":"Postal or ZIP code.","oneOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"Supplier country (ISO code or name).","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress":{"description":"Postal address line 1, e.g. a PO Box.","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress2":{"description":"Postal address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"postalsuburb":{"description":"Postal address suburb.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcity":{"description":"Postal address city.","oneOf":[{"type":"string"},{"type":"null"}]},"postalpostalcode":{"description":"Postal address postal code.","oneOf":[{"type":"string"},{"type":"null"}]},"documentaddress":{"description":"Which address documents print: physical (default) or postal.","oneOf":[{"type":"string","enum":["physical","postal"]},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"contacts":{"description":"The full list of contact people, each {id, name, email, phone, role, ondocuments}. It replaces the stored list: a person left out is removed. Leave the key out to keep the stored list; send [] to clear it. A contact with no customer or supplier role keeps its people too, and they move onto the role it gains. A contact that is both a customer and a supplier holds one list, read back as people.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The contact person id. Send it to keep and update that person; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"ondocuments":{"description":"True to send documents to this person.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"website":{"description":"Supplier website, e.g. www.example.co.za. Trimmed; a blank string clears it, null leaves it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]},"contactname":{"description":"Name of the primary contact person.","oneOf":[{"type":"string"},{"type":"null"}]},"contactemail":{"description":"Email of the primary contact person.","oneOf":[{"type":"string"},{"type":"null"}]},"number":{"description":"Main telephone (landline) number of the supplier, beside the contact person's contactnumber. Trimmed; a blank value on update clears it.","oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"description":"Phone number of the primary contact person.","oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"description":"VAT / tax registration number.","oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"description":"Business registration number.","oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"description":"Whether this supplier is marked as a favourite.","oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"description":"Opening balance amount carried for this supplier at openingdate.","oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"description":"Date the opening balance applies from (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"description":"Most the business means to owe this supplier, in base currency. It only warns: a bill over it still saves.","oneOf":[{"type":"number"},{"type":"null"}]},"clearcreditlimit":{"description":"When true, removes the stored supplier limit.","oneOf":[{"type":"boolean"},{"type":"null"}]},"items":{"description":"Vector of supplier objects to create/update in one all-or-nothing batch. Preferred over repeated calls. Each item with an id updates; each without creates.","type":"array","items":{"type":"object","properties":{"id":{"description":"Supplier id. Present → update that supplier; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"tags":{"description":"Category or group names to tag it with (a Sage customer category, say). A tag with the same name is reused; a missing one is made.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"name":{"description":"Display name / description of the supplier.","oneOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Supplier email address.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"description":"Street address line 1.","oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"description":"Street address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"description":"Suburb or district.","oneOf":[{"type":"string"},{"type":"null"}]},"city":{"description":"City.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"description":"Postal or ZIP code.","oneOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"Supplier country (ISO code or name).","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress":{"description":"Postal address line 1, e.g. a PO Box.","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress2":{"description":"Postal address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"postalsuburb":{"description":"Postal address suburb.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcity":{"description":"Postal address city.","oneOf":[{"type":"string"},{"type":"null"}]},"postalpostalcode":{"description":"Postal address postal code.","oneOf":[{"type":"string"},{"type":"null"}]},"documentaddress":{"description":"Which address documents print: physical (default) or postal.","oneOf":[{"type":"string","enum":["physical","postal"]},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"contacts":{"description":"The full list of contact people, each {id, name, email, phone, role, ondocuments}. It replaces the stored list: a person left out is removed. Leave the key out to keep the stored list; send [] to clear it. A contact with no customer or supplier role keeps its people too, and they move onto the role it gains. A contact that is both a customer and a supplier holds one list, read back as people.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The contact person id. Send it to keep and update that person; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"ondocuments":{"description":"True to send documents to this person.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"website":{"description":"Supplier website, e.g. www.example.co.za. Trimmed; a blank string clears it, null leaves it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]},"contactname":{"description":"Name of the primary contact person.","oneOf":[{"type":"string"},{"type":"null"}]},"contactemail":{"description":"Email of the primary contact person.","oneOf":[{"type":"string"},{"type":"null"}]},"number":{"description":"Main telephone (landline) number of the supplier, beside the contact person's contactnumber. Trimmed; a blank value on update clears it.","oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"description":"Phone number of the primary contact person.","oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"description":"VAT / tax registration number.","oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"description":"Business registration number.","oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"description":"Whether this supplier is marked as a favourite.","oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"description":"Opening balance amount carried for this supplier at openingdate.","oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"description":"Date the opening balance applies from (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"description":"Most the business means to owe this supplier, in base currency. It only warns: a bill over it still saves.","oneOf":[{"type":"number"},{"type":"null"}]},"clearcreditlimit":{"description":"When true, removes the stored supplier limit.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false}},"clearopeningbalance":{"description":"Reserved, mirrors update_bank_account: when true the opening-date confirmation below is not asked.","oneOf":[{"type":"boolean"},{"type":"null"}]},"confirm":{"description":"PROD-1951: required only to save an opening date that is LATER than the supplier's own earliest bill or expense. Without it that one case is refused, unwritten, with code confirm-required plus earliesttransactiondate and transactionsbefore, so the caller can show what the date would exclude from the creditors balance and let the user override it.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Supplier id. Present → update that supplier; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"tags":{"description":"Category or group names to tag it with (a Sage customer category, say). A tag with the same name is reused; a missing one is made.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"name":{"description":"Display name / description of the supplier.","oneOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Supplier email address.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"description":"Street address line 1.","oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"description":"Street address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"description":"Suburb or district.","oneOf":[{"type":"string"},{"type":"null"}]},"city":{"description":"City.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"description":"Postal or ZIP code.","oneOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"Supplier country (ISO code or name).","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress":{"description":"Postal address line 1, e.g. a PO Box.","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress2":{"description":"Postal address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"postalsuburb":{"description":"Postal address suburb.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcity":{"description":"Postal address city.","oneOf":[{"type":"string"},{"type":"null"}]},"postalpostalcode":{"description":"Postal address postal code.","oneOf":[{"type":"string"},{"type":"null"}]},"documentaddress":{"description":"Which address documents print: physical (default) or postal.","oneOf":[{"type":"string","enum":["physical","postal"]},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"contacts":{"description":"The full list of contact people, each {id, name, email, phone, role, ondocuments}. It replaces the stored list: a person left out is removed. Leave the key out to keep the stored list; send [] to clear it. A contact with no customer or supplier role keeps its people too, and they move onto the role it gains. A contact that is both a customer and a supplier holds one list, read back as people.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The contact person id. Send it to keep and update that person; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"ondocuments":{"description":"True to send documents to this person.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"website":{"description":"Supplier website, e.g. www.example.co.za. Trimmed; a blank string clears it, null leaves it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]},"contactname":{"description":"Name of the primary contact person.","oneOf":[{"type":"string"},{"type":"null"}]},"contactemail":{"description":"Email of the primary contact person.","oneOf":[{"type":"string"},{"type":"null"}]},"number":{"description":"Main telephone (landline) number of the supplier, beside the contact person's contactnumber. Trimmed; a blank value on update clears it.","oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"description":"Phone number of the primary contact person.","oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"description":"VAT / tax registration number.","oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"description":"Business registration number.","oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"description":"Whether this supplier is marked as a favourite.","oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"description":"Opening balance amount carried for this supplier at openingdate.","oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"description":"Date the opening balance applies from (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"description":"Most the business means to owe this supplier, in base currency. It only warns: a bill over it still saves.","oneOf":[{"type":"number"},{"type":"null"}]},"clearcreditlimit":{"description":"When true, removes the stored supplier limit.","oneOf":[{"type":"boolean"},{"type":"null"}]},"items":{"description":"Vector of supplier objects to create/update in one all-or-nothing batch. Preferred over repeated calls. Each item with an id updates; each without creates.","type":"array","items":{"type":"object","properties":{"id":{"description":"Supplier id. Present → update that supplier; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"tags":{"description":"Category or group names to tag it with (a Sage customer category, say). A tag with the same name is reused; a missing one is made.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"name":{"description":"Display name / description of the supplier.","oneOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Supplier email address.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"description":"Street address line 1.","oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"description":"Street address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"description":"Suburb or district.","oneOf":[{"type":"string"},{"type":"null"}]},"city":{"description":"City.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"description":"Postal or ZIP code.","oneOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"Supplier country (ISO code or name).","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress":{"description":"Postal address line 1, e.g. a PO Box.","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress2":{"description":"Postal address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"postalsuburb":{"description":"Postal address suburb.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcity":{"description":"Postal address city.","oneOf":[{"type":"string"},{"type":"null"}]},"postalpostalcode":{"description":"Postal address postal code.","oneOf":[{"type":"string"},{"type":"null"}]},"documentaddress":{"description":"Which address documents print: physical (default) or postal.","oneOf":[{"type":"string","enum":["physical","postal"]},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"contacts":{"description":"The full list of contact people, each {id, name, email, phone, role, ondocuments}. It replaces the stored list: a person left out is removed. Leave the key out to keep the stored list; send [] to clear it. A contact with no customer or supplier role keeps its people too, and they move onto the role it gains. A contact that is both a customer and a supplier holds one list, read back as people.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The contact person id. Send it to keep and update that person; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"ondocuments":{"description":"True to send documents to this person.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"website":{"description":"Supplier website, e.g. www.example.co.za. Trimmed; a blank string clears it, null leaves it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]},"contactname":{"description":"Name of the primary contact person.","oneOf":[{"type":"string"},{"type":"null"}]},"contactemail":{"description":"Email of the primary contact person.","oneOf":[{"type":"string"},{"type":"null"}]},"number":{"description":"Main telephone (landline) number of the supplier, beside the contact person's contactnumber. Trimmed; a blank value on update clears it.","oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"description":"Phone number of the primary contact person.","oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"description":"VAT / tax registration number.","oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"description":"Business registration number.","oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"description":"Whether this supplier is marked as a favourite.","oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"description":"Opening balance amount carried for this supplier at openingdate.","oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"description":"Date the opening balance applies from (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"description":"Most the business means to owe this supplier, in base currency. It only warns: a bill over it still saves.","oneOf":[{"type":"number"},{"type":"null"}]},"clearcreditlimit":{"description":"When true, removes the stored supplier limit.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false}},"clearopeningbalance":{"description":"Reserved, mirrors update_bank_account: when true the opening-date confirmation below is not asked.","oneOf":[{"type":"boolean"},{"type":"null"}]},"confirm":{"description":"PROD-1951: required only to save an opening date that is LATER than the supplier's own earliest bill or expense. Without it that one case is refused, unwritten, with code confirm-required plus earliesttransactiondate and transactionsbefore, so the caller can show what the date would exclude from the creditors balance and let the user override it.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create or update a supplier. Pass an `id` to update that supplier; omit `id` to create a new one. Returns the new supplier id on create. Updating an existing supplier with an opening date later than its own earliest bill or expense is refused, unwritten, with code confirm-required until the same call is repeated with confirm true. To create/update many at once, send an `items` array — one all-or-nothing transaction with a single ledger recompute; each item with an `id` updates, each without creates.","tags":["supplier management"]}},"/api/supplier/update-many":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"suppliers":{"description":"Suppliers to update; each item requires :id plus the fields to change (partial update)","type":"array","items":{"type":"object","properties":{"id":{"description":"ID of the supplier","type":"string"},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress":{"description":"Postal address line 1, e.g. a PO Box.","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress2":{"description":"Postal address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"postalsuburb":{"description":"Postal address suburb.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcity":{"description":"Postal address city.","oneOf":[{"type":"string"},{"type":"null"}]},"postalpostalcode":{"description":"Postal address postal code.","oneOf":[{"type":"string"},{"type":"null"}]},"documentaddress":{"description":"Which address documents print: physical (default) or postal.","oneOf":[{"type":"string","enum":["physical","postal"]},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"contacts":{"description":"The full list of contact people, each {id, name, email, phone, role, ondocuments}. It replaces the stored list: a person left out is removed. Leave the key out to keep the stored list; send [] to clear it. A contact with no customer or supplier role keeps its people too, and they move onto the role it gains. A contact that is both a customer and a supplier holds one list, read back as people.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The contact person id. Send it to keep and update that person; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"ondocuments":{"description":"True to send documents to this person.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"website":{"description":"Supplier website, e.g. www.example.co.za. Trimmed; a blank string clears it, null leaves it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]},"contactname":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactemail":{"oneOf":[{"type":"string"},{"type":"null"}]},"number":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"oneOf":[{"type":"number"},{"type":"null"}]},"clearcreditlimit":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["id"],"additionalProperties":false}}},"required":["token","suppliers"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"suppliers":{"description":"Suppliers to update; each item requires :id plus the fields to change (partial update)","type":"array","items":{"type":"object","properties":{"id":{"description":"ID of the supplier","type":"string"},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress":{"description":"Postal address line 1, e.g. a PO Box.","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress2":{"description":"Postal address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"postalsuburb":{"description":"Postal address suburb.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcity":{"description":"Postal address city.","oneOf":[{"type":"string"},{"type":"null"}]},"postalpostalcode":{"description":"Postal address postal code.","oneOf":[{"type":"string"},{"type":"null"}]},"documentaddress":{"description":"Which address documents print: physical (default) or postal.","oneOf":[{"type":"string","enum":["physical","postal"]},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"contacts":{"description":"The full list of contact people, each {id, name, email, phone, role, ondocuments}. It replaces the stored list: a person left out is removed. Leave the key out to keep the stored list; send [] to clear it. A contact with no customer or supplier role keeps its people too, and they move onto the role it gains. A contact that is both a customer and a supplier holds one list, read back as people.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The contact person id. Send it to keep and update that person; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"ondocuments":{"description":"True to send documents to this person.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"website":{"description":"Supplier website, e.g. www.example.co.za. Trimmed; a blank string clears it, null leaves it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]},"contactname":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactemail":{"oneOf":[{"type":"string"},{"type":"null"}]},"number":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"oneOf":[{"type":"number"},{"type":"null"}]},"clearcreditlimit":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["id"],"additionalProperties":false}}},"required":["token","suppliers"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"suppliers":{"description":"Suppliers to update; each item requires :id plus the fields to change (partial update)","type":"array","items":{"type":"object","properties":{"id":{"description":"ID of the supplier","type":"string"},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress":{"description":"Postal address line 1, e.g. a PO Box.","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress2":{"description":"Postal address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"postalsuburb":{"description":"Postal address suburb.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcity":{"description":"Postal address city.","oneOf":[{"type":"string"},{"type":"null"}]},"postalpostalcode":{"description":"Postal address postal code.","oneOf":[{"type":"string"},{"type":"null"}]},"documentaddress":{"description":"Which address documents print: physical (default) or postal.","oneOf":[{"type":"string","enum":["physical","postal"]},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"contacts":{"description":"The full list of contact people, each {id, name, email, phone, role, ondocuments}. It replaces the stored list: a person left out is removed. Leave the key out to keep the stored list; send [] to clear it. A contact with no customer or supplier role keeps its people too, and they move onto the role it gains. A contact that is both a customer and a supplier holds one list, read back as people.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The contact person id. Send it to keep and update that person; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"ondocuments":{"description":"True to send documents to this person.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"website":{"description":"Supplier website, e.g. www.example.co.za. Trimmed; a blank string clears it, null leaves it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]},"contactname":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactemail":{"oneOf":[{"type":"string"},{"type":"null"}]},"number":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"oneOf":[{"type":"number"},{"type":"null"}]},"clearcreditlimit":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["id"],"additionalProperties":false}}},"required":["token","suppliers"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"suppliers":{"description":"Suppliers to update; each item requires :id plus the fields to change (partial update)","type":"array","items":{"type":"object","properties":{"id":{"description":"ID of the supplier","type":"string"},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress":{"description":"Postal address line 1, e.g. a PO Box.","oneOf":[{"type":"string"},{"type":"null"}]},"postaladdress2":{"description":"Postal address line 2.","oneOf":[{"type":"string"},{"type":"null"}]},"postalsuburb":{"description":"Postal address suburb.","oneOf":[{"type":"string"},{"type":"null"}]},"postalcity":{"description":"Postal address city.","oneOf":[{"type":"string"},{"type":"null"}]},"postalpostalcode":{"description":"Postal address postal code.","oneOf":[{"type":"string"},{"type":"null"}]},"documentaddress":{"description":"Which address documents print: physical (default) or postal.","oneOf":[{"type":"string","enum":["physical","postal"]},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"contacts":{"description":"The full list of contact people, each {id, name, email, phone, role, ondocuments}. It replaces the stored list: a person left out is removed. Leave the key out to keep the stored list; send [] to clear it. A contact with no customer or supplier role keeps its people too, and they move onto the role it gains. A contact that is both a customer and a supplier holds one list, read back as people.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The contact person id. Send it to keep and update that person; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"ondocuments":{"description":"True to send documents to this person.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"website":{"description":"Supplier website, e.g. www.example.co.za. Trimmed; a blank string clears it, null leaves it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]},"contactname":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactemail":{"oneOf":[{"type":"string"},{"type":"null"}]},"number":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"creditlimit":{"oneOf":[{"type":"number"},{"type":"null"}]},"clearcreditlimit":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["id"],"additionalProperties":false}}},"required":["token","suppliers"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Bulk update suppliers","tags":["supplier management"]}},"/api/supplier/delete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"One supplier id to delete.","type":"string"},"ids":{"description":"Up to 1000 supplier ids to delete in one transaction. Partial success: ids this business does not own, already deleted, or still linked (unless force) are skipped and listed in errors.","type":"array","items":{"type":"string"},"minItems":1,"maxItems":1000},"force":{"description":"Delete even when the supplier still has linked (non-deleted) bills/expenses. Default false: the delete is refused when links exist, so linked expenses aren't orphaned (PROD-663).","type":"boolean"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"One supplier id to delete.","type":"string"},"ids":{"description":"Up to 1000 supplier ids to delete in one transaction. Partial success: ids this business does not own, already deleted, or still linked (unless force) are skipped and listed in errors.","type":"array","items":{"type":"string"},"minItems":1,"maxItems":1000},"force":{"description":"Delete even when the supplier still has linked (non-deleted) bills/expenses. Default false: the delete is refused when links exist, so linked expenses aren't orphaned (PROD-663).","type":"boolean"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"One supplier id to delete.","type":"string"},"ids":{"description":"Up to 1000 supplier ids to delete in one transaction. Partial success: ids this business does not own, already deleted, or still linked (unless force) are skipped and listed in errors.","type":"array","items":{"type":"string"},"minItems":1,"maxItems":1000},"force":{"description":"Delete even when the supplier still has linked (non-deleted) bills/expenses. Default false: the delete is refused when links exist, so linked expenses aren't orphaned (PROD-663).","type":"boolean"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"One supplier id to delete.","type":"string"},"ids":{"description":"Up to 1000 supplier ids to delete in one transaction. Partial success: ids this business does not own, already deleted, or still linked (unless force) are skipped and listed in errors.","type":"array","items":{"type":"string"},"minItems":1,"maxItems":1000},"force":{"description":"Delete even when the supplier still has linked (non-deleted) bills/expenses. Default false: the delete is refused when links exist, so linked expenses aren't orphaned (PROD-663).","type":"boolean"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Delete one supplier or many to the bin (soft-delete, restorable). Send `id` for one supplier, which returns {error}. Or send `ids` (up to 1000) to delete many in one transaction, which returns {error, deleted: [id ...], errors: [{id, message} ...]}. That is partial success: ids this business does not own, already deleted, or still linked to bills/expenses are skipped and listed in errors, and error is true only when nothing was deleted. By default a supplier with linked (non-deleted) bills/expenses is refused so those expenses aren't orphaned. Pass force:true to override, or archive via save_supplier.","tags":["supplier management"]}},"/api/supplier/delete-many":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"suppliers":{"description":"Suppliers to delete; each item requires :id","type":"array","items":{"type":"object","properties":{"id":{"description":"ID of the supplier","type":"string"}},"required":["id"],"additionalProperties":false}}},"required":["token","suppliers"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"suppliers":{"description":"Suppliers to delete; each item requires :id","type":"array","items":{"type":"object","properties":{"id":{"description":"ID of the supplier","type":"string"}},"required":["id"],"additionalProperties":false}}},"required":["token","suppliers"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"suppliers":{"description":"Suppliers to delete; each item requires :id","type":"array","items":{"type":"object","properties":{"id":{"description":"ID of the supplier","type":"string"}},"required":["id"],"additionalProperties":false}}},"required":["token","suppliers"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"suppliers":{"description":"Suppliers to delete; each item requires :id","type":"array","items":{"type":"object","properties":{"id":{"description":"ID of the supplier","type":"string"}},"required":["id"],"additionalProperties":false}}},"required":["token","suppliers"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Delete multiple suppliers in one transaction (soft-delete to bin). All-or-nothing: the whole request fails if any id is unknown or any supplier still has linked expenses. Body: {suppliers: [{id} ...]}. For a single supplier use delete_supplier.","tags":["supplier management"]}},"/api/statement/entries":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Client or supplier id whose statement to build. Find it yourself with list_clients or list_suppliers by name; never ask the user for an id.","type":"string"},"kind":{"description":"Contact kind: \"customer\" (default) or \"supplier\".","oneOf":[{"type":"string"},{"type":"null"}]},"start":{"description":"Period start (ISO date). Default 2000-01-01.","oneOf":[{"type":"string"},{"type":"null"}]},"end":{"description":"Period end (ISO date). Default today (UTC).","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Client or supplier id whose statement to build. Find it yourself with list_clients or list_suppliers by name; never ask the user for an id.","type":"string"},"kind":{"description":"Contact kind: \"customer\" (default) or \"supplier\".","oneOf":[{"type":"string"},{"type":"null"}]},"start":{"description":"Period start (ISO date). Default 2000-01-01.","oneOf":[{"type":"string"},{"type":"null"}]},"end":{"description":"Period end (ISO date). Default today (UTC).","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Client or supplier id whose statement to build. Find it yourself with list_clients or list_suppliers by name; never ask the user for an id.","type":"string"},"kind":{"description":"Contact kind: \"customer\" (default) or \"supplier\".","oneOf":[{"type":"string"},{"type":"null"}]},"start":{"description":"Period start (ISO date). Default 2000-01-01.","oneOf":[{"type":"string"},{"type":"null"}]},"end":{"description":"Period end (ISO date). Default today (UTC).","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Client or supplier id whose statement to build. Find it yourself with list_clients or list_suppliers by name; never ask the user for an id.","type":"string"},"kind":{"description":"Contact kind: \"customer\" (default) or \"supplier\".","oneOf":[{"type":"string"},{"type":"null"}]},"start":{"description":"Period start (ISO date). Default 2000-01-01.","oneOf":[{"type":"string"},{"type":"null"}]},"end":{"description":"Period end (ISO date). Default today (UTC).","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Build the account-statement rows (running balance) for a customer or supplier over a date range.","tags":["account statements"]}},"/api/statement/share":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Client or supplier id to share/unshare. Find it yourself with list_clients or list_suppliers by name; never ask the user for an id.","type":"string"},"kind":{"description":"Contact kind: \"customer\" (default) or \"supplier\".","oneOf":[{"type":"string"},{"type":"null"}]},"enabled":{"description":"true opens the public link, false closes it. OMIT IT (with :rotate) to READ the current state — omitting it changes nothing.","oneOf":[{"type":"boolean"},{"type":"null"}]},"rotate":{"description":"Mint a fresh token, revoking any previously shared link. Omit it (with :enabled) to READ.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Client or supplier id to share/unshare. Find it yourself with list_clients or list_suppliers by name; never ask the user for an id.","type":"string"},"kind":{"description":"Contact kind: \"customer\" (default) or \"supplier\".","oneOf":[{"type":"string"},{"type":"null"}]},"enabled":{"description":"true opens the public link, false closes it. OMIT IT (with :rotate) to READ the current state — omitting it changes nothing.","oneOf":[{"type":"boolean"},{"type":"null"}]},"rotate":{"description":"Mint a fresh token, revoking any previously shared link. Omit it (with :enabled) to READ.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Client or supplier id to share/unshare. Find it yourself with list_clients or list_suppliers by name; never ask the user for an id.","type":"string"},"kind":{"description":"Contact kind: \"customer\" (default) or \"supplier\".","oneOf":[{"type":"string"},{"type":"null"}]},"enabled":{"description":"true opens the public link, false closes it. OMIT IT (with :rotate) to READ the current state — omitting it changes nothing.","oneOf":[{"type":"boolean"},{"type":"null"}]},"rotate":{"description":"Mint a fresh token, revoking any previously shared link. Omit it (with :enabled) to READ.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Client or supplier id to share/unshare. Find it yourself with list_clients or list_suppliers by name; never ask the user for an id.","type":"string"},"kind":{"description":"Contact kind: \"customer\" (default) or \"supplier\".","oneOf":[{"type":"string"},{"type":"null"}]},"enabled":{"description":"true opens the public link, false closes it. OMIT IT (with :rotate) to READ the current state — omitting it changes nothing.","oneOf":[{"type":"boolean"},{"type":"null"}]},"rotate":{"description":"Mint a fresh token, revoking any previously shared link. Omit it (with :enabled) to READ.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Read the public account-statement share state for a customer/supplier, or (with :enabled or :rotate) open/close the link and mint or rotate its share token.","tags":["account statements"]}},"/api/statement/send":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Client or supplier id to send the statement to. Find it yourself with list_clients or list_suppliers by name; never ask the user for an id.","type":"string"},"kind":{"description":"Contact kind: \"customer\" (default) or \"supplier\".","oneOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Override recipient; defaults to the contact's email.","oneOf":[{"type":"string"},{"type":"null"}]},"message":{"description":"Optional custom message to include in the email.","oneOf":[{"type":"string"},{"type":"null"}]},"attachmentfileids":{"description":"Attach these business files; the sender must be able to read Files. A file in a locked folder or of another business never goes. Files that do not fit are sent as download links. At most 20.","oneOf":[{"type":"array","items":{"type":"string"},"maxItems":20},{"type":"null"}]},"sendcopy":{"description":"Send me a copy: BCC the signed-in user who sends this, and nobody else. Off by default. Only a signed-in person gets a copy; an API, agent or MCP token sends none.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Client or supplier id to send the statement to. Find it yourself with list_clients or list_suppliers by name; never ask the user for an id.","type":"string"},"kind":{"description":"Contact kind: \"customer\" (default) or \"supplier\".","oneOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Override recipient; defaults to the contact's email.","oneOf":[{"type":"string"},{"type":"null"}]},"message":{"description":"Optional custom message to include in the email.","oneOf":[{"type":"string"},{"type":"null"}]},"attachmentfileids":{"description":"Attach these business files; the sender must be able to read Files. A file in a locked folder or of another business never goes. Files that do not fit are sent as download links. At most 20.","oneOf":[{"type":"array","items":{"type":"string"},"maxItems":20},{"type":"null"}]},"sendcopy":{"description":"Send me a copy: BCC the signed-in user who sends this, and nobody else. Off by default. Only a signed-in person gets a copy; an API, agent or MCP token sends none.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Client or supplier id to send the statement to. Find it yourself with list_clients or list_suppliers by name; never ask the user for an id.","type":"string"},"kind":{"description":"Contact kind: \"customer\" (default) or \"supplier\".","oneOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Override recipient; defaults to the contact's email.","oneOf":[{"type":"string"},{"type":"null"}]},"message":{"description":"Optional custom message to include in the email.","oneOf":[{"type":"string"},{"type":"null"}]},"attachmentfileids":{"description":"Attach these business files; the sender must be able to read Files. A file in a locked folder or of another business never goes. Files that do not fit are sent as download links. At most 20.","oneOf":[{"type":"array","items":{"type":"string"},"maxItems":20},{"type":"null"}]},"sendcopy":{"description":"Send me a copy: BCC the signed-in user who sends this, and nobody else. Off by default. Only a signed-in person gets a copy; an API, agent or MCP token sends none.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Client or supplier id to send the statement to. Find it yourself with list_clients or list_suppliers by name; never ask the user for an id.","type":"string"},"kind":{"description":"Contact kind: \"customer\" (default) or \"supplier\".","oneOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Override recipient; defaults to the contact's email.","oneOf":[{"type":"string"},{"type":"null"}]},"message":{"description":"Optional custom message to include in the email.","oneOf":[{"type":"string"},{"type":"null"}]},"attachmentfileids":{"description":"Attach these business files; the sender must be able to read Files. A file in a locked folder or of another business never goes. Files that do not fit are sent as download links. At most 20.","oneOf":[{"type":"array","items":{"type":"string"},"maxItems":20},{"type":"null"}]},"sendcopy":{"description":"Send me a copy: BCC the signed-in user who sends this, and nobody else. Off by default. Only a signed-in person gets a copy; an API, agent or MCP token sends none.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Email a customer/supplier a link to their live account statement (recorded in email history).","tags":["account statements"]}},"/api/statement/email":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Client or supplier id to send the statement to. Find it yourself with list_clients or list_suppliers by name; never ask the user for an id.","type":"string"},"kind":{"description":"Contact kind: \"customer\" (default) or \"supplier\".","oneOf":[{"type":"string"},{"type":"null"}]},"message":{"description":"Optional custom message to include in the email.","oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"description":"Id of the chat to show the card in.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Client or supplier id to send the statement to. Find it yourself with list_clients or list_suppliers by name; never ask the user for an id.","type":"string"},"kind":{"description":"Contact kind: \"customer\" (default) or \"supplier\".","oneOf":[{"type":"string"},{"type":"null"}]},"message":{"description":"Optional custom message to include in the email.","oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"description":"Id of the chat to show the card in.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Client or supplier id to send the statement to. Find it yourself with list_clients or list_suppliers by name; never ask the user for an id.","type":"string"},"kind":{"description":"Contact kind: \"customer\" (default) or \"supplier\".","oneOf":[{"type":"string"},{"type":"null"}]},"message":{"description":"Optional custom message to include in the email.","oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"description":"Id of the chat to show the card in.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Client or supplier id to send the statement to. Find it yourself with list_clients or list_suppliers by name; never ask the user for an id.","type":"string"},"kind":{"description":"Contact kind: \"customer\" (default) or \"supplier\".","oneOf":[{"type":"string"},{"type":"null"}]},"message":{"description":"Optional custom message to include in the email.","oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"description":"Id of the chat to show the card in.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Email one customer (or supplier) a link to their live account statement. The link opens the statement as it stands, with a date picker; it carries no period, so never promise a month. Sending switches the statement's share link on. It goes only to the contact's email on file. The first call sends nothing: it puts a card on the chat saying who gets what, and answers status awaiting-user. Stop and wait; if the user ticks Send it, call again with the same input. Runs only inside an Ask stub chat.","tags":["account statements"]}},"/api/product/create":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"unit":{"oneOf":[{"type":"string"},{"type":"null"}]},"units":{"oneOf":[{"type":"string"},{"type":"null"}]},"sku":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"cost":{"oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"oneOf":[{"type":"number"},{"type":"null"}]},"price":{"oneOf":[{"type":"number"},{"type":"null"}]},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"costcurrency":{"oneOf":[{"type":"string"},{"type":"null"}]},"requireaddress":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"enablequantity":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"allowoversell":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"trackstock":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"stocklocationid":{"oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"image":{"oneOf":[{"type":"string"},{"type":"null"}]},"paymentlink":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"salestaxids":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"unlinktaxes":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"salestaxexclusive":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"unit":{"oneOf":[{"type":"string"},{"type":"null"}]},"units":{"oneOf":[{"type":"string"},{"type":"null"}]},"sku":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"cost":{"oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"oneOf":[{"type":"number"},{"type":"null"}]},"price":{"oneOf":[{"type":"number"},{"type":"null"}]},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"costcurrency":{"oneOf":[{"type":"string"},{"type":"null"}]},"requireaddress":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"enablequantity":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"allowoversell":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"trackstock":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"stocklocationid":{"oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"image":{"oneOf":[{"type":"string"},{"type":"null"}]},"paymentlink":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"salestaxids":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"unlinktaxes":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"salestaxexclusive":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"unit":{"oneOf":[{"type":"string"},{"type":"null"}]},"units":{"oneOf":[{"type":"string"},{"type":"null"}]},"sku":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"cost":{"oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"oneOf":[{"type":"number"},{"type":"null"}]},"price":{"oneOf":[{"type":"number"},{"type":"null"}]},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"costcurrency":{"oneOf":[{"type":"string"},{"type":"null"}]},"requireaddress":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"enablequantity":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"allowoversell":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"trackstock":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"stocklocationid":{"oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"image":{"oneOf":[{"type":"string"},{"type":"null"}]},"paymentlink":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"salestaxids":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"unlinktaxes":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"salestaxexclusive":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"unit":{"oneOf":[{"type":"string"},{"type":"null"}]},"units":{"oneOf":[{"type":"string"},{"type":"null"}]},"sku":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"cost":{"oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"oneOf":[{"type":"number"},{"type":"null"}]},"price":{"oneOf":[{"type":"number"},{"type":"null"}]},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"costcurrency":{"oneOf":[{"type":"string"},{"type":"null"}]},"requireaddress":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"enablequantity":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"allowoversell":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"trackstock":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"stocklocationid":{"oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"image":{"oneOf":[{"type":"string"},{"type":"null"}]},"paymentlink":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"salestaxids":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"unlinktaxes":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"salestaxexclusive":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create a product. Returns the new product id.","tags":["product management"]}},"/api/product/update":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"unit":{"oneOf":[{"type":"string"},{"type":"null"}]},"units":{"oneOf":[{"type":"string"},{"type":"null"}]},"sku":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"cost":{"oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"oneOf":[{"type":"number"},{"type":"null"}]},"price":{"oneOf":[{"type":"number"},{"type":"null"}]},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"costcurrency":{"oneOf":[{"type":"string"},{"type":"null"}]},"requireaddress":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"enablequantity":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"allowoversell":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"trackstock":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"stocklocationid":{"oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"image":{"oneOf":[{"type":"string"},{"type":"null"}]},"paymentlink":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"salestaxids":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"unlinktaxes":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"salestaxexclusive":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"unit":{"oneOf":[{"type":"string"},{"type":"null"}]},"units":{"oneOf":[{"type":"string"},{"type":"null"}]},"sku":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"cost":{"oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"oneOf":[{"type":"number"},{"type":"null"}]},"price":{"oneOf":[{"type":"number"},{"type":"null"}]},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"costcurrency":{"oneOf":[{"type":"string"},{"type":"null"}]},"requireaddress":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"enablequantity":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"allowoversell":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"trackstock":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"stocklocationid":{"oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"image":{"oneOf":[{"type":"string"},{"type":"null"}]},"paymentlink":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"salestaxids":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"unlinktaxes":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"salestaxexclusive":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"unit":{"oneOf":[{"type":"string"},{"type":"null"}]},"units":{"oneOf":[{"type":"string"},{"type":"null"}]},"sku":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"cost":{"oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"oneOf":[{"type":"number"},{"type":"null"}]},"price":{"oneOf":[{"type":"number"},{"type":"null"}]},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"costcurrency":{"oneOf":[{"type":"string"},{"type":"null"}]},"requireaddress":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"enablequantity":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"allowoversell":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"trackstock":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"stocklocationid":{"oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"image":{"oneOf":[{"type":"string"},{"type":"null"}]},"paymentlink":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"salestaxids":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"unlinktaxes":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"salestaxexclusive":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"unit":{"oneOf":[{"type":"string"},{"type":"null"}]},"units":{"oneOf":[{"type":"string"},{"type":"null"}]},"sku":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"cost":{"oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"oneOf":[{"type":"number"},{"type":"null"}]},"price":{"oneOf":[{"type":"number"},{"type":"null"}]},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"costcurrency":{"oneOf":[{"type":"string"},{"type":"null"}]},"requireaddress":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"enablequantity":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"allowoversell":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"trackstock":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"stocklocationid":{"oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"image":{"oneOf":[{"type":"string"},{"type":"null"}]},"paymentlink":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"salestaxids":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"unlinktaxes":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"salestaxexclusive":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Update an existing product by id.","tags":["product management"]}},"/api/product/save":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Product id. Present → update that product; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name / description of the product.","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"Product description.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Unit amount before quantity/tax, in the record's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"unit":{"description":"Legacy unit-of-measure label; prefer `units`.","oneOf":[{"type":"string"},{"type":"null"}]},"units":{"description":"Unit of measure label (e.g. \"each\", \"hour\", \"kg\").","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"cost":{"description":"Cost price per unit.","oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"description":"Number of units.","oneOf":[{"type":"number"},{"type":"null"}]},"price":{"description":"Selling price per unit, in the record's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"costcurrency":{"description":"ISO 4217 currency code for the cost price.","oneOf":[{"type":"string"},{"type":"null"}]},"requireaddress":{"description":"Whether a delivery/billing address is required when this product is purchased.","oneOf":[{"type":"boolean"},{"type":"null"}]},"enablequantity":{"description":"Whether the buyer can choose a quantity for this product.","oneOf":[{"type":"boolean"},{"type":"null"}]},"allowoversell":{"description":"Whether the product can be sold beyond available stock.","oneOf":[{"type":"boolean"},{"type":"null"}]},"trackstock":{"description":"Whether stock levels are tracked for this product.","oneOf":[{"type":"boolean"},{"type":"null"}]},"stocklocationid":{"description":"Default stock location id for new stock moves: \"2\" (main) or one of the business's locations. Pass \"$delete\" to clear it.","oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"description":"Whether the product is starred/favourited.","oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"description":"Archive (true) or unarchive (false) the product. An archived product is kept with its history and still listed; it is not deleted.","oneOf":[{"type":"boolean"},{"type":"null"}]},"image":{"description":"Product image URL; pass \"$delete\" to remove the existing image.","oneOf":[{"type":"string"},{"type":"null"}]},"paymentlink":{"description":"Whether an online payment link is enabled for this product.","oneOf":[{"type":"boolean"},{"type":"null"}]},"salestaxids":{"description":"Sales tax ids to link to this product.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"unlinktaxes":{"description":"Sales tax ids to unlink from this product.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"sku":{"description":"Stock-keeping unit / product stock code. Canonical product-level SKU (mirrors a variant's sku).","oneOf":[{"type":"string"},{"type":"null"}]},"salestaxexclusive":{"description":"Whether the price excludes sales tax.","oneOf":[{"type":"boolean"},{"type":"null"}]},"items":{"description":"Vector of product objects to create/update in one all-or-nothing batch. Preferred over repeated calls. Each item with an id updates; each without creates.","type":"array","items":{"type":"object","properties":{"id":{"description":"Product id. Present → update that product; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name / description of the product.","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"Product description.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Unit amount before quantity/tax, in the record's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"unit":{"description":"Legacy unit-of-measure label; prefer `units`.","oneOf":[{"type":"string"},{"type":"null"}]},"units":{"description":"Unit of measure label (e.g. \"each\", \"hour\", \"kg\").","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"cost":{"description":"Cost price per unit.","oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"description":"Number of units.","oneOf":[{"type":"number"},{"type":"null"}]},"price":{"description":"Selling price per unit, in the record's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"costcurrency":{"description":"ISO 4217 currency code for the cost price.","oneOf":[{"type":"string"},{"type":"null"}]},"requireaddress":{"description":"Whether a delivery/billing address is required when this product is purchased.","oneOf":[{"type":"boolean"},{"type":"null"}]},"enablequantity":{"description":"Whether the buyer can choose a quantity for this product.","oneOf":[{"type":"boolean"},{"type":"null"}]},"allowoversell":{"description":"Whether the product can be sold beyond available stock.","oneOf":[{"type":"boolean"},{"type":"null"}]},"trackstock":{"description":"Whether stock levels are tracked for this product.","oneOf":[{"type":"boolean"},{"type":"null"}]},"stocklocationid":{"description":"Default stock location id for new stock moves: \"2\" (main) or one of the business's locations. Pass \"$delete\" to clear it.","oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"description":"Whether the product is starred/favourited.","oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"description":"Archive (true) or unarchive (false) the product. An archived product is kept with its history and still listed; it is not deleted.","oneOf":[{"type":"boolean"},{"type":"null"}]},"image":{"description":"Product image URL; pass \"$delete\" to remove the existing image.","oneOf":[{"type":"string"},{"type":"null"}]},"paymentlink":{"description":"Whether an online payment link is enabled for this product.","oneOf":[{"type":"boolean"},{"type":"null"}]},"salestaxids":{"description":"Sales tax ids to link to this product.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"unlinktaxes":{"description":"Sales tax ids to unlink from this product.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"sku":{"description":"Stock-keeping unit / product stock code. Canonical product-level SKU (mirrors a variant's sku).","oneOf":[{"type":"string"},{"type":"null"}]},"salestaxexclusive":{"description":"Whether the price excludes sales tax.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false}}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Product id. Present → update that product; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name / description of the product.","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"Product description.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Unit amount before quantity/tax, in the record's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"unit":{"description":"Legacy unit-of-measure label; prefer `units`.","oneOf":[{"type":"string"},{"type":"null"}]},"units":{"description":"Unit of measure label (e.g. \"each\", \"hour\", \"kg\").","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"cost":{"description":"Cost price per unit.","oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"description":"Number of units.","oneOf":[{"type":"number"},{"type":"null"}]},"price":{"description":"Selling price per unit, in the record's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"costcurrency":{"description":"ISO 4217 currency code for the cost price.","oneOf":[{"type":"string"},{"type":"null"}]},"requireaddress":{"description":"Whether a delivery/billing address is required when this product is purchased.","oneOf":[{"type":"boolean"},{"type":"null"}]},"enablequantity":{"description":"Whether the buyer can choose a quantity for this product.","oneOf":[{"type":"boolean"},{"type":"null"}]},"allowoversell":{"description":"Whether the product can be sold beyond available stock.","oneOf":[{"type":"boolean"},{"type":"null"}]},"trackstock":{"description":"Whether stock levels are tracked for this product.","oneOf":[{"type":"boolean"},{"type":"null"}]},"stocklocationid":{"description":"Default stock location id for new stock moves: \"2\" (main) or one of the business's locations. Pass \"$delete\" to clear it.","oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"description":"Whether the product is starred/favourited.","oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"description":"Archive (true) or unarchive (false) the product. An archived product is kept with its history and still listed; it is not deleted.","oneOf":[{"type":"boolean"},{"type":"null"}]},"image":{"description":"Product image URL; pass \"$delete\" to remove the existing image.","oneOf":[{"type":"string"},{"type":"null"}]},"paymentlink":{"description":"Whether an online payment link is enabled for this product.","oneOf":[{"type":"boolean"},{"type":"null"}]},"salestaxids":{"description":"Sales tax ids to link to this product.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"unlinktaxes":{"description":"Sales tax ids to unlink from this product.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"sku":{"description":"Stock-keeping unit / product stock code. Canonical product-level SKU (mirrors a variant's sku).","oneOf":[{"type":"string"},{"type":"null"}]},"salestaxexclusive":{"description":"Whether the price excludes sales tax.","oneOf":[{"type":"boolean"},{"type":"null"}]},"items":{"description":"Vector of product objects to create/update in one all-or-nothing batch. Preferred over repeated calls. Each item with an id updates; each without creates.","type":"array","items":{"type":"object","properties":{"id":{"description":"Product id. Present → update that product; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name / description of the product.","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"Product description.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Unit amount before quantity/tax, in the record's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"unit":{"description":"Legacy unit-of-measure label; prefer `units`.","oneOf":[{"type":"string"},{"type":"null"}]},"units":{"description":"Unit of measure label (e.g. \"each\", \"hour\", \"kg\").","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"cost":{"description":"Cost price per unit.","oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"description":"Number of units.","oneOf":[{"type":"number"},{"type":"null"}]},"price":{"description":"Selling price per unit, in the record's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"costcurrency":{"description":"ISO 4217 currency code for the cost price.","oneOf":[{"type":"string"},{"type":"null"}]},"requireaddress":{"description":"Whether a delivery/billing address is required when this product is purchased.","oneOf":[{"type":"boolean"},{"type":"null"}]},"enablequantity":{"description":"Whether the buyer can choose a quantity for this product.","oneOf":[{"type":"boolean"},{"type":"null"}]},"allowoversell":{"description":"Whether the product can be sold beyond available stock.","oneOf":[{"type":"boolean"},{"type":"null"}]},"trackstock":{"description":"Whether stock levels are tracked for this product.","oneOf":[{"type":"boolean"},{"type":"null"}]},"stocklocationid":{"description":"Default stock location id for new stock moves: \"2\" (main) or one of the business's locations. Pass \"$delete\" to clear it.","oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"description":"Whether the product is starred/favourited.","oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"description":"Archive (true) or unarchive (false) the product. An archived product is kept with its history and still listed; it is not deleted.","oneOf":[{"type":"boolean"},{"type":"null"}]},"image":{"description":"Product image URL; pass \"$delete\" to remove the existing image.","oneOf":[{"type":"string"},{"type":"null"}]},"paymentlink":{"description":"Whether an online payment link is enabled for this product.","oneOf":[{"type":"boolean"},{"type":"null"}]},"salestaxids":{"description":"Sales tax ids to link to this product.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"unlinktaxes":{"description":"Sales tax ids to unlink from this product.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"sku":{"description":"Stock-keeping unit / product stock code. Canonical product-level SKU (mirrors a variant's sku).","oneOf":[{"type":"string"},{"type":"null"}]},"salestaxexclusive":{"description":"Whether the price excludes sales tax.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false}}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Product id. Present → update that product; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name / description of the product.","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"Product description.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Unit amount before quantity/tax, in the record's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"unit":{"description":"Legacy unit-of-measure label; prefer `units`.","oneOf":[{"type":"string"},{"type":"null"}]},"units":{"description":"Unit of measure label (e.g. \"each\", \"hour\", \"kg\").","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"cost":{"description":"Cost price per unit.","oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"description":"Number of units.","oneOf":[{"type":"number"},{"type":"null"}]},"price":{"description":"Selling price per unit, in the record's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"costcurrency":{"description":"ISO 4217 currency code for the cost price.","oneOf":[{"type":"string"},{"type":"null"}]},"requireaddress":{"description":"Whether a delivery/billing address is required when this product is purchased.","oneOf":[{"type":"boolean"},{"type":"null"}]},"enablequantity":{"description":"Whether the buyer can choose a quantity for this product.","oneOf":[{"type":"boolean"},{"type":"null"}]},"allowoversell":{"description":"Whether the product can be sold beyond available stock.","oneOf":[{"type":"boolean"},{"type":"null"}]},"trackstock":{"description":"Whether stock levels are tracked for this product.","oneOf":[{"type":"boolean"},{"type":"null"}]},"stocklocationid":{"description":"Default stock location id for new stock moves: \"2\" (main) or one of the business's locations. Pass \"$delete\" to clear it.","oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"description":"Whether the product is starred/favourited.","oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"description":"Archive (true) or unarchive (false) the product. An archived product is kept with its history and still listed; it is not deleted.","oneOf":[{"type":"boolean"},{"type":"null"}]},"image":{"description":"Product image URL; pass \"$delete\" to remove the existing image.","oneOf":[{"type":"string"},{"type":"null"}]},"paymentlink":{"description":"Whether an online payment link is enabled for this product.","oneOf":[{"type":"boolean"},{"type":"null"}]},"salestaxids":{"description":"Sales tax ids to link to this product.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"unlinktaxes":{"description":"Sales tax ids to unlink from this product.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"sku":{"description":"Stock-keeping unit / product stock code. Canonical product-level SKU (mirrors a variant's sku).","oneOf":[{"type":"string"},{"type":"null"}]},"salestaxexclusive":{"description":"Whether the price excludes sales tax.","oneOf":[{"type":"boolean"},{"type":"null"}]},"items":{"description":"Vector of product objects to create/update in one all-or-nothing batch. Preferred over repeated calls. Each item with an id updates; each without creates.","type":"array","items":{"type":"object","properties":{"id":{"description":"Product id. Present → update that product; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name / description of the product.","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"Product description.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Unit amount before quantity/tax, in the record's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"unit":{"description":"Legacy unit-of-measure label; prefer `units`.","oneOf":[{"type":"string"},{"type":"null"}]},"units":{"description":"Unit of measure label (e.g. \"each\", \"hour\", \"kg\").","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"cost":{"description":"Cost price per unit.","oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"description":"Number of units.","oneOf":[{"type":"number"},{"type":"null"}]},"price":{"description":"Selling price per unit, in the record's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"costcurrency":{"description":"ISO 4217 currency code for the cost price.","oneOf":[{"type":"string"},{"type":"null"}]},"requireaddress":{"description":"Whether a delivery/billing address is required when this product is purchased.","oneOf":[{"type":"boolean"},{"type":"null"}]},"enablequantity":{"description":"Whether the buyer can choose a quantity for this product.","oneOf":[{"type":"boolean"},{"type":"null"}]},"allowoversell":{"description":"Whether the product can be sold beyond available stock.","oneOf":[{"type":"boolean"},{"type":"null"}]},"trackstock":{"description":"Whether stock levels are tracked for this product.","oneOf":[{"type":"boolean"},{"type":"null"}]},"stocklocationid":{"description":"Default stock location id for new stock moves: \"2\" (main) or one of the business's locations. Pass \"$delete\" to clear it.","oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"description":"Whether the product is starred/favourited.","oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"description":"Archive (true) or unarchive (false) the product. An archived product is kept with its history and still listed; it is not deleted.","oneOf":[{"type":"boolean"},{"type":"null"}]},"image":{"description":"Product image URL; pass \"$delete\" to remove the existing image.","oneOf":[{"type":"string"},{"type":"null"}]},"paymentlink":{"description":"Whether an online payment link is enabled for this product.","oneOf":[{"type":"boolean"},{"type":"null"}]},"salestaxids":{"description":"Sales tax ids to link to this product.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"unlinktaxes":{"description":"Sales tax ids to unlink from this product.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"sku":{"description":"Stock-keeping unit / product stock code. Canonical product-level SKU (mirrors a variant's sku).","oneOf":[{"type":"string"},{"type":"null"}]},"salestaxexclusive":{"description":"Whether the price excludes sales tax.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false}}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Product id. Present → update that product; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name / description of the product.","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"Product description.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Unit amount before quantity/tax, in the record's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"unit":{"description":"Legacy unit-of-measure label; prefer `units`.","oneOf":[{"type":"string"},{"type":"null"}]},"units":{"description":"Unit of measure label (e.g. \"each\", \"hour\", \"kg\").","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"cost":{"description":"Cost price per unit.","oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"description":"Number of units.","oneOf":[{"type":"number"},{"type":"null"}]},"price":{"description":"Selling price per unit, in the record's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"costcurrency":{"description":"ISO 4217 currency code for the cost price.","oneOf":[{"type":"string"},{"type":"null"}]},"requireaddress":{"description":"Whether a delivery/billing address is required when this product is purchased.","oneOf":[{"type":"boolean"},{"type":"null"}]},"enablequantity":{"description":"Whether the buyer can choose a quantity for this product.","oneOf":[{"type":"boolean"},{"type":"null"}]},"allowoversell":{"description":"Whether the product can be sold beyond available stock.","oneOf":[{"type":"boolean"},{"type":"null"}]},"trackstock":{"description":"Whether stock levels are tracked for this product.","oneOf":[{"type":"boolean"},{"type":"null"}]},"stocklocationid":{"description":"Default stock location id for new stock moves: \"2\" (main) or one of the business's locations. Pass \"$delete\" to clear it.","oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"description":"Whether the product is starred/favourited.","oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"description":"Archive (true) or unarchive (false) the product. An archived product is kept with its history and still listed; it is not deleted.","oneOf":[{"type":"boolean"},{"type":"null"}]},"image":{"description":"Product image URL; pass \"$delete\" to remove the existing image.","oneOf":[{"type":"string"},{"type":"null"}]},"paymentlink":{"description":"Whether an online payment link is enabled for this product.","oneOf":[{"type":"boolean"},{"type":"null"}]},"salestaxids":{"description":"Sales tax ids to link to this product.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"unlinktaxes":{"description":"Sales tax ids to unlink from this product.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"sku":{"description":"Stock-keeping unit / product stock code. Canonical product-level SKU (mirrors a variant's sku).","oneOf":[{"type":"string"},{"type":"null"}]},"salestaxexclusive":{"description":"Whether the price excludes sales tax.","oneOf":[{"type":"boolean"},{"type":"null"}]},"items":{"description":"Vector of product objects to create/update in one all-or-nothing batch. Preferred over repeated calls. Each item with an id updates; each without creates.","type":"array","items":{"type":"object","properties":{"id":{"description":"Product id. Present → update that product; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name / description of the product.","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"Product description.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Unit amount before quantity/tax, in the record's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"unit":{"description":"Legacy unit-of-measure label; prefer `units`.","oneOf":[{"type":"string"},{"type":"null"}]},"units":{"description":"Unit of measure label (e.g. \"each\", \"hour\", \"kg\").","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"cost":{"description":"Cost price per unit.","oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"description":"Number of units.","oneOf":[{"type":"number"},{"type":"null"}]},"price":{"description":"Selling price per unit, in the record's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"costcurrency":{"description":"ISO 4217 currency code for the cost price.","oneOf":[{"type":"string"},{"type":"null"}]},"requireaddress":{"description":"Whether a delivery/billing address is required when this product is purchased.","oneOf":[{"type":"boolean"},{"type":"null"}]},"enablequantity":{"description":"Whether the buyer can choose a quantity for this product.","oneOf":[{"type":"boolean"},{"type":"null"}]},"allowoversell":{"description":"Whether the product can be sold beyond available stock.","oneOf":[{"type":"boolean"},{"type":"null"}]},"trackstock":{"description":"Whether stock levels are tracked for this product.","oneOf":[{"type":"boolean"},{"type":"null"}]},"stocklocationid":{"description":"Default stock location id for new stock moves: \"2\" (main) or one of the business's locations. Pass \"$delete\" to clear it.","oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"description":"Whether the product is starred/favourited.","oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"description":"Archive (true) or unarchive (false) the product. An archived product is kept with its history and still listed; it is not deleted.","oneOf":[{"type":"boolean"},{"type":"null"}]},"image":{"description":"Product image URL; pass \"$delete\" to remove the existing image.","oneOf":[{"type":"string"},{"type":"null"}]},"paymentlink":{"description":"Whether an online payment link is enabled for this product.","oneOf":[{"type":"boolean"},{"type":"null"}]},"salestaxids":{"description":"Sales tax ids to link to this product.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"unlinktaxes":{"description":"Sales tax ids to unlink from this product.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"sku":{"description":"Stock-keeping unit / product stock code. Canonical product-level SKU (mirrors a variant's sku).","oneOf":[{"type":"string"},{"type":"null"}]},"salestaxexclusive":{"description":"Whether the price excludes sales tax.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false}}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create or update the catalogue PRODUCT itself (name, price, account); for a size, colour or other option of an existing product, use save_variant. Pass an `id` to update that product; omit `id` to create a new one. Returns the new product id on create. To create/update many at once, send an `items` array — one all-or-nothing transaction with a single ledger recompute; each item with an `id` updates, each without creates.","tags":["product management"]}},"/api/product/delete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"One product id to delete.","type":"string"},"ids":{"description":"Up to 1000 product ids to delete in one transaction. Partial success: ids this business does not own are skipped and listed in errors.","type":"array","items":{"type":"string"},"minItems":1,"maxItems":1000}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"One product id to delete.","type":"string"},"ids":{"description":"Up to 1000 product ids to delete in one transaction. Partial success: ids this business does not own are skipped and listed in errors.","type":"array","items":{"type":"string"},"minItems":1,"maxItems":1000}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"One product id to delete.","type":"string"},"ids":{"description":"Up to 1000 product ids to delete in one transaction. Partial success: ids this business does not own are skipped and listed in errors.","type":"array","items":{"type":"string"},"minItems":1,"maxItems":1000}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"One product id to delete.","type":"string"},"ids":{"description":"Up to 1000 product ids to delete in one transaction. Partial success: ids this business does not own are skipped and listed in errors.","type":"array","items":{"type":"string"},"minItems":1,"maxItems":1000}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Delete one product or many to the bin (soft-delete, restorable). Send `id` for one product, which returns {error}. Or send `ids` (up to 1000) to delete many in one transaction, which returns {error, deleted: [id ...], errors: [{id, message} ...]}. That is partial success: ids this business does not own, or already deleted, are skipped and listed in errors, and error is true only when nothing was deleted. Document lines that used a product keep their own copies of name/price.","tags":["product management"]}},"/api/product/openingstock/get":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"productid":{"type":"string"},"variantid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","productid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"productid":{"type":"string"},"variantid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","productid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"productid":{"type":"string"},"variantid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","productid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"productid":{"type":"string"},"variantid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","productid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"A product's (or variant's) opening stock: quantity, unit cost, value, date and source (\"modal\", \"import\" or null).","tags":["product management"]}},"/api/product/openingstock/save":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"productid":{"description":"The product, from list_products.","type":"string"},"variantid":{"description":"The variant, from list_products. Required when the product has variants: each variant has its own opening stock.","oneOf":[{"type":"string"},{"type":"null"}]},"quantity":{"description":"Whole units on hand on the opening date, above zero.","oneOf":[{"type":"number"},{"type":"null"}]},"cost":{"description":"Cost of one unit, zero or more. The opening value posted is quantity x cost.","oneOf":[{"type":"number"},{"type":"null"}]},"date":{"description":"The opening date, YYYY-MM-DD. Not before the business's take-on date, and not in a locked period.","oneOf":[{"type":"string"},{"type":"null"}]},"stocklocationid":{"description":"Where the stock is held. Omit it for the product's default location.","oneOf":[{"type":"string"},{"type":"null"}]},"clear":{"description":"True to remove the opening stock and its ledger posting.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","productid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"productid":{"description":"The product, from list_products.","type":"string"},"variantid":{"description":"The variant, from list_products. Required when the product has variants: each variant has its own opening stock.","oneOf":[{"type":"string"},{"type":"null"}]},"quantity":{"description":"Whole units on hand on the opening date, above zero.","oneOf":[{"type":"number"},{"type":"null"}]},"cost":{"description":"Cost of one unit, zero or more. The opening value posted is quantity x cost.","oneOf":[{"type":"number"},{"type":"null"}]},"date":{"description":"The opening date, YYYY-MM-DD. Not before the business's take-on date, and not in a locked period.","oneOf":[{"type":"string"},{"type":"null"}]},"stocklocationid":{"description":"Where the stock is held. Omit it for the product's default location.","oneOf":[{"type":"string"},{"type":"null"}]},"clear":{"description":"True to remove the opening stock and its ledger posting.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","productid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"productid":{"description":"The product, from list_products.","type":"string"},"variantid":{"description":"The variant, from list_products. Required when the product has variants: each variant has its own opening stock.","oneOf":[{"type":"string"},{"type":"null"}]},"quantity":{"description":"Whole units on hand on the opening date, above zero.","oneOf":[{"type":"number"},{"type":"null"}]},"cost":{"description":"Cost of one unit, zero or more. The opening value posted is quantity x cost.","oneOf":[{"type":"number"},{"type":"null"}]},"date":{"description":"The opening date, YYYY-MM-DD. Not before the business's take-on date, and not in a locked period.","oneOf":[{"type":"string"},{"type":"null"}]},"stocklocationid":{"description":"Where the stock is held. Omit it for the product's default location.","oneOf":[{"type":"string"},{"type":"null"}]},"clear":{"description":"True to remove the opening stock and its ledger posting.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","productid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"productid":{"description":"The product, from list_products.","type":"string"},"variantid":{"description":"The variant, from list_products. Required when the product has variants: each variant has its own opening stock.","oneOf":[{"type":"string"},{"type":"null"}]},"quantity":{"description":"Whole units on hand on the opening date, above zero.","oneOf":[{"type":"number"},{"type":"null"}]},"cost":{"description":"Cost of one unit, zero or more. The opening value posted is quantity x cost.","oneOf":[{"type":"number"},{"type":"null"}]},"date":{"description":"The opening date, YYYY-MM-DD. Not before the business's take-on date, and not in a locked period.","oneOf":[{"type":"string"},{"type":"null"}]},"stocklocationid":{"description":"Where the stock is held. Omit it for the product's default location.","oneOf":[{"type":"string"},{"type":"null"}]},"clear":{"description":"True to remove the opening stock and its ledger posting.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","productid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Set a product's (or variant's) opening stock: whole-unit quantity at unit cost on a date, posted Dr Inventory / Cr Opening Balances. To correct the stock on hand after that, use set_stock_quantity. Setting again replaces it; clear: true removes it. Refused on a locked period.","tags":["product management"]}},"/api/product/yoco/items":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Every Yoco item the business has sold, with the product its sales land on, whether that product tracks stock, and whether it is linked by hand or match.","tags":["product management"]}},"/api/product/yoco/link":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"variantid":{"description":"The Yoco item (variant) id, as `/product/yoco/items` lists it.","type":"string","minLength":1},"productid":{"description":"The business's own product to link. Omit or null to unlink.","oneOf":[{"type":"string","minLength":1},{"type":"null"}]},"fromdate":{"description":"\"yyyy-MM-dd\". Also move the item's Yoco sales from this day on. Omit to move none.","oneOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},"required":["token","variantid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"variantid":{"description":"The Yoco item (variant) id, as `/product/yoco/items` lists it.","type":"string","minLength":1},"productid":{"description":"The business's own product to link. Omit or null to unlink.","oneOf":[{"type":"string","minLength":1},{"type":"null"}]},"fromdate":{"description":"\"yyyy-MM-dd\". Also move the item's Yoco sales from this day on. Omit to move none.","oneOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},"required":["token","variantid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"variantid":{"description":"The Yoco item (variant) id, as `/product/yoco/items` lists it.","type":"string","minLength":1},"productid":{"description":"The business's own product to link. Omit or null to unlink.","oneOf":[{"type":"string","minLength":1},{"type":"null"}]},"fromdate":{"description":"\"yyyy-MM-dd\". Also move the item's Yoco sales from this day on. Omit to move none.","oneOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},"required":["token","variantid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"variantid":{"description":"The Yoco item (variant) id, as `/product/yoco/items` lists it.","type":"string","minLength":1},"productid":{"description":"The business's own product to link. Omit or null to unlink.","oneOf":[{"type":"string","minLength":1},{"type":"null"}]},"fromdate":{"description":"\"yyyy-MM-dd\". Also move the item's Yoco sales from this day on. Omit to move none.","oneOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},"required":["token","variantid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Link a Yoco item to one of the business's own products, or unlink it (productid null). Future sales land there; fromdate also moves past Yoco sales from that day. Idempotent. Refused on a locked period.","tags":["product management"]}},"/api/product/advice":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"description":{"type":"string"},"kind":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","description"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"description":{"type":"string"},"kind":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","description"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"description":{"type":"string"},"kind":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","description"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"description":{"type":"string"},"kind":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","description"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Advice on product pricing","tags":["product management"]}},"/api/product/international-advice":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"description":{"type":"string"},"kind":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","description"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"description":{"type":"string"},"kind":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","description"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"description":{"type":"string"},"kind":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","description"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"description":{"type":"string"},"kind":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","description"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Advice on product pricing","tags":["product management"]}},"/api/invoice/create":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"currency":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"client":{"oneOf":[{"type":"string"},{"type":"null"}]},"showdiscount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showshipping":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showvat":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showdeposit":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"invoicenumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"date":{"oneOf":[{"type":"string"},{"type":"null"}]},"duedate":{"oneOf":[{"type":"string"},{"type":"null"}]},"quote":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"paymentnote":{"oneOf":[{"type":"string"},{"type":"null"}]},"channel":{"oneOf":[{"type":"string"},{"type":"null"}]},"created":{"oneOf":[{"type":"string"},{"type":"null"}]},"quotesent":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"quotesentdate":{"oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"sent":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"shipping":{"oneOf":[{"type":"number"},{"type":"null"}]},"depositpercent":{"oneOf":[{"type":"number"},{"type":"null"}]},"depositamount":{"oneOf":[{"type":"number"},{"type":"null"}]},"deposituseamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"discountamount":{"oneOf":[{"type":"number"},{"type":"null"}]},"discountpercent":{"oneOf":[{"type":"number"},{"type":"null"}]},"accepted":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"accepteddate":{"oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"discountuseamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"vatpercent":{"oneOf":[{"type":"number"},{"type":"null"}]},"vatinclusive":{"oneOf":[{"type":"string"},{"type":"null"}]},"notification":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showpaymentlink":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"orderstatus":{"oneOf":[{"type":"string"},{"type":"null"}]},"showbank":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"invoicebankid":{"oneOf":[{"type":"string"},{"type":"null"}]},"locked":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"writtenoff":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"writtenoffdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"showpurchaseorder":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"purchaseorder":{"oneOf":[{"type":"string"},{"type":"null"}]},"installments":{"oneOf":[{"type":"number"},{"type":"null"}]},"showinstallments":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"settled":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"salesinvoice":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"message":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"settledaccountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"causeid":{"oneOf":[{"type":"string"},{"type":"null"}]},"causetype":{"oneOf":[{"type":"string"},{"type":"null"}]},"settleddate":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountpayment":{"oneOf":[{"type":"number"},{"type":"null"}]},"design":{"description":"Id of one of the business's own document designs to print this document with. \"$delete\" clears it back to the business default; null or omitted leaves it unchanged. An unknown, archived or foreign id is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"designpinnedat":{"description":"Pins the document to its design as it stood at this ISO instant, zone included (2026-11-27T09:00:00Z). \"$delete\" unpins. A design change unpins unless the same save pins again.","oneOf":[{"type":"string"},{"type":"null"}]},"blocks":{"description":"The document's own rich-text blocks: a JSON object {blockid: richtext}, or its JSON text, at most 64 KB. \"$delete\" clears them.","oneOf":[{"anyOf":[{"type":"string"},{"type":"object"}]},{"type":"null"}]}},"required":["token","currency"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"currency":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"client":{"oneOf":[{"type":"string"},{"type":"null"}]},"showdiscount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showshipping":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showvat":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showdeposit":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"invoicenumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"date":{"oneOf":[{"type":"string"},{"type":"null"}]},"duedate":{"oneOf":[{"type":"string"},{"type":"null"}]},"quote":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"paymentnote":{"oneOf":[{"type":"string"},{"type":"null"}]},"channel":{"oneOf":[{"type":"string"},{"type":"null"}]},"created":{"oneOf":[{"type":"string"},{"type":"null"}]},"quotesent":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"quotesentdate":{"oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"sent":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"shipping":{"oneOf":[{"type":"number"},{"type":"null"}]},"depositpercent":{"oneOf":[{"type":"number"},{"type":"null"}]},"depositamount":{"oneOf":[{"type":"number"},{"type":"null"}]},"deposituseamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"discountamount":{"oneOf":[{"type":"number"},{"type":"null"}]},"discountpercent":{"oneOf":[{"type":"number"},{"type":"null"}]},"accepted":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"accepteddate":{"oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"discountuseamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"vatpercent":{"oneOf":[{"type":"number"},{"type":"null"}]},"vatinclusive":{"oneOf":[{"type":"string"},{"type":"null"}]},"notification":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showpaymentlink":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"orderstatus":{"oneOf":[{"type":"string"},{"type":"null"}]},"showbank":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"invoicebankid":{"oneOf":[{"type":"string"},{"type":"null"}]},"locked":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"writtenoff":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"writtenoffdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"showpurchaseorder":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"purchaseorder":{"oneOf":[{"type":"string"},{"type":"null"}]},"installments":{"oneOf":[{"type":"number"},{"type":"null"}]},"showinstallments":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"settled":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"salesinvoice":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"message":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"settledaccountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"causeid":{"oneOf":[{"type":"string"},{"type":"null"}]},"causetype":{"oneOf":[{"type":"string"},{"type":"null"}]},"settleddate":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountpayment":{"oneOf":[{"type":"number"},{"type":"null"}]},"design":{"description":"Id of one of the business's own document designs to print this document with. \"$delete\" clears it back to the business default; null or omitted leaves it unchanged. An unknown, archived or foreign id is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"designpinnedat":{"description":"Pins the document to its design as it stood at this ISO instant, zone included (2026-11-27T09:00:00Z). \"$delete\" unpins. A design change unpins unless the same save pins again.","oneOf":[{"type":"string"},{"type":"null"}]},"blocks":{"description":"The document's own rich-text blocks: a JSON object {blockid: richtext}, or its JSON text, at most 64 KB. \"$delete\" clears them.","oneOf":[{"anyOf":[{"type":"string"},{"type":"object"}]},{"type":"null"}]}},"required":["token","currency"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"currency":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"client":{"oneOf":[{"type":"string"},{"type":"null"}]},"showdiscount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showshipping":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showvat":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showdeposit":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"invoicenumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"date":{"oneOf":[{"type":"string"},{"type":"null"}]},"duedate":{"oneOf":[{"type":"string"},{"type":"null"}]},"quote":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"paymentnote":{"oneOf":[{"type":"string"},{"type":"null"}]},"channel":{"oneOf":[{"type":"string"},{"type":"null"}]},"created":{"oneOf":[{"type":"string"},{"type":"null"}]},"quotesent":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"quotesentdate":{"oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"sent":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"shipping":{"oneOf":[{"type":"number"},{"type":"null"}]},"depositpercent":{"oneOf":[{"type":"number"},{"type":"null"}]},"depositamount":{"oneOf":[{"type":"number"},{"type":"null"}]},"deposituseamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"discountamount":{"oneOf":[{"type":"number"},{"type":"null"}]},"discountpercent":{"oneOf":[{"type":"number"},{"type":"null"}]},"accepted":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"accepteddate":{"oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"discountuseamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"vatpercent":{"oneOf":[{"type":"number"},{"type":"null"}]},"vatinclusive":{"oneOf":[{"type":"string"},{"type":"null"}]},"notification":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showpaymentlink":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"orderstatus":{"oneOf":[{"type":"string"},{"type":"null"}]},"showbank":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"invoicebankid":{"oneOf":[{"type":"string"},{"type":"null"}]},"locked":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"writtenoff":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"writtenoffdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"showpurchaseorder":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"purchaseorder":{"oneOf":[{"type":"string"},{"type":"null"}]},"installments":{"oneOf":[{"type":"number"},{"type":"null"}]},"showinstallments":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"settled":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"salesinvoice":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"message":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"settledaccountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"causeid":{"oneOf":[{"type":"string"},{"type":"null"}]},"causetype":{"oneOf":[{"type":"string"},{"type":"null"}]},"settleddate":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountpayment":{"oneOf":[{"type":"number"},{"type":"null"}]},"design":{"description":"Id of one of the business's own document designs to print this document with. \"$delete\" clears it back to the business default; null or omitted leaves it unchanged. An unknown, archived or foreign id is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"designpinnedat":{"description":"Pins the document to its design as it stood at this ISO instant, zone included (2026-11-27T09:00:00Z). \"$delete\" unpins. A design change unpins unless the same save pins again.","oneOf":[{"type":"string"},{"type":"null"}]},"blocks":{"description":"The document's own rich-text blocks: a JSON object {blockid: richtext}, or its JSON text, at most 64 KB. \"$delete\" clears them.","oneOf":[{"anyOf":[{"type":"string"},{"type":"object"}]},{"type":"null"}]}},"required":["token","currency"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"currency":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"client":{"oneOf":[{"type":"string"},{"type":"null"}]},"showdiscount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showshipping":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showvat":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showdeposit":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"invoicenumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"date":{"oneOf":[{"type":"string"},{"type":"null"}]},"duedate":{"oneOf":[{"type":"string"},{"type":"null"}]},"quote":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"paymentnote":{"oneOf":[{"type":"string"},{"type":"null"}]},"channel":{"oneOf":[{"type":"string"},{"type":"null"}]},"created":{"oneOf":[{"type":"string"},{"type":"null"}]},"quotesent":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"quotesentdate":{"oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"sent":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"shipping":{"oneOf":[{"type":"number"},{"type":"null"}]},"depositpercent":{"oneOf":[{"type":"number"},{"type":"null"}]},"depositamount":{"oneOf":[{"type":"number"},{"type":"null"}]},"deposituseamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"discountamount":{"oneOf":[{"type":"number"},{"type":"null"}]},"discountpercent":{"oneOf":[{"type":"number"},{"type":"null"}]},"accepted":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"accepteddate":{"oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"discountuseamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"vatpercent":{"oneOf":[{"type":"number"},{"type":"null"}]},"vatinclusive":{"oneOf":[{"type":"string"},{"type":"null"}]},"notification":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showpaymentlink":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"orderstatus":{"oneOf":[{"type":"string"},{"type":"null"}]},"showbank":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"invoicebankid":{"oneOf":[{"type":"string"},{"type":"null"}]},"locked":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"writtenoff":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"writtenoffdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"showpurchaseorder":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"purchaseorder":{"oneOf":[{"type":"string"},{"type":"null"}]},"installments":{"oneOf":[{"type":"number"},{"type":"null"}]},"showinstallments":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"settled":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"salesinvoice":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"message":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"settledaccountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"causeid":{"oneOf":[{"type":"string"},{"type":"null"}]},"causetype":{"oneOf":[{"type":"string"},{"type":"null"}]},"settleddate":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountpayment":{"oneOf":[{"type":"number"},{"type":"null"}]},"design":{"description":"Id of one of the business's own document designs to print this document with. \"$delete\" clears it back to the business default; null or omitted leaves it unchanged. An unknown, archived or foreign id is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"designpinnedat":{"description":"Pins the document to its design as it stood at this ISO instant, zone included (2026-11-27T09:00:00Z). \"$delete\" unpins. A design change unpins unless the same save pins again.","oneOf":[{"type":"string"},{"type":"null"}]},"blocks":{"description":"The document's own rich-text blocks: a JSON object {blockid: richtext}, or its JSON text, at most 64 KB. \"$delete\" clears them.","oneOf":[{"anyOf":[{"type":"string"},{"type":"object"}]},{"type":"null"}]}},"required":["token","currency"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"DEPRECATED — use save_document instead. Legacy quinvoice create (numeric type). Create an invoice/quote/credit-note/etc. Returns the created entity. Retained as a REST endpoint for the web app; excluded from the MCP surface.","tags":["Manage invoices (quotes, proforma invoices, credit notes, debit notes)"]}},"/api/invoice/quick-create":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"client":{"oneOf":[{"type":"object","properties":{"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactname":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactemail":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]},"showdiscount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showshipping":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showdeposit":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"invoicenumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"date":{"oneOf":[{"type":"string"},{"type":"null"}]},"duedate":{"oneOf":[{"type":"string"},{"type":"null"}]},"quote":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"paymentnote":{"oneOf":[{"type":"string"},{"type":"null"}]},"channel":{"oneOf":[{"type":"string"},{"type":"null"}]},"shipping":{"oneOf":[{"type":"number"},{"type":"null"}]},"depositpercent":{"oneOf":[{"type":"number"},{"type":"null"}]},"depositamount":{"oneOf":[{"type":"number"},{"type":"null"}]},"deposituseamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"discountamount":{"oneOf":[{"type":"number"},{"type":"null"}]},"discountpercent":{"oneOf":[{"type":"number"},{"type":"null"}]},"discountuseamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notification":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showpaymentlink":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showbank":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"locked":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"writtenoff":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showpurchaseorder":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"purchaseorder":{"oneOf":[{"type":"string"},{"type":"null"}]},"installments":{"oneOf":[{"type":"number"},{"type":"null"}]},"showinstallments":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"settled":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"orderstatus":{"oneOf":[{"type":"string"},{"type":"null"}]},"message":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"settledaccountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"causeid":{"oneOf":[{"type":"string"},{"type":"null"}]},"causetype":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountpayment":{"oneOf":[{"type":"number"},{"type":"null"}]},"type":{"oneOf":[{"type":"number"},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"price":{"type":"number"},"quantity":{"type":"number"},"cost":{"oneOf":[{"type":"number"},{"type":"null"}]},"unit":{"oneOf":[{"type":"string"},{"type":"null"}]},"product":{"oneOf":[{"type":"string"},{"type":"null"}]},"variant":{"oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"type":"number"},"stocklocationid":{"oneOf":[{"type":"string"},{"type":"null"}]},"sort":{"oneOf":[{"type":"number"},{"type":"null"}]},"costcurrency":{"oneOf":[{"type":"string"},{"type":"null"}]},"salestaxes":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"referencenumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"recoverable":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"rate":{"oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"useamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"exclusive":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["name"],"additionalProperties":false}}},"required":["name","price","quantity","amount"],"additionalProperties":false}},"payments":{"type":"array","items":{"type":"object","properties":{"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"type":"number"},"date":{"oneOf":[{"type":"string"},{"type":"null"}]},"method":{"oneOf":[{"type":"string"},{"type":"null"}]},"payment":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"oneOf":[{"type":"number"},{"type":"null"}]},"transactionid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["amount"],"additionalProperties":false}}},"required":["token","items"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"client":{"oneOf":[{"type":"object","properties":{"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactname":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactemail":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]},"showdiscount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showshipping":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showdeposit":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"invoicenumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"date":{"oneOf":[{"type":"string"},{"type":"null"}]},"duedate":{"oneOf":[{"type":"string"},{"type":"null"}]},"quote":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"paymentnote":{"oneOf":[{"type":"string"},{"type":"null"}]},"channel":{"oneOf":[{"type":"string"},{"type":"null"}]},"shipping":{"oneOf":[{"type":"number"},{"type":"null"}]},"depositpercent":{"oneOf":[{"type":"number"},{"type":"null"}]},"depositamount":{"oneOf":[{"type":"number"},{"type":"null"}]},"deposituseamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"discountamount":{"oneOf":[{"type":"number"},{"type":"null"}]},"discountpercent":{"oneOf":[{"type":"number"},{"type":"null"}]},"discountuseamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notification":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showpaymentlink":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showbank":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"locked":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"writtenoff":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showpurchaseorder":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"purchaseorder":{"oneOf":[{"type":"string"},{"type":"null"}]},"installments":{"oneOf":[{"type":"number"},{"type":"null"}]},"showinstallments":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"settled":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"orderstatus":{"oneOf":[{"type":"string"},{"type":"null"}]},"message":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"settledaccountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"causeid":{"oneOf":[{"type":"string"},{"type":"null"}]},"causetype":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountpayment":{"oneOf":[{"type":"number"},{"type":"null"}]},"type":{"oneOf":[{"type":"number"},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"price":{"type":"number"},"quantity":{"type":"number"},"cost":{"oneOf":[{"type":"number"},{"type":"null"}]},"unit":{"oneOf":[{"type":"string"},{"type":"null"}]},"product":{"oneOf":[{"type":"string"},{"type":"null"}]},"variant":{"oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"type":"number"},"stocklocationid":{"oneOf":[{"type":"string"},{"type":"null"}]},"sort":{"oneOf":[{"type":"number"},{"type":"null"}]},"costcurrency":{"oneOf":[{"type":"string"},{"type":"null"}]},"salestaxes":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"referencenumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"recoverable":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"rate":{"oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"useamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"exclusive":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["name"],"additionalProperties":false}}},"required":["name","price","quantity","amount"],"additionalProperties":false}},"payments":{"type":"array","items":{"type":"object","properties":{"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"type":"number"},"date":{"oneOf":[{"type":"string"},{"type":"null"}]},"method":{"oneOf":[{"type":"string"},{"type":"null"}]},"payment":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"oneOf":[{"type":"number"},{"type":"null"}]},"transactionid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["amount"],"additionalProperties":false}}},"required":["token","items"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"client":{"oneOf":[{"type":"object","properties":{"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactname":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactemail":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]},"showdiscount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showshipping":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showdeposit":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"invoicenumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"date":{"oneOf":[{"type":"string"},{"type":"null"}]},"duedate":{"oneOf":[{"type":"string"},{"type":"null"}]},"quote":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"paymentnote":{"oneOf":[{"type":"string"},{"type":"null"}]},"channel":{"oneOf":[{"type":"string"},{"type":"null"}]},"shipping":{"oneOf":[{"type":"number"},{"type":"null"}]},"depositpercent":{"oneOf":[{"type":"number"},{"type":"null"}]},"depositamount":{"oneOf":[{"type":"number"},{"type":"null"}]},"deposituseamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"discountamount":{"oneOf":[{"type":"number"},{"type":"null"}]},"discountpercent":{"oneOf":[{"type":"number"},{"type":"null"}]},"discountuseamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notification":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showpaymentlink":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showbank":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"locked":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"writtenoff":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showpurchaseorder":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"purchaseorder":{"oneOf":[{"type":"string"},{"type":"null"}]},"installments":{"oneOf":[{"type":"number"},{"type":"null"}]},"showinstallments":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"settled":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"orderstatus":{"oneOf":[{"type":"string"},{"type":"null"}]},"message":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"settledaccountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"causeid":{"oneOf":[{"type":"string"},{"type":"null"}]},"causetype":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountpayment":{"oneOf":[{"type":"number"},{"type":"null"}]},"type":{"oneOf":[{"type":"number"},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"price":{"type":"number"},"quantity":{"type":"number"},"cost":{"oneOf":[{"type":"number"},{"type":"null"}]},"unit":{"oneOf":[{"type":"string"},{"type":"null"}]},"product":{"oneOf":[{"type":"string"},{"type":"null"}]},"variant":{"oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"type":"number"},"stocklocationid":{"oneOf":[{"type":"string"},{"type":"null"}]},"sort":{"oneOf":[{"type":"number"},{"type":"null"}]},"costcurrency":{"oneOf":[{"type":"string"},{"type":"null"}]},"salestaxes":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"referencenumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"recoverable":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"rate":{"oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"useamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"exclusive":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["name"],"additionalProperties":false}}},"required":["name","price","quantity","amount"],"additionalProperties":false}},"payments":{"type":"array","items":{"type":"object","properties":{"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"type":"number"},"date":{"oneOf":[{"type":"string"},{"type":"null"}]},"method":{"oneOf":[{"type":"string"},{"type":"null"}]},"payment":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"oneOf":[{"type":"number"},{"type":"null"}]},"transactionid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["amount"],"additionalProperties":false}}},"required":["token","items"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"client":{"oneOf":[{"type":"object","properties":{"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactname":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactemail":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]},"showdiscount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showshipping":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showdeposit":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"invoicenumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"date":{"oneOf":[{"type":"string"},{"type":"null"}]},"duedate":{"oneOf":[{"type":"string"},{"type":"null"}]},"quote":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"paymentnote":{"oneOf":[{"type":"string"},{"type":"null"}]},"channel":{"oneOf":[{"type":"string"},{"type":"null"}]},"shipping":{"oneOf":[{"type":"number"},{"type":"null"}]},"depositpercent":{"oneOf":[{"type":"number"},{"type":"null"}]},"depositamount":{"oneOf":[{"type":"number"},{"type":"null"}]},"deposituseamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"discountamount":{"oneOf":[{"type":"number"},{"type":"null"}]},"discountpercent":{"oneOf":[{"type":"number"},{"type":"null"}]},"discountuseamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notification":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showpaymentlink":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showbank":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"locked":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"writtenoff":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showpurchaseorder":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"purchaseorder":{"oneOf":[{"type":"string"},{"type":"null"}]},"installments":{"oneOf":[{"type":"number"},{"type":"null"}]},"showinstallments":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"settled":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"orderstatus":{"oneOf":[{"type":"string"},{"type":"null"}]},"message":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"settledaccountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"causeid":{"oneOf":[{"type":"string"},{"type":"null"}]},"causetype":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountpayment":{"oneOf":[{"type":"number"},{"type":"null"}]},"type":{"oneOf":[{"type":"number"},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"price":{"type":"number"},"quantity":{"type":"number"},"cost":{"oneOf":[{"type":"number"},{"type":"null"}]},"unit":{"oneOf":[{"type":"string"},{"type":"null"}]},"product":{"oneOf":[{"type":"string"},{"type":"null"}]},"variant":{"oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"type":"number"},"stocklocationid":{"oneOf":[{"type":"string"},{"type":"null"}]},"sort":{"oneOf":[{"type":"number"},{"type":"null"}]},"costcurrency":{"oneOf":[{"type":"string"},{"type":"null"}]},"salestaxes":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"referencenumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"recoverable":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"rate":{"oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"useamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"exclusive":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["name"],"additionalProperties":false}}},"required":["name","price","quantity","amount"],"additionalProperties":false}},"payments":{"type":"array","items":{"type":"object","properties":{"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"type":"number"},"date":{"oneOf":[{"type":"string"},{"type":"null"}]},"method":{"oneOf":[{"type":"string"},{"type":"null"}]},"payment":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"oneOf":[{"type":"number"},{"type":"null"}]},"transactionid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["amount"],"additionalProperties":false}}},"required":["token","items"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create a new invoice (or quote, proforma invoice, credit note, debit note) with items, taxes, discounts, deposits, and payments in one call","tags":["Manage invoices (quotes, proforma invoices, credit notes, debit notes)"]}},"/api/invoice/view/{uid}/{id}":{"get":{"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Preview invoice (or quote, proforma invoice, credit note, debit note)","tags":["Manage invoices (quotes, proforma invoices, credit notes, debit notes)"]}},"/api/invoice/accept/{uid}/{id}":{"get":{"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Accept invoice (or quote, proforma invoice, credit note, debit note)","tags":["Manage invoices (quotes, proforma invoices, credit notes, debit notes)"]}},"/api/invoice/sign-delivery/{uid}/{id}":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"},"signature":{"type":"string"},"surname":{"oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"date":{"oneOf":[{"type":"string"},{"type":"null"}]},"method":{"oneOf":[{"type":"string"},{"type":"null"}]},"images":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["name","email","phone","signature"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"},"signature":{"type":"string"},"surname":{"oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"date":{"oneOf":[{"type":"string"},{"type":"null"}]},"method":{"oneOf":[{"type":"string"},{"type":"null"}]},"images":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["name","email","phone","signature"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"},"signature":{"type":"string"},"surname":{"oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"date":{"oneOf":[{"type":"string"},{"type":"null"}]},"method":{"oneOf":[{"type":"string"},{"type":"null"}]},"images":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["name","email","phone","signature"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"},"signature":{"type":"string"},"surname":{"oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"date":{"oneOf":[{"type":"string"},{"type":"null"}]},"method":{"oneOf":[{"type":"string"},{"type":"null"}]},"images":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["name","email","phone","signature"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Record a proof-of-delivery signature on an invoice (public, unauthed)","tags":["Manage invoices (quotes, proforma invoices, credit notes, debit notes)"]}},"/api/invoice/online/{uid}/{id}":{"get":{"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Online invoice (or quote, proforma invoice, credit note, debit note)","tags":["Manage invoices (quotes, proforma invoices, credit notes, debit notes)"]}},"/api/invoice/send":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the document (invoice, quote, credit note, etc.) to email (required).","type":"string"},"email":{"description":"Override recipient address; defaults to the document contact's email on file.","oneOf":[{"type":"string"},{"type":"null"}]},"attachrebilled":{"description":"Attach the receipt of every expense rebilled on this document's lines. Off by default. Files that do not fit are sent as download links.","oneOf":[{"type":"boolean"},{"type":"null"}]},"attachpdf":{"description":"Attach the document's own PDF, drawn at send time from the saved document. Off when absent: stub-web sends true by default. If the PDF cannot be drawn, the email goes without it. The view-online link always stays.","oneOf":[{"type":"boolean"},{"type":"null"}]},"attachmentfileids":{"description":"Attach these files: a rebilled receipt's file id (or the expense id for a legacy receipt), or the id of any business file when the sender may read Files. A file in a locked folder never goes. With attachrebilled, adds to the rebilled receipts. At most 20.","oneOf":[{"type":"array","items":{"type":"string"},"maxItems":20},{"type":"null"}]},"message":{"description":"A note shown in the email above the document.","oneOf":[{"type":"string"},{"type":"null"}]},"sendcopy":{"description":"Send me a copy: BCC the signed-in user who sends this, and nobody else. Off by default. Only a signed-in person gets a copy; an API, agent or MCP token sends none.","oneOf":[{"type":"boolean"},{"type":"null"}]},"cc":{"description":"Extra addresses to CC on this send, shown to every recipient. Each entry may hold one address or several split by , or ;. At most 10 addresses.","oneOf":[{"type":"array","items":{"type":"string"},"maxItems":10},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the document (invoice, quote, credit note, etc.) to email (required).","type":"string"},"email":{"description":"Override recipient address; defaults to the document contact's email on file.","oneOf":[{"type":"string"},{"type":"null"}]},"attachrebilled":{"description":"Attach the receipt of every expense rebilled on this document's lines. Off by default. Files that do not fit are sent as download links.","oneOf":[{"type":"boolean"},{"type":"null"}]},"attachpdf":{"description":"Attach the document's own PDF, drawn at send time from the saved document. Off when absent: stub-web sends true by default. If the PDF cannot be drawn, the email goes without it. The view-online link always stays.","oneOf":[{"type":"boolean"},{"type":"null"}]},"attachmentfileids":{"description":"Attach these files: a rebilled receipt's file id (or the expense id for a legacy receipt), or the id of any business file when the sender may read Files. A file in a locked folder never goes. With attachrebilled, adds to the rebilled receipts. At most 20.","oneOf":[{"type":"array","items":{"type":"string"},"maxItems":20},{"type":"null"}]},"message":{"description":"A note shown in the email above the document.","oneOf":[{"type":"string"},{"type":"null"}]},"sendcopy":{"description":"Send me a copy: BCC the signed-in user who sends this, and nobody else. Off by default. Only a signed-in person gets a copy; an API, agent or MCP token sends none.","oneOf":[{"type":"boolean"},{"type":"null"}]},"cc":{"description":"Extra addresses to CC on this send, shown to every recipient. Each entry may hold one address or several split by , or ;. At most 10 addresses.","oneOf":[{"type":"array","items":{"type":"string"},"maxItems":10},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the document (invoice, quote, credit note, etc.) to email (required).","type":"string"},"email":{"description":"Override recipient address; defaults to the document contact's email on file.","oneOf":[{"type":"string"},{"type":"null"}]},"attachrebilled":{"description":"Attach the receipt of every expense rebilled on this document's lines. Off by default. Files that do not fit are sent as download links.","oneOf":[{"type":"boolean"},{"type":"null"}]},"attachpdf":{"description":"Attach the document's own PDF, drawn at send time from the saved document. Off when absent: stub-web sends true by default. If the PDF cannot be drawn, the email goes without it. The view-online link always stays.","oneOf":[{"type":"boolean"},{"type":"null"}]},"attachmentfileids":{"description":"Attach these files: a rebilled receipt's file id (or the expense id for a legacy receipt), or the id of any business file when the sender may read Files. A file in a locked folder never goes. With attachrebilled, adds to the rebilled receipts. At most 20.","oneOf":[{"type":"array","items":{"type":"string"},"maxItems":20},{"type":"null"}]},"message":{"description":"A note shown in the email above the document.","oneOf":[{"type":"string"},{"type":"null"}]},"sendcopy":{"description":"Send me a copy: BCC the signed-in user who sends this, and nobody else. Off by default. Only a signed-in person gets a copy; an API, agent or MCP token sends none.","oneOf":[{"type":"boolean"},{"type":"null"}]},"cc":{"description":"Extra addresses to CC on this send, shown to every recipient. Each entry may hold one address or several split by , or ;. At most 10 addresses.","oneOf":[{"type":"array","items":{"type":"string"},"maxItems":10},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the document (invoice, quote, credit note, etc.) to email (required).","type":"string"},"email":{"description":"Override recipient address; defaults to the document contact's email on file.","oneOf":[{"type":"string"},{"type":"null"}]},"attachrebilled":{"description":"Attach the receipt of every expense rebilled on this document's lines. Off by default. Files that do not fit are sent as download links.","oneOf":[{"type":"boolean"},{"type":"null"}]},"attachpdf":{"description":"Attach the document's own PDF, drawn at send time from the saved document. Off when absent: stub-web sends true by default. If the PDF cannot be drawn, the email goes without it. The view-online link always stays.","oneOf":[{"type":"boolean"},{"type":"null"}]},"attachmentfileids":{"description":"Attach these files: a rebilled receipt's file id (or the expense id for a legacy receipt), or the id of any business file when the sender may read Files. A file in a locked folder never goes. With attachrebilled, adds to the rebilled receipts. At most 20.","oneOf":[{"type":"array","items":{"type":"string"},"maxItems":20},{"type":"null"}]},"message":{"description":"A note shown in the email above the document.","oneOf":[{"type":"string"},{"type":"null"}]},"sendcopy":{"description":"Send me a copy: BCC the signed-in user who sends this, and nobody else. Off by default. Only a signed-in person gets a copy; an API, agent or MCP token sends none.","oneOf":[{"type":"boolean"},{"type":"null"}]},"cc":{"description":"Extra addresses to CC on this send, shown to every recipient. Each entry may hold one address or several split by , or ;. At most 10 addresses.","oneOf":[{"type":"array","items":{"type":"string"},"maxItems":10},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Email a document (invoice, quote, credit note, etc.) to its contact. Works on any document id. This actually sends the email — to flag a document as sent without emailing use mark_document_sent, and to log a payment against it use record_document_payment. Find the id yourself with list_documents (query by number or contact); never ask the user for an id. Its reply's destination is every address the email went to: say who received it from that, never a guess.","tags":["Manage invoices (quotes, proforma invoices, credit notes, debit notes)"]}},"/api/invoice/mark-as-sent":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Mark a document as sent without emailing it.","tags":["Manage invoices (quotes, proforma invoices, credit notes, debit notes)"]}},"/api/invoice/mark-notification-as-read":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Mark notifcation as read","tags":["Manage invoices (quotes, proforma invoices, credit notes, debit notes)"]}},"/api/invoice/update":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"client":{"oneOf":[{"type":"string"},{"type":"null"}]},"showdiscount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showshipping":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showdeposit":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"invoicenumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"date":{"oneOf":[{"type":"string"},{"type":"null"}]},"duedate":{"oneOf":[{"type":"string"},{"type":"null"}]},"quote":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"paymentnote":{"oneOf":[{"type":"string"},{"type":"null"}]},"channel":{"oneOf":[{"type":"string"},{"type":"null"}]},"created":{"oneOf":[{"type":"string"},{"type":"null"}]},"quotesent":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"quotesentdate":{"oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"sent":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"shipping":{"oneOf":[{"type":"number"},{"type":"null"}]},"depositpercent":{"oneOf":[{"type":"number"},{"type":"null"}]},"depositamount":{"oneOf":[{"type":"number"},{"type":"null"}]},"deposituseamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"discountamount":{"oneOf":[{"type":"number"},{"type":"null"}]},"discountpercent":{"oneOf":[{"type":"number"},{"type":"null"}]},"accepted":{"anyOf":[{"oneOf":[{"type":"boolean"},{"type":"null"}]},{"type":"string","enum":["$delete"]}]},"accepteddate":{"oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"discountuseamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notification":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showpaymentlink":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"orderstatus":{"oneOf":[{"type":"string"},{"type":"null"}]},"showbank":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"invoicebankid":{"oneOf":[{"type":"string"},{"type":"null"}]},"locked":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"writtenoff":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"writtenoffdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"showpurchaseorder":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"purchaseorder":{"oneOf":[{"type":"string"},{"type":"null"}]},"installments":{"oneOf":[{"type":"number"},{"type":"null"}]},"showinstallments":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"settled":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"message":{"oneOf":[{"type":"string"},{"type":"null"}]},"type":{"oneOf":[{"type":"number"},{"type":"null"}]},"responseid":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"settledaccountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"causeid":{"oneOf":[{"type":"string"},{"type":"null"}]},"causetype":{"oneOf":[{"type":"string"},{"type":"null"}]},"settleddate":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountpayment":{"oneOf":[{"type":"number"},{"type":"null"}]},"design":{"description":"Id of one of the business's own document designs to print this document with. \"$delete\" clears it back to the business default; null or omitted leaves it unchanged. An unknown, archived or foreign id is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"designpinnedat":{"description":"Pins the document to its design as it stood at this ISO instant, zone included (2026-11-27T09:00:00Z). \"$delete\" unpins. A design change unpins unless the same save pins again.","oneOf":[{"type":"string"},{"type":"null"}]},"blocks":{"description":"The document's own rich-text blocks: a JSON object {blockid: richtext}, or its JSON text, at most 64 KB. \"$delete\" clears them.","oneOf":[{"anyOf":[{"type":"string"},{"type":"object"}]},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"client":{"oneOf":[{"type":"string"},{"type":"null"}]},"showdiscount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showshipping":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showdeposit":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"invoicenumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"date":{"oneOf":[{"type":"string"},{"type":"null"}]},"duedate":{"oneOf":[{"type":"string"},{"type":"null"}]},"quote":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"paymentnote":{"oneOf":[{"type":"string"},{"type":"null"}]},"channel":{"oneOf":[{"type":"string"},{"type":"null"}]},"created":{"oneOf":[{"type":"string"},{"type":"null"}]},"quotesent":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"quotesentdate":{"oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"sent":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"shipping":{"oneOf":[{"type":"number"},{"type":"null"}]},"depositpercent":{"oneOf":[{"type":"number"},{"type":"null"}]},"depositamount":{"oneOf":[{"type":"number"},{"type":"null"}]},"deposituseamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"discountamount":{"oneOf":[{"type":"number"},{"type":"null"}]},"discountpercent":{"oneOf":[{"type":"number"},{"type":"null"}]},"accepted":{"anyOf":[{"oneOf":[{"type":"boolean"},{"type":"null"}]},{"type":"string","enum":["$delete"]}]},"accepteddate":{"oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"discountuseamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notification":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showpaymentlink":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"orderstatus":{"oneOf":[{"type":"string"},{"type":"null"}]},"showbank":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"invoicebankid":{"oneOf":[{"type":"string"},{"type":"null"}]},"locked":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"writtenoff":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"writtenoffdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"showpurchaseorder":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"purchaseorder":{"oneOf":[{"type":"string"},{"type":"null"}]},"installments":{"oneOf":[{"type":"number"},{"type":"null"}]},"showinstallments":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"settled":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"message":{"oneOf":[{"type":"string"},{"type":"null"}]},"type":{"oneOf":[{"type":"number"},{"type":"null"}]},"responseid":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"settledaccountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"causeid":{"oneOf":[{"type":"string"},{"type":"null"}]},"causetype":{"oneOf":[{"type":"string"},{"type":"null"}]},"settleddate":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountpayment":{"oneOf":[{"type":"number"},{"type":"null"}]},"design":{"description":"Id of one of the business's own document designs to print this document with. \"$delete\" clears it back to the business default; null or omitted leaves it unchanged. An unknown, archived or foreign id is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"designpinnedat":{"description":"Pins the document to its design as it stood at this ISO instant, zone included (2026-11-27T09:00:00Z). \"$delete\" unpins. A design change unpins unless the same save pins again.","oneOf":[{"type":"string"},{"type":"null"}]},"blocks":{"description":"The document's own rich-text blocks: a JSON object {blockid: richtext}, or its JSON text, at most 64 KB. \"$delete\" clears them.","oneOf":[{"anyOf":[{"type":"string"},{"type":"object"}]},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"client":{"oneOf":[{"type":"string"},{"type":"null"}]},"showdiscount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showshipping":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showdeposit":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"invoicenumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"date":{"oneOf":[{"type":"string"},{"type":"null"}]},"duedate":{"oneOf":[{"type":"string"},{"type":"null"}]},"quote":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"paymentnote":{"oneOf":[{"type":"string"},{"type":"null"}]},"channel":{"oneOf":[{"type":"string"},{"type":"null"}]},"created":{"oneOf":[{"type":"string"},{"type":"null"}]},"quotesent":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"quotesentdate":{"oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"sent":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"shipping":{"oneOf":[{"type":"number"},{"type":"null"}]},"depositpercent":{"oneOf":[{"type":"number"},{"type":"null"}]},"depositamount":{"oneOf":[{"type":"number"},{"type":"null"}]},"deposituseamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"discountamount":{"oneOf":[{"type":"number"},{"type":"null"}]},"discountpercent":{"oneOf":[{"type":"number"},{"type":"null"}]},"accepted":{"anyOf":[{"oneOf":[{"type":"boolean"},{"type":"null"}]},{"type":"string","enum":["$delete"]}]},"accepteddate":{"oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"discountuseamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notification":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showpaymentlink":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"orderstatus":{"oneOf":[{"type":"string"},{"type":"null"}]},"showbank":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"invoicebankid":{"oneOf":[{"type":"string"},{"type":"null"}]},"locked":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"writtenoff":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"writtenoffdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"showpurchaseorder":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"purchaseorder":{"oneOf":[{"type":"string"},{"type":"null"}]},"installments":{"oneOf":[{"type":"number"},{"type":"null"}]},"showinstallments":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"settled":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"message":{"oneOf":[{"type":"string"},{"type":"null"}]},"type":{"oneOf":[{"type":"number"},{"type":"null"}]},"responseid":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"settledaccountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"causeid":{"oneOf":[{"type":"string"},{"type":"null"}]},"causetype":{"oneOf":[{"type":"string"},{"type":"null"}]},"settleddate":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountpayment":{"oneOf":[{"type":"number"},{"type":"null"}]},"design":{"description":"Id of one of the business's own document designs to print this document with. \"$delete\" clears it back to the business default; null or omitted leaves it unchanged. An unknown, archived or foreign id is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"designpinnedat":{"description":"Pins the document to its design as it stood at this ISO instant, zone included (2026-11-27T09:00:00Z). \"$delete\" unpins. A design change unpins unless the same save pins again.","oneOf":[{"type":"string"},{"type":"null"}]},"blocks":{"description":"The document's own rich-text blocks: a JSON object {blockid: richtext}, or its JSON text, at most 64 KB. \"$delete\" clears them.","oneOf":[{"anyOf":[{"type":"string"},{"type":"object"}]},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"client":{"oneOf":[{"type":"string"},{"type":"null"}]},"showdiscount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showshipping":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showdeposit":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"invoicenumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"date":{"oneOf":[{"type":"string"},{"type":"null"}]},"duedate":{"oneOf":[{"type":"string"},{"type":"null"}]},"quote":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"paymentnote":{"oneOf":[{"type":"string"},{"type":"null"}]},"channel":{"oneOf":[{"type":"string"},{"type":"null"}]},"created":{"oneOf":[{"type":"string"},{"type":"null"}]},"quotesent":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"quotesentdate":{"oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"sent":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"shipping":{"oneOf":[{"type":"number"},{"type":"null"}]},"depositpercent":{"oneOf":[{"type":"number"},{"type":"null"}]},"depositamount":{"oneOf":[{"type":"number"},{"type":"null"}]},"deposituseamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"discountamount":{"oneOf":[{"type":"number"},{"type":"null"}]},"discountpercent":{"oneOf":[{"type":"number"},{"type":"null"}]},"accepted":{"anyOf":[{"oneOf":[{"type":"boolean"},{"type":"null"}]},{"type":"string","enum":["$delete"]}]},"accepteddate":{"oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"discountuseamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notification":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showpaymentlink":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"orderstatus":{"oneOf":[{"type":"string"},{"type":"null"}]},"showbank":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"invoicebankid":{"oneOf":[{"type":"string"},{"type":"null"}]},"locked":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"writtenoff":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"writtenoffdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"showpurchaseorder":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"purchaseorder":{"oneOf":[{"type":"string"},{"type":"null"}]},"installments":{"oneOf":[{"type":"number"},{"type":"null"}]},"showinstallments":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"settled":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"message":{"oneOf":[{"type":"string"},{"type":"null"}]},"type":{"oneOf":[{"type":"number"},{"type":"null"}]},"responseid":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"settledaccountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"causeid":{"oneOf":[{"type":"string"},{"type":"null"}]},"causetype":{"oneOf":[{"type":"string"},{"type":"null"}]},"settleddate":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountpayment":{"oneOf":[{"type":"number"},{"type":"null"}]},"design":{"description":"Id of one of the business's own document designs to print this document with. \"$delete\" clears it back to the business default; null or omitted leaves it unchanged. An unknown, archived or foreign id is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"designpinnedat":{"description":"Pins the document to its design as it stood at this ISO instant, zone included (2026-11-27T09:00:00Z). \"$delete\" unpins. A design change unpins unless the same save pins again.","oneOf":[{"type":"string"},{"type":"null"}]},"blocks":{"description":"The document's own rich-text blocks: a JSON object {blockid: richtext}, or its JSON text, at most 64 KB. \"$delete\" clears them.","oneOf":[{"anyOf":[{"type":"string"},{"type":"object"}]},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"DEPRECATED — use save_document instead. Legacy quinvoice update. Update an invoice/quote/credit-note/etc by id. Returns the updated entity. Retained as a REST endpoint; excluded from the MCP surface.","tags":["Manage invoices (quotes, proforma invoices, credit notes, debit notes)"]}},"/api/invoice/add-payment":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Document id to record the payment against — a money-in document (invoice / recurring invoice / quote / debit note) or a money-out document (bill / purchase order / GRN / credit note). On update, the payment id.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Label for this payment (e.g. \"Deposit\", \"Final payment\").","oneOf":[{"type":"string"},{"type":"null"}]},"date":{"description":"Date the payment was received (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"category":{"description":"Income category for the payment; defaults to Sales when omitted.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Payment amount in the payment's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"payment":{"description":"Bank/ledger account id the money moved through — received into (money-in) or paid from (money-out) (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"method":{"description":"Payment method as free text (e.g. \"cash\", \"card\", \"eft\") — no fixed set.","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes on the payment.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Manual FX rate to the business base currency; omit to use the stored/auto rate.","oneOf":[{"type":"number"},{"type":"null"}]},"responseid":{"description":"Internal: correlation id used to return the updated entity to the frontend; omit.","oneOf":[{"type":"string"},{"type":"null"}]},"transactionid":{"description":"Bank transaction id that paid this document. When the line already carries its own unallocated income of the same amount and currency, that income is linked to the document instead of recording a second one.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Document id to record the payment against — a money-in document (invoice / recurring invoice / quote / debit note) or a money-out document (bill / purchase order / GRN / credit note). On update, the payment id.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Label for this payment (e.g. \"Deposit\", \"Final payment\").","oneOf":[{"type":"string"},{"type":"null"}]},"date":{"description":"Date the payment was received (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"category":{"description":"Income category for the payment; defaults to Sales when omitted.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Payment amount in the payment's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"payment":{"description":"Bank/ledger account id the money moved through — received into (money-in) or paid from (money-out) (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"method":{"description":"Payment method as free text (e.g. \"cash\", \"card\", \"eft\") — no fixed set.","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes on the payment.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Manual FX rate to the business base currency; omit to use the stored/auto rate.","oneOf":[{"type":"number"},{"type":"null"}]},"responseid":{"description":"Internal: correlation id used to return the updated entity to the frontend; omit.","oneOf":[{"type":"string"},{"type":"null"}]},"transactionid":{"description":"Bank transaction id that paid this document. When the line already carries its own unallocated income of the same amount and currency, that income is linked to the document instead of recording a second one.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Document id to record the payment against — a money-in document (invoice / recurring invoice / quote / debit note) or a money-out document (bill / purchase order / GRN / credit note). On update, the payment id.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Label for this payment (e.g. \"Deposit\", \"Final payment\").","oneOf":[{"type":"string"},{"type":"null"}]},"date":{"description":"Date the payment was received (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"category":{"description":"Income category for the payment; defaults to Sales when omitted.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Payment amount in the payment's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"payment":{"description":"Bank/ledger account id the money moved through — received into (money-in) or paid from (money-out) (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"method":{"description":"Payment method as free text (e.g. \"cash\", \"card\", \"eft\") — no fixed set.","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes on the payment.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Manual FX rate to the business base currency; omit to use the stored/auto rate.","oneOf":[{"type":"number"},{"type":"null"}]},"responseid":{"description":"Internal: correlation id used to return the updated entity to the frontend; omit.","oneOf":[{"type":"string"},{"type":"null"}]},"transactionid":{"description":"Bank transaction id that paid this document. When the line already carries its own unallocated income of the same amount and currency, that income is linked to the document instead of recording a second one.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Document id to record the payment against — a money-in document (invoice / recurring invoice / quote / debit note) or a money-out document (bill / purchase order / GRN / credit note). On update, the payment id.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Label for this payment (e.g. \"Deposit\", \"Final payment\").","oneOf":[{"type":"string"},{"type":"null"}]},"date":{"description":"Date the payment was received (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"category":{"description":"Income category for the payment; defaults to Sales when omitted.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Payment amount in the payment's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"payment":{"description":"Bank/ledger account id the money moved through — received into (money-in) or paid from (money-out) (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"method":{"description":"Payment method as free text (e.g. \"cash\", \"card\", \"eft\") — no fixed set.","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes on the payment.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Manual FX rate to the business base currency; omit to use the stored/auto rate.","oneOf":[{"type":"number"},{"type":"null"}]},"responseid":{"description":"Internal: correlation id used to return the updated entity to the frontend; omit.","oneOf":[{"type":"string"},{"type":"null"}]},"transactionid":{"description":"Bank transaction id that paid this document. When the line already carries its own unallocated income of the same amount and currency, that income is linked to the document instead of recording a second one.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Record a NEW payment against ONE document, in either direction; for several bills at once use settle_bills, and to correct a payment already recorded use update_document_payment. A money-in document (invoice, recurring invoice, quote, debit note) records the payment as an income; a money-out document (bill, purchase order, GRN, credit note) is settled by recording an expense whose accountid is the document's id — the tool dispatches on the document's direction, so pass the document id and the payment details either way. Find the id yourself with list_documents (query by number or contact); never ask the user for an id. Record only what was actually paid, never an amount made up to clear a gap: if the payment is already there and only an FX or rounding gap is left ('settle it', 'it's FX'), use save_document with settled true.","tags":["Manage invoices (quotes, proforma invoices, credit notes, debit notes)"]}},"/api/invoice/update-payment":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Document id to record the payment against — a money-in document (invoice / recurring invoice / quote / debit note) or a money-out document (bill / purchase order / GRN / credit note). On update, the payment id.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Label for this payment (e.g. \"Deposit\", \"Final payment\").","oneOf":[{"type":"string"},{"type":"null"}]},"date":{"description":"Date the payment was received (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"category":{"description":"Income category for the payment; defaults to Sales when omitted.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Payment amount in the payment's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"payment":{"description":"Bank/ledger account id the money moved through — received into (money-in) or paid from (money-out) (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"method":{"description":"Payment method as free text (e.g. \"cash\", \"card\", \"eft\") — no fixed set.","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes on the payment.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Manual FX rate to the business base currency; omit to use the stored/auto rate.","oneOf":[{"type":"number"},{"type":"null"}]},"responseid":{"description":"Internal: correlation id used to return the updated entity to the frontend; omit.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Document id to record the payment against — a money-in document (invoice / recurring invoice / quote / debit note) or a money-out document (bill / purchase order / GRN / credit note). On update, the payment id.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Label for this payment (e.g. \"Deposit\", \"Final payment\").","oneOf":[{"type":"string"},{"type":"null"}]},"date":{"description":"Date the payment was received (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"category":{"description":"Income category for the payment; defaults to Sales when omitted.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Payment amount in the payment's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"payment":{"description":"Bank/ledger account id the money moved through — received into (money-in) or paid from (money-out) (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"method":{"description":"Payment method as free text (e.g. \"cash\", \"card\", \"eft\") — no fixed set.","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes on the payment.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Manual FX rate to the business base currency; omit to use the stored/auto rate.","oneOf":[{"type":"number"},{"type":"null"}]},"responseid":{"description":"Internal: correlation id used to return the updated entity to the frontend; omit.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Document id to record the payment against — a money-in document (invoice / recurring invoice / quote / debit note) or a money-out document (bill / purchase order / GRN / credit note). On update, the payment id.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Label for this payment (e.g. \"Deposit\", \"Final payment\").","oneOf":[{"type":"string"},{"type":"null"}]},"date":{"description":"Date the payment was received (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"category":{"description":"Income category for the payment; defaults to Sales when omitted.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Payment amount in the payment's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"payment":{"description":"Bank/ledger account id the money moved through — received into (money-in) or paid from (money-out) (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"method":{"description":"Payment method as free text (e.g. \"cash\", \"card\", \"eft\") — no fixed set.","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes on the payment.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Manual FX rate to the business base currency; omit to use the stored/auto rate.","oneOf":[{"type":"number"},{"type":"null"}]},"responseid":{"description":"Internal: correlation id used to return the updated entity to the frontend; omit.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Document id to record the payment against — a money-in document (invoice / recurring invoice / quote / debit note) or a money-out document (bill / purchase order / GRN / credit note). On update, the payment id.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Label for this payment (e.g. \"Deposit\", \"Final payment\").","oneOf":[{"type":"string"},{"type":"null"}]},"date":{"description":"Date the payment was received (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"category":{"description":"Income category for the payment; defaults to Sales when omitted.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Payment amount in the payment's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"payment":{"description":"Bank/ledger account id the money moved through — received into (money-in) or paid from (money-out) (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"method":{"description":"Payment method as free text (e.g. \"cash\", \"card\", \"eft\") — no fixed set.","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes on the payment.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Manual FX rate to the business base currency; omit to use the stored/auto rate.","oneOf":[{"type":"number"},{"type":"null"}]},"responseid":{"description":"Internal: correlation id used to return the updated entity to the frontend; omit.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Correct a payment ALREADY recorded against a document, identified by the payment id (not the document id); to record a new payment, use record_document_payment. Changes its amount, date or account on an invoice, quote, credit note or debit note. Never edit a correct payment to hide an FX or rounding gap; settle the document with save_document settled true instead.","tags":["Manage invoices (quotes, proforma invoices, credit notes, debit notes)"]}},"/api/invoice/delete-payment":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"delete payment from invoice (or quote, proforma invoice, credit note, debit note)","tags":["Manage invoices (quotes, proforma invoices, credit notes, debit notes)"]}},"/api/invoice/add-item":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Line item id. Required on update_document_item; omit on add_document_line.","oneOf":[{"type":"string"},{"type":"null"}]},"quinvoice":{"description":"Id of the parent document (invoice, quote, bill, etc.) this line belongs to.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Line item name: the title the document shows for the line. Give every new line one; put any extra detail in :description. A new line sent with only a description takes it as its name.","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"Line item description.","oneOf":[{"type":"string"},{"type":"null"}]},"price":{"description":"Unit price (per-unit selling price) in the document currency.","oneOf":[{"type":"number"},{"type":"null"}]},"sort":{"description":"Display order of the line within the document (ascending).","oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"description":"Number of units. Accepts a number or a numeric string.","oneOf":[{"anyOf":[{"type":"number"},{}]},{"type":"null"}]},"cost":{"description":"Unit cost (for margin / cost-of-sales), in :costcurrency.","oneOf":[{"type":"number"},{"type":"null"}]},"unit":{"description":"Unit label for the quantity (e.g. \"hours\", \"kg\").","oneOf":[{"type":"string"},{"type":"null"}]},"product":{"description":"Id of a catalog product to link this line to.","oneOf":[{"type":"string"},{"type":"null"}]},"variant":{"description":"Id of a catalog product variant to link this line to.","oneOf":[{"type":"string"},{"type":"null"}]},"stocklocationid":{"description":"Stock location this line moves stock at; one of your active locations. Omit for the variant or product default; \"$delete\" re-stamps that default.","oneOf":[{"type":"string"},{"type":"null"}]},"expense":{"description":"Pass \"$delete\" to unlink the expense this line recovers; the line keeps its name, account and amount. Rebilling is add-only, so any other value is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Line total (unit price × quantity), usually derived from :price × :quantity. Accepts a number or a numeric string.","oneOf":[{"anyOf":[{"type":"number"},{}]},{"type":"null"}]},"costcurrency":{"description":"ISO 4217 currency of :cost, when it differs from the document currency.","oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"Per-line chart-of-accounts / expense-category id; bills split cost by category at accrual (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"baseupdatedat":{"description":"Optimistic-concurrency token: the line's last-known updatedat (epoch number or ISO string). A stale value is rejected; omit to skip the check.","oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"responseid":{"description":"Internal: correlation id used to return the updated entity to the frontend; omit.","oneOf":[{"type":"string"},{"type":"null"}]},"expenseid":{"description":"Recover this expense's cost on a sales invoice, order or pro-forma (quinvoice or contract id). The expense is copied onto the line once: its name, its category account (the line credits that account, not Sales; an uncategorised expense books to the document's income account, Sales by default) and its amount. A VAT-registered business bills the net amount plus its own output VAT; otherwise the gross amount, untaxed. Later edits to the expense do not change the line. Recovering an expense that is already on a live document is allowed: the response's billedon lists the live documents that already recovered it before this add (this document too, when it is already on another of its lines), so the caller can warn.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Line item id. Required on update_document_item; omit on add_document_line.","oneOf":[{"type":"string"},{"type":"null"}]},"quinvoice":{"description":"Id of the parent document (invoice, quote, bill, etc.) this line belongs to.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Line item name: the title the document shows for the line. Give every new line one; put any extra detail in :description. A new line sent with only a description takes it as its name.","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"Line item description.","oneOf":[{"type":"string"},{"type":"null"}]},"price":{"description":"Unit price (per-unit selling price) in the document currency.","oneOf":[{"type":"number"},{"type":"null"}]},"sort":{"description":"Display order of the line within the document (ascending).","oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"description":"Number of units. Accepts a number or a numeric string.","oneOf":[{"anyOf":[{"type":"number"},{}]},{"type":"null"}]},"cost":{"description":"Unit cost (for margin / cost-of-sales), in :costcurrency.","oneOf":[{"type":"number"},{"type":"null"}]},"unit":{"description":"Unit label for the quantity (e.g. \"hours\", \"kg\").","oneOf":[{"type":"string"},{"type":"null"}]},"product":{"description":"Id of a catalog product to link this line to.","oneOf":[{"type":"string"},{"type":"null"}]},"variant":{"description":"Id of a catalog product variant to link this line to.","oneOf":[{"type":"string"},{"type":"null"}]},"stocklocationid":{"description":"Stock location this line moves stock at; one of your active locations. Omit for the variant or product default; \"$delete\" re-stamps that default.","oneOf":[{"type":"string"},{"type":"null"}]},"expense":{"description":"Pass \"$delete\" to unlink the expense this line recovers; the line keeps its name, account and amount. Rebilling is add-only, so any other value is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Line total (unit price × quantity), usually derived from :price × :quantity. Accepts a number or a numeric string.","oneOf":[{"anyOf":[{"type":"number"},{}]},{"type":"null"}]},"costcurrency":{"description":"ISO 4217 currency of :cost, when it differs from the document currency.","oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"Per-line chart-of-accounts / expense-category id; bills split cost by category at accrual (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"baseupdatedat":{"description":"Optimistic-concurrency token: the line's last-known updatedat (epoch number or ISO string). A stale value is rejected; omit to skip the check.","oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"responseid":{"description":"Internal: correlation id used to return the updated entity to the frontend; omit.","oneOf":[{"type":"string"},{"type":"null"}]},"expenseid":{"description":"Recover this expense's cost on a sales invoice, order or pro-forma (quinvoice or contract id). The expense is copied onto the line once: its name, its category account (the line credits that account, not Sales; an uncategorised expense books to the document's income account, Sales by default) and its amount. A VAT-registered business bills the net amount plus its own output VAT; otherwise the gross amount, untaxed. Later edits to the expense do not change the line. Recovering an expense that is already on a live document is allowed: the response's billedon lists the live documents that already recovered it before this add (this document too, when it is already on another of its lines), so the caller can warn.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Line item id. Required on update_document_item; omit on add_document_line.","oneOf":[{"type":"string"},{"type":"null"}]},"quinvoice":{"description":"Id of the parent document (invoice, quote, bill, etc.) this line belongs to.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Line item name: the title the document shows for the line. Give every new line one; put any extra detail in :description. A new line sent with only a description takes it as its name.","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"Line item description.","oneOf":[{"type":"string"},{"type":"null"}]},"price":{"description":"Unit price (per-unit selling price) in the document currency.","oneOf":[{"type":"number"},{"type":"null"}]},"sort":{"description":"Display order of the line within the document (ascending).","oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"description":"Number of units. Accepts a number or a numeric string.","oneOf":[{"anyOf":[{"type":"number"},{}]},{"type":"null"}]},"cost":{"description":"Unit cost (for margin / cost-of-sales), in :costcurrency.","oneOf":[{"type":"number"},{"type":"null"}]},"unit":{"description":"Unit label for the quantity (e.g. \"hours\", \"kg\").","oneOf":[{"type":"string"},{"type":"null"}]},"product":{"description":"Id of a catalog product to link this line to.","oneOf":[{"type":"string"},{"type":"null"}]},"variant":{"description":"Id of a catalog product variant to link this line to.","oneOf":[{"type":"string"},{"type":"null"}]},"stocklocationid":{"description":"Stock location this line moves stock at; one of your active locations. Omit for the variant or product default; \"$delete\" re-stamps that default.","oneOf":[{"type":"string"},{"type":"null"}]},"expense":{"description":"Pass \"$delete\" to unlink the expense this line recovers; the line keeps its name, account and amount. Rebilling is add-only, so any other value is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Line total (unit price × quantity), usually derived from :price × :quantity. Accepts a number or a numeric string.","oneOf":[{"anyOf":[{"type":"number"},{}]},{"type":"null"}]},"costcurrency":{"description":"ISO 4217 currency of :cost, when it differs from the document currency.","oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"Per-line chart-of-accounts / expense-category id; bills split cost by category at accrual (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"baseupdatedat":{"description":"Optimistic-concurrency token: the line's last-known updatedat (epoch number or ISO string). A stale value is rejected; omit to skip the check.","oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"responseid":{"description":"Internal: correlation id used to return the updated entity to the frontend; omit.","oneOf":[{"type":"string"},{"type":"null"}]},"expenseid":{"description":"Recover this expense's cost on a sales invoice, order or pro-forma (quinvoice or contract id). The expense is copied onto the line once: its name, its category account (the line credits that account, not Sales; an uncategorised expense books to the document's income account, Sales by default) and its amount. A VAT-registered business bills the net amount plus its own output VAT; otherwise the gross amount, untaxed. Later edits to the expense do not change the line. Recovering an expense that is already on a live document is allowed: the response's billedon lists the live documents that already recovered it before this add (this document too, when it is already on another of its lines), so the caller can warn.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Line item id. Required on update_document_item; omit on add_document_line.","oneOf":[{"type":"string"},{"type":"null"}]},"quinvoice":{"description":"Id of the parent document (invoice, quote, bill, etc.) this line belongs to.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Line item name: the title the document shows for the line. Give every new line one; put any extra detail in :description. A new line sent with only a description takes it as its name.","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"Line item description.","oneOf":[{"type":"string"},{"type":"null"}]},"price":{"description":"Unit price (per-unit selling price) in the document currency.","oneOf":[{"type":"number"},{"type":"null"}]},"sort":{"description":"Display order of the line within the document (ascending).","oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"description":"Number of units. Accepts a number or a numeric string.","oneOf":[{"anyOf":[{"type":"number"},{}]},{"type":"null"}]},"cost":{"description":"Unit cost (for margin / cost-of-sales), in :costcurrency.","oneOf":[{"type":"number"},{"type":"null"}]},"unit":{"description":"Unit label for the quantity (e.g. \"hours\", \"kg\").","oneOf":[{"type":"string"},{"type":"null"}]},"product":{"description":"Id of a catalog product to link this line to.","oneOf":[{"type":"string"},{"type":"null"}]},"variant":{"description":"Id of a catalog product variant to link this line to.","oneOf":[{"type":"string"},{"type":"null"}]},"stocklocationid":{"description":"Stock location this line moves stock at; one of your active locations. Omit for the variant or product default; \"$delete\" re-stamps that default.","oneOf":[{"type":"string"},{"type":"null"}]},"expense":{"description":"Pass \"$delete\" to unlink the expense this line recovers; the line keeps its name, account and amount. Rebilling is add-only, so any other value is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Line total (unit price × quantity), usually derived from :price × :quantity. Accepts a number or a numeric string.","oneOf":[{"anyOf":[{"type":"number"},{}]},{"type":"null"}]},"costcurrency":{"description":"ISO 4217 currency of :cost, when it differs from the document currency.","oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"Per-line chart-of-accounts / expense-category id; bills split cost by category at accrual (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"baseupdatedat":{"description":"Optimistic-concurrency token: the line's last-known updatedat (epoch number or ISO string). A stale value is rejected; omit to skip the check.","oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"responseid":{"description":"Internal: correlation id used to return the updated entity to the frontend; omit.","oneOf":[{"type":"string"},{"type":"null"}]},"expenseid":{"description":"Recover this expense's cost on a sales invoice, order or pro-forma (quinvoice or contract id). The expense is copied onto the line once: its name, its category account (the line credits that account, not Sales; an uncategorised expense books to the document's income account, Sales by default) and its amount. A VAT-registered business bills the net amount plus its own output VAT; otherwise the gross amount, untaxed. Later edits to the expense do not change the line. Recovering an expense that is already on a live document is allowed: the response's billedon lists the live documents that already recovered it before this add (this document too, when it is already on another of its lines), so the caller can warn.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Add ONE new line to an EXISTING document (invoice, quote, bill and so on); to create the document itself use save_document, and to change a line already on it use update_document_item.","tags":["Manage invoices (quotes, proforma invoices, credit notes, debit notes)"]}},"/api/invoice/update-item":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Line item id. Required on update_document_item; omit on add_document_line.","oneOf":[{"type":"string"},{"type":"null"}]},"quinvoice":{"description":"Id of the parent document (invoice, quote, bill, etc.) this line belongs to.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Line item name: the title the document shows for the line. Give every new line one; put any extra detail in :description. A new line sent with only a description takes it as its name.","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"Line item description.","oneOf":[{"type":"string"},{"type":"null"}]},"price":{"description":"Unit price (per-unit selling price) in the document currency.","oneOf":[{"type":"number"},{"type":"null"}]},"sort":{"description":"Display order of the line within the document (ascending).","oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"description":"Number of units. Accepts a number or a numeric string.","oneOf":[{"anyOf":[{"type":"number"},{}]},{"type":"null"}]},"cost":{"description":"Unit cost (for margin / cost-of-sales), in :costcurrency.","oneOf":[{"type":"number"},{"type":"null"}]},"unit":{"description":"Unit label for the quantity (e.g. \"hours\", \"kg\").","oneOf":[{"type":"string"},{"type":"null"}]},"product":{"description":"Id of a catalog product to link this line to.","oneOf":[{"type":"string"},{"type":"null"}]},"variant":{"description":"Id of a catalog product variant to link this line to.","oneOf":[{"type":"string"},{"type":"null"}]},"stocklocationid":{"description":"Stock location this line moves stock at; one of your active locations. Omit for the variant or product default; \"$delete\" re-stamps that default.","oneOf":[{"type":"string"},{"type":"null"}]},"expense":{"description":"Pass \"$delete\" to unlink the expense this line recovers; the line keeps its name, account and amount. Rebilling is add-only, so any other value is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Line total (unit price × quantity), usually derived from :price × :quantity. Accepts a number or a numeric string.","oneOf":[{"anyOf":[{"type":"number"},{}]},{"type":"null"}]},"costcurrency":{"description":"ISO 4217 currency of :cost, when it differs from the document currency.","oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"Per-line chart-of-accounts / expense-category id; bills split cost by category at accrual (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"baseupdatedat":{"description":"Optimistic-concurrency token: the line's last-known updatedat (epoch number or ISO string). A stale value is rejected; omit to skip the check.","oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"responseid":{"description":"Internal: correlation id used to return the updated entity to the frontend; omit.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Line item id. Required on update_document_item; omit on add_document_line.","oneOf":[{"type":"string"},{"type":"null"}]},"quinvoice":{"description":"Id of the parent document (invoice, quote, bill, etc.) this line belongs to.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Line item name: the title the document shows for the line. Give every new line one; put any extra detail in :description. A new line sent with only a description takes it as its name.","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"Line item description.","oneOf":[{"type":"string"},{"type":"null"}]},"price":{"description":"Unit price (per-unit selling price) in the document currency.","oneOf":[{"type":"number"},{"type":"null"}]},"sort":{"description":"Display order of the line within the document (ascending).","oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"description":"Number of units. Accepts a number or a numeric string.","oneOf":[{"anyOf":[{"type":"number"},{}]},{"type":"null"}]},"cost":{"description":"Unit cost (for margin / cost-of-sales), in :costcurrency.","oneOf":[{"type":"number"},{"type":"null"}]},"unit":{"description":"Unit label for the quantity (e.g. \"hours\", \"kg\").","oneOf":[{"type":"string"},{"type":"null"}]},"product":{"description":"Id of a catalog product to link this line to.","oneOf":[{"type":"string"},{"type":"null"}]},"variant":{"description":"Id of a catalog product variant to link this line to.","oneOf":[{"type":"string"},{"type":"null"}]},"stocklocationid":{"description":"Stock location this line moves stock at; one of your active locations. Omit for the variant or product default; \"$delete\" re-stamps that default.","oneOf":[{"type":"string"},{"type":"null"}]},"expense":{"description":"Pass \"$delete\" to unlink the expense this line recovers; the line keeps its name, account and amount. Rebilling is add-only, so any other value is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Line total (unit price × quantity), usually derived from :price × :quantity. Accepts a number or a numeric string.","oneOf":[{"anyOf":[{"type":"number"},{}]},{"type":"null"}]},"costcurrency":{"description":"ISO 4217 currency of :cost, when it differs from the document currency.","oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"Per-line chart-of-accounts / expense-category id; bills split cost by category at accrual (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"baseupdatedat":{"description":"Optimistic-concurrency token: the line's last-known updatedat (epoch number or ISO string). A stale value is rejected; omit to skip the check.","oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"responseid":{"description":"Internal: correlation id used to return the updated entity to the frontend; omit.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Line item id. Required on update_document_item; omit on add_document_line.","oneOf":[{"type":"string"},{"type":"null"}]},"quinvoice":{"description":"Id of the parent document (invoice, quote, bill, etc.) this line belongs to.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Line item name: the title the document shows for the line. Give every new line one; put any extra detail in :description. A new line sent with only a description takes it as its name.","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"Line item description.","oneOf":[{"type":"string"},{"type":"null"}]},"price":{"description":"Unit price (per-unit selling price) in the document currency.","oneOf":[{"type":"number"},{"type":"null"}]},"sort":{"description":"Display order of the line within the document (ascending).","oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"description":"Number of units. Accepts a number or a numeric string.","oneOf":[{"anyOf":[{"type":"number"},{}]},{"type":"null"}]},"cost":{"description":"Unit cost (for margin / cost-of-sales), in :costcurrency.","oneOf":[{"type":"number"},{"type":"null"}]},"unit":{"description":"Unit label for the quantity (e.g. \"hours\", \"kg\").","oneOf":[{"type":"string"},{"type":"null"}]},"product":{"description":"Id of a catalog product to link this line to.","oneOf":[{"type":"string"},{"type":"null"}]},"variant":{"description":"Id of a catalog product variant to link this line to.","oneOf":[{"type":"string"},{"type":"null"}]},"stocklocationid":{"description":"Stock location this line moves stock at; one of your active locations. Omit for the variant or product default; \"$delete\" re-stamps that default.","oneOf":[{"type":"string"},{"type":"null"}]},"expense":{"description":"Pass \"$delete\" to unlink the expense this line recovers; the line keeps its name, account and amount. Rebilling is add-only, so any other value is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Line total (unit price × quantity), usually derived from :price × :quantity. Accepts a number or a numeric string.","oneOf":[{"anyOf":[{"type":"number"},{}]},{"type":"null"}]},"costcurrency":{"description":"ISO 4217 currency of :cost, when it differs from the document currency.","oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"Per-line chart-of-accounts / expense-category id; bills split cost by category at accrual (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"baseupdatedat":{"description":"Optimistic-concurrency token: the line's last-known updatedat (epoch number or ISO string). A stale value is rejected; omit to skip the check.","oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"responseid":{"description":"Internal: correlation id used to return the updated entity to the frontend; omit.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Line item id. Required on update_document_item; omit on add_document_line.","oneOf":[{"type":"string"},{"type":"null"}]},"quinvoice":{"description":"Id of the parent document (invoice, quote, bill, etc.) this line belongs to.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Line item name: the title the document shows for the line. Give every new line one; put any extra detail in :description. A new line sent with only a description takes it as its name.","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"Line item description.","oneOf":[{"type":"string"},{"type":"null"}]},"price":{"description":"Unit price (per-unit selling price) in the document currency.","oneOf":[{"type":"number"},{"type":"null"}]},"sort":{"description":"Display order of the line within the document (ascending).","oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"description":"Number of units. Accepts a number or a numeric string.","oneOf":[{"anyOf":[{"type":"number"},{}]},{"type":"null"}]},"cost":{"description":"Unit cost (for margin / cost-of-sales), in :costcurrency.","oneOf":[{"type":"number"},{"type":"null"}]},"unit":{"description":"Unit label for the quantity (e.g. \"hours\", \"kg\").","oneOf":[{"type":"string"},{"type":"null"}]},"product":{"description":"Id of a catalog product to link this line to.","oneOf":[{"type":"string"},{"type":"null"}]},"variant":{"description":"Id of a catalog product variant to link this line to.","oneOf":[{"type":"string"},{"type":"null"}]},"stocklocationid":{"description":"Stock location this line moves stock at; one of your active locations. Omit for the variant or product default; \"$delete\" re-stamps that default.","oneOf":[{"type":"string"},{"type":"null"}]},"expense":{"description":"Pass \"$delete\" to unlink the expense this line recovers; the line keeps its name, account and amount. Rebilling is add-only, so any other value is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Line total (unit price × quantity), usually derived from :price × :quantity. Accepts a number or a numeric string.","oneOf":[{"anyOf":[{"type":"number"},{}]},{"type":"null"}]},"costcurrency":{"description":"ISO 4217 currency of :cost, when it differs from the document currency.","oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"Per-line chart-of-accounts / expense-category id; bills split cost by category at accrual (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"baseupdatedat":{"description":"Optimistic-concurrency token: the line's last-known updatedat (epoch number or ISO string). A stale value is rejected; omit to skip the check.","oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"responseid":{"description":"Internal: correlation id used to return the updated entity to the frontend; omit.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Change a line that is ALREADY on a document (invoice, quote, bill and so on), not its header: header fields (contact, dates, type) go through save_document, and a new line goes through add_document_line. To change several lines on one document, prefer update_document_items_bulk — one call instead of many.","tags":["Manage invoices (quotes, proforma invoices, credit notes, debit notes)"]}},"/api/invoice/update-many-items":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"quinvoice":{"description":"Id of the parent document (invoice, quote, bill, etc.) whose line items are being updated (required).","type":"string"},"items":{"description":"Line items to update; each entry must include the line `id` plus the fields to change.","type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"price":{"oneOf":[{"type":"number"},{"type":"null"}]},"sort":{"oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"oneOf":[{},{"type":"null"}]},"cost":{"oneOf":[{"type":"number"},{"type":"null"}]},"unit":{"oneOf":[{"type":"string"},{"type":"null"}]},"product":{"oneOf":[{"type":"string"},{"type":"null"}]},"stocklocationid":{"oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"oneOf":[{"anyOf":[{"type":"number"},{}]},{"type":"null"}]},"costcurrency":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"baseupdatedat":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]}},"required":["id"],"additionalProperties":false}}},"required":["token","quinvoice","items"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"quinvoice":{"description":"Id of the parent document (invoice, quote, bill, etc.) whose line items are being updated (required).","type":"string"},"items":{"description":"Line items to update; each entry must include the line `id` plus the fields to change.","type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"price":{"oneOf":[{"type":"number"},{"type":"null"}]},"sort":{"oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"oneOf":[{},{"type":"null"}]},"cost":{"oneOf":[{"type":"number"},{"type":"null"}]},"unit":{"oneOf":[{"type":"string"},{"type":"null"}]},"product":{"oneOf":[{"type":"string"},{"type":"null"}]},"stocklocationid":{"oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"oneOf":[{"anyOf":[{"type":"number"},{}]},{"type":"null"}]},"costcurrency":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"baseupdatedat":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]}},"required":["id"],"additionalProperties":false}}},"required":["token","quinvoice","items"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"quinvoice":{"description":"Id of the parent document (invoice, quote, bill, etc.) whose line items are being updated (required).","type":"string"},"items":{"description":"Line items to update; each entry must include the line `id` plus the fields to change.","type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"price":{"oneOf":[{"type":"number"},{"type":"null"}]},"sort":{"oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"oneOf":[{},{"type":"null"}]},"cost":{"oneOf":[{"type":"number"},{"type":"null"}]},"unit":{"oneOf":[{"type":"string"},{"type":"null"}]},"product":{"oneOf":[{"type":"string"},{"type":"null"}]},"stocklocationid":{"oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"oneOf":[{"anyOf":[{"type":"number"},{}]},{"type":"null"}]},"costcurrency":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"baseupdatedat":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]}},"required":["id"],"additionalProperties":false}}},"required":["token","quinvoice","items"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"quinvoice":{"description":"Id of the parent document (invoice, quote, bill, etc.) whose line items are being updated (required).","type":"string"},"items":{"description":"Line items to update; each entry must include the line `id` plus the fields to change.","type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"price":{"oneOf":[{"type":"number"},{"type":"null"}]},"sort":{"oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"oneOf":[{},{"type":"null"}]},"cost":{"oneOf":[{"type":"number"},{"type":"null"}]},"unit":{"oneOf":[{"type":"string"},{"type":"null"}]},"product":{"oneOf":[{"type":"string"},{"type":"null"}]},"stocklocationid":{"oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"oneOf":[{"anyOf":[{"type":"number"},{}]},{"type":"null"}]},"costcurrency":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"baseupdatedat":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]}},"required":["id"],"additionalProperties":false}}},"required":["token","quinvoice","items"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Update many line items on a document in one call — prefer this over repeated single-item updates.","tags":["Manage invoices (quotes, proforma invoices, credit notes, debit notes)"]}},"/api/invoice/delete-item":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Line item id to delete (required).","type":"string"},"quinvoice":{"description":"Id of the parent document (invoice, quote, bill, etc.) the line belongs to — pass this so the correct document is updated. Required in practice.","oneOf":[{"type":"string"},{"type":"null"}]},"invoiceid":{"description":"Alias for quinvoice (the parent document id); prefer quinvoice.","oneOf":[{"type":"string"},{"type":"null"}]},"invoice":{"description":"Alias for quinvoice (the parent document id); prefer quinvoice.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Line item id to delete (required).","type":"string"},"quinvoice":{"description":"Id of the parent document (invoice, quote, bill, etc.) the line belongs to — pass this so the correct document is updated. Required in practice.","oneOf":[{"type":"string"},{"type":"null"}]},"invoiceid":{"description":"Alias for quinvoice (the parent document id); prefer quinvoice.","oneOf":[{"type":"string"},{"type":"null"}]},"invoice":{"description":"Alias for quinvoice (the parent document id); prefer quinvoice.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Line item id to delete (required).","type":"string"},"quinvoice":{"description":"Id of the parent document (invoice, quote, bill, etc.) the line belongs to — pass this so the correct document is updated. Required in practice.","oneOf":[{"type":"string"},{"type":"null"}]},"invoiceid":{"description":"Alias for quinvoice (the parent document id); prefer quinvoice.","oneOf":[{"type":"string"},{"type":"null"}]},"invoice":{"description":"Alias for quinvoice (the parent document id); prefer quinvoice.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Line item id to delete (required).","type":"string"},"quinvoice":{"description":"Id of the parent document (invoice, quote, bill, etc.) the line belongs to — pass this so the correct document is updated. Required in practice.","oneOf":[{"type":"string"},{"type":"null"}]},"invoiceid":{"description":"Alias for quinvoice (the parent document id); prefer quinvoice.","oneOf":[{"type":"string"},{"type":"null"}]},"invoice":{"description":"Alias for quinvoice (the parent document id); prefer quinvoice.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Delete a line item from a document (invoice, quote, bill, etc.). `id` is the line id; pass the parent document id as `quinvoice` so the correct document is updated. To change a line rather than remove it use update_document_item (or update_document_items_bulk for several).","tags":["Manage invoices (quotes, proforma invoices, credit notes, debit notes)"]}},"/api/invoice/add-item-salestax":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Sales-tax line id. On update, identifies which sales-tax to change (or pass :salestaxid); omit on add.","oneOf":[{"type":"string"},{"type":"null"}]},"itemid":{"description":"Id of the document line item this sales-tax attaches to. On update, if :id/:salestaxid are omitted and the item has exactly one sales-tax, it is resolved from here.","oneOf":[{"type":"string"},{"type":"null"}]},"quinvoice":{"description":"Id of the parent document (invoice, quote, credit/debit note). Used to reindex the correct document; aliased by :invoice / :invoiceid.","oneOf":[{"type":"string"},{"type":"null"}]},"invoice":{"description":"Alias for the parent document id (see :quinvoice).","oneOf":[{"type":"string"},{"type":"null"}]},"invoiceid":{"description":"Alias for the parent document id (see :quinvoice); takes precedence when several are supplied.","oneOf":[{"type":"string"},{"type":"null"}]},"salestaxid":{"description":"Id of the sales-tax to update (alternative to :id).","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Sales-tax name (e.g. \"VAT\").","oneOf":[{"type":"string"},{"type":"null"}]},"parentid":{"description":"Id of the business's own sales-tax definition this line applies (see get_business_profile salestaxes). On add, when omitted, the definition is matched by name, then by rate when exactly one definition has that rate. If several match, the call is refused and lists their ids; pass one as parentid. A 0 rate with no name match stays unlinked.","oneOf":[{"type":"string"},{"type":"null"}]},"referencenumber":{"description":"Sales-tax registration / reference number.","oneOf":[{"type":"string"},{"type":"null"}]},"recoverable":{"description":"Whether this input sales tax / VAT is recoverable.","oneOf":[{"type":"boolean"},{"type":"null"}]},"exclusive":{"description":"Whether the tax is exclusive (added on top of the line amount) rather than inclusive (already contained in it).","oneOf":[{"type":"boolean"},{"type":"null"}]},"rate":{"description":"Sales tax rate as a DECIMAL FRACTION, e.g. 0.15 = 15% (NOT 15). A rate of 1.0 (100%) or higher is rejected.","oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"description":"Fixed sales-tax amount, used instead of :rate when :useamount is true.","oneOf":[{"type":"number"},{"type":"null"}]},"useamount":{"description":"Use the fixed :amount instead of computing tax from :rate.","oneOf":[{"type":"boolean"},{"type":"null"}]},"responseid":{"description":"Internal: correlation id used to return the updated entity to the frontend; omit.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Sales-tax line id. On update, identifies which sales-tax to change (or pass :salestaxid); omit on add.","oneOf":[{"type":"string"},{"type":"null"}]},"itemid":{"description":"Id of the document line item this sales-tax attaches to. On update, if :id/:salestaxid are omitted and the item has exactly one sales-tax, it is resolved from here.","oneOf":[{"type":"string"},{"type":"null"}]},"quinvoice":{"description":"Id of the parent document (invoice, quote, credit/debit note). Used to reindex the correct document; aliased by :invoice / :invoiceid.","oneOf":[{"type":"string"},{"type":"null"}]},"invoice":{"description":"Alias for the parent document id (see :quinvoice).","oneOf":[{"type":"string"},{"type":"null"}]},"invoiceid":{"description":"Alias for the parent document id (see :quinvoice); takes precedence when several are supplied.","oneOf":[{"type":"string"},{"type":"null"}]},"salestaxid":{"description":"Id of the sales-tax to update (alternative to :id).","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Sales-tax name (e.g. \"VAT\").","oneOf":[{"type":"string"},{"type":"null"}]},"parentid":{"description":"Id of the business's own sales-tax definition this line applies (see get_business_profile salestaxes). On add, when omitted, the definition is matched by name, then by rate when exactly one definition has that rate. If several match, the call is refused and lists their ids; pass one as parentid. A 0 rate with no name match stays unlinked.","oneOf":[{"type":"string"},{"type":"null"}]},"referencenumber":{"description":"Sales-tax registration / reference number.","oneOf":[{"type":"string"},{"type":"null"}]},"recoverable":{"description":"Whether this input sales tax / VAT is recoverable.","oneOf":[{"type":"boolean"},{"type":"null"}]},"exclusive":{"description":"Whether the tax is exclusive (added on top of the line amount) rather than inclusive (already contained in it).","oneOf":[{"type":"boolean"},{"type":"null"}]},"rate":{"description":"Sales tax rate as a DECIMAL FRACTION, e.g. 0.15 = 15% (NOT 15). A rate of 1.0 (100%) or higher is rejected.","oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"description":"Fixed sales-tax amount, used instead of :rate when :useamount is true.","oneOf":[{"type":"number"},{"type":"null"}]},"useamount":{"description":"Use the fixed :amount instead of computing tax from :rate.","oneOf":[{"type":"boolean"},{"type":"null"}]},"responseid":{"description":"Internal: correlation id used to return the updated entity to the frontend; omit.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Sales-tax line id. On update, identifies which sales-tax to change (or pass :salestaxid); omit on add.","oneOf":[{"type":"string"},{"type":"null"}]},"itemid":{"description":"Id of the document line item this sales-tax attaches to. On update, if :id/:salestaxid are omitted and the item has exactly one sales-tax, it is resolved from here.","oneOf":[{"type":"string"},{"type":"null"}]},"quinvoice":{"description":"Id of the parent document (invoice, quote, credit/debit note). Used to reindex the correct document; aliased by :invoice / :invoiceid.","oneOf":[{"type":"string"},{"type":"null"}]},"invoice":{"description":"Alias for the parent document id (see :quinvoice).","oneOf":[{"type":"string"},{"type":"null"}]},"invoiceid":{"description":"Alias for the parent document id (see :quinvoice); takes precedence when several are supplied.","oneOf":[{"type":"string"},{"type":"null"}]},"salestaxid":{"description":"Id of the sales-tax to update (alternative to :id).","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Sales-tax name (e.g. \"VAT\").","oneOf":[{"type":"string"},{"type":"null"}]},"parentid":{"description":"Id of the business's own sales-tax definition this line applies (see get_business_profile salestaxes). On add, when omitted, the definition is matched by name, then by rate when exactly one definition has that rate. If several match, the call is refused and lists their ids; pass one as parentid. A 0 rate with no name match stays unlinked.","oneOf":[{"type":"string"},{"type":"null"}]},"referencenumber":{"description":"Sales-tax registration / reference number.","oneOf":[{"type":"string"},{"type":"null"}]},"recoverable":{"description":"Whether this input sales tax / VAT is recoverable.","oneOf":[{"type":"boolean"},{"type":"null"}]},"exclusive":{"description":"Whether the tax is exclusive (added on top of the line amount) rather than inclusive (already contained in it).","oneOf":[{"type":"boolean"},{"type":"null"}]},"rate":{"description":"Sales tax rate as a DECIMAL FRACTION, e.g. 0.15 = 15% (NOT 15). A rate of 1.0 (100%) or higher is rejected.","oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"description":"Fixed sales-tax amount, used instead of :rate when :useamount is true.","oneOf":[{"type":"number"},{"type":"null"}]},"useamount":{"description":"Use the fixed :amount instead of computing tax from :rate.","oneOf":[{"type":"boolean"},{"type":"null"}]},"responseid":{"description":"Internal: correlation id used to return the updated entity to the frontend; omit.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Sales-tax line id. On update, identifies which sales-tax to change (or pass :salestaxid); omit on add.","oneOf":[{"type":"string"},{"type":"null"}]},"itemid":{"description":"Id of the document line item this sales-tax attaches to. On update, if :id/:salestaxid are omitted and the item has exactly one sales-tax, it is resolved from here.","oneOf":[{"type":"string"},{"type":"null"}]},"quinvoice":{"description":"Id of the parent document (invoice, quote, credit/debit note). Used to reindex the correct document; aliased by :invoice / :invoiceid.","oneOf":[{"type":"string"},{"type":"null"}]},"invoice":{"description":"Alias for the parent document id (see :quinvoice).","oneOf":[{"type":"string"},{"type":"null"}]},"invoiceid":{"description":"Alias for the parent document id (see :quinvoice); takes precedence when several are supplied.","oneOf":[{"type":"string"},{"type":"null"}]},"salestaxid":{"description":"Id of the sales-tax to update (alternative to :id).","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Sales-tax name (e.g. \"VAT\").","oneOf":[{"type":"string"},{"type":"null"}]},"parentid":{"description":"Id of the business's own sales-tax definition this line applies (see get_business_profile salestaxes). On add, when omitted, the definition is matched by name, then by rate when exactly one definition has that rate. If several match, the call is refused and lists their ids; pass one as parentid. A 0 rate with no name match stays unlinked.","oneOf":[{"type":"string"},{"type":"null"}]},"referencenumber":{"description":"Sales-tax registration / reference number.","oneOf":[{"type":"string"},{"type":"null"}]},"recoverable":{"description":"Whether this input sales tax / VAT is recoverable.","oneOf":[{"type":"boolean"},{"type":"null"}]},"exclusive":{"description":"Whether the tax is exclusive (added on top of the line amount) rather than inclusive (already contained in it).","oneOf":[{"type":"boolean"},{"type":"null"}]},"rate":{"description":"Sales tax rate as a DECIMAL FRACTION, e.g. 0.15 = 15% (NOT 15). A rate of 1.0 (100%) or higher is rejected.","oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"description":"Fixed sales-tax amount, used instead of :rate when :useamount is true.","oneOf":[{"type":"number"},{"type":"null"}]},"useamount":{"description":"Use the fixed :amount instead of computing tax from :rate.","oneOf":[{"type":"boolean"},{"type":"null"}]},"responseid":{"description":"Internal: correlation id used to return the updated entity to the frontend; omit.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Add a sales-tax (VAT) line to a single line item on a document (invoice, quote, credit note, debit note). Identify the document item by its id. Pairs with update_document_item_salestax.","tags":["Manage invoices (quotes, proforma invoices, credit notes, debit notes)"]}},"/api/invoice/update-item-salestax":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Sales-tax line id. On update, identifies which sales-tax to change (or pass :salestaxid); omit on add.","oneOf":[{"type":"string"},{"type":"null"}]},"itemid":{"description":"Id of the document line item this sales-tax attaches to. On update, if :id/:salestaxid are omitted and the item has exactly one sales-tax, it is resolved from here.","oneOf":[{"type":"string"},{"type":"null"}]},"quinvoice":{"description":"Id of the parent document (invoice, quote, credit/debit note). Used to reindex the correct document; aliased by :invoice / :invoiceid.","oneOf":[{"type":"string"},{"type":"null"}]},"invoice":{"description":"Alias for the parent document id (see :quinvoice).","oneOf":[{"type":"string"},{"type":"null"}]},"invoiceid":{"description":"Alias for the parent document id (see :quinvoice); takes precedence when several are supplied.","oneOf":[{"type":"string"},{"type":"null"}]},"salestaxid":{"description":"Id of the sales-tax to update (alternative to :id).","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Sales-tax name (e.g. \"VAT\").","oneOf":[{"type":"string"},{"type":"null"}]},"parentid":{"description":"Id of the business's own sales-tax definition this line applies (see get_business_profile salestaxes). On add, when omitted, the definition is matched by name, then by rate when exactly one definition has that rate. If several match, the call is refused and lists their ids; pass one as parentid. A 0 rate with no name match stays unlinked.","oneOf":[{"type":"string"},{"type":"null"}]},"referencenumber":{"description":"Sales-tax registration / reference number.","oneOf":[{"type":"string"},{"type":"null"}]},"recoverable":{"description":"Whether this input sales tax / VAT is recoverable.","oneOf":[{"type":"boolean"},{"type":"null"}]},"exclusive":{"description":"Whether the tax is exclusive (added on top of the line amount) rather than inclusive (already contained in it).","oneOf":[{"type":"boolean"},{"type":"null"}]},"rate":{"description":"Sales tax rate as a DECIMAL FRACTION, e.g. 0.15 = 15% (NOT 15). A rate of 1.0 (100%) or higher is rejected.","oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"description":"Fixed sales-tax amount, used instead of :rate when :useamount is true.","oneOf":[{"type":"number"},{"type":"null"}]},"useamount":{"description":"Use the fixed :amount instead of computing tax from :rate.","oneOf":[{"type":"boolean"},{"type":"null"}]},"responseid":{"description":"Internal: correlation id used to return the updated entity to the frontend; omit.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Sales-tax line id. On update, identifies which sales-tax to change (or pass :salestaxid); omit on add.","oneOf":[{"type":"string"},{"type":"null"}]},"itemid":{"description":"Id of the document line item this sales-tax attaches to. On update, if :id/:salestaxid are omitted and the item has exactly one sales-tax, it is resolved from here.","oneOf":[{"type":"string"},{"type":"null"}]},"quinvoice":{"description":"Id of the parent document (invoice, quote, credit/debit note). Used to reindex the correct document; aliased by :invoice / :invoiceid.","oneOf":[{"type":"string"},{"type":"null"}]},"invoice":{"description":"Alias for the parent document id (see :quinvoice).","oneOf":[{"type":"string"},{"type":"null"}]},"invoiceid":{"description":"Alias for the parent document id (see :quinvoice); takes precedence when several are supplied.","oneOf":[{"type":"string"},{"type":"null"}]},"salestaxid":{"description":"Id of the sales-tax to update (alternative to :id).","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Sales-tax name (e.g. \"VAT\").","oneOf":[{"type":"string"},{"type":"null"}]},"parentid":{"description":"Id of the business's own sales-tax definition this line applies (see get_business_profile salestaxes). On add, when omitted, the definition is matched by name, then by rate when exactly one definition has that rate. If several match, the call is refused and lists their ids; pass one as parentid. A 0 rate with no name match stays unlinked.","oneOf":[{"type":"string"},{"type":"null"}]},"referencenumber":{"description":"Sales-tax registration / reference number.","oneOf":[{"type":"string"},{"type":"null"}]},"recoverable":{"description":"Whether this input sales tax / VAT is recoverable.","oneOf":[{"type":"boolean"},{"type":"null"}]},"exclusive":{"description":"Whether the tax is exclusive (added on top of the line amount) rather than inclusive (already contained in it).","oneOf":[{"type":"boolean"},{"type":"null"}]},"rate":{"description":"Sales tax rate as a DECIMAL FRACTION, e.g. 0.15 = 15% (NOT 15). A rate of 1.0 (100%) or higher is rejected.","oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"description":"Fixed sales-tax amount, used instead of :rate when :useamount is true.","oneOf":[{"type":"number"},{"type":"null"}]},"useamount":{"description":"Use the fixed :amount instead of computing tax from :rate.","oneOf":[{"type":"boolean"},{"type":"null"}]},"responseid":{"description":"Internal: correlation id used to return the updated entity to the frontend; omit.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Sales-tax line id. On update, identifies which sales-tax to change (or pass :salestaxid); omit on add.","oneOf":[{"type":"string"},{"type":"null"}]},"itemid":{"description":"Id of the document line item this sales-tax attaches to. On update, if :id/:salestaxid are omitted and the item has exactly one sales-tax, it is resolved from here.","oneOf":[{"type":"string"},{"type":"null"}]},"quinvoice":{"description":"Id of the parent document (invoice, quote, credit/debit note). Used to reindex the correct document; aliased by :invoice / :invoiceid.","oneOf":[{"type":"string"},{"type":"null"}]},"invoice":{"description":"Alias for the parent document id (see :quinvoice).","oneOf":[{"type":"string"},{"type":"null"}]},"invoiceid":{"description":"Alias for the parent document id (see :quinvoice); takes precedence when several are supplied.","oneOf":[{"type":"string"},{"type":"null"}]},"salestaxid":{"description":"Id of the sales-tax to update (alternative to :id).","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Sales-tax name (e.g. \"VAT\").","oneOf":[{"type":"string"},{"type":"null"}]},"parentid":{"description":"Id of the business's own sales-tax definition this line applies (see get_business_profile salestaxes). On add, when omitted, the definition is matched by name, then by rate when exactly one definition has that rate. If several match, the call is refused and lists their ids; pass one as parentid. A 0 rate with no name match stays unlinked.","oneOf":[{"type":"string"},{"type":"null"}]},"referencenumber":{"description":"Sales-tax registration / reference number.","oneOf":[{"type":"string"},{"type":"null"}]},"recoverable":{"description":"Whether this input sales tax / VAT is recoverable.","oneOf":[{"type":"boolean"},{"type":"null"}]},"exclusive":{"description":"Whether the tax is exclusive (added on top of the line amount) rather than inclusive (already contained in it).","oneOf":[{"type":"boolean"},{"type":"null"}]},"rate":{"description":"Sales tax rate as a DECIMAL FRACTION, e.g. 0.15 = 15% (NOT 15). A rate of 1.0 (100%) or higher is rejected.","oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"description":"Fixed sales-tax amount, used instead of :rate when :useamount is true.","oneOf":[{"type":"number"},{"type":"null"}]},"useamount":{"description":"Use the fixed :amount instead of computing tax from :rate.","oneOf":[{"type":"boolean"},{"type":"null"}]},"responseid":{"description":"Internal: correlation id used to return the updated entity to the frontend; omit.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Sales-tax line id. On update, identifies which sales-tax to change (or pass :salestaxid); omit on add.","oneOf":[{"type":"string"},{"type":"null"}]},"itemid":{"description":"Id of the document line item this sales-tax attaches to. On update, if :id/:salestaxid are omitted and the item has exactly one sales-tax, it is resolved from here.","oneOf":[{"type":"string"},{"type":"null"}]},"quinvoice":{"description":"Id of the parent document (invoice, quote, credit/debit note). Used to reindex the correct document; aliased by :invoice / :invoiceid.","oneOf":[{"type":"string"},{"type":"null"}]},"invoice":{"description":"Alias for the parent document id (see :quinvoice).","oneOf":[{"type":"string"},{"type":"null"}]},"invoiceid":{"description":"Alias for the parent document id (see :quinvoice); takes precedence when several are supplied.","oneOf":[{"type":"string"},{"type":"null"}]},"salestaxid":{"description":"Id of the sales-tax to update (alternative to :id).","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Sales-tax name (e.g. \"VAT\").","oneOf":[{"type":"string"},{"type":"null"}]},"parentid":{"description":"Id of the business's own sales-tax definition this line applies (see get_business_profile salestaxes). On add, when omitted, the definition is matched by name, then by rate when exactly one definition has that rate. If several match, the call is refused and lists their ids; pass one as parentid. A 0 rate with no name match stays unlinked.","oneOf":[{"type":"string"},{"type":"null"}]},"referencenumber":{"description":"Sales-tax registration / reference number.","oneOf":[{"type":"string"},{"type":"null"}]},"recoverable":{"description":"Whether this input sales tax / VAT is recoverable.","oneOf":[{"type":"boolean"},{"type":"null"}]},"exclusive":{"description":"Whether the tax is exclusive (added on top of the line amount) rather than inclusive (already contained in it).","oneOf":[{"type":"boolean"},{"type":"null"}]},"rate":{"description":"Sales tax rate as a DECIMAL FRACTION, e.g. 0.15 = 15% (NOT 15). A rate of 1.0 (100%) or higher is rejected.","oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"description":"Fixed sales-tax amount, used instead of :rate when :useamount is true.","oneOf":[{"type":"number"},{"type":"null"}]},"useamount":{"description":"Use the fixed :amount instead of computing tax from :rate.","oneOf":[{"type":"boolean"},{"type":"null"}]},"responseid":{"description":"Internal: correlation id used to return the updated entity to the frontend; omit.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Update the sales-tax (VAT) on a single line item of a document (invoice, quote, credit note, debit note) — change the rate or amount. Identify the item by its id. To add a new sales-tax line use add_document_item_salestax.","tags":["Manage invoices (quotes, proforma invoices, credit notes, debit notes)"]}},"/api/invoice/delete-item-salestax":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"delete sales tax from invoice (or quote, proforma invoice, credit note, debit note) item","tags":["Manage invoices (quotes, proforma invoices, credit notes, debit notes)"]}},"/api/invoice/add-client":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Document id to attach the contact to (invoice, quote, bill, etc.).","type":"string"},"client":{"description":"Contact id to attach — a client for money-in documents, a supplier for money-out documents (see list_clients / list_suppliers).","type":"string"}},"required":["token","id","client"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Document id to attach the contact to (invoice, quote, bill, etc.).","type":"string"},"client":{"description":"Contact id to attach — a client for money-in documents, a supplier for money-out documents (see list_clients / list_suppliers).","type":"string"}},"required":["token","id","client"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Document id to attach the contact to (invoice, quote, bill, etc.).","type":"string"},"client":{"description":"Contact id to attach — a client for money-in documents, a supplier for money-out documents (see list_clients / list_suppliers).","type":"string"}},"required":["token","id","client"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Document id to attach the contact to (invoice, quote, bill, etc.).","type":"string"},"client":{"description":"Contact id to attach — a client for money-in documents, a supplier for money-out documents (see list_clients / list_suppliers).","type":"string"}},"required":["token","id","client"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Attach a contact to a document — a client for money-in documents, a supplier for money-out documents.","tags":["Manage invoices (quotes, proforma invoices, credit notes, debit notes)"]}},"/api/invoice/remove-client":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Detach the contact (client or supplier) from a document. Pairs with set_document_contact.","tags":["Manage invoices (quotes, proforma invoices, credit notes, debit notes)"]}},"/api/invoice/add-contact":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"contact":{"type":"string"}},"required":["token","id","contact"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"contact":{"type":"string"}},"required":["token","id","contact"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"contact":{"type":"string"}},"required":["token","id","contact"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"contact":{"type":"string"}},"required":["token","id","contact"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"add contact to contract (or client to invoice if inv ID provided)","tags":["Manage invoices (quotes, proforma invoices, credit notes, debit notes)"]}},"/api/invoice/remove-contact":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"remove contact from contract (or client from invoice if inv ID provided)","tags":["Manage invoices (quotes, proforma invoices, credit notes, debit notes)"]}},"/api/invoice/delete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Delete a document (invoice, quote, credit note, debit note, bill, etc.) by id. Reversible — the document and the payments that settle it are moved to the bin together, where list_binned shows them and restore_deleted brings them back. Find the id yourself with list_documents (query by number or contact); never ask the user for an id.","tags":["Manage invoices (quotes, proforma invoices, credit notes, debit notes)"]}},"/api/document/share":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Contract or legacy invoice id to share or unshare.","type":"string"},"enabled":{"description":"true opens the public link, false revokes it. OMIT IT (with :rotate) to READ the current state.","oneOf":[{"type":"boolean"},{"type":"null"}]},"rotate":{"description":"Mint a fresh token, killing the previous link. Omit it (with :enabled) to READ.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Contract or legacy invoice id to share or unshare.","type":"string"},"enabled":{"description":"true opens the public link, false revokes it. OMIT IT (with :rotate) to READ the current state.","oneOf":[{"type":"boolean"},{"type":"null"}]},"rotate":{"description":"Mint a fresh token, killing the previous link. Omit it (with :enabled) to READ.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Contract or legacy invoice id to share or unshare.","type":"string"},"enabled":{"description":"true opens the public link, false revokes it. OMIT IT (with :rotate) to READ the current state.","oneOf":[{"type":"boolean"},{"type":"null"}]},"rotate":{"description":"Mint a fresh token, killing the previous link. Omit it (with :enabled) to READ.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Contract or legacy invoice id to share or unshare.","type":"string"},"enabled":{"description":"true opens the public link, false revokes it. OMIT IT (with :rotate) to READ the current state.","oneOf":[{"type":"boolean"},{"type":"null"}]},"rotate":{"description":"Mint a fresh token, killing the previous link. Omit it (with :enabled) to READ.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Read a document's public share link, or (with :enabled or :rotate) enable, rotate or revoke its share token.","tags":["invoices"]}},"/api/document/void":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Contract or legacy invoice id to void or un-void.","type":"string"},"void":{"description":"true (the default) voids the document; false un-voids it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"confirm":{"description":"Send true only after the user has agreed to the change the refusal described.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Contract or legacy invoice id to void or un-void.","type":"string"},"void":{"description":"true (the default) voids the document; false un-voids it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"confirm":{"description":"Send true only after the user has agreed to the change the refusal described.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Contract or legacy invoice id to void or un-void.","type":"string"},"void":{"description":"true (the default) voids the document; false un-voids it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"confirm":{"description":"Send true only after the user has agreed to the change the refusal described.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Contract or legacy invoice id to void or un-void.","type":"string"},"void":{"description":"true (the default) voids the document; false un-voids it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"confirm":{"description":"Send true only after the user has agreed to the change the refusal described.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Void a document (invoice, quote, credit note, bill or any other kind) by id, or un-void it with void false. A void document keeps its number but leaves the books and the contact's balance. Without confirm true it changes nothing and answers reason confirm-required with what it would do; ask the user, then call again with confirm true. A missing or another business's id is not-found.","tags":["invoices"]}},"/api/document/writeoff":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"The sales invoice to write off, from list_invoices or get_document.","type":"string"},"confirm":{"description":"Send true only after the user has agreed to the write-off the refusal described.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"The sales invoice to write off, from list_invoices or get_document.","type":"string"},"confirm":{"description":"Send true only after the user has agreed to the write-off the refusal described.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"The sales invoice to write off, from list_invoices or get_document.","type":"string"},"confirm":{"description":"Send true only after the user has agreed to the write-off the refusal described.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"The sales invoice to write off, from list_invoices or get_document.","type":"string"},"confirm":{"description":"Send true only after the user has agreed to the write-off the refusal described.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Write off the unpaid rest of a sales invoice that will not be paid (bad debt), as the app's Write off on the invoice does: the outstanding amount goes to the write-off account, the VAT on it is reversed, and the invoice is locked. The write-off is always dated today, so its VAT reversal lands in the current open period; there is no date to choose. Without confirm true it changes nothing and answers reason confirm-required naming the amount, the account and the date; ask the user, then call again with confirm true. Refuses a quote or other non-invoice (not-an-invoice), a void invoice, one already written off (unchanged), one marked settled, one with nothing outstanding, one with a bank line stub matched to it that is not yet linked (payment-pending: blockingpayments lists each line's id, date, amount and narration; name those lines to the user, never guess one), an invoice dated after today (invalid-date), and books locked through today (locked-period). A missing or another business's id is not-found.","tags":["invoices"]}},"/api/document/toquote":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"The sales invoice to turn into a quote, from list_invoices or get_document.","type":"string"},"confirm":{"description":"Send true only after the user has agreed to the change the refusal described.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"The sales invoice to turn into a quote, from list_invoices or get_document.","type":"string"},"confirm":{"description":"Send true only after the user has agreed to the change the refusal described.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"The sales invoice to turn into a quote, from list_invoices or get_document.","type":"string"},"confirm":{"description":"Send true only after the user has agreed to the change the refusal described.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"The sales invoice to turn into a quote, from list_invoices or get_document.","type":"string"},"confirm":{"description":"Send true only after the user has agreed to the change the refusal described.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Turn a sales invoice into a quote in place. It keeps its id, client, lines and history; it takes the next quote number, and the old invoice number stays in its history (previousnumber). Its postings leave the ledger, as deleting it would remove them. Use this whenever the user asks to turn, change or convert an invoice into a quote; never delete the invoice and create a new quote. Without confirm true it changes nothing and answers reason confirm-required naming both numbers; ask the user, then call again with confirm true. Refuses a document that is already a quote (unchanged), a recurring template or other non-invoice (not-an-invoice), a void invoice, one written off (written-off), one marked settled, one with payments or refunds recorded (has-payments: delete or unlink them first), one with a bank line matched to it but not yet linked (payment-pending), one a credit note is set against (credit-noted: unlink the credit note first), one with a prepayment or credit allocated to it (allocated: remove the allocation first), and one dated inside a locked period (locked-period: unlock that period first). A missing or another business's id is not-found.","tags":["invoices"]}},"/api/document/allocate":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"invoiceid":{"description":"The sales invoice (for a credit note) or bill (for a debit note) to reduce, from list_invoices or get_document.","type":"string"},"noteid":{"description":"The credit note or debit note to set against it.","type":"string"},"amount":{"description":"How much of the note to set against it. Omit it to use as much as both documents allow.","oneOf":[{"type":"number"},{"type":"null"}]},"confirm":{"description":"Send true only after the user has agreed to the allocation the refusal described.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","invoiceid","noteid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"invoiceid":{"description":"The sales invoice (for a credit note) or bill (for a debit note) to reduce, from list_invoices or get_document.","type":"string"},"noteid":{"description":"The credit note or debit note to set against it.","type":"string"},"amount":{"description":"How much of the note to set against it. Omit it to use as much as both documents allow.","oneOf":[{"type":"number"},{"type":"null"}]},"confirm":{"description":"Send true only after the user has agreed to the allocation the refusal described.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","invoiceid","noteid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"invoiceid":{"description":"The sales invoice (for a credit note) or bill (for a debit note) to reduce, from list_invoices or get_document.","type":"string"},"noteid":{"description":"The credit note or debit note to set against it.","type":"string"},"amount":{"description":"How much of the note to set against it. Omit it to use as much as both documents allow.","oneOf":[{"type":"number"},{"type":"null"}]},"confirm":{"description":"Send true only after the user has agreed to the allocation the refusal described.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","invoiceid","noteid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"invoiceid":{"description":"The sales invoice (for a credit note) or bill (for a debit note) to reduce, from list_invoices or get_document.","type":"string"},"noteid":{"description":"The credit note or debit note to set against it.","type":"string"},"amount":{"description":"How much of the note to set against it. Omit it to use as much as both documents allow.","oneOf":[{"type":"number"},{"type":"null"}]},"confirm":{"description":"Send true only after the user has agreed to the allocation the refusal described.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","invoiceid","noteid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Set a credit note against the sales invoice it credits, or a debit note against the bill it reduces, as the app's link on the note does. The invoice's outstanding amount goes down by the amount set; no payment is recorded and no ledger entry is added. Without amount it sets as much as both allow: the rest of the note, or the invoice's outstanding amount if that is less. Without confirm true it changes nothing and answers reason confirm-required naming both documents and the amount; ask the user, then call again with confirm true. Refuses a pair that is not credit note to sales invoice or debit note to bill (not-a-pair), a document in the bin (deleted), a void one, two currencies (currency-mismatch), a pair already linked (unchanged), an invoice with nothing outstanding, an amount of zero or less (invalid-amount), and more than is left on the note or outstanding on the invoice (over-allocated). A missing or another business's id is not-found.","tags":["invoices"]}},"/api/document/pdf":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"The invoice, quote, credit note or other document to save as a PDF, from list_invoices or get_document.","type":"string"},"share":{"description":"true also turns on the document's public link and returns it as link, for the user to send the customer. Needs invoice write. Omit it to only save the PDF.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"The invoice, quote, credit note or other document to save as a PDF, from list_invoices or get_document.","type":"string"},"share":{"description":"true also turns on the document's public link and returns it as link, for the user to send the customer. Needs invoice write. Omit it to only save the PDF.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"The invoice, quote, credit note or other document to save as a PDF, from list_invoices or get_document.","type":"string"},"share":{"description":"true also turns on the document's public link and returns it as link, for the user to send the customer. Needs invoice write. Omit it to only save the PDF.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"The invoice, quote, credit note or other document to save as a PDF, from list_invoices or get_document.","type":"string"},"share":{"description":"true also turns on the document's public link and returns it as link, for the user to send the customer. Needs invoice write. Omit it to only save the PDF.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Save a document (invoice, quote, credit note or any other kind) as a PDF in the business's Files, drawn as the customer sees it. Answers the new file's id and name: cite it as a file tag so the user can open and download it. Each call saves a new copy, so call it once per request. The file is kept, not imported into the books. A missing or another business's id is refused with reason document-not-found. With share true it also turns on the document's PUBLIC link and answers it as link (shared true): anyone who holds the link can open the document and download its PDF, so send it only to the customer. The link is the one the app's Copy link hands out, the same each call; it is switched off from the document's share settings, not by deleting the file. share true needs invoice write.","tags":["invoices"]}},"/api/errors/codes":{"get":{"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Every error code, the params it fills and its English line. Public and cacheable.","tags":["errors"]}},"/invoice/{uid}/{id}":{"get":{"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Preview quinvoice","tags":["public endpoints"]}},"/pay/i/{id}":{"get":{"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Pay invoice","tags":["payment endpoints"]}},"/pay/form/{reference}":{"get":{"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Post a processor's checkout form for the payer","tags":["payment endpoints"]}},"/pay/hello":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"apikey":{"type":"string"}},"required":["apikey"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"apikey":{"type":"string"}},"required":["apikey"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"apikey":{"type":"string"}},"required":["apikey"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"apikey":{"type":"string"}},"required":["apikey"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Test API key","tags":["payment endpoints"]}},"/pay/standard":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"integrationname":{"type":"string"},"amount":{"type":"number"},"payeremail":{"type":"string"},"payername":{"type":"string"},"redirect":{"type":"string"},"reference":{"type":"string"},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"meta":{"oneOf":[{},{"type":"null"}]}},"required":["integrationname","amount","payeremail","payername","redirect","reference"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"integrationname":{"type":"string"},"amount":{"type":"number"},"payeremail":{"type":"string"},"payername":{"type":"string"},"redirect":{"type":"string"},"reference":{"type":"string"},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"meta":{"oneOf":[{},{"type":"null"}]}},"required":["integrationname","amount","payeremail","payername","redirect","reference"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"integrationname":{"type":"string"},"amount":{"type":"number"},"payeremail":{"type":"string"},"payername":{"type":"string"},"redirect":{"type":"string"},"reference":{"type":"string"},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"meta":{"oneOf":[{},{"type":"null"}]}},"required":["integrationname","amount","payeremail","payername","redirect","reference"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"integrationname":{"type":"string"},"amount":{"type":"number"},"payeremail":{"type":"string"},"payername":{"type":"string"},"redirect":{"type":"string"},"reference":{"type":"string"},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"meta":{"oneOf":[{},{"type":"null"}]}},"required":["integrationname","amount","payeremail","payername","redirect","reference"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Initiate a payment from a third party service","tags":["payment endpoints"]}},"/pay/page":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"tag":{"type":"string"},"amount":{"type":"number"},"payeremail":{"type":"string"},"payername":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"message":{"oneOf":[{"type":"string"},{"type":"null"}]},"action":{"oneOf":[{"type":"string"},{"type":"null"}]},"dollars":{"oneOf":[{"type":"number"},{"type":"null"}]}},"required":["tag","amount","payeremail"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"tag":{"type":"string"},"amount":{"type":"number"},"payeremail":{"type":"string"},"payername":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"message":{"oneOf":[{"type":"string"},{"type":"null"}]},"action":{"oneOf":[{"type":"string"},{"type":"null"}]},"dollars":{"oneOf":[{"type":"number"},{"type":"null"}]}},"required":["tag","amount","payeremail"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"tag":{"type":"string"},"amount":{"type":"number"},"payeremail":{"type":"string"},"payername":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"message":{"oneOf":[{"type":"string"},{"type":"null"}]},"action":{"oneOf":[{"type":"string"},{"type":"null"}]},"dollars":{"oneOf":[{"type":"number"},{"type":"null"}]}},"required":["tag","amount","payeremail"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"tag":{"type":"string"},"amount":{"type":"number"},"payeremail":{"type":"string"},"payername":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"message":{"oneOf":[{"type":"string"},{"type":"null"}]},"action":{"oneOf":[{"type":"string"},{"type":"null"}]},"dollars":{"oneOf":[{"type":"number"},{"type":"null"}]}},"required":["tag","amount","payeremail"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Initiate a payment from the public payment page","tags":["payment endpoints"]}},"/pay/split":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"integrationname":{"type":"string"},"targetaccountid":{"type":"string"},"amount":{"type":"number"},"payeremail":{"type":"string"},"payername":{"type":"string"},"fee":{"type":"number"},"redirect":{"type":"string"},"reference":{"type":"string"},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"meta":{"oneOf":[{},{"type":"null"}]},"tag":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["integrationname","targetaccountid","amount","payeremail","payername","fee","redirect","reference"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"integrationname":{"type":"string"},"targetaccountid":{"type":"string"},"amount":{"type":"number"},"payeremail":{"type":"string"},"payername":{"type":"string"},"fee":{"type":"number"},"redirect":{"type":"string"},"reference":{"type":"string"},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"meta":{"oneOf":[{},{"type":"null"}]},"tag":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["integrationname","targetaccountid","amount","payeremail","payername","fee","redirect","reference"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"integrationname":{"type":"string"},"targetaccountid":{"type":"string"},"amount":{"type":"number"},"payeremail":{"type":"string"},"payername":{"type":"string"},"fee":{"type":"number"},"redirect":{"type":"string"},"reference":{"type":"string"},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"meta":{"oneOf":[{},{"type":"null"}]},"tag":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["integrationname","targetaccountid","amount","payeremail","payername","fee","redirect","reference"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"integrationname":{"type":"string"},"targetaccountid":{"type":"string"},"amount":{"type":"number"},"payeremail":{"type":"string"},"payername":{"type":"string"},"fee":{"type":"number"},"redirect":{"type":"string"},"reference":{"type":"string"},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"meta":{"oneOf":[{},{"type":"null"}]},"tag":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["integrationname","targetaccountid","amount","payeremail","payername","fee","redirect","reference"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Split a payment with another stub user","tags":["payment endpoints"]}},"/receipt/p/{id}":{"get":{"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Payment receipts","tags":["public endpoints"]}},"/api/transaction/create":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the transaction, only required for updates","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"Description of the transaction","oneOf":[{"type":"string"},{"type":"null"}]},"date":{"description":"Transaction date","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"value":{"description":"Transaction amount in the base currency","oneOf":[{"type":"number"},{"type":"null"}]},"basecurrency":{"description":"The base currency of the business","oneOf":[{"type":"string"},{"type":"null"}]},"transactioncurrency":{"description":"The currency of the transaction if different from base currency","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Exchange rate if transaction currency differs from base currency","oneOf":[{"type":"number"},{"type":"null"}]},"debitjournal":{"description":"ID of the account to debit","oneOf":[{"type":"string"},{"type":"null"}]},"creditjournal":{"description":"ID of the account to credit","oneOf":[{"type":"string"},{"type":"null"}]},"ignored":{"description":"Whether to ignore this transaction in reports","oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"description":"Additional notes about the transaction","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the transaction, only required for updates","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"Description of the transaction","oneOf":[{"type":"string"},{"type":"null"}]},"date":{"description":"Transaction date","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"value":{"description":"Transaction amount in the base currency","oneOf":[{"type":"number"},{"type":"null"}]},"basecurrency":{"description":"The base currency of the business","oneOf":[{"type":"string"},{"type":"null"}]},"transactioncurrency":{"description":"The currency of the transaction if different from base currency","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Exchange rate if transaction currency differs from base currency","oneOf":[{"type":"number"},{"type":"null"}]},"debitjournal":{"description":"ID of the account to debit","oneOf":[{"type":"string"},{"type":"null"}]},"creditjournal":{"description":"ID of the account to credit","oneOf":[{"type":"string"},{"type":"null"}]},"ignored":{"description":"Whether to ignore this transaction in reports","oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"description":"Additional notes about the transaction","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the transaction, only required for updates","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"Description of the transaction","oneOf":[{"type":"string"},{"type":"null"}]},"date":{"description":"Transaction date","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"value":{"description":"Transaction amount in the base currency","oneOf":[{"type":"number"},{"type":"null"}]},"basecurrency":{"description":"The base currency of the business","oneOf":[{"type":"string"},{"type":"null"}]},"transactioncurrency":{"description":"The currency of the transaction if different from base currency","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Exchange rate if transaction currency differs from base currency","oneOf":[{"type":"number"},{"type":"null"}]},"debitjournal":{"description":"ID of the account to debit","oneOf":[{"type":"string"},{"type":"null"}]},"creditjournal":{"description":"ID of the account to credit","oneOf":[{"type":"string"},{"type":"null"}]},"ignored":{"description":"Whether to ignore this transaction in reports","oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"description":"Additional notes about the transaction","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the transaction, only required for updates","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"Description of the transaction","oneOf":[{"type":"string"},{"type":"null"}]},"date":{"description":"Transaction date","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"value":{"description":"Transaction amount in the base currency","oneOf":[{"type":"number"},{"type":"null"}]},"basecurrency":{"description":"The base currency of the business","oneOf":[{"type":"string"},{"type":"null"}]},"transactioncurrency":{"description":"The currency of the transaction if different from base currency","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Exchange rate if transaction currency differs from base currency","oneOf":[{"type":"number"},{"type":"null"}]},"debitjournal":{"description":"ID of the account to debit","oneOf":[{"type":"string"},{"type":"null"}]},"creditjournal":{"description":"ID of the account to credit","oneOf":[{"type":"string"},{"type":"null"}]},"ignored":{"description":"Whether to ignore this transaction in reports","oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"description":"Additional notes about the transaction","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create a manual transaction.","tags":["transaction management"]}},"/api/transaction/update":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the transaction to update. Omit when sending items.","oneOf":[{"type":"string"},{"type":"null"}]},"items":{"description":"Several transactions to update in one call. Partial success: owned ids are written and the rest come back in `errors`. `deleted` true bins the transaction and the income/expense derived from it.","type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"description":"Description of the transaction","oneOf":[{"type":"string"},{"type":"null"}]},"date":{"description":"Transaction date, YYYY-MM-DD","oneOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"value":{"description":"Transaction amount in the base currency","oneOf":[{"type":"number"},{"type":"null"}]},"ignored":{"description":"Whether to exclude this transaction from the ledger","oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"description":"Additional notes about the transaction","oneOf":[{"type":"string"},{"type":"null"}]},"deleted":{"type":"boolean"}},"required":["id"],"additionalProperties":false},"minItems":1,"maxItems":1000},"description":{"description":"Description of the transaction","oneOf":[{"type":"string"},{"type":"null"}]},"date":{"description":"Transaction date, YYYY-MM-DD","oneOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"value":{"description":"Transaction amount in the base currency","oneOf":[{"type":"number"},{"type":"null"}]},"ignored":{"description":"Whether to exclude this transaction from the ledger","oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"description":"Additional notes about the transaction","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the transaction to update. Omit when sending items.","oneOf":[{"type":"string"},{"type":"null"}]},"items":{"description":"Several transactions to update in one call. Partial success: owned ids are written and the rest come back in `errors`. `deleted` true bins the transaction and the income/expense derived from it.","type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"description":"Description of the transaction","oneOf":[{"type":"string"},{"type":"null"}]},"date":{"description":"Transaction date, YYYY-MM-DD","oneOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"value":{"description":"Transaction amount in the base currency","oneOf":[{"type":"number"},{"type":"null"}]},"ignored":{"description":"Whether to exclude this transaction from the ledger","oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"description":"Additional notes about the transaction","oneOf":[{"type":"string"},{"type":"null"}]},"deleted":{"type":"boolean"}},"required":["id"],"additionalProperties":false},"minItems":1,"maxItems":1000},"description":{"description":"Description of the transaction","oneOf":[{"type":"string"},{"type":"null"}]},"date":{"description":"Transaction date, YYYY-MM-DD","oneOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"value":{"description":"Transaction amount in the base currency","oneOf":[{"type":"number"},{"type":"null"}]},"ignored":{"description":"Whether to exclude this transaction from the ledger","oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"description":"Additional notes about the transaction","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the transaction to update. Omit when sending items.","oneOf":[{"type":"string"},{"type":"null"}]},"items":{"description":"Several transactions to update in one call. Partial success: owned ids are written and the rest come back in `errors`. `deleted` true bins the transaction and the income/expense derived from it.","type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"description":"Description of the transaction","oneOf":[{"type":"string"},{"type":"null"}]},"date":{"description":"Transaction date, YYYY-MM-DD","oneOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"value":{"description":"Transaction amount in the base currency","oneOf":[{"type":"number"},{"type":"null"}]},"ignored":{"description":"Whether to exclude this transaction from the ledger","oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"description":"Additional notes about the transaction","oneOf":[{"type":"string"},{"type":"null"}]},"deleted":{"type":"boolean"}},"required":["id"],"additionalProperties":false},"minItems":1,"maxItems":1000},"description":{"description":"Description of the transaction","oneOf":[{"type":"string"},{"type":"null"}]},"date":{"description":"Transaction date, YYYY-MM-DD","oneOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"value":{"description":"Transaction amount in the base currency","oneOf":[{"type":"number"},{"type":"null"}]},"ignored":{"description":"Whether to exclude this transaction from the ledger","oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"description":"Additional notes about the transaction","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the transaction to update. Omit when sending items.","oneOf":[{"type":"string"},{"type":"null"}]},"items":{"description":"Several transactions to update in one call. Partial success: owned ids are written and the rest come back in `errors`. `deleted` true bins the transaction and the income/expense derived from it.","type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"description":"Description of the transaction","oneOf":[{"type":"string"},{"type":"null"}]},"date":{"description":"Transaction date, YYYY-MM-DD","oneOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"value":{"description":"Transaction amount in the base currency","oneOf":[{"type":"number"},{"type":"null"}]},"ignored":{"description":"Whether to exclude this transaction from the ledger","oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"description":"Additional notes about the transaction","oneOf":[{"type":"string"},{"type":"null"}]},"deleted":{"type":"boolean"}},"required":["id"],"additionalProperties":false},"minItems":1,"maxItems":1000},"description":{"description":"Description of the transaction","oneOf":[{"type":"string"},{"type":"null"}]},"date":{"description":"Transaction date, YYYY-MM-DD","oneOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"value":{"description":"Transaction amount in the base currency","oneOf":[{"type":"number"},{"type":"null"}]},"ignored":{"description":"Whether to exclude this transaction from the ledger","oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"description":"Additional notes about the transaction","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Edit the imported BANK LINE by id, not the accounting entry categorised from it; to recategorise or re-attribute, use save_expense or save_income. Send `id` with the fields to change, or an `items` array to change many in one call. `items` is partial success: owned lines are written and the rest come back in `errors`. An item with `deleted` true bins the line and the income/expense derived from it.","tags":["transaction management"]}},"/api/transaction/update-many":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"transactions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"date":{"oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"value":{"oneOf":[{"type":"number"},{"type":"null"}]},"ignored":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"deleted":{"type":"boolean"}},"required":["id"],"additionalProperties":false}}},"required":["token","transactions"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"transactions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"date":{"oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"value":{"oneOf":[{"type":"number"},{"type":"null"}]},"ignored":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"deleted":{"type":"boolean"}},"required":["id"],"additionalProperties":false}}},"required":["token","transactions"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"transactions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"date":{"oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"value":{"oneOf":[{"type":"number"},{"type":"null"}]},"ignored":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"deleted":{"type":"boolean"}},"required":["id"],"additionalProperties":false}}},"required":["token","transactions"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"transactions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"date":{"oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"value":{"oneOf":[{"type":"number"},{"type":"null"}]},"ignored":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"deleted":{"type":"boolean"}},"required":["id"],"additionalProperties":false}}},"required":["token","transactions"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Update many transactions in one all-or-nothing call (description, date, value, ignored, notes, deleted per item). stub-web only; off the MCP surface, where update_transaction items covers it with partial success.","tags":["transaction management"]}},"/api/transaction/include-many":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"ids":{"description":"Ids of the transactions to include (un-ignore) in the general ledger","type":"array","items":{"type":"string"},"minItems":1}},"required":["token","ids"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"ids":{"description":"Ids of the transactions to include (un-ignore) in the general ledger","type":"array","items":{"type":"string"},"minItems":1}},"required":["token","ids"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"ids":{"description":"Ids of the transactions to include (un-ignore) in the general ledger","type":"array","items":{"type":"string"},"minItems":1}},"required":["token","ids"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"ids":{"description":"Ids of the transactions to include (un-ignore) in the general ledger","type":"array","items":{"type":"string"},"minItems":1}},"required":["token","ids"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Include (un-ignore) many bank transactions in one atomic call — the exact inverse of excluding them. Restores the income/expense entries the exclude soft-deleted rather than creating duplicates, and only creates a fresh entry for a transaction that never had one. Safe to retry: a second call changes nothing.","tags":["transaction management"]}},"/api/transaction/delete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the transaction","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the transaction","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the transaction","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the transaction","type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Delete transaction data","tags":["transaction management"]}},"/api/transaction/delete-all":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Delete all transaction data","tags":["transaction management"]}},"/api/transaction/v2/create":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"direction":{"description":"\"in\" or \"out\". Required on create.","oneOf":[{"type":"string","enum":["in","out"]},{"type":"null"}]},"date":{"description":"The date the money moved (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Description.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"The money that moved: always positive and gross, whatever the direction.","oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"description":"Units bought, money out only; amount stays the total.","oneOf":[{"type":"number"},{"type":"null"}]},"currency":{"description":"ISO 4217 code. Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Rate to the base currency; omit for the stored or market rate.","oneOf":[{"type":"number"},{"type":"null"}]},"accountid":{"description":"Where the money is allocated: an account id; a document id, which makes this a payment against that invoice, bill, order or note; a contact id, which puts it on that contact's account; or an asset id, which buys or sells that asset. \"\" leaves it uncategorised.","oneOf":[{"type":"string"},{"type":"null"}]},"contactside":{"description":"\"client\" or \"supplier\", only where accountid is a contact holding both roles.","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"description":"The bank or cash ledger the money was paid into (in) or from (out).","oneOf":[{"type":"string"},{"type":"null"}]},"contact":{"description":"The contact id. First use adds the customer role for in, the supplier role for out.","oneOf":[{"type":"string"},{"type":"null"}]},"reference":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"taglist":{"description":"Tag ids; replaces the set.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"split":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"groupid":{"oneOf":[{"type":"string"},{"type":"null"}]},"slip":{"description":"Money out only: \"paid\" or \"onaccount\".","oneOf":[{"type":"string"},{"type":"null"}]},"flagged":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"deleted":{"description":"true bins, false restores.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"direction":{"description":"\"in\" or \"out\". Required on create.","oneOf":[{"type":"string","enum":["in","out"]},{"type":"null"}]},"date":{"description":"The date the money moved (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Description.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"The money that moved: always positive and gross, whatever the direction.","oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"description":"Units bought, money out only; amount stays the total.","oneOf":[{"type":"number"},{"type":"null"}]},"currency":{"description":"ISO 4217 code. Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Rate to the base currency; omit for the stored or market rate.","oneOf":[{"type":"number"},{"type":"null"}]},"accountid":{"description":"Where the money is allocated: an account id; a document id, which makes this a payment against that invoice, bill, order or note; a contact id, which puts it on that contact's account; or an asset id, which buys or sells that asset. \"\" leaves it uncategorised.","oneOf":[{"type":"string"},{"type":"null"}]},"contactside":{"description":"\"client\" or \"supplier\", only where accountid is a contact holding both roles.","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"description":"The bank or cash ledger the money was paid into (in) or from (out).","oneOf":[{"type":"string"},{"type":"null"}]},"contact":{"description":"The contact id. First use adds the customer role for in, the supplier role for out.","oneOf":[{"type":"string"},{"type":"null"}]},"reference":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"taglist":{"description":"Tag ids; replaces the set.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"split":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"groupid":{"oneOf":[{"type":"string"},{"type":"null"}]},"slip":{"description":"Money out only: \"paid\" or \"onaccount\".","oneOf":[{"type":"string"},{"type":"null"}]},"flagged":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"deleted":{"description":"true bins, false restores.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"direction":{"description":"\"in\" or \"out\". Required on create.","oneOf":[{"type":"string","enum":["in","out"]},{"type":"null"}]},"date":{"description":"The date the money moved (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Description.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"The money that moved: always positive and gross, whatever the direction.","oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"description":"Units bought, money out only; amount stays the total.","oneOf":[{"type":"number"},{"type":"null"}]},"currency":{"description":"ISO 4217 code. Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Rate to the base currency; omit for the stored or market rate.","oneOf":[{"type":"number"},{"type":"null"}]},"accountid":{"description":"Where the money is allocated: an account id; a document id, which makes this a payment against that invoice, bill, order or note; a contact id, which puts it on that contact's account; or an asset id, which buys or sells that asset. \"\" leaves it uncategorised.","oneOf":[{"type":"string"},{"type":"null"}]},"contactside":{"description":"\"client\" or \"supplier\", only where accountid is a contact holding both roles.","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"description":"The bank or cash ledger the money was paid into (in) or from (out).","oneOf":[{"type":"string"},{"type":"null"}]},"contact":{"description":"The contact id. First use adds the customer role for in, the supplier role for out.","oneOf":[{"type":"string"},{"type":"null"}]},"reference":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"taglist":{"description":"Tag ids; replaces the set.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"split":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"groupid":{"oneOf":[{"type":"string"},{"type":"null"}]},"slip":{"description":"Money out only: \"paid\" or \"onaccount\".","oneOf":[{"type":"string"},{"type":"null"}]},"flagged":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"deleted":{"description":"true bins, false restores.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"direction":{"description":"\"in\" or \"out\". Required on create.","oneOf":[{"type":"string","enum":["in","out"]},{"type":"null"}]},"date":{"description":"The date the money moved (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Description.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"The money that moved: always positive and gross, whatever the direction.","oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"description":"Units bought, money out only; amount stays the total.","oneOf":[{"type":"number"},{"type":"null"}]},"currency":{"description":"ISO 4217 code. Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Rate to the base currency; omit for the stored or market rate.","oneOf":[{"type":"number"},{"type":"null"}]},"accountid":{"description":"Where the money is allocated: an account id; a document id, which makes this a payment against that invoice, bill, order or note; a contact id, which puts it on that contact's account; or an asset id, which buys or sells that asset. \"\" leaves it uncategorised.","oneOf":[{"type":"string"},{"type":"null"}]},"contactside":{"description":"\"client\" or \"supplier\", only where accountid is a contact holding both roles.","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"description":"The bank or cash ledger the money was paid into (in) or from (out).","oneOf":[{"type":"string"},{"type":"null"}]},"contact":{"description":"The contact id. First use adds the customer role for in, the supplier role for out.","oneOf":[{"type":"string"},{"type":"null"}]},"reference":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"taglist":{"description":"Tag ids; replaces the set.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"split":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"groupid":{"oneOf":[{"type":"string"},{"type":"null"}]},"slip":{"description":"Money out only: \"paid\" or \"onaccount\".","oneOf":[{"type":"string"},{"type":"null"}]},"flagged":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"deleted":{"description":"true bins, false restores.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Record money in or out. direction is required and amount is always positive. Returns the new id.","tags":["transactions"]}},"/api/transaction/v2/update":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"direction":{"description":"\"in\" or \"out\". Required on create.","oneOf":[{"type":"string","enum":["in","out"]},{"type":"null"}]},"date":{"description":"The date the money moved (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Description.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"The money that moved: always positive and gross, whatever the direction.","oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"description":"Units bought, money out only; amount stays the total.","oneOf":[{"type":"number"},{"type":"null"}]},"currency":{"description":"ISO 4217 code. Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Rate to the base currency; omit for the stored or market rate.","oneOf":[{"type":"number"},{"type":"null"}]},"accountid":{"description":"Where the money is allocated: an account id; a document id, which makes this a payment against that invoice, bill, order or note; a contact id, which puts it on that contact's account; or an asset id, which buys or sells that asset. \"\" leaves it uncategorised.","oneOf":[{"type":"string"},{"type":"null"}]},"contactside":{"description":"\"client\" or \"supplier\", only where accountid is a contact holding both roles.","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"description":"The bank or cash ledger the money was paid into (in) or from (out).","oneOf":[{"type":"string"},{"type":"null"}]},"contact":{"description":"The contact id. First use adds the customer role for in, the supplier role for out.","oneOf":[{"type":"string"},{"type":"null"}]},"reference":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"taglist":{"description":"Tag ids; replaces the set.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"split":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"groupid":{"oneOf":[{"type":"string"},{"type":"null"}]},"slip":{"description":"Money out only: \"paid\" or \"onaccount\".","oneOf":[{"type":"string"},{"type":"null"}]},"flagged":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"deleted":{"description":"true bins, false restores.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"direction":{"description":"\"in\" or \"out\". Required on create.","oneOf":[{"type":"string","enum":["in","out"]},{"type":"null"}]},"date":{"description":"The date the money moved (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Description.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"The money that moved: always positive and gross, whatever the direction.","oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"description":"Units bought, money out only; amount stays the total.","oneOf":[{"type":"number"},{"type":"null"}]},"currency":{"description":"ISO 4217 code. Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Rate to the base currency; omit for the stored or market rate.","oneOf":[{"type":"number"},{"type":"null"}]},"accountid":{"description":"Where the money is allocated: an account id; a document id, which makes this a payment against that invoice, bill, order or note; a contact id, which puts it on that contact's account; or an asset id, which buys or sells that asset. \"\" leaves it uncategorised.","oneOf":[{"type":"string"},{"type":"null"}]},"contactside":{"description":"\"client\" or \"supplier\", only where accountid is a contact holding both roles.","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"description":"The bank or cash ledger the money was paid into (in) or from (out).","oneOf":[{"type":"string"},{"type":"null"}]},"contact":{"description":"The contact id. First use adds the customer role for in, the supplier role for out.","oneOf":[{"type":"string"},{"type":"null"}]},"reference":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"taglist":{"description":"Tag ids; replaces the set.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"split":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"groupid":{"oneOf":[{"type":"string"},{"type":"null"}]},"slip":{"description":"Money out only: \"paid\" or \"onaccount\".","oneOf":[{"type":"string"},{"type":"null"}]},"flagged":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"deleted":{"description":"true bins, false restores.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"direction":{"description":"\"in\" or \"out\". Required on create.","oneOf":[{"type":"string","enum":["in","out"]},{"type":"null"}]},"date":{"description":"The date the money moved (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Description.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"The money that moved: always positive and gross, whatever the direction.","oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"description":"Units bought, money out only; amount stays the total.","oneOf":[{"type":"number"},{"type":"null"}]},"currency":{"description":"ISO 4217 code. Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Rate to the base currency; omit for the stored or market rate.","oneOf":[{"type":"number"},{"type":"null"}]},"accountid":{"description":"Where the money is allocated: an account id; a document id, which makes this a payment against that invoice, bill, order or note; a contact id, which puts it on that contact's account; or an asset id, which buys or sells that asset. \"\" leaves it uncategorised.","oneOf":[{"type":"string"},{"type":"null"}]},"contactside":{"description":"\"client\" or \"supplier\", only where accountid is a contact holding both roles.","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"description":"The bank or cash ledger the money was paid into (in) or from (out).","oneOf":[{"type":"string"},{"type":"null"}]},"contact":{"description":"The contact id. First use adds the customer role for in, the supplier role for out.","oneOf":[{"type":"string"},{"type":"null"}]},"reference":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"taglist":{"description":"Tag ids; replaces the set.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"split":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"groupid":{"oneOf":[{"type":"string"},{"type":"null"}]},"slip":{"description":"Money out only: \"paid\" or \"onaccount\".","oneOf":[{"type":"string"},{"type":"null"}]},"flagged":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"deleted":{"description":"true bins, false restores.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"direction":{"description":"\"in\" or \"out\". Required on create.","oneOf":[{"type":"string","enum":["in","out"]},{"type":"null"}]},"date":{"description":"The date the money moved (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Description.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"The money that moved: always positive and gross, whatever the direction.","oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"description":"Units bought, money out only; amount stays the total.","oneOf":[{"type":"number"},{"type":"null"}]},"currency":{"description":"ISO 4217 code. Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Rate to the base currency; omit for the stored or market rate.","oneOf":[{"type":"number"},{"type":"null"}]},"accountid":{"description":"Where the money is allocated: an account id; a document id, which makes this a payment against that invoice, bill, order or note; a contact id, which puts it on that contact's account; or an asset id, which buys or sells that asset. \"\" leaves it uncategorised.","oneOf":[{"type":"string"},{"type":"null"}]},"contactside":{"description":"\"client\" or \"supplier\", only where accountid is a contact holding both roles.","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"description":"The bank or cash ledger the money was paid into (in) or from (out).","oneOf":[{"type":"string"},{"type":"null"}]},"contact":{"description":"The contact id. First use adds the customer role for in, the supplier role for out.","oneOf":[{"type":"string"},{"type":"null"}]},"reference":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"taglist":{"description":"Tag ids; replaces the set.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"split":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"groupid":{"oneOf":[{"type":"string"},{"type":"null"}]},"slip":{"description":"Money out only: \"paid\" or \"onaccount\".","oneOf":[{"type":"string"},{"type":"null"}]},"flagged":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"deleted":{"description":"true bins, false restores.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Edit a transaction by id. Any field may change, direction too: the entry re-posts. \"\" unallocates accountid and \"$delete\" clears any other field.","tags":["transactions"]}},"/api/transaction/v2/update-many":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"transactions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"direction":{"description":"\"in\" or \"out\". Required on create.","oneOf":[{"type":"string","enum":["in","out"]},{"type":"null"}]},"date":{"description":"The date the money moved (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Description.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"The money that moved: always positive and gross, whatever the direction.","oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"description":"Units bought, money out only; amount stays the total.","oneOf":[{"type":"number"},{"type":"null"}]},"currency":{"description":"ISO 4217 code. Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Rate to the base currency; omit for the stored or market rate.","oneOf":[{"type":"number"},{"type":"null"}]},"accountid":{"description":"Where the money is allocated: an account id; a document id, which makes this a payment against that invoice, bill, order or note; a contact id, which puts it on that contact's account; or an asset id, which buys or sells that asset. \"\" leaves it uncategorised.","oneOf":[{"type":"string"},{"type":"null"}]},"contactside":{"description":"\"client\" or \"supplier\", only where accountid is a contact holding both roles.","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"description":"The bank or cash ledger the money was paid into (in) or from (out).","oneOf":[{"type":"string"},{"type":"null"}]},"contact":{"description":"The contact id. First use adds the customer role for in, the supplier role for out.","oneOf":[{"type":"string"},{"type":"null"}]},"reference":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"taglist":{"description":"Tag ids; replaces the set.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"split":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"groupid":{"oneOf":[{"type":"string"},{"type":"null"}]},"slip":{"description":"Money out only: \"paid\" or \"onaccount\".","oneOf":[{"type":"string"},{"type":"null"}]},"flagged":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"deleted":{"description":"true bins, false restores.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["id"],"additionalProperties":false}}},"required":["token","transactions"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"transactions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"direction":{"description":"\"in\" or \"out\". Required on create.","oneOf":[{"type":"string","enum":["in","out"]},{"type":"null"}]},"date":{"description":"The date the money moved (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Description.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"The money that moved: always positive and gross, whatever the direction.","oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"description":"Units bought, money out only; amount stays the total.","oneOf":[{"type":"number"},{"type":"null"}]},"currency":{"description":"ISO 4217 code. Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Rate to the base currency; omit for the stored or market rate.","oneOf":[{"type":"number"},{"type":"null"}]},"accountid":{"description":"Where the money is allocated: an account id; a document id, which makes this a payment against that invoice, bill, order or note; a contact id, which puts it on that contact's account; or an asset id, which buys or sells that asset. \"\" leaves it uncategorised.","oneOf":[{"type":"string"},{"type":"null"}]},"contactside":{"description":"\"client\" or \"supplier\", only where accountid is a contact holding both roles.","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"description":"The bank or cash ledger the money was paid into (in) or from (out).","oneOf":[{"type":"string"},{"type":"null"}]},"contact":{"description":"The contact id. First use adds the customer role for in, the supplier role for out.","oneOf":[{"type":"string"},{"type":"null"}]},"reference":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"taglist":{"description":"Tag ids; replaces the set.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"split":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"groupid":{"oneOf":[{"type":"string"},{"type":"null"}]},"slip":{"description":"Money out only: \"paid\" or \"onaccount\".","oneOf":[{"type":"string"},{"type":"null"}]},"flagged":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"deleted":{"description":"true bins, false restores.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["id"],"additionalProperties":false}}},"required":["token","transactions"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"transactions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"direction":{"description":"\"in\" or \"out\". Required on create.","oneOf":[{"type":"string","enum":["in","out"]},{"type":"null"}]},"date":{"description":"The date the money moved (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Description.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"The money that moved: always positive and gross, whatever the direction.","oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"description":"Units bought, money out only; amount stays the total.","oneOf":[{"type":"number"},{"type":"null"}]},"currency":{"description":"ISO 4217 code. Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Rate to the base currency; omit for the stored or market rate.","oneOf":[{"type":"number"},{"type":"null"}]},"accountid":{"description":"Where the money is allocated: an account id; a document id, which makes this a payment against that invoice, bill, order or note; a contact id, which puts it on that contact's account; or an asset id, which buys or sells that asset. \"\" leaves it uncategorised.","oneOf":[{"type":"string"},{"type":"null"}]},"contactside":{"description":"\"client\" or \"supplier\", only where accountid is a contact holding both roles.","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"description":"The bank or cash ledger the money was paid into (in) or from (out).","oneOf":[{"type":"string"},{"type":"null"}]},"contact":{"description":"The contact id. First use adds the customer role for in, the supplier role for out.","oneOf":[{"type":"string"},{"type":"null"}]},"reference":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"taglist":{"description":"Tag ids; replaces the set.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"split":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"groupid":{"oneOf":[{"type":"string"},{"type":"null"}]},"slip":{"description":"Money out only: \"paid\" or \"onaccount\".","oneOf":[{"type":"string"},{"type":"null"}]},"flagged":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"deleted":{"description":"true bins, false restores.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["id"],"additionalProperties":false}}},"required":["token","transactions"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"transactions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"direction":{"description":"\"in\" or \"out\". Required on create.","oneOf":[{"type":"string","enum":["in","out"]},{"type":"null"}]},"date":{"description":"The date the money moved (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Description.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"The money that moved: always positive and gross, whatever the direction.","oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"description":"Units bought, money out only; amount stays the total.","oneOf":[{"type":"number"},{"type":"null"}]},"currency":{"description":"ISO 4217 code. Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Rate to the base currency; omit for the stored or market rate.","oneOf":[{"type":"number"},{"type":"null"}]},"accountid":{"description":"Where the money is allocated: an account id; a document id, which makes this a payment against that invoice, bill, order or note; a contact id, which puts it on that contact's account; or an asset id, which buys or sells that asset. \"\" leaves it uncategorised.","oneOf":[{"type":"string"},{"type":"null"}]},"contactside":{"description":"\"client\" or \"supplier\", only where accountid is a contact holding both roles.","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"description":"The bank or cash ledger the money was paid into (in) or from (out).","oneOf":[{"type":"string"},{"type":"null"}]},"contact":{"description":"The contact id. First use adds the customer role for in, the supplier role for out.","oneOf":[{"type":"string"},{"type":"null"}]},"reference":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"taglist":{"description":"Tag ids; replaces the set.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"split":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"groupid":{"oneOf":[{"type":"string"},{"type":"null"}]},"slip":{"description":"Money out only: \"paid\" or \"onaccount\".","oneOf":[{"type":"string"},{"type":"null"}]},"flagged":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"deleted":{"description":"true bins, false restores.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["id"],"additionalProperties":false}}},"required":["token","transactions"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Edit many transactions at once. deleted true bins a transaction and false restores it.","tags":["transactions"]}},"/api/transaction/v2/delete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Bin a transaction. Restore it with update-many and deleted false.","tags":["transactions"]}},"/api/transaction/v2/split":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"legs":{"type":"array","items":{"type":"object","properties":{"amount":{"type":"number"},"direction":{"type":"string","enum":["in","out"]},"accountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"contact":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"taglist":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["amount","direction"],"additionalProperties":false}}},"required":["token","id","legs"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"legs":{"type":"array","items":{"type":"object","properties":{"amount":{"type":"number"},"direction":{"type":"string","enum":["in","out"]},"accountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"contact":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"taglist":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["amount","direction"],"additionalProperties":false}}},"required":["token","id","legs"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"legs":{"type":"array","items":{"type":"object","properties":{"amount":{"type":"number"},"direction":{"type":"string","enum":["in","out"]},"accountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"contact":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"taglist":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["amount","direction"],"additionalProperties":false}}},"required":["token","id","legs"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"legs":{"type":"array","items":{"type":"object","properties":{"amount":{"type":"number"},"direction":{"type":"string","enum":["in","out"]},"accountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"contact":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"taglist":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["amount","direction"],"additionalProperties":false}}},"required":["token","id","legs"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Split a transaction into legs in one write. The legs sum to the original, signed by direction; the first keeps the id and every leg keeps the bank identity and one groupid.","tags":["transactions"]}},"/api/bankaccount/list":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"List the business's bank accounts: each account's name, bank, type, currency, opening balance and the bank-reported balance as of `$latestbalancedate` (the statement's running balance, not the ledger). Each account carries `private`: true marks a personal account kept out of the books; never count its balance as business cash. Each account carries `feed`, the same health the app shows: `feed` is \"live\" (a bank connection fills it), \"pending\" (connecting), \"attention\" (it needs the customer, often only a Sync), \"failing\" (connected but broken), \"off\" (switched off) or \"manual\" (no connection: entered by hand or by statement import). `reason` names why, `message` is the sentence the customer sees, `actions` the standard fixes (first is primary), `provider` what feeds it, `since` the date of its newest transaction from the feed and `lastsync` the last clean pull. When the health could not be read just now, `feed` is null and `reason` is \"unavailable\": say so, and never guess. Read it; never guess whether an account has a feed.","tags":["bank account management"]}},"/api/bankaccount/create":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the bank account, required for updates","oneOf":[{"type":"string"},{"type":"null"}]},"accountname":{"description":"Name of the bank account","oneOf":[{"type":"string"},{"type":"null"}]},"accountnumber":{"description":"Bank account number","oneOf":[{"type":"string"},{"type":"null"}]},"accounttype":{"description":"Type of account (e.g., checking, savings)","oneOf":[{"type":"string"},{"type":"null"}]},"bank":{"description":"Name of the bank","oneOf":[{"type":"string"},{"type":"null"}]},"branchcode":{"description":"Bank branch code or routing number","oneOf":[{"type":"string"},{"type":"null"}]},"sync":{"description":"Whether automatic bank sync is enabled","oneOf":[{"type":"boolean"},{"type":"null"}]},"syncing":{"description":"Whether sync is currently in progress","oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"description":"Opening balance for the account","oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"description":"Date of the opening balance","oneOf":[{"type":"string"},{"type":"null"}]},"openingrate":{"description":"PROD-2452: for an account in a currency other than the business's, the opening exchange rate as account-currency units per one base unit (21.7821 ZAR per GBP); must be above 0. Omitted, the rate feed's rate on the opening date is used. Ignored for a base-currency account.","oneOf":[{"type":"number"},{"type":"null"}]},"clearopeningbalance":{"description":"PROD-1200: when true, fully REMOVE the opening balance — retracts openingbalance, openingdate and the FX opening rate and base value (clears the Insights banner). Distinct from setting the balance to 0, which stays 'set'.","oneOf":[{"type":"boolean"},{"type":"null"}]},"confirm":{"description":"PROD-1536: required only to save an opening date that is LATER than the account's own earliest transaction. Without it that one case is refused, unwritten, with code confirm-required plus earliesttransactiondate and transactionsbefore, so the caller can show what the date would exclude and let the user override it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"creditaccount":{"description":"Default credit account ID","oneOf":[{"type":"string"},{"type":"null"}]},"creditjournal":{"description":"Default credit journal ID","oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"description":"Whether the account is archived","oneOf":[{"type":"boolean"},{"type":"null"}]},"hidden":{"description":"Whether the account is hidden/soft-deleted (removes its card; also stops sync)","oneOf":[{"type":"boolean"},{"type":"null"}]},"swiftcode":{"description":"SWIFT/BIC code for international transfers","oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"The ledger account this bank account settles into. PROD-2612: set it to one of the business's own asset accounts to use that account instead of minting a new one; it must not be a control or built-in account or another bank's, and the request must leave out the opening balance and any other currency. Refused with a link-* reason.","oneOf":[{"type":"string"},{"type":"null"}]},"private":{"description":"Whether this is a private account","oneOf":[{"type":"boolean"},{"type":"null"}]},"syncenabled":{"description":"Whether this account is enabled for bank sync","oneOf":[{"type":"boolean"},{"type":"null"}]},"currency":{"description":"ISO 4217 code (e.g. \"USD\") stamped on the new ledger account. Omit for the business's base currency; an unknown code is refused with reason unknown-currency.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the bank account, required for updates","oneOf":[{"type":"string"},{"type":"null"}]},"accountname":{"description":"Name of the bank account","oneOf":[{"type":"string"},{"type":"null"}]},"accountnumber":{"description":"Bank account number","oneOf":[{"type":"string"},{"type":"null"}]},"accounttype":{"description":"Type of account (e.g., checking, savings)","oneOf":[{"type":"string"},{"type":"null"}]},"bank":{"description":"Name of the bank","oneOf":[{"type":"string"},{"type":"null"}]},"branchcode":{"description":"Bank branch code or routing number","oneOf":[{"type":"string"},{"type":"null"}]},"sync":{"description":"Whether automatic bank sync is enabled","oneOf":[{"type":"boolean"},{"type":"null"}]},"syncing":{"description":"Whether sync is currently in progress","oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"description":"Opening balance for the account","oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"description":"Date of the opening balance","oneOf":[{"type":"string"},{"type":"null"}]},"openingrate":{"description":"PROD-2452: for an account in a currency other than the business's, the opening exchange rate as account-currency units per one base unit (21.7821 ZAR per GBP); must be above 0. Omitted, the rate feed's rate on the opening date is used. Ignored for a base-currency account.","oneOf":[{"type":"number"},{"type":"null"}]},"clearopeningbalance":{"description":"PROD-1200: when true, fully REMOVE the opening balance — retracts openingbalance, openingdate and the FX opening rate and base value (clears the Insights banner). Distinct from setting the balance to 0, which stays 'set'.","oneOf":[{"type":"boolean"},{"type":"null"}]},"confirm":{"description":"PROD-1536: required only to save an opening date that is LATER than the account's own earliest transaction. Without it that one case is refused, unwritten, with code confirm-required plus earliesttransactiondate and transactionsbefore, so the caller can show what the date would exclude and let the user override it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"creditaccount":{"description":"Default credit account ID","oneOf":[{"type":"string"},{"type":"null"}]},"creditjournal":{"description":"Default credit journal ID","oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"description":"Whether the account is archived","oneOf":[{"type":"boolean"},{"type":"null"}]},"hidden":{"description":"Whether the account is hidden/soft-deleted (removes its card; also stops sync)","oneOf":[{"type":"boolean"},{"type":"null"}]},"swiftcode":{"description":"SWIFT/BIC code for international transfers","oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"The ledger account this bank account settles into. PROD-2612: set it to one of the business's own asset accounts to use that account instead of minting a new one; it must not be a control or built-in account or another bank's, and the request must leave out the opening balance and any other currency. Refused with a link-* reason.","oneOf":[{"type":"string"},{"type":"null"}]},"private":{"description":"Whether this is a private account","oneOf":[{"type":"boolean"},{"type":"null"}]},"syncenabled":{"description":"Whether this account is enabled for bank sync","oneOf":[{"type":"boolean"},{"type":"null"}]},"currency":{"description":"ISO 4217 code (e.g. \"USD\") stamped on the new ledger account. Omit for the business's base currency; an unknown code is refused with reason unknown-currency.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the bank account, required for updates","oneOf":[{"type":"string"},{"type":"null"}]},"accountname":{"description":"Name of the bank account","oneOf":[{"type":"string"},{"type":"null"}]},"accountnumber":{"description":"Bank account number","oneOf":[{"type":"string"},{"type":"null"}]},"accounttype":{"description":"Type of account (e.g., checking, savings)","oneOf":[{"type":"string"},{"type":"null"}]},"bank":{"description":"Name of the bank","oneOf":[{"type":"string"},{"type":"null"}]},"branchcode":{"description":"Bank branch code or routing number","oneOf":[{"type":"string"},{"type":"null"}]},"sync":{"description":"Whether automatic bank sync is enabled","oneOf":[{"type":"boolean"},{"type":"null"}]},"syncing":{"description":"Whether sync is currently in progress","oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"description":"Opening balance for the account","oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"description":"Date of the opening balance","oneOf":[{"type":"string"},{"type":"null"}]},"openingrate":{"description":"PROD-2452: for an account in a currency other than the business's, the opening exchange rate as account-currency units per one base unit (21.7821 ZAR per GBP); must be above 0. Omitted, the rate feed's rate on the opening date is used. Ignored for a base-currency account.","oneOf":[{"type":"number"},{"type":"null"}]},"clearopeningbalance":{"description":"PROD-1200: when true, fully REMOVE the opening balance — retracts openingbalance, openingdate and the FX opening rate and base value (clears the Insights banner). Distinct from setting the balance to 0, which stays 'set'.","oneOf":[{"type":"boolean"},{"type":"null"}]},"confirm":{"description":"PROD-1536: required only to save an opening date that is LATER than the account's own earliest transaction. Without it that one case is refused, unwritten, with code confirm-required plus earliesttransactiondate and transactionsbefore, so the caller can show what the date would exclude and let the user override it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"creditaccount":{"description":"Default credit account ID","oneOf":[{"type":"string"},{"type":"null"}]},"creditjournal":{"description":"Default credit journal ID","oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"description":"Whether the account is archived","oneOf":[{"type":"boolean"},{"type":"null"}]},"hidden":{"description":"Whether the account is hidden/soft-deleted (removes its card; also stops sync)","oneOf":[{"type":"boolean"},{"type":"null"}]},"swiftcode":{"description":"SWIFT/BIC code for international transfers","oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"The ledger account this bank account settles into. PROD-2612: set it to one of the business's own asset accounts to use that account instead of minting a new one; it must not be a control or built-in account or another bank's, and the request must leave out the opening balance and any other currency. Refused with a link-* reason.","oneOf":[{"type":"string"},{"type":"null"}]},"private":{"description":"Whether this is a private account","oneOf":[{"type":"boolean"},{"type":"null"}]},"syncenabled":{"description":"Whether this account is enabled for bank sync","oneOf":[{"type":"boolean"},{"type":"null"}]},"currency":{"description":"ISO 4217 code (e.g. \"USD\") stamped on the new ledger account. Omit for the business's base currency; an unknown code is refused with reason unknown-currency.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the bank account, required for updates","oneOf":[{"type":"string"},{"type":"null"}]},"accountname":{"description":"Name of the bank account","oneOf":[{"type":"string"},{"type":"null"}]},"accountnumber":{"description":"Bank account number","oneOf":[{"type":"string"},{"type":"null"}]},"accounttype":{"description":"Type of account (e.g., checking, savings)","oneOf":[{"type":"string"},{"type":"null"}]},"bank":{"description":"Name of the bank","oneOf":[{"type":"string"},{"type":"null"}]},"branchcode":{"description":"Bank branch code or routing number","oneOf":[{"type":"string"},{"type":"null"}]},"sync":{"description":"Whether automatic bank sync is enabled","oneOf":[{"type":"boolean"},{"type":"null"}]},"syncing":{"description":"Whether sync is currently in progress","oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"description":"Opening balance for the account","oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"description":"Date of the opening balance","oneOf":[{"type":"string"},{"type":"null"}]},"openingrate":{"description":"PROD-2452: for an account in a currency other than the business's, the opening exchange rate as account-currency units per one base unit (21.7821 ZAR per GBP); must be above 0. Omitted, the rate feed's rate on the opening date is used. Ignored for a base-currency account.","oneOf":[{"type":"number"},{"type":"null"}]},"clearopeningbalance":{"description":"PROD-1200: when true, fully REMOVE the opening balance — retracts openingbalance, openingdate and the FX opening rate and base value (clears the Insights banner). Distinct from setting the balance to 0, which stays 'set'.","oneOf":[{"type":"boolean"},{"type":"null"}]},"confirm":{"description":"PROD-1536: required only to save an opening date that is LATER than the account's own earliest transaction. Without it that one case is refused, unwritten, with code confirm-required plus earliesttransactiondate and transactionsbefore, so the caller can show what the date would exclude and let the user override it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"creditaccount":{"description":"Default credit account ID","oneOf":[{"type":"string"},{"type":"null"}]},"creditjournal":{"description":"Default credit journal ID","oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"description":"Whether the account is archived","oneOf":[{"type":"boolean"},{"type":"null"}]},"hidden":{"description":"Whether the account is hidden/soft-deleted (removes its card; also stops sync)","oneOf":[{"type":"boolean"},{"type":"null"}]},"swiftcode":{"description":"SWIFT/BIC code for international transfers","oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"The ledger account this bank account settles into. PROD-2612: set it to one of the business's own asset accounts to use that account instead of minting a new one; it must not be a control or built-in account or another bank's, and the request must leave out the opening balance and any other currency. Refused with a link-* reason.","oneOf":[{"type":"string"},{"type":"null"}]},"private":{"description":"Whether this is a private account","oneOf":[{"type":"boolean"},{"type":"null"}]},"syncenabled":{"description":"Whether this account is enabled for bank sync","oneOf":[{"type":"boolean"},{"type":"null"}]},"currency":{"description":"ISO 4217 code (e.g. \"USD\") stamped on the new ledger account. Omit for the business's base currency; an unknown code is refused with reason unknown-currency.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create a new bank account for the business (a real account money moves through — used for reconciliation and cashflow). Not a chart-of-accounts ledger account.","tags":["bank account management"]}},"/api/bankaccount/update":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the bank account, required for updates","oneOf":[{"type":"string"},{"type":"null"}]},"accountname":{"description":"Name of the bank account","oneOf":[{"type":"string"},{"type":"null"}]},"accountnumber":{"description":"Bank account number","oneOf":[{"type":"string"},{"type":"null"}]},"accounttype":{"description":"Type of account (e.g., checking, savings)","oneOf":[{"type":"string"},{"type":"null"}]},"bank":{"description":"Name of the bank","oneOf":[{"type":"string"},{"type":"null"}]},"branchcode":{"description":"Bank branch code or routing number","oneOf":[{"type":"string"},{"type":"null"}]},"sync":{"description":"Whether automatic bank sync is enabled","oneOf":[{"type":"boolean"},{"type":"null"}]},"syncing":{"description":"Whether sync is currently in progress","oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"description":"Opening balance for the account","oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"description":"Date of the opening balance","oneOf":[{"type":"string"},{"type":"null"}]},"openingrate":{"description":"PROD-2452: for an account in a currency other than the business's, the opening exchange rate as account-currency units per one base unit (21.7821 ZAR per GBP); must be above 0. Omitted, the rate feed's rate on the opening date is used. Ignored for a base-currency account.","oneOf":[{"type":"number"},{"type":"null"}]},"clearopeningbalance":{"description":"PROD-1200: when true, fully REMOVE the opening balance — retracts openingbalance, openingdate and the FX opening rate and base value (clears the Insights banner). Distinct from setting the balance to 0, which stays 'set'.","oneOf":[{"type":"boolean"},{"type":"null"}]},"confirm":{"description":"PROD-1536: required only to save an opening date that is LATER than the account's own earliest transaction. Without it that one case is refused, unwritten, with code confirm-required plus earliesttransactiondate and transactionsbefore, so the caller can show what the date would exclude and let the user override it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"creditaccount":{"description":"Default credit account ID","oneOf":[{"type":"string"},{"type":"null"}]},"creditjournal":{"description":"Default credit journal ID","oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"description":"Whether the account is archived","oneOf":[{"type":"boolean"},{"type":"null"}]},"hidden":{"description":"Whether the account is hidden/soft-deleted (removes its card; also stops sync)","oneOf":[{"type":"boolean"},{"type":"null"}]},"swiftcode":{"description":"SWIFT/BIC code for international transfers","oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"The ledger account this bank account settles into. PROD-2612: set it to one of the business's own asset accounts to use that account instead of minting a new one; it must not be a control or built-in account or another bank's, and the request must leave out the opening balance and any other currency. Refused with a link-* reason.","oneOf":[{"type":"string"},{"type":"null"}]},"private":{"description":"Whether this is a private account","oneOf":[{"type":"boolean"},{"type":"null"}]},"syncenabled":{"description":"Whether this account is enabled for bank sync","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the bank account, required for updates","oneOf":[{"type":"string"},{"type":"null"}]},"accountname":{"description":"Name of the bank account","oneOf":[{"type":"string"},{"type":"null"}]},"accountnumber":{"description":"Bank account number","oneOf":[{"type":"string"},{"type":"null"}]},"accounttype":{"description":"Type of account (e.g., checking, savings)","oneOf":[{"type":"string"},{"type":"null"}]},"bank":{"description":"Name of the bank","oneOf":[{"type":"string"},{"type":"null"}]},"branchcode":{"description":"Bank branch code or routing number","oneOf":[{"type":"string"},{"type":"null"}]},"sync":{"description":"Whether automatic bank sync is enabled","oneOf":[{"type":"boolean"},{"type":"null"}]},"syncing":{"description":"Whether sync is currently in progress","oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"description":"Opening balance for the account","oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"description":"Date of the opening balance","oneOf":[{"type":"string"},{"type":"null"}]},"openingrate":{"description":"PROD-2452: for an account in a currency other than the business's, the opening exchange rate as account-currency units per one base unit (21.7821 ZAR per GBP); must be above 0. Omitted, the rate feed's rate on the opening date is used. Ignored for a base-currency account.","oneOf":[{"type":"number"},{"type":"null"}]},"clearopeningbalance":{"description":"PROD-1200: when true, fully REMOVE the opening balance — retracts openingbalance, openingdate and the FX opening rate and base value (clears the Insights banner). Distinct from setting the balance to 0, which stays 'set'.","oneOf":[{"type":"boolean"},{"type":"null"}]},"confirm":{"description":"PROD-1536: required only to save an opening date that is LATER than the account's own earliest transaction. Without it that one case is refused, unwritten, with code confirm-required plus earliesttransactiondate and transactionsbefore, so the caller can show what the date would exclude and let the user override it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"creditaccount":{"description":"Default credit account ID","oneOf":[{"type":"string"},{"type":"null"}]},"creditjournal":{"description":"Default credit journal ID","oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"description":"Whether the account is archived","oneOf":[{"type":"boolean"},{"type":"null"}]},"hidden":{"description":"Whether the account is hidden/soft-deleted (removes its card; also stops sync)","oneOf":[{"type":"boolean"},{"type":"null"}]},"swiftcode":{"description":"SWIFT/BIC code for international transfers","oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"The ledger account this bank account settles into. PROD-2612: set it to one of the business's own asset accounts to use that account instead of minting a new one; it must not be a control or built-in account or another bank's, and the request must leave out the opening balance and any other currency. Refused with a link-* reason.","oneOf":[{"type":"string"},{"type":"null"}]},"private":{"description":"Whether this is a private account","oneOf":[{"type":"boolean"},{"type":"null"}]},"syncenabled":{"description":"Whether this account is enabled for bank sync","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the bank account, required for updates","oneOf":[{"type":"string"},{"type":"null"}]},"accountname":{"description":"Name of the bank account","oneOf":[{"type":"string"},{"type":"null"}]},"accountnumber":{"description":"Bank account number","oneOf":[{"type":"string"},{"type":"null"}]},"accounttype":{"description":"Type of account (e.g., checking, savings)","oneOf":[{"type":"string"},{"type":"null"}]},"bank":{"description":"Name of the bank","oneOf":[{"type":"string"},{"type":"null"}]},"branchcode":{"description":"Bank branch code or routing number","oneOf":[{"type":"string"},{"type":"null"}]},"sync":{"description":"Whether automatic bank sync is enabled","oneOf":[{"type":"boolean"},{"type":"null"}]},"syncing":{"description":"Whether sync is currently in progress","oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"description":"Opening balance for the account","oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"description":"Date of the opening balance","oneOf":[{"type":"string"},{"type":"null"}]},"openingrate":{"description":"PROD-2452: for an account in a currency other than the business's, the opening exchange rate as account-currency units per one base unit (21.7821 ZAR per GBP); must be above 0. Omitted, the rate feed's rate on the opening date is used. Ignored for a base-currency account.","oneOf":[{"type":"number"},{"type":"null"}]},"clearopeningbalance":{"description":"PROD-1200: when true, fully REMOVE the opening balance — retracts openingbalance, openingdate and the FX opening rate and base value (clears the Insights banner). Distinct from setting the balance to 0, which stays 'set'.","oneOf":[{"type":"boolean"},{"type":"null"}]},"confirm":{"description":"PROD-1536: required only to save an opening date that is LATER than the account's own earliest transaction. Without it that one case is refused, unwritten, with code confirm-required plus earliesttransactiondate and transactionsbefore, so the caller can show what the date would exclude and let the user override it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"creditaccount":{"description":"Default credit account ID","oneOf":[{"type":"string"},{"type":"null"}]},"creditjournal":{"description":"Default credit journal ID","oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"description":"Whether the account is archived","oneOf":[{"type":"boolean"},{"type":"null"}]},"hidden":{"description":"Whether the account is hidden/soft-deleted (removes its card; also stops sync)","oneOf":[{"type":"boolean"},{"type":"null"}]},"swiftcode":{"description":"SWIFT/BIC code for international transfers","oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"The ledger account this bank account settles into. PROD-2612: set it to one of the business's own asset accounts to use that account instead of minting a new one; it must not be a control or built-in account or another bank's, and the request must leave out the opening balance and any other currency. Refused with a link-* reason.","oneOf":[{"type":"string"},{"type":"null"}]},"private":{"description":"Whether this is a private account","oneOf":[{"type":"boolean"},{"type":"null"}]},"syncenabled":{"description":"Whether this account is enabled for bank sync","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the bank account, required for updates","oneOf":[{"type":"string"},{"type":"null"}]},"accountname":{"description":"Name of the bank account","oneOf":[{"type":"string"},{"type":"null"}]},"accountnumber":{"description":"Bank account number","oneOf":[{"type":"string"},{"type":"null"}]},"accounttype":{"description":"Type of account (e.g., checking, savings)","oneOf":[{"type":"string"},{"type":"null"}]},"bank":{"description":"Name of the bank","oneOf":[{"type":"string"},{"type":"null"}]},"branchcode":{"description":"Bank branch code or routing number","oneOf":[{"type":"string"},{"type":"null"}]},"sync":{"description":"Whether automatic bank sync is enabled","oneOf":[{"type":"boolean"},{"type":"null"}]},"syncing":{"description":"Whether sync is currently in progress","oneOf":[{"type":"boolean"},{"type":"null"}]},"openingbalance":{"description":"Opening balance for the account","oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"description":"Date of the opening balance","oneOf":[{"type":"string"},{"type":"null"}]},"openingrate":{"description":"PROD-2452: for an account in a currency other than the business's, the opening exchange rate as account-currency units per one base unit (21.7821 ZAR per GBP); must be above 0. Omitted, the rate feed's rate on the opening date is used. Ignored for a base-currency account.","oneOf":[{"type":"number"},{"type":"null"}]},"clearopeningbalance":{"description":"PROD-1200: when true, fully REMOVE the opening balance — retracts openingbalance, openingdate and the FX opening rate and base value (clears the Insights banner). Distinct from setting the balance to 0, which stays 'set'.","oneOf":[{"type":"boolean"},{"type":"null"}]},"confirm":{"description":"PROD-1536: required only to save an opening date that is LATER than the account's own earliest transaction. Without it that one case is refused, unwritten, with code confirm-required plus earliesttransactiondate and transactionsbefore, so the caller can show what the date would exclude and let the user override it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"creditaccount":{"description":"Default credit account ID","oneOf":[{"type":"string"},{"type":"null"}]},"creditjournal":{"description":"Default credit journal ID","oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"description":"Whether the account is archived","oneOf":[{"type":"boolean"},{"type":"null"}]},"hidden":{"description":"Whether the account is hidden/soft-deleted (removes its card; also stops sync)","oneOf":[{"type":"boolean"},{"type":"null"}]},"swiftcode":{"description":"SWIFT/BIC code for international transfers","oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"The ledger account this bank account settles into. PROD-2612: set it to one of the business's own asset accounts to use that account instead of minting a new one; it must not be a control or built-in account or another bank's, and the request must leave out the opening balance and any other currency. Refused with a link-* reason.","oneOf":[{"type":"string"},{"type":"null"}]},"private":{"description":"Whether this is a private account","oneOf":[{"type":"boolean"},{"type":"null"}]},"syncenabled":{"description":"Whether this account is enabled for bank sync","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Update an existing bank account by id — its name, bank, account number or opening balance. Changing the opening balance regenerates the account's synthetic opening-balance entry. An opening date later than the account's own earliest transaction is refused, unwritten, with code confirm-required until the same call is repeated with confirm true. To add a brand-new account use create_bank_account. PROD-2612: an :accountid naming another ledger account moves the bank account and its bare feed transactions onto it; pick one from /bankaccount/candidates and send :openingbalance 0, because a feed's stored opening balance would otherwise refuse the move, and clearing it lets the next sync write it again.","tags":["bank account management"]}},"/api/bankaccount/currency":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the bank account","type":"string"},"currency":{"description":"The new three-letter ISO currency code, e.g. USD","type":"string"},"confirm":{"description":"true to change it although the account already has transactions","oneOf":[{"type":"boolean"},{"type":"null"}]},"openingrate":{"description":"Rate for the opening balance, in account units per one base unit; the feed's rate otherwise","oneOf":[{"type":"number"},{"type":"null"}]}},"required":["token","id","currency"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the bank account","type":"string"},"currency":{"description":"The new three-letter ISO currency code, e.g. USD","type":"string"},"confirm":{"description":"true to change it although the account already has transactions","oneOf":[{"type":"boolean"},{"type":"null"}]},"openingrate":{"description":"Rate for the opening balance, in account units per one base unit; the feed's rate otherwise","oneOf":[{"type":"number"},{"type":"null"}]}},"required":["token","id","currency"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the bank account","type":"string"},"currency":{"description":"The new three-letter ISO currency code, e.g. USD","type":"string"},"confirm":{"description":"true to change it although the account already has transactions","oneOf":[{"type":"boolean"},{"type":"null"}]},"openingrate":{"description":"Rate for the opening balance, in account units per one base unit; the feed's rate otherwise","oneOf":[{"type":"number"},{"type":"null"}]}},"required":["token","id","currency"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the bank account","type":"string"},"currency":{"description":"The new three-letter ISO currency code, e.g. USD","type":"string"},"confirm":{"description":"true to change it although the account already has transactions","oneOf":[{"type":"boolean"},{"type":"null"}]},"openingrate":{"description":"Rate for the opening balance, in account units per one base unit; the feed's rate otherwise","oneOf":[{"type":"number"},{"type":"null"}]}},"required":["token","id","currency"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Change the currency of an existing bank account by id. The ledger account moves with it, and a stored opening balance is repriced in the new currency. An account that already has transactions is refused, unwritten, with code confirm-required until the same call is repeated with confirm true.","tags":["bank account management"]}},"/api/bankaccount/import":{"post":{"requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"token":{"type":"string"},"bankaccountid":{"description":"ID of the bank account to import into","type":"string"},"businessid":{"description":"ID of the business","type":"string"},"bank":{"description":"Bank name","type":"string"},"csv":{"description":"CSV file containing transactions","type":"string","format":"binary"}},"required":["token","bankaccountid","businessid","bank","csv"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Import transactions from an uploaded bank statement file (CSV/OFX) into a bank account.","tags":["bank account management"]}},"/api/bankaccount/lines/import":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"bankaccountid":{"description":"ID of the bank account the lines belong to (from list_bank_accounts)","type":"string"},"items":{"description":"The statement lines, at most 1000. Parse a CSV yourself and send its rows here.","type":"array","items":{"type":"object","properties":{"date":{"description":"Date of the line, yyyy-MM-dd","type":"string"},"description":{"description":"The statement narrative, as the bank printed it","type":"string"},"reference":{"description":"The line's own reference; kept in the notes","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Signed amount: positive is money in, negative is money out. At most 2 decimal places.","type":"number"}},"required":["date","description","amount"],"additionalProperties":false},"minItems":1,"maxItems":1000},"autocategorise":{"description":"Default true. False leaves every line uncategorised, and no categoriser or matcher fills it later.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","bankaccountid","items"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"bankaccountid":{"description":"ID of the bank account the lines belong to (from list_bank_accounts)","type":"string"},"items":{"description":"The statement lines, at most 1000. Parse a CSV yourself and send its rows here.","type":"array","items":{"type":"object","properties":{"date":{"description":"Date of the line, yyyy-MM-dd","type":"string"},"description":{"description":"The statement narrative, as the bank printed it","type":"string"},"reference":{"description":"The line's own reference; kept in the notes","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Signed amount: positive is money in, negative is money out. At most 2 decimal places.","type":"number"}},"required":["date","description","amount"],"additionalProperties":false},"minItems":1,"maxItems":1000},"autocategorise":{"description":"Default true. False leaves every line uncategorised, and no categoriser or matcher fills it later.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","bankaccountid","items"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"bankaccountid":{"description":"ID of the bank account the lines belong to (from list_bank_accounts)","type":"string"},"items":{"description":"The statement lines, at most 1000. Parse a CSV yourself and send its rows here.","type":"array","items":{"type":"object","properties":{"date":{"description":"Date of the line, yyyy-MM-dd","type":"string"},"description":{"description":"The statement narrative, as the bank printed it","type":"string"},"reference":{"description":"The line's own reference; kept in the notes","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Signed amount: positive is money in, negative is money out. At most 2 decimal places.","type":"number"}},"required":["date","description","amount"],"additionalProperties":false},"minItems":1,"maxItems":1000},"autocategorise":{"description":"Default true. False leaves every line uncategorised, and no categoriser or matcher fills it later.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","bankaccountid","items"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"bankaccountid":{"description":"ID of the bank account the lines belong to (from list_bank_accounts)","type":"string"},"items":{"description":"The statement lines, at most 1000. Parse a CSV yourself and send its rows here.","type":"array","items":{"type":"object","properties":{"date":{"description":"Date of the line, yyyy-MM-dd","type":"string"},"description":{"description":"The statement narrative, as the bank printed it","type":"string"},"reference":{"description":"The line's own reference; kept in the notes","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Signed amount: positive is money in, negative is money out. At most 2 decimal places.","type":"number"}},"required":["date","description","amount"],"additionalProperties":false},"minItems":1,"maxItems":1000},"autocategorise":{"description":"Default true. False leaves every line uncategorised, and no categoriser or matcher fills it later.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","bankaccountid","items"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create bank lines on one of the business's bank accounts from a list of statement lines (date, description, reference, signed amount). Lines go through the statement importer: a line already on the account, from a feed, a statement upload or an earlier call, is skipped, so it is safe to send the same lines again. Set autocategorise false to leave the new lines uncategorised for the owner. Refused lines come back in skippedrows with a reason.","tags":["bank account management"]}},"/api/bankaccount/revaluation/preview":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"date":{"description":"The day to revalue at (yyyy-MM-dd); open documents' revaluation is reversed the next day","type":"string"},"rates":{"description":"Bank account id -> closing rate override","oneOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]},"documentrates":{"description":"Currency code -> closing rate override for open invoices and bills, in foreign units per one base unit","oneOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]}},"required":["token","date"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"date":{"description":"The day to revalue at (yyyy-MM-dd); open documents' revaluation is reversed the next day","type":"string"},"rates":{"description":"Bank account id -> closing rate override","oneOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]},"documentrates":{"description":"Currency code -> closing rate override for open invoices and bills, in foreign units per one base unit","oneOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]}},"required":["token","date"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"date":{"description":"The day to revalue at (yyyy-MM-dd); open documents' revaluation is reversed the next day","type":"string"},"rates":{"description":"Bank account id -> closing rate override","oneOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]},"documentrates":{"description":"Currency code -> closing rate override for open invoices and bills, in foreign units per one base unit","oneOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]}},"required":["token","date"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"date":{"description":"The day to revalue at (yyyy-MM-dd); open documents' revaluation is reversed the next day","type":"string"},"rates":{"description":"Bank account id -> closing rate override","oneOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]},"documentrates":{"description":"Currency code -> closing rate override for open invoices and bills, in foreign units per one base unit","oneOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]}},"required":["token","date"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Preview revaluing every foreign balance at a day's closing rate: foreign-currency bank accounts (their transactions and journals), open foreign invoices and bills, and journal lines on rand accounts that name a currency. Each shows its foreign balance, carried base value, the rate and its source (override, typed, old-package, own or feed) and the adjustment. Reads only; post it on the owner's word.","tags":["bank account management"]}},"/api/bankaccount/revaluation/post":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"date":{"description":"The day to revalue at (yyyy-MM-dd); open documents' revaluation is reversed the next day","type":"string"},"rates":{"description":"Bank account id -> closing rate override","oneOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]},"documentrates":{"description":"Currency code -> closing rate override for open invoices and bills, in foreign units per one base unit","oneOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]}},"required":["token","date"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"date":{"description":"The day to revalue at (yyyy-MM-dd); open documents' revaluation is reversed the next day","type":"string"},"rates":{"description":"Bank account id -> closing rate override","oneOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]},"documentrates":{"description":"Currency code -> closing rate override for open invoices and bills, in foreign units per one base unit","oneOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]}},"required":["token","date"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"date":{"description":"The day to revalue at (yyyy-MM-dd); open documents' revaluation is reversed the next day","type":"string"},"rates":{"description":"Bank account id -> closing rate override","oneOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]},"documentrates":{"description":"Currency code -> closing rate override for open invoices and bills, in foreign units per one base unit","oneOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]}},"required":["token","date"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"date":{"description":"The day to revalue at (yyyy-MM-dd); open documents' revaluation is reversed the next day","type":"string"},"rates":{"description":"Bank account id -> closing rate override","oneOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]},"documentrates":{"description":"Currency code -> closing rate override for open invoices and bills, in foreign units per one base unit","oneOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]}},"required":["token","date"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Post the foreign-currency revaluation for a date, as its preview shows it, once the owner has agreed. Bank accounts post to Bank Revaluation and roll forward; open invoices, bills and foreign journal lines post to Unrealised FX and are reversed the next day. Replaces that date's revaluation; refused while a later one stands.","tags":["bank account management"]}},"/api/bankaccount/revaluation/delete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"date":{"description":"The day to revalue at (yyyy-MM-dd); open documents' revaluation is reversed the next day","type":"string"},"rates":{"description":"Bank account id -> closing rate override","oneOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]},"documentrates":{"description":"Currency code -> closing rate override for open invoices and bills, in foreign units per one base unit","oneOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]}},"required":["token","date"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"date":{"description":"The day to revalue at (yyyy-MM-dd); open documents' revaluation is reversed the next day","type":"string"},"rates":{"description":"Bank account id -> closing rate override","oneOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]},"documentrates":{"description":"Currency code -> closing rate override for open invoices and bills, in foreign units per one base unit","oneOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]}},"required":["token","date"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"date":{"description":"The day to revalue at (yyyy-MM-dd); open documents' revaluation is reversed the next day","type":"string"},"rates":{"description":"Bank account id -> closing rate override","oneOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]},"documentrates":{"description":"Currency code -> closing rate override for open invoices and bills, in foreign units per one base unit","oneOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]}},"required":["token","date"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"date":{"description":"The day to revalue at (yyyy-MM-dd); open documents' revaluation is reversed the next day","type":"string"},"rates":{"description":"Bank account id -> closing rate override","oneOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]},"documentrates":{"description":"Currency code -> closing rate override for open invoices and bills, in foreign units per one base unit","oneOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]}},"required":["token","date"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Remove the foreign-currency revaluation for a date, with the documents' reversal.","tags":["bank account management"]}},"/api/bankaccount/candidates":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the bank account","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the bank account","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the bank account","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the bank account","type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"PROD-2612: the business's ledger accounts marked as a bank that this bank account may link to, best name match first. Empty, with a reason, when the bank account cannot leave its own ledger account. Link one with /bankaccount/update {:id :accountid :openingbalance 0}.","tags":["bank account management"]}},"/api/bankaccount/delete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the bank account","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the bank account","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the bank account","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the bank account","type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Delete bank account data","tags":["bank account management"]}},"/api/closingrate/list":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"The business's own closing rates: the rate each foreign balance is valued at on a day, with where it came from (typed by a person, or from the package the business switched from). A revaluation uses these first, then the rate the business's own transactions used that day, then stub's daily rate.","tags":["currency"]}},"/api/closingrate/set":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"date":{"description":"The day, yyyy-MM-dd: usually a month end.","type":"string"},"currency":{"description":"The foreign currency, e.g. EUR.","type":"string"},"rate":{"description":"Base currency per ONE unit of the foreign currency, e.g. 19.1534 rand per euro.","type":"number"}},"required":["token","date","currency","rate"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"date":{"description":"The day, yyyy-MM-dd: usually a month end.","type":"string"},"currency":{"description":"The foreign currency, e.g. EUR.","type":"string"},"rate":{"description":"Base currency per ONE unit of the foreign currency, e.g. 19.1534 rand per euro.","type":"number"}},"required":["token","date","currency","rate"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"date":{"description":"The day, yyyy-MM-dd: usually a month end.","type":"string"},"currency":{"description":"The foreign currency, e.g. EUR.","type":"string"},"rate":{"description":"Base currency per ONE unit of the foreign currency, e.g. 19.1534 rand per euro.","type":"number"}},"required":["token","date","currency","rate"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"date":{"description":"The day, yyyy-MM-dd: usually a month end.","type":"string"},"currency":{"description":"The foreign currency, e.g. EUR.","type":"string"},"rate":{"description":"Base currency per ONE unit of the foreign currency, e.g. 19.1534 rand per euro.","type":"number"}},"required":["token","date","currency","rate"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Keep the rate a foreign currency's balances are valued at on a day, as the owner or their accountant gives it: in base currency per ONE foreign unit. It replaces any rate on that day and is used by every revaluation at that day. Never quote a rate from memory.","tags":["currency"]}},"/api/closingrate/delete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"date":{"description":"The day, yyyy-MM-dd: usually a month end.","type":"string"},"currency":{"description":"The foreign currency, e.g. EUR.","type":"string"}},"required":["token","date","currency"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"date":{"description":"The day, yyyy-MM-dd: usually a month end.","type":"string"},"currency":{"description":"The foreign currency, e.g. EUR.","type":"string"}},"required":["token","date","currency"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"date":{"description":"The day, yyyy-MM-dd: usually a month end.","type":"string"},"currency":{"description":"The foreign currency, e.g. EUR.","type":"string"}},"required":["token","date","currency"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"date":{"description":"The day, yyyy-MM-dd: usually a month end.","type":"string"},"currency":{"description":"The foreign currency, e.g. EUR.","type":"string"}},"required":["token","date","currency"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Remove the business's closing rate for a day and currency.","tags":["currency"]}},"/validate/accountid":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"apikey":{"type":"string"},"accountid":{"type":"string"}},"required":["apikey","accountid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"apikey":{"type":"string"},"accountid":{"type":"string"}},"required":["apikey","accountid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"apikey":{"type":"string"},"accountid":{"type":"string"}},"required":["apikey","accountid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"apikey":{"type":"string"},"accountid":{"type":"string"}},"required":["apikey","accountid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Validate user id","tags":["user management"]}},"/api/asset/list":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"List the business's fixed assets: each asset's name, purchase price, book value, accumulated depreciation, depreciation method and rate, useful life, and whether it was disposed of or sold.","tags":["asset management"]}},"/api/asset/create":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Asset id. Required on update; omit on create.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Name of the asset (e.g. \"Delivery van\").","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"(Deprecated) legacy purchase value; the asset's cost now derives from its linked expense/transaction, so this is ignored.","oneOf":[{"type":"number"},{"type":"null"}]},"disposed":{"description":"Whether the asset has been disposed of (sold or retired).","oneOf":[{"type":"boolean"},{"type":"null"}]},"disposeddate":{"description":"Date the asset was disposed (ISO 8601); defaults to now when :disposed is set without a date.","oneOf":[{"type":"string"},{"type":"null"}]},"depreciation":{"description":"Whether this asset depreciates over time.","oneOf":[{"type":"boolean"},{"type":"null"}]},"depreciationstart":{"description":"Date depreciation starts (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"depreciationrate":{"description":"Annual depreciation rate as a decimal fraction (e.g. 0.2 = 20% per year); used by the diminishing-balance method.","oneOf":[{"type":"number"},{"type":"null"}]},"depreciationtype":{"description":"Depreciation method: a string containing \"straight\" (straight-line), \"diminish\" (reducing/diminishing balance), or \"fifty\" (50/30/20 wear-and-tear).","oneOf":[{"type":"string"},{"type":"null"}]},"usedefaultdepreciation":{"description":"Whether to use the business/category default depreciation settings instead of the values on this asset.","oneOf":[{"type":"boolean"},{"type":"null"}]},"usefullife":{"description":"Useful life of the asset in years.","oneOf":[{"type":"number"},{"type":"null"}]},"averaging":{"description":"How straight-line depreciation spreads over the year: \"fullmonth\" (default, a twelfth a month) or \"actualdays\" (yearly charge × days / days in the financial year). Refused on other methods.","oneOf":[{"type":"string","enum":["fullmonth","actualdays"]},{"type":"null"}]},"openingdepreciation":{"description":"Accumulated depreciation a migrated asset brings in, charged by openingdepreciationdate. stub charges nothing up to that date.","oneOf":[{"type":"number"},{"type":"null"}]},"openingdepreciationdate":{"description":"Date (yyyy-MM-dd) the opening accumulated depreciation is charged to. Required with a non-zero openingdepreciation.","oneOf":[{"type":"string"},{"type":"null"}]},"transaction":{"description":"(Legacy) id of a bank transaction to associate with the asset; asset↔transaction links are normally managed via the dedicated link/unlink asset-transaction endpoints.","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes about the asset.","oneOf":[{"type":"string"},{"type":"null"}]},"income":{"description":"Id of an income record linked to this asset (e.g. proceeds from its disposal).","oneOf":[{"type":"string"},{"type":"null"}]},"expense":{"description":"Id of the expense record that recorded the asset's purchase (its cost basis).","oneOf":[{"type":"string"},{"type":"null"}]},"unlink":{"description":"(Legacy) id of a linked transaction to detach from the asset; prefer the dedicated unlink asset-transaction endpoint.","oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"Chart-of-accounts account id categorising this asset (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"description":"Chart-of-accounts account id for the asset's accumulated-depreciation / base account (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Asset id. Required on update; omit on create.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Name of the asset (e.g. \"Delivery van\").","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"(Deprecated) legacy purchase value; the asset's cost now derives from its linked expense/transaction, so this is ignored.","oneOf":[{"type":"number"},{"type":"null"}]},"disposed":{"description":"Whether the asset has been disposed of (sold or retired).","oneOf":[{"type":"boolean"},{"type":"null"}]},"disposeddate":{"description":"Date the asset was disposed (ISO 8601); defaults to now when :disposed is set without a date.","oneOf":[{"type":"string"},{"type":"null"}]},"depreciation":{"description":"Whether this asset depreciates over time.","oneOf":[{"type":"boolean"},{"type":"null"}]},"depreciationstart":{"description":"Date depreciation starts (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"depreciationrate":{"description":"Annual depreciation rate as a decimal fraction (e.g. 0.2 = 20% per year); used by the diminishing-balance method.","oneOf":[{"type":"number"},{"type":"null"}]},"depreciationtype":{"description":"Depreciation method: a string containing \"straight\" (straight-line), \"diminish\" (reducing/diminishing balance), or \"fifty\" (50/30/20 wear-and-tear).","oneOf":[{"type":"string"},{"type":"null"}]},"usedefaultdepreciation":{"description":"Whether to use the business/category default depreciation settings instead of the values on this asset.","oneOf":[{"type":"boolean"},{"type":"null"}]},"usefullife":{"description":"Useful life of the asset in years.","oneOf":[{"type":"number"},{"type":"null"}]},"averaging":{"description":"How straight-line depreciation spreads over the year: \"fullmonth\" (default, a twelfth a month) or \"actualdays\" (yearly charge × days / days in the financial year). Refused on other methods.","oneOf":[{"type":"string","enum":["fullmonth","actualdays"]},{"type":"null"}]},"openingdepreciation":{"description":"Accumulated depreciation a migrated asset brings in, charged by openingdepreciationdate. stub charges nothing up to that date.","oneOf":[{"type":"number"},{"type":"null"}]},"openingdepreciationdate":{"description":"Date (yyyy-MM-dd) the opening accumulated depreciation is charged to. Required with a non-zero openingdepreciation.","oneOf":[{"type":"string"},{"type":"null"}]},"transaction":{"description":"(Legacy) id of a bank transaction to associate with the asset; asset↔transaction links are normally managed via the dedicated link/unlink asset-transaction endpoints.","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes about the asset.","oneOf":[{"type":"string"},{"type":"null"}]},"income":{"description":"Id of an income record linked to this asset (e.g. proceeds from its disposal).","oneOf":[{"type":"string"},{"type":"null"}]},"expense":{"description":"Id of the expense record that recorded the asset's purchase (its cost basis).","oneOf":[{"type":"string"},{"type":"null"}]},"unlink":{"description":"(Legacy) id of a linked transaction to detach from the asset; prefer the dedicated unlink asset-transaction endpoint.","oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"Chart-of-accounts account id categorising this asset (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"description":"Chart-of-accounts account id for the asset's accumulated-depreciation / base account (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Asset id. Required on update; omit on create.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Name of the asset (e.g. \"Delivery van\").","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"(Deprecated) legacy purchase value; the asset's cost now derives from its linked expense/transaction, so this is ignored.","oneOf":[{"type":"number"},{"type":"null"}]},"disposed":{"description":"Whether the asset has been disposed of (sold or retired).","oneOf":[{"type":"boolean"},{"type":"null"}]},"disposeddate":{"description":"Date the asset was disposed (ISO 8601); defaults to now when :disposed is set without a date.","oneOf":[{"type":"string"},{"type":"null"}]},"depreciation":{"description":"Whether this asset depreciates over time.","oneOf":[{"type":"boolean"},{"type":"null"}]},"depreciationstart":{"description":"Date depreciation starts (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"depreciationrate":{"description":"Annual depreciation rate as a decimal fraction (e.g. 0.2 = 20% per year); used by the diminishing-balance method.","oneOf":[{"type":"number"},{"type":"null"}]},"depreciationtype":{"description":"Depreciation method: a string containing \"straight\" (straight-line), \"diminish\" (reducing/diminishing balance), or \"fifty\" (50/30/20 wear-and-tear).","oneOf":[{"type":"string"},{"type":"null"}]},"usedefaultdepreciation":{"description":"Whether to use the business/category default depreciation settings instead of the values on this asset.","oneOf":[{"type":"boolean"},{"type":"null"}]},"usefullife":{"description":"Useful life of the asset in years.","oneOf":[{"type":"number"},{"type":"null"}]},"averaging":{"description":"How straight-line depreciation spreads over the year: \"fullmonth\" (default, a twelfth a month) or \"actualdays\" (yearly charge × days / days in the financial year). Refused on other methods.","oneOf":[{"type":"string","enum":["fullmonth","actualdays"]},{"type":"null"}]},"openingdepreciation":{"description":"Accumulated depreciation a migrated asset brings in, charged by openingdepreciationdate. stub charges nothing up to that date.","oneOf":[{"type":"number"},{"type":"null"}]},"openingdepreciationdate":{"description":"Date (yyyy-MM-dd) the opening accumulated depreciation is charged to. Required with a non-zero openingdepreciation.","oneOf":[{"type":"string"},{"type":"null"}]},"transaction":{"description":"(Legacy) id of a bank transaction to associate with the asset; asset↔transaction links are normally managed via the dedicated link/unlink asset-transaction endpoints.","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes about the asset.","oneOf":[{"type":"string"},{"type":"null"}]},"income":{"description":"Id of an income record linked to this asset (e.g. proceeds from its disposal).","oneOf":[{"type":"string"},{"type":"null"}]},"expense":{"description":"Id of the expense record that recorded the asset's purchase (its cost basis).","oneOf":[{"type":"string"},{"type":"null"}]},"unlink":{"description":"(Legacy) id of a linked transaction to detach from the asset; prefer the dedicated unlink asset-transaction endpoint.","oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"Chart-of-accounts account id categorising this asset (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"description":"Chart-of-accounts account id for the asset's accumulated-depreciation / base account (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Asset id. Required on update; omit on create.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Name of the asset (e.g. \"Delivery van\").","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"(Deprecated) legacy purchase value; the asset's cost now derives from its linked expense/transaction, so this is ignored.","oneOf":[{"type":"number"},{"type":"null"}]},"disposed":{"description":"Whether the asset has been disposed of (sold or retired).","oneOf":[{"type":"boolean"},{"type":"null"}]},"disposeddate":{"description":"Date the asset was disposed (ISO 8601); defaults to now when :disposed is set without a date.","oneOf":[{"type":"string"},{"type":"null"}]},"depreciation":{"description":"Whether this asset depreciates over time.","oneOf":[{"type":"boolean"},{"type":"null"}]},"depreciationstart":{"description":"Date depreciation starts (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"depreciationrate":{"description":"Annual depreciation rate as a decimal fraction (e.g. 0.2 = 20% per year); used by the diminishing-balance method.","oneOf":[{"type":"number"},{"type":"null"}]},"depreciationtype":{"description":"Depreciation method: a string containing \"straight\" (straight-line), \"diminish\" (reducing/diminishing balance), or \"fifty\" (50/30/20 wear-and-tear).","oneOf":[{"type":"string"},{"type":"null"}]},"usedefaultdepreciation":{"description":"Whether to use the business/category default depreciation settings instead of the values on this asset.","oneOf":[{"type":"boolean"},{"type":"null"}]},"usefullife":{"description":"Useful life of the asset in years.","oneOf":[{"type":"number"},{"type":"null"}]},"averaging":{"description":"How straight-line depreciation spreads over the year: \"fullmonth\" (default, a twelfth a month) or \"actualdays\" (yearly charge × days / days in the financial year). Refused on other methods.","oneOf":[{"type":"string","enum":["fullmonth","actualdays"]},{"type":"null"}]},"openingdepreciation":{"description":"Accumulated depreciation a migrated asset brings in, charged by openingdepreciationdate. stub charges nothing up to that date.","oneOf":[{"type":"number"},{"type":"null"}]},"openingdepreciationdate":{"description":"Date (yyyy-MM-dd) the opening accumulated depreciation is charged to. Required with a non-zero openingdepreciation.","oneOf":[{"type":"string"},{"type":"null"}]},"transaction":{"description":"(Legacy) id of a bank transaction to associate with the asset; asset↔transaction links are normally managed via the dedicated link/unlink asset-transaction endpoints.","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes about the asset.","oneOf":[{"type":"string"},{"type":"null"}]},"income":{"description":"Id of an income record linked to this asset (e.g. proceeds from its disposal).","oneOf":[{"type":"string"},{"type":"null"}]},"expense":{"description":"Id of the expense record that recorded the asset's purchase (its cost basis).","oneOf":[{"type":"string"},{"type":"null"}]},"unlink":{"description":"(Legacy) id of a linked transaction to detach from the asset; prefer the dedicated unlink asset-transaction endpoint.","oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"Chart-of-accounts account id categorising this asset (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"description":"Chart-of-accounts account id for the asset's accumulated-depreciation / base account (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create a new fixed asset — an item of equipment, property or similar that the business owns and depreciates over time. Use when recording a capital purchase you want to depreciate over its useful life rather than expensing outright; link it to the originating purchase via :expense (see list_expenses) so its cost basis flows from the ledger. To amend an existing asset use update_asset; to remove one use delete_asset.","tags":["asset management"]}},"/api/asset/update":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Asset id. Required on update; omit on create.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Name of the asset (e.g. \"Delivery van\").","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"(Deprecated) legacy purchase value; the asset's cost now derives from its linked expense/transaction, so this is ignored.","oneOf":[{"type":"number"},{"type":"null"}]},"disposed":{"description":"Whether the asset has been disposed of (sold or retired).","oneOf":[{"type":"boolean"},{"type":"null"}]},"disposeddate":{"description":"Date the asset was disposed (ISO 8601); defaults to now when :disposed is set without a date.","oneOf":[{"type":"string"},{"type":"null"}]},"depreciation":{"description":"Whether this asset depreciates over time.","oneOf":[{"type":"boolean"},{"type":"null"}]},"depreciationstart":{"description":"Date depreciation starts (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"depreciationrate":{"description":"Annual depreciation rate as a decimal fraction (e.g. 0.2 = 20% per year); used by the diminishing-balance method.","oneOf":[{"type":"number"},{"type":"null"}]},"depreciationtype":{"description":"Depreciation method: a string containing \"straight\" (straight-line), \"diminish\" (reducing/diminishing balance), or \"fifty\" (50/30/20 wear-and-tear).","oneOf":[{"type":"string"},{"type":"null"}]},"usedefaultdepreciation":{"description":"Whether to use the business/category default depreciation settings instead of the values on this asset.","oneOf":[{"type":"boolean"},{"type":"null"}]},"usefullife":{"description":"Useful life of the asset in years.","oneOf":[{"type":"number"},{"type":"null"}]},"averaging":{"description":"How straight-line depreciation spreads over the year: \"fullmonth\" (default, a twelfth a month) or \"actualdays\" (yearly charge × days / days in the financial year). Refused on other methods.","oneOf":[{"type":"string","enum":["fullmonth","actualdays"]},{"type":"null"}]},"openingdepreciation":{"description":"Accumulated depreciation a migrated asset brings in, charged by openingdepreciationdate. stub charges nothing up to that date.","oneOf":[{"type":"number"},{"type":"null"}]},"openingdepreciationdate":{"description":"Date (yyyy-MM-dd) the opening accumulated depreciation is charged to. Required with a non-zero openingdepreciation.","oneOf":[{"type":"string"},{"type":"null"}]},"transaction":{"description":"(Legacy) id of a bank transaction to associate with the asset; asset↔transaction links are normally managed via the dedicated link/unlink asset-transaction endpoints.","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes about the asset.","oneOf":[{"type":"string"},{"type":"null"}]},"income":{"description":"Id of an income record linked to this asset (e.g. proceeds from its disposal).","oneOf":[{"type":"string"},{"type":"null"}]},"expense":{"description":"Id of the expense record that recorded the asset's purchase (its cost basis).","oneOf":[{"type":"string"},{"type":"null"}]},"unlink":{"description":"(Legacy) id of a linked transaction to detach from the asset; prefer the dedicated unlink asset-transaction endpoint.","oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"Chart-of-accounts account id categorising this asset (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"description":"Chart-of-accounts account id for the asset's accumulated-depreciation / base account (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Asset id. Required on update; omit on create.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Name of the asset (e.g. \"Delivery van\").","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"(Deprecated) legacy purchase value; the asset's cost now derives from its linked expense/transaction, so this is ignored.","oneOf":[{"type":"number"},{"type":"null"}]},"disposed":{"description":"Whether the asset has been disposed of (sold or retired).","oneOf":[{"type":"boolean"},{"type":"null"}]},"disposeddate":{"description":"Date the asset was disposed (ISO 8601); defaults to now when :disposed is set without a date.","oneOf":[{"type":"string"},{"type":"null"}]},"depreciation":{"description":"Whether this asset depreciates over time.","oneOf":[{"type":"boolean"},{"type":"null"}]},"depreciationstart":{"description":"Date depreciation starts (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"depreciationrate":{"description":"Annual depreciation rate as a decimal fraction (e.g. 0.2 = 20% per year); used by the diminishing-balance method.","oneOf":[{"type":"number"},{"type":"null"}]},"depreciationtype":{"description":"Depreciation method: a string containing \"straight\" (straight-line), \"diminish\" (reducing/diminishing balance), or \"fifty\" (50/30/20 wear-and-tear).","oneOf":[{"type":"string"},{"type":"null"}]},"usedefaultdepreciation":{"description":"Whether to use the business/category default depreciation settings instead of the values on this asset.","oneOf":[{"type":"boolean"},{"type":"null"}]},"usefullife":{"description":"Useful life of the asset in years.","oneOf":[{"type":"number"},{"type":"null"}]},"averaging":{"description":"How straight-line depreciation spreads over the year: \"fullmonth\" (default, a twelfth a month) or \"actualdays\" (yearly charge × days / days in the financial year). Refused on other methods.","oneOf":[{"type":"string","enum":["fullmonth","actualdays"]},{"type":"null"}]},"openingdepreciation":{"description":"Accumulated depreciation a migrated asset brings in, charged by openingdepreciationdate. stub charges nothing up to that date.","oneOf":[{"type":"number"},{"type":"null"}]},"openingdepreciationdate":{"description":"Date (yyyy-MM-dd) the opening accumulated depreciation is charged to. Required with a non-zero openingdepreciation.","oneOf":[{"type":"string"},{"type":"null"}]},"transaction":{"description":"(Legacy) id of a bank transaction to associate with the asset; asset↔transaction links are normally managed via the dedicated link/unlink asset-transaction endpoints.","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes about the asset.","oneOf":[{"type":"string"},{"type":"null"}]},"income":{"description":"Id of an income record linked to this asset (e.g. proceeds from its disposal).","oneOf":[{"type":"string"},{"type":"null"}]},"expense":{"description":"Id of the expense record that recorded the asset's purchase (its cost basis).","oneOf":[{"type":"string"},{"type":"null"}]},"unlink":{"description":"(Legacy) id of a linked transaction to detach from the asset; prefer the dedicated unlink asset-transaction endpoint.","oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"Chart-of-accounts account id categorising this asset (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"description":"Chart-of-accounts account id for the asset's accumulated-depreciation / base account (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Asset id. Required on update; omit on create.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Name of the asset (e.g. \"Delivery van\").","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"(Deprecated) legacy purchase value; the asset's cost now derives from its linked expense/transaction, so this is ignored.","oneOf":[{"type":"number"},{"type":"null"}]},"disposed":{"description":"Whether the asset has been disposed of (sold or retired).","oneOf":[{"type":"boolean"},{"type":"null"}]},"disposeddate":{"description":"Date the asset was disposed (ISO 8601); defaults to now when :disposed is set without a date.","oneOf":[{"type":"string"},{"type":"null"}]},"depreciation":{"description":"Whether this asset depreciates over time.","oneOf":[{"type":"boolean"},{"type":"null"}]},"depreciationstart":{"description":"Date depreciation starts (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"depreciationrate":{"description":"Annual depreciation rate as a decimal fraction (e.g. 0.2 = 20% per year); used by the diminishing-balance method.","oneOf":[{"type":"number"},{"type":"null"}]},"depreciationtype":{"description":"Depreciation method: a string containing \"straight\" (straight-line), \"diminish\" (reducing/diminishing balance), or \"fifty\" (50/30/20 wear-and-tear).","oneOf":[{"type":"string"},{"type":"null"}]},"usedefaultdepreciation":{"description":"Whether to use the business/category default depreciation settings instead of the values on this asset.","oneOf":[{"type":"boolean"},{"type":"null"}]},"usefullife":{"description":"Useful life of the asset in years.","oneOf":[{"type":"number"},{"type":"null"}]},"averaging":{"description":"How straight-line depreciation spreads over the year: \"fullmonth\" (default, a twelfth a month) or \"actualdays\" (yearly charge × days / days in the financial year). Refused on other methods.","oneOf":[{"type":"string","enum":["fullmonth","actualdays"]},{"type":"null"}]},"openingdepreciation":{"description":"Accumulated depreciation a migrated asset brings in, charged by openingdepreciationdate. stub charges nothing up to that date.","oneOf":[{"type":"number"},{"type":"null"}]},"openingdepreciationdate":{"description":"Date (yyyy-MM-dd) the opening accumulated depreciation is charged to. Required with a non-zero openingdepreciation.","oneOf":[{"type":"string"},{"type":"null"}]},"transaction":{"description":"(Legacy) id of a bank transaction to associate with the asset; asset↔transaction links are normally managed via the dedicated link/unlink asset-transaction endpoints.","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes about the asset.","oneOf":[{"type":"string"},{"type":"null"}]},"income":{"description":"Id of an income record linked to this asset (e.g. proceeds from its disposal).","oneOf":[{"type":"string"},{"type":"null"}]},"expense":{"description":"Id of the expense record that recorded the asset's purchase (its cost basis).","oneOf":[{"type":"string"},{"type":"null"}]},"unlink":{"description":"(Legacy) id of a linked transaction to detach from the asset; prefer the dedicated unlink asset-transaction endpoint.","oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"Chart-of-accounts account id categorising this asset (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"description":"Chart-of-accounts account id for the asset's accumulated-depreciation / base account (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Asset id. Required on update; omit on create.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Name of the asset (e.g. \"Delivery van\").","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"(Deprecated) legacy purchase value; the asset's cost now derives from its linked expense/transaction, so this is ignored.","oneOf":[{"type":"number"},{"type":"null"}]},"disposed":{"description":"Whether the asset has been disposed of (sold or retired).","oneOf":[{"type":"boolean"},{"type":"null"}]},"disposeddate":{"description":"Date the asset was disposed (ISO 8601); defaults to now when :disposed is set without a date.","oneOf":[{"type":"string"},{"type":"null"}]},"depreciation":{"description":"Whether this asset depreciates over time.","oneOf":[{"type":"boolean"},{"type":"null"}]},"depreciationstart":{"description":"Date depreciation starts (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"depreciationrate":{"description":"Annual depreciation rate as a decimal fraction (e.g. 0.2 = 20% per year); used by the diminishing-balance method.","oneOf":[{"type":"number"},{"type":"null"}]},"depreciationtype":{"description":"Depreciation method: a string containing \"straight\" (straight-line), \"diminish\" (reducing/diminishing balance), or \"fifty\" (50/30/20 wear-and-tear).","oneOf":[{"type":"string"},{"type":"null"}]},"usedefaultdepreciation":{"description":"Whether to use the business/category default depreciation settings instead of the values on this asset.","oneOf":[{"type":"boolean"},{"type":"null"}]},"usefullife":{"description":"Useful life of the asset in years.","oneOf":[{"type":"number"},{"type":"null"}]},"averaging":{"description":"How straight-line depreciation spreads over the year: \"fullmonth\" (default, a twelfth a month) or \"actualdays\" (yearly charge × days / days in the financial year). Refused on other methods.","oneOf":[{"type":"string","enum":["fullmonth","actualdays"]},{"type":"null"}]},"openingdepreciation":{"description":"Accumulated depreciation a migrated asset brings in, charged by openingdepreciationdate. stub charges nothing up to that date.","oneOf":[{"type":"number"},{"type":"null"}]},"openingdepreciationdate":{"description":"Date (yyyy-MM-dd) the opening accumulated depreciation is charged to. Required with a non-zero openingdepreciation.","oneOf":[{"type":"string"},{"type":"null"}]},"transaction":{"description":"(Legacy) id of a bank transaction to associate with the asset; asset↔transaction links are normally managed via the dedicated link/unlink asset-transaction endpoints.","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes about the asset.","oneOf":[{"type":"string"},{"type":"null"}]},"income":{"description":"Id of an income record linked to this asset (e.g. proceeds from its disposal).","oneOf":[{"type":"string"},{"type":"null"}]},"expense":{"description":"Id of the expense record that recorded the asset's purchase (its cost basis).","oneOf":[{"type":"string"},{"type":"null"}]},"unlink":{"description":"(Legacy) id of a linked transaction to detach from the asset; prefer the dedicated unlink asset-transaction endpoint.","oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"Chart-of-accounts account id categorising this asset (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"description":"Chart-of-accounts account id for the asset's accumulated-depreciation / base account (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Update a fixed asset by id — its name, value, purchase date or depreciation settings.","tags":["asset management"]}},"/api/asset/delete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Delete a fixed asset by id. Removes the asset and any depreciation it carried; linked income/expense records are kept but no longer point at it.","tags":["asset management"]}},"/api/assetpolicy/list":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"List the business's accounting policies, one per asset class: method, useful life, rate, residual percent and threshold.","tags":["asset management"]}},"/api/assetpolicy/create":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"accountid":{"description":"The asset class: the chart account the asset is recorded in (see list_accounts). Required on create.","oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"description":"\"depreciation\" (default) or \"amortisation\" for intangibles.","oneOf":[{"type":"string"},{"type":"null"}]},"method":{"description":"\"straight\" or \"diminishing\". Tax wear-and-tear (\"fifty\") is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"indefinite":{"description":"An intangible with an indefinite life (IAS 38.107), such as goodwill: not amortised.","oneOf":[{"type":"boolean"},{"type":"null"}]},"usefullife":{"description":"Useful life in whole years.","oneOf":[{"type":"number"},{"type":"null"}]},"rate":{"description":"Yearly rate for the diminishing method, as a fraction (0.2 = 20%).","oneOf":[{"type":"number"},{"type":"null"}]},"residualpercent":{"description":"Residual value as a percent of cost, 0 to 100.","oneOf":[{"type":"number"},{"type":"null"}]},"threshold":{"description":"Capitalisation threshold in base currency. Stored only for now.","oneOf":[{"type":"number"},{"type":"null"}]},"source":{"description":"\"settings\" (default), \"prompt\" or \"afs\".","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"accountid":{"description":"The asset class: the chart account the asset is recorded in (see list_accounts). Required on create.","oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"description":"\"depreciation\" (default) or \"amortisation\" for intangibles.","oneOf":[{"type":"string"},{"type":"null"}]},"method":{"description":"\"straight\" or \"diminishing\". Tax wear-and-tear (\"fifty\") is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"indefinite":{"description":"An intangible with an indefinite life (IAS 38.107), such as goodwill: not amortised.","oneOf":[{"type":"boolean"},{"type":"null"}]},"usefullife":{"description":"Useful life in whole years.","oneOf":[{"type":"number"},{"type":"null"}]},"rate":{"description":"Yearly rate for the diminishing method, as a fraction (0.2 = 20%).","oneOf":[{"type":"number"},{"type":"null"}]},"residualpercent":{"description":"Residual value as a percent of cost, 0 to 100.","oneOf":[{"type":"number"},{"type":"null"}]},"threshold":{"description":"Capitalisation threshold in base currency. Stored only for now.","oneOf":[{"type":"number"},{"type":"null"}]},"source":{"description":"\"settings\" (default), \"prompt\" or \"afs\".","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"accountid":{"description":"The asset class: the chart account the asset is recorded in (see list_accounts). Required on create.","oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"description":"\"depreciation\" (default) or \"amortisation\" for intangibles.","oneOf":[{"type":"string"},{"type":"null"}]},"method":{"description":"\"straight\" or \"diminishing\". Tax wear-and-tear (\"fifty\") is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"indefinite":{"description":"An intangible with an indefinite life (IAS 38.107), such as goodwill: not amortised.","oneOf":[{"type":"boolean"},{"type":"null"}]},"usefullife":{"description":"Useful life in whole years.","oneOf":[{"type":"number"},{"type":"null"}]},"rate":{"description":"Yearly rate for the diminishing method, as a fraction (0.2 = 20%).","oneOf":[{"type":"number"},{"type":"null"}]},"residualpercent":{"description":"Residual value as a percent of cost, 0 to 100.","oneOf":[{"type":"number"},{"type":"null"}]},"threshold":{"description":"Capitalisation threshold in base currency. Stored only for now.","oneOf":[{"type":"number"},{"type":"null"}]},"source":{"description":"\"settings\" (default), \"prompt\" or \"afs\".","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"accountid":{"description":"The asset class: the chart account the asset is recorded in (see list_accounts). Required on create.","oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"description":"\"depreciation\" (default) or \"amortisation\" for intangibles.","oneOf":[{"type":"string"},{"type":"null"}]},"method":{"description":"\"straight\" or \"diminishing\". Tax wear-and-tear (\"fifty\") is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"indefinite":{"description":"An intangible with an indefinite life (IAS 38.107), such as goodwill: not amortised.","oneOf":[{"type":"boolean"},{"type":"null"}]},"usefullife":{"description":"Useful life in whole years.","oneOf":[{"type":"number"},{"type":"null"}]},"rate":{"description":"Yearly rate for the diminishing method, as a fraction (0.2 = 20%).","oneOf":[{"type":"number"},{"type":"null"}]},"residualpercent":{"description":"Residual value as a percent of cost, 0 to 100.","oneOf":[{"type":"number"},{"type":"null"}]},"threshold":{"description":"Capitalisation threshold in base currency. Stored only for now.","oneOf":[{"type":"number"},{"type":"null"}]},"source":{"description":"\"settings\" (default), \"prompt\" or \"afs\".","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create the accounting policy for one asset class. A new asset in that class with usedefaultdepreciation copies it.","tags":["asset management"]}},"/api/assetpolicy/update":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"accountid":{"description":"The asset class: the chart account the asset is recorded in (see list_accounts). Required on create.","oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"description":"\"depreciation\" (default) or \"amortisation\" for intangibles.","oneOf":[{"type":"string"},{"type":"null"}]},"method":{"description":"\"straight\" or \"diminishing\". Tax wear-and-tear (\"fifty\") is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"indefinite":{"description":"An intangible with an indefinite life (IAS 38.107), such as goodwill: not amortised.","oneOf":[{"type":"boolean"},{"type":"null"}]},"usefullife":{"description":"Useful life in whole years.","oneOf":[{"type":"number"},{"type":"null"}]},"rate":{"description":"Yearly rate for the diminishing method, as a fraction (0.2 = 20%).","oneOf":[{"type":"number"},{"type":"null"}]},"residualpercent":{"description":"Residual value as a percent of cost, 0 to 100.","oneOf":[{"type":"number"},{"type":"null"}]},"threshold":{"description":"Capitalisation threshold in base currency. Stored only for now.","oneOf":[{"type":"number"},{"type":"null"}]},"source":{"description":"\"settings\" (default), \"prompt\" or \"afs\".","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"accountid":{"description":"The asset class: the chart account the asset is recorded in (see list_accounts). Required on create.","oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"description":"\"depreciation\" (default) or \"amortisation\" for intangibles.","oneOf":[{"type":"string"},{"type":"null"}]},"method":{"description":"\"straight\" or \"diminishing\". Tax wear-and-tear (\"fifty\") is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"indefinite":{"description":"An intangible with an indefinite life (IAS 38.107), such as goodwill: not amortised.","oneOf":[{"type":"boolean"},{"type":"null"}]},"usefullife":{"description":"Useful life in whole years.","oneOf":[{"type":"number"},{"type":"null"}]},"rate":{"description":"Yearly rate for the diminishing method, as a fraction (0.2 = 20%).","oneOf":[{"type":"number"},{"type":"null"}]},"residualpercent":{"description":"Residual value as a percent of cost, 0 to 100.","oneOf":[{"type":"number"},{"type":"null"}]},"threshold":{"description":"Capitalisation threshold in base currency. Stored only for now.","oneOf":[{"type":"number"},{"type":"null"}]},"source":{"description":"\"settings\" (default), \"prompt\" or \"afs\".","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"accountid":{"description":"The asset class: the chart account the asset is recorded in (see list_accounts). Required on create.","oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"description":"\"depreciation\" (default) or \"amortisation\" for intangibles.","oneOf":[{"type":"string"},{"type":"null"}]},"method":{"description":"\"straight\" or \"diminishing\". Tax wear-and-tear (\"fifty\") is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"indefinite":{"description":"An intangible with an indefinite life (IAS 38.107), such as goodwill: not amortised.","oneOf":[{"type":"boolean"},{"type":"null"}]},"usefullife":{"description":"Useful life in whole years.","oneOf":[{"type":"number"},{"type":"null"}]},"rate":{"description":"Yearly rate for the diminishing method, as a fraction (0.2 = 20%).","oneOf":[{"type":"number"},{"type":"null"}]},"residualpercent":{"description":"Residual value as a percent of cost, 0 to 100.","oneOf":[{"type":"number"},{"type":"null"}]},"threshold":{"description":"Capitalisation threshold in base currency. Stored only for now.","oneOf":[{"type":"number"},{"type":"null"}]},"source":{"description":"\"settings\" (default), \"prompt\" or \"afs\".","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"accountid":{"description":"The asset class: the chart account the asset is recorded in (see list_accounts). Required on create.","oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"description":"\"depreciation\" (default) or \"amortisation\" for intangibles.","oneOf":[{"type":"string"},{"type":"null"}]},"method":{"description":"\"straight\" or \"diminishing\". Tax wear-and-tear (\"fifty\") is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"indefinite":{"description":"An intangible with an indefinite life (IAS 38.107), such as goodwill: not amortised.","oneOf":[{"type":"boolean"},{"type":"null"}]},"usefullife":{"description":"Useful life in whole years.","oneOf":[{"type":"number"},{"type":"null"}]},"rate":{"description":"Yearly rate for the diminishing method, as a fraction (0.2 = 20%).","oneOf":[{"type":"number"},{"type":"null"}]},"residualpercent":{"description":"Residual value as a percent of cost, 0 to 100.","oneOf":[{"type":"number"},{"type":"null"}]},"threshold":{"description":"Capitalisation threshold in base currency. Stored only for now.","oneOf":[{"type":"number"},{"type":"null"}]},"source":{"description":"\"settings\" (default), \"prompt\" or \"afs\".","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Edit an accounting policy. It applies to new assets only; recorded assets keep their values.","tags":["asset management"]}},"/api/assetpolicy/delete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Delete an accounting policy. Recorded assets keep their values.","tags":["asset management"]}},"/api/loan/list":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"List the business's loans: each loan's name, lender, interest rate, original amount, and whether it is current or archived. `amount` is what was borrowed, not what is still owed; for the balance owed, read the loan's ledger account in a trial balance with evaluate_report.","tags":["loan management"]}},"/api/loan/create":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"lender":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"rate":{"oneOf":[{"type":"number"},{"type":"null"}]},"current":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"openingbalance":{"oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"debitaccount":{"oneOf":[{"type":"string"},{"type":"null"}]},"debitjournal":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"cash":{"description":"PROD-3096: true when payments can be made from the loan's account, which makes that account a base account; false clears it. A new loan without it is not cash. Omit it on update to leave the account as it is.","oneOf":[{"type":"boolean"},{"type":"null"}]},"confirm":{"description":"PROD-1952: required only to save an opening date on an EXISTING loan that is LATER than the earliest repayment, drawdown or journal already posted to that loan's account. Without it that one case is refused, unwritten, with code confirm-required plus earliesttransactiondate and transactionsbefore, so the caller can show what the date would exclude from the loan balance and let the user override it. Inert on create, where the loan's account is new and can carry nothing.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"lender":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"rate":{"oneOf":[{"type":"number"},{"type":"null"}]},"current":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"openingbalance":{"oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"debitaccount":{"oneOf":[{"type":"string"},{"type":"null"}]},"debitjournal":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"cash":{"description":"PROD-3096: true when payments can be made from the loan's account, which makes that account a base account; false clears it. A new loan without it is not cash. Omit it on update to leave the account as it is.","oneOf":[{"type":"boolean"},{"type":"null"}]},"confirm":{"description":"PROD-1952: required only to save an opening date on an EXISTING loan that is LATER than the earliest repayment, drawdown or journal already posted to that loan's account. Without it that one case is refused, unwritten, with code confirm-required plus earliesttransactiondate and transactionsbefore, so the caller can show what the date would exclude from the loan balance and let the user override it. Inert on create, where the loan's account is new and can carry nothing.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"lender":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"rate":{"oneOf":[{"type":"number"},{"type":"null"}]},"current":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"openingbalance":{"oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"debitaccount":{"oneOf":[{"type":"string"},{"type":"null"}]},"debitjournal":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"cash":{"description":"PROD-3096: true when payments can be made from the loan's account, which makes that account a base account; false clears it. A new loan without it is not cash. Omit it on update to leave the account as it is.","oneOf":[{"type":"boolean"},{"type":"null"}]},"confirm":{"description":"PROD-1952: required only to save an opening date on an EXISTING loan that is LATER than the earliest repayment, drawdown or journal already posted to that loan's account. Without it that one case is refused, unwritten, with code confirm-required plus earliesttransactiondate and transactionsbefore, so the caller can show what the date would exclude from the loan balance and let the user override it. Inert on create, where the loan's account is new and can carry nothing.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"lender":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"rate":{"oneOf":[{"type":"number"},{"type":"null"}]},"current":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"openingbalance":{"oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"debitaccount":{"oneOf":[{"type":"string"},{"type":"null"}]},"debitjournal":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"cash":{"description":"PROD-3096: true when payments can be made from the loan's account, which makes that account a base account; false clears it. A new loan without it is not cash. Omit it on update to leave the account as it is.","oneOf":[{"type":"boolean"},{"type":"null"}]},"confirm":{"description":"PROD-1952: required only to save an opening date on an EXISTING loan that is LATER than the earliest repayment, drawdown or journal already posted to that loan's account. Without it that one case is refused, unwritten, with code confirm-required plus earliesttransactiondate and transactionsbefore, so the caller can show what the date would exclude from the loan balance and let the user override it. Inert on create, where the loan's account is new and can carry nothing.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create new loan","tags":["loan management"]}},"/api/loan/update":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"lender":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"rate":{"oneOf":[{"type":"number"},{"type":"null"}]},"current":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"openingbalance":{"oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"debitaccount":{"oneOf":[{"type":"string"},{"type":"null"}]},"debitjournal":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"cash":{"description":"PROD-3096: true when payments can be made from the loan's account, which makes that account a base account; false clears it. A new loan without it is not cash. Omit it on update to leave the account as it is.","oneOf":[{"type":"boolean"},{"type":"null"}]},"confirm":{"description":"PROD-1952: required only to save an opening date on an EXISTING loan that is LATER than the earliest repayment, drawdown or journal already posted to that loan's account. Without it that one case is refused, unwritten, with code confirm-required plus earliesttransactiondate and transactionsbefore, so the caller can show what the date would exclude from the loan balance and let the user override it. Inert on create, where the loan's account is new and can carry nothing.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"lender":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"rate":{"oneOf":[{"type":"number"},{"type":"null"}]},"current":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"openingbalance":{"oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"debitaccount":{"oneOf":[{"type":"string"},{"type":"null"}]},"debitjournal":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"cash":{"description":"PROD-3096: true when payments can be made from the loan's account, which makes that account a base account; false clears it. A new loan without it is not cash. Omit it on update to leave the account as it is.","oneOf":[{"type":"boolean"},{"type":"null"}]},"confirm":{"description":"PROD-1952: required only to save an opening date on an EXISTING loan that is LATER than the earliest repayment, drawdown or journal already posted to that loan's account. Without it that one case is refused, unwritten, with code confirm-required plus earliesttransactiondate and transactionsbefore, so the caller can show what the date would exclude from the loan balance and let the user override it. Inert on create, where the loan's account is new and can carry nothing.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"lender":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"rate":{"oneOf":[{"type":"number"},{"type":"null"}]},"current":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"openingbalance":{"oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"debitaccount":{"oneOf":[{"type":"string"},{"type":"null"}]},"debitjournal":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"cash":{"description":"PROD-3096: true when payments can be made from the loan's account, which makes that account a base account; false clears it. A new loan without it is not cash. Omit it on update to leave the account as it is.","oneOf":[{"type":"boolean"},{"type":"null"}]},"confirm":{"description":"PROD-1952: required only to save an opening date on an EXISTING loan that is LATER than the earliest repayment, drawdown or journal already posted to that loan's account. Without it that one case is refused, unwritten, with code confirm-required plus earliesttransactiondate and transactionsbefore, so the caller can show what the date would exclude from the loan balance and let the user override it. Inert on create, where the loan's account is new and can carry nothing.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"lender":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"rate":{"oneOf":[{"type":"number"},{"type":"null"}]},"current":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"openingbalance":{"oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"debitaccount":{"oneOf":[{"type":"string"},{"type":"null"}]},"debitjournal":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"cash":{"description":"PROD-3096: true when payments can be made from the loan's account, which makes that account a base account; false clears it. A new loan without it is not cash. Omit it on update to leave the account as it is.","oneOf":[{"type":"boolean"},{"type":"null"}]},"confirm":{"description":"PROD-1952: required only to save an opening date on an EXISTING loan that is LATER than the earliest repayment, drawdown or journal already posted to that loan's account. Without it that one case is refused, unwritten, with code confirm-required plus earliesttransactiondate and transactionsbefore, so the caller can show what the date would exclude from the loan balance and let the user override it. Inert on create, where the loan's account is new and can carry nothing.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Update loan data. An opening date later than the earliest repayment, drawdown or journal already posted to this loan's account is refused, unwritten, with code confirm-required until the same call is repeated with confirm true.","tags":["loan management"]}},"/api/loan/save":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"The loan to update, from list_loans. Omit it to create a new loan.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"What the business calls the loan, e.g. Vehicle finance. A new loan needs a lender.","oneOf":[{"type":"string"},{"type":"null"}]},"lender":{"description":"Who lent the money: a bank, a director, a family member.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"What was borrowed, in the loan's currency. Not the balance still owed.","oneOf":[{"type":"number"},{"type":"null"}]},"rate":{"description":"Yearly interest rate as a percentage, e.g. 11.5.","oneOf":[{"type":"number"},{"type":"null"}]},"current":{"description":"True when the loan is due within a year (a current liability). Only read when the loan is created.","oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"description":"True to archive a loan that is paid off.","oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO currency code, e.g. ZAR. Omit for the business's own currency.","oneOf":[{"type":"string"},{"type":"null"}]},"openingbalance":{"description":"What was still owed on openingdate, for a loan that started before the business used stub. 0 clears it.","oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"description":"Date the opening balance applies from, yyyy-MM-dd.","oneOf":[{"type":"string"},{"type":"null"}]},"cash":{"description":"True when payments can be made from this loan's account, e.g. a credit facility drawn like a bank account. A new loan without it is not cash. Omit it to leave it as it is.","oneOf":[{"type":"boolean"},{"type":"null"}]},"confirm":{"description":"Send true only after the user agrees, when an update came back with code confirm-required: the opening date is later than entries already on the loan's account.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"The loan to update, from list_loans. Omit it to create a new loan.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"What the business calls the loan, e.g. Vehicle finance. A new loan needs a lender.","oneOf":[{"type":"string"},{"type":"null"}]},"lender":{"description":"Who lent the money: a bank, a director, a family member.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"What was borrowed, in the loan's currency. Not the balance still owed.","oneOf":[{"type":"number"},{"type":"null"}]},"rate":{"description":"Yearly interest rate as a percentage, e.g. 11.5.","oneOf":[{"type":"number"},{"type":"null"}]},"current":{"description":"True when the loan is due within a year (a current liability). Only read when the loan is created.","oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"description":"True to archive a loan that is paid off.","oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO currency code, e.g. ZAR. Omit for the business's own currency.","oneOf":[{"type":"string"},{"type":"null"}]},"openingbalance":{"description":"What was still owed on openingdate, for a loan that started before the business used stub. 0 clears it.","oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"description":"Date the opening balance applies from, yyyy-MM-dd.","oneOf":[{"type":"string"},{"type":"null"}]},"cash":{"description":"True when payments can be made from this loan's account, e.g. a credit facility drawn like a bank account. A new loan without it is not cash. Omit it to leave it as it is.","oneOf":[{"type":"boolean"},{"type":"null"}]},"confirm":{"description":"Send true only after the user agrees, when an update came back with code confirm-required: the opening date is later than entries already on the loan's account.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"The loan to update, from list_loans. Omit it to create a new loan.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"What the business calls the loan, e.g. Vehicle finance. A new loan needs a lender.","oneOf":[{"type":"string"},{"type":"null"}]},"lender":{"description":"Who lent the money: a bank, a director, a family member.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"What was borrowed, in the loan's currency. Not the balance still owed.","oneOf":[{"type":"number"},{"type":"null"}]},"rate":{"description":"Yearly interest rate as a percentage, e.g. 11.5.","oneOf":[{"type":"number"},{"type":"null"}]},"current":{"description":"True when the loan is due within a year (a current liability). Only read when the loan is created.","oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"description":"True to archive a loan that is paid off.","oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO currency code, e.g. ZAR. Omit for the business's own currency.","oneOf":[{"type":"string"},{"type":"null"}]},"openingbalance":{"description":"What was still owed on openingdate, for a loan that started before the business used stub. 0 clears it.","oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"description":"Date the opening balance applies from, yyyy-MM-dd.","oneOf":[{"type":"string"},{"type":"null"}]},"cash":{"description":"True when payments can be made from this loan's account, e.g. a credit facility drawn like a bank account. A new loan without it is not cash. Omit it to leave it as it is.","oneOf":[{"type":"boolean"},{"type":"null"}]},"confirm":{"description":"Send true only after the user agrees, when an update came back with code confirm-required: the opening date is later than entries already on the loan's account.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"The loan to update, from list_loans. Omit it to create a new loan.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"What the business calls the loan, e.g. Vehicle finance. A new loan needs a lender.","oneOf":[{"type":"string"},{"type":"null"}]},"lender":{"description":"Who lent the money: a bank, a director, a family member.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"What was borrowed, in the loan's currency. Not the balance still owed.","oneOf":[{"type":"number"},{"type":"null"}]},"rate":{"description":"Yearly interest rate as a percentage, e.g. 11.5.","oneOf":[{"type":"number"},{"type":"null"}]},"current":{"description":"True when the loan is due within a year (a current liability). Only read when the loan is created.","oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"description":"True to archive a loan that is paid off.","oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO currency code, e.g. ZAR. Omit for the business's own currency.","oneOf":[{"type":"string"},{"type":"null"}]},"openingbalance":{"description":"What was still owed on openingdate, for a loan that started before the business used stub. 0 clears it.","oneOf":[{"type":"number"},{"type":"null"}]},"openingdate":{"description":"Date the opening balance applies from, yyyy-MM-dd.","oneOf":[{"type":"string"},{"type":"null"}]},"cash":{"description":"True when payments can be made from this loan's account, e.g. a credit facility drawn like a bank account. A new loan without it is not cash. Omit it to leave it as it is.","oneOf":[{"type":"boolean"},{"type":"null"}]},"confirm":{"description":"Send true only after the user agrees, when an update came back with code confirm-required: the opening date is later than entries already on the loan's account.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create or update a loan: money the business owes. Pass an `id` from list_loans to update that loan; omit it to create one, which needs a lender. A new loan gets its own liability account. An id this business does not own is refused with code loan-not-found. An opening date later than entries already on the loan's account is refused, unwritten, with code confirm-required until the same call is repeated with confirm true.","tags":["loan management"]}},"/api/loan/delete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Delete loan data","tags":["loan management"]}},"/api/employee/create":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"number":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"idnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"taxnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"identifiers":{"description":"The full list of the employee's ID, passport and tax numbers. It replaces the stored list: an identifier left out is removed. Leave the key out to keep the stored list; send [] to clear it. idnumber and taxnumber are kept in step with it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The identifier id. Send it to keep and update that identifier; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"description":"The kind, a lower-case slug: said (South African ID), passport, taxnumber, or another registration the country uses.","oneOf":[{"type":"string"},{"type":"null"}]},"value":{"description":"The number as it is written.","oneOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"The issuing country's name, for a passport.","oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false},"maxItems":20},{"type":"null"}]},"leaveentitlements":{"description":"The employee's own yearly leave days per leave type (PROD-3501). Accrual uses, for each month, the row for the type in force then, in place of the leave type's yearly rate; 0 stops that type for the employee. Each row applies from its effectivefrom date (PROD-3502), so a change adds a row and leaves the old one as history. The list replaces the stored one: leave the key out to keep it, send [] to clear it. A row that is in force on or before the employee's last finalised payslip cannot be changed or removed (leaveentitlement-affects-finalised-payslips, with lockedthrough).","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The entitlement id. With the same days, it keeps that row. With new days and no effectivefrom, it changes that row's days on its own date when the row starts after the last finalised payslip; otherwise that row stays as history and the new days apply from today, or the save is refused if that would re-rate a finalised payslip.","oneOf":[{"type":"string"},{"type":"null"}]},"leavetype":{"description":"The leave type id, from this business.","anyOf":[{"type":"string"},{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}]},"days":{"description":"Yearly days for this leave type, 0 or more.","anyOf":[{"type":"number"},{"type":"string"}]},"effectivefrom":{"description":"YYYY-MM-DD the days apply from. Left out: a row with the same type and days as a stored one keeps that row; any other row applies from today on update, and from the start on create.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["leavetype","days"],"additionalProperties":false},"maxItems":50},{"type":"null"}]},"employments":{"type":"array","items":{"type":"object","properties":{"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"startdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"enddate":{"oneOf":[{"type":"string"},{"type":"null"}]},"status":{"oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}},"birthdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"packagekind":{"oneOf":[{"type":"string","enum":["annual","monthly","weekly","daily","hourly","$delete"]},{"type":"null"}]},"packageamount":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string","enum":["$delete"]}]},{"type":"null"}]},"packagequantity":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string","enum":["$delete"]}]},{"type":"null"}]},"paysliptemplate":{"oneOf":[{"type":"string"},{"type":"null"}]},"payvalues":{"oneOf":[{"anyOf":[{"type":"string","enum":["$delete"]},{"allOf":[{"type":"string"},{}]}]},{"type":"null"}]},"payinputs":{"oneOf":[{"anyOf":[{"type":"string","enum":["$delete"]},{"allOf":[{"type":"string"},{}]}]},{"type":"null"}]},"jurisdiction":{"oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"department":{"oneOf":[{"type":"string"},{"type":"null"}]},"contact":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"number":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"idnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"taxnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"identifiers":{"description":"The full list of the employee's ID, passport and tax numbers. It replaces the stored list: an identifier left out is removed. Leave the key out to keep the stored list; send [] to clear it. idnumber and taxnumber are kept in step with it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The identifier id. Send it to keep and update that identifier; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"description":"The kind, a lower-case slug: said (South African ID), passport, taxnumber, or another registration the country uses.","oneOf":[{"type":"string"},{"type":"null"}]},"value":{"description":"The number as it is written.","oneOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"The issuing country's name, for a passport.","oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false},"maxItems":20},{"type":"null"}]},"leaveentitlements":{"description":"The employee's own yearly leave days per leave type (PROD-3501). Accrual uses, for each month, the row for the type in force then, in place of the leave type's yearly rate; 0 stops that type for the employee. Each row applies from its effectivefrom date (PROD-3502), so a change adds a row and leaves the old one as history. The list replaces the stored one: leave the key out to keep it, send [] to clear it. A row that is in force on or before the employee's last finalised payslip cannot be changed or removed (leaveentitlement-affects-finalised-payslips, with lockedthrough).","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The entitlement id. With the same days, it keeps that row. With new days and no effectivefrom, it changes that row's days on its own date when the row starts after the last finalised payslip; otherwise that row stays as history and the new days apply from today, or the save is refused if that would re-rate a finalised payslip.","oneOf":[{"type":"string"},{"type":"null"}]},"leavetype":{"description":"The leave type id, from this business.","anyOf":[{"type":"string"},{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}]},"days":{"description":"Yearly days for this leave type, 0 or more.","anyOf":[{"type":"number"},{"type":"string"}]},"effectivefrom":{"description":"YYYY-MM-DD the days apply from. Left out: a row with the same type and days as a stored one keeps that row; any other row applies from today on update, and from the start on create.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["leavetype","days"],"additionalProperties":false},"maxItems":50},{"type":"null"}]},"employments":{"type":"array","items":{"type":"object","properties":{"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"startdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"enddate":{"oneOf":[{"type":"string"},{"type":"null"}]},"status":{"oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}},"birthdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"packagekind":{"oneOf":[{"type":"string","enum":["annual","monthly","weekly","daily","hourly","$delete"]},{"type":"null"}]},"packageamount":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string","enum":["$delete"]}]},{"type":"null"}]},"packagequantity":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string","enum":["$delete"]}]},{"type":"null"}]},"paysliptemplate":{"oneOf":[{"type":"string"},{"type":"null"}]},"payvalues":{"oneOf":[{"anyOf":[{"type":"string","enum":["$delete"]},{"allOf":[{"type":"string"},{}]}]},{"type":"null"}]},"payinputs":{"oneOf":[{"anyOf":[{"type":"string","enum":["$delete"]},{"allOf":[{"type":"string"},{}]}]},{"type":"null"}]},"jurisdiction":{"oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"department":{"oneOf":[{"type":"string"},{"type":"null"}]},"contact":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"number":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"idnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"taxnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"identifiers":{"description":"The full list of the employee's ID, passport and tax numbers. It replaces the stored list: an identifier left out is removed. Leave the key out to keep the stored list; send [] to clear it. idnumber and taxnumber are kept in step with it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The identifier id. Send it to keep and update that identifier; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"description":"The kind, a lower-case slug: said (South African ID), passport, taxnumber, or another registration the country uses.","oneOf":[{"type":"string"},{"type":"null"}]},"value":{"description":"The number as it is written.","oneOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"The issuing country's name, for a passport.","oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false},"maxItems":20},{"type":"null"}]},"leaveentitlements":{"description":"The employee's own yearly leave days per leave type (PROD-3501). Accrual uses, for each month, the row for the type in force then, in place of the leave type's yearly rate; 0 stops that type for the employee. Each row applies from its effectivefrom date (PROD-3502), so a change adds a row and leaves the old one as history. The list replaces the stored one: leave the key out to keep it, send [] to clear it. A row that is in force on or before the employee's last finalised payslip cannot be changed or removed (leaveentitlement-affects-finalised-payslips, with lockedthrough).","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The entitlement id. With the same days, it keeps that row. With new days and no effectivefrom, it changes that row's days on its own date when the row starts after the last finalised payslip; otherwise that row stays as history and the new days apply from today, or the save is refused if that would re-rate a finalised payslip.","oneOf":[{"type":"string"},{"type":"null"}]},"leavetype":{"description":"The leave type id, from this business.","anyOf":[{"type":"string"},{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}]},"days":{"description":"Yearly days for this leave type, 0 or more.","anyOf":[{"type":"number"},{"type":"string"}]},"effectivefrom":{"description":"YYYY-MM-DD the days apply from. Left out: a row with the same type and days as a stored one keeps that row; any other row applies from today on update, and from the start on create.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["leavetype","days"],"additionalProperties":false},"maxItems":50},{"type":"null"}]},"employments":{"type":"array","items":{"type":"object","properties":{"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"startdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"enddate":{"oneOf":[{"type":"string"},{"type":"null"}]},"status":{"oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}},"birthdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"packagekind":{"oneOf":[{"type":"string","enum":["annual","monthly","weekly","daily","hourly","$delete"]},{"type":"null"}]},"packageamount":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string","enum":["$delete"]}]},{"type":"null"}]},"packagequantity":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string","enum":["$delete"]}]},{"type":"null"}]},"paysliptemplate":{"oneOf":[{"type":"string"},{"type":"null"}]},"payvalues":{"oneOf":[{"anyOf":[{"type":"string","enum":["$delete"]},{"allOf":[{"type":"string"},{}]}]},{"type":"null"}]},"payinputs":{"oneOf":[{"anyOf":[{"type":"string","enum":["$delete"]},{"allOf":[{"type":"string"},{}]}]},{"type":"null"}]},"jurisdiction":{"oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"department":{"oneOf":[{"type":"string"},{"type":"null"}]},"contact":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"number":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"idnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"taxnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"identifiers":{"description":"The full list of the employee's ID, passport and tax numbers. It replaces the stored list: an identifier left out is removed. Leave the key out to keep the stored list; send [] to clear it. idnumber and taxnumber are kept in step with it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The identifier id. Send it to keep and update that identifier; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"description":"The kind, a lower-case slug: said (South African ID), passport, taxnumber, or another registration the country uses.","oneOf":[{"type":"string"},{"type":"null"}]},"value":{"description":"The number as it is written.","oneOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"The issuing country's name, for a passport.","oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false},"maxItems":20},{"type":"null"}]},"leaveentitlements":{"description":"The employee's own yearly leave days per leave type (PROD-3501). Accrual uses, for each month, the row for the type in force then, in place of the leave type's yearly rate; 0 stops that type for the employee. Each row applies from its effectivefrom date (PROD-3502), so a change adds a row and leaves the old one as history. The list replaces the stored one: leave the key out to keep it, send [] to clear it. A row that is in force on or before the employee's last finalised payslip cannot be changed or removed (leaveentitlement-affects-finalised-payslips, with lockedthrough).","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The entitlement id. With the same days, it keeps that row. With new days and no effectivefrom, it changes that row's days on its own date when the row starts after the last finalised payslip; otherwise that row stays as history and the new days apply from today, or the save is refused if that would re-rate a finalised payslip.","oneOf":[{"type":"string"},{"type":"null"}]},"leavetype":{"description":"The leave type id, from this business.","anyOf":[{"type":"string"},{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}]},"days":{"description":"Yearly days for this leave type, 0 or more.","anyOf":[{"type":"number"},{"type":"string"}]},"effectivefrom":{"description":"YYYY-MM-DD the days apply from. Left out: a row with the same type and days as a stored one keeps that row; any other row applies from today on update, and from the start on create.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["leavetype","days"],"additionalProperties":false},"maxItems":50},{"type":"null"}]},"employments":{"type":"array","items":{"type":"object","properties":{"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"startdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"enddate":{"oneOf":[{"type":"string"},{"type":"null"}]},"status":{"oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}},"birthdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"packagekind":{"oneOf":[{"type":"string","enum":["annual","monthly","weekly","daily","hourly","$delete"]},{"type":"null"}]},"packageamount":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string","enum":["$delete"]}]},{"type":"null"}]},"packagequantity":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string","enum":["$delete"]}]},{"type":"null"}]},"paysliptemplate":{"oneOf":[{"type":"string"},{"type":"null"}]},"payvalues":{"oneOf":[{"anyOf":[{"type":"string","enum":["$delete"]},{"allOf":[{"type":"string"},{}]}]},{"type":"null"}]},"payinputs":{"oneOf":[{"anyOf":[{"type":"string","enum":["$delete"]},{"allOf":[{"type":"string"},{}]}]},{"type":"null"}]},"jurisdiction":{"oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"department":{"oneOf":[{"type":"string"},{"type":"null"}]},"contact":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create new employee","tags":["employee management"]}},"/api/employee/update":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"number":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"idnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"taxnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"identifiers":{"description":"The full list of the employee's ID, passport and tax numbers. It replaces the stored list: an identifier left out is removed. Leave the key out to keep the stored list; send [] to clear it. idnumber and taxnumber are kept in step with it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The identifier id. Send it to keep and update that identifier; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"description":"The kind, a lower-case slug: said (South African ID), passport, taxnumber, or another registration the country uses.","oneOf":[{"type":"string"},{"type":"null"}]},"value":{"description":"The number as it is written.","oneOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"The issuing country's name, for a passport.","oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false},"maxItems":20},{"type":"null"}]},"leaveentitlements":{"description":"The employee's own yearly leave days per leave type (PROD-3501). Accrual uses, for each month, the row for the type in force then, in place of the leave type's yearly rate; 0 stops that type for the employee. Each row applies from its effectivefrom date (PROD-3502), so a change adds a row and leaves the old one as history. The list replaces the stored one: leave the key out to keep it, send [] to clear it. A row that is in force on or before the employee's last finalised payslip cannot be changed or removed (leaveentitlement-affects-finalised-payslips, with lockedthrough).","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The entitlement id. With the same days, it keeps that row. With new days and no effectivefrom, it changes that row's days on its own date when the row starts after the last finalised payslip; otherwise that row stays as history and the new days apply from today, or the save is refused if that would re-rate a finalised payslip.","oneOf":[{"type":"string"},{"type":"null"}]},"leavetype":{"description":"The leave type id, from this business.","anyOf":[{"type":"string"},{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}]},"days":{"description":"Yearly days for this leave type, 0 or more.","anyOf":[{"type":"number"},{"type":"string"}]},"effectivefrom":{"description":"YYYY-MM-DD the days apply from. Left out: a row with the same type and days as a stored one keeps that row; any other row applies from today on update, and from the start on create.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["leavetype","days"],"additionalProperties":false},"maxItems":50},{"type":"null"}]},"employments":{"type":"array","items":{"type":"object","properties":{"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"startdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"enddate":{"oneOf":[{"type":"string"},{"type":"null"}]},"status":{"oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}},"birthdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"packagekind":{"oneOf":[{"type":"string","enum":["annual","monthly","weekly","daily","hourly","$delete"]},{"type":"null"}]},"packageamount":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string","enum":["$delete"]}]},{"type":"null"}]},"packagequantity":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string","enum":["$delete"]}]},{"type":"null"}]},"paysliptemplate":{"oneOf":[{"type":"string"},{"type":"null"}]},"payvalues":{"oneOf":[{"anyOf":[{"type":"string","enum":["$delete"]},{"allOf":[{"type":"string"},{}]}]},{"type":"null"}]},"payinputs":{"oneOf":[{"anyOf":[{"type":"string","enum":["$delete"]},{"allOf":[{"type":"string"},{}]}]},{"type":"null"}]},"jurisdiction":{"oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"department":{"oneOf":[{"type":"string"},{"type":"null"}]},"contact":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"number":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"idnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"taxnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"identifiers":{"description":"The full list of the employee's ID, passport and tax numbers. It replaces the stored list: an identifier left out is removed. Leave the key out to keep the stored list; send [] to clear it. idnumber and taxnumber are kept in step with it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The identifier id. Send it to keep and update that identifier; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"description":"The kind, a lower-case slug: said (South African ID), passport, taxnumber, or another registration the country uses.","oneOf":[{"type":"string"},{"type":"null"}]},"value":{"description":"The number as it is written.","oneOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"The issuing country's name, for a passport.","oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false},"maxItems":20},{"type":"null"}]},"leaveentitlements":{"description":"The employee's own yearly leave days per leave type (PROD-3501). Accrual uses, for each month, the row for the type in force then, in place of the leave type's yearly rate; 0 stops that type for the employee. Each row applies from its effectivefrom date (PROD-3502), so a change adds a row and leaves the old one as history. The list replaces the stored one: leave the key out to keep it, send [] to clear it. A row that is in force on or before the employee's last finalised payslip cannot be changed or removed (leaveentitlement-affects-finalised-payslips, with lockedthrough).","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The entitlement id. With the same days, it keeps that row. With new days and no effectivefrom, it changes that row's days on its own date when the row starts after the last finalised payslip; otherwise that row stays as history and the new days apply from today, or the save is refused if that would re-rate a finalised payslip.","oneOf":[{"type":"string"},{"type":"null"}]},"leavetype":{"description":"The leave type id, from this business.","anyOf":[{"type":"string"},{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}]},"days":{"description":"Yearly days for this leave type, 0 or more.","anyOf":[{"type":"number"},{"type":"string"}]},"effectivefrom":{"description":"YYYY-MM-DD the days apply from. Left out: a row with the same type and days as a stored one keeps that row; any other row applies from today on update, and from the start on create.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["leavetype","days"],"additionalProperties":false},"maxItems":50},{"type":"null"}]},"employments":{"type":"array","items":{"type":"object","properties":{"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"startdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"enddate":{"oneOf":[{"type":"string"},{"type":"null"}]},"status":{"oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}},"birthdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"packagekind":{"oneOf":[{"type":"string","enum":["annual","monthly","weekly","daily","hourly","$delete"]},{"type":"null"}]},"packageamount":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string","enum":["$delete"]}]},{"type":"null"}]},"packagequantity":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string","enum":["$delete"]}]},{"type":"null"}]},"paysliptemplate":{"oneOf":[{"type":"string"},{"type":"null"}]},"payvalues":{"oneOf":[{"anyOf":[{"type":"string","enum":["$delete"]},{"allOf":[{"type":"string"},{}]}]},{"type":"null"}]},"payinputs":{"oneOf":[{"anyOf":[{"type":"string","enum":["$delete"]},{"allOf":[{"type":"string"},{}]}]},{"type":"null"}]},"jurisdiction":{"oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"department":{"oneOf":[{"type":"string"},{"type":"null"}]},"contact":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"number":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"idnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"taxnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"identifiers":{"description":"The full list of the employee's ID, passport and tax numbers. It replaces the stored list: an identifier left out is removed. Leave the key out to keep the stored list; send [] to clear it. idnumber and taxnumber are kept in step with it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The identifier id. Send it to keep and update that identifier; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"description":"The kind, a lower-case slug: said (South African ID), passport, taxnumber, or another registration the country uses.","oneOf":[{"type":"string"},{"type":"null"}]},"value":{"description":"The number as it is written.","oneOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"The issuing country's name, for a passport.","oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false},"maxItems":20},{"type":"null"}]},"leaveentitlements":{"description":"The employee's own yearly leave days per leave type (PROD-3501). Accrual uses, for each month, the row for the type in force then, in place of the leave type's yearly rate; 0 stops that type for the employee. Each row applies from its effectivefrom date (PROD-3502), so a change adds a row and leaves the old one as history. The list replaces the stored one: leave the key out to keep it, send [] to clear it. A row that is in force on or before the employee's last finalised payslip cannot be changed or removed (leaveentitlement-affects-finalised-payslips, with lockedthrough).","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The entitlement id. With the same days, it keeps that row. With new days and no effectivefrom, it changes that row's days on its own date when the row starts after the last finalised payslip; otherwise that row stays as history and the new days apply from today, or the save is refused if that would re-rate a finalised payslip.","oneOf":[{"type":"string"},{"type":"null"}]},"leavetype":{"description":"The leave type id, from this business.","anyOf":[{"type":"string"},{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}]},"days":{"description":"Yearly days for this leave type, 0 or more.","anyOf":[{"type":"number"},{"type":"string"}]},"effectivefrom":{"description":"YYYY-MM-DD the days apply from. Left out: a row with the same type and days as a stored one keeps that row; any other row applies from today on update, and from the start on create.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["leavetype","days"],"additionalProperties":false},"maxItems":50},{"type":"null"}]},"employments":{"type":"array","items":{"type":"object","properties":{"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"startdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"enddate":{"oneOf":[{"type":"string"},{"type":"null"}]},"status":{"oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}},"birthdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"packagekind":{"oneOf":[{"type":"string","enum":["annual","monthly","weekly","daily","hourly","$delete"]},{"type":"null"}]},"packageamount":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string","enum":["$delete"]}]},{"type":"null"}]},"packagequantity":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string","enum":["$delete"]}]},{"type":"null"}]},"paysliptemplate":{"oneOf":[{"type":"string"},{"type":"null"}]},"payvalues":{"oneOf":[{"anyOf":[{"type":"string","enum":["$delete"]},{"allOf":[{"type":"string"},{}]}]},{"type":"null"}]},"payinputs":{"oneOf":[{"anyOf":[{"type":"string","enum":["$delete"]},{"allOf":[{"type":"string"},{}]}]},{"type":"null"}]},"jurisdiction":{"oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"department":{"oneOf":[{"type":"string"},{"type":"null"}]},"contact":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"number":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"idnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"taxnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"identifiers":{"description":"The full list of the employee's ID, passport and tax numbers. It replaces the stored list: an identifier left out is removed. Leave the key out to keep the stored list; send [] to clear it. idnumber and taxnumber are kept in step with it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The identifier id. Send it to keep and update that identifier; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"description":"The kind, a lower-case slug: said (South African ID), passport, taxnumber, or another registration the country uses.","oneOf":[{"type":"string"},{"type":"null"}]},"value":{"description":"The number as it is written.","oneOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"The issuing country's name, for a passport.","oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false},"maxItems":20},{"type":"null"}]},"leaveentitlements":{"description":"The employee's own yearly leave days per leave type (PROD-3501). Accrual uses, for each month, the row for the type in force then, in place of the leave type's yearly rate; 0 stops that type for the employee. Each row applies from its effectivefrom date (PROD-3502), so a change adds a row and leaves the old one as history. The list replaces the stored one: leave the key out to keep it, send [] to clear it. A row that is in force on or before the employee's last finalised payslip cannot be changed or removed (leaveentitlement-affects-finalised-payslips, with lockedthrough).","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The entitlement id. With the same days, it keeps that row. With new days and no effectivefrom, it changes that row's days on its own date when the row starts after the last finalised payslip; otherwise that row stays as history and the new days apply from today, or the save is refused if that would re-rate a finalised payslip.","oneOf":[{"type":"string"},{"type":"null"}]},"leavetype":{"description":"The leave type id, from this business.","anyOf":[{"type":"string"},{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}]},"days":{"description":"Yearly days for this leave type, 0 or more.","anyOf":[{"type":"number"},{"type":"string"}]},"effectivefrom":{"description":"YYYY-MM-DD the days apply from. Left out: a row with the same type and days as a stored one keeps that row; any other row applies from today on update, and from the start on create.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["leavetype","days"],"additionalProperties":false},"maxItems":50},{"type":"null"}]},"employments":{"type":"array","items":{"type":"object","properties":{"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"startdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"enddate":{"oneOf":[{"type":"string"},{"type":"null"}]},"status":{"oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}},"birthdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"packagekind":{"oneOf":[{"type":"string","enum":["annual","monthly","weekly","daily","hourly","$delete"]},{"type":"null"}]},"packageamount":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string","enum":["$delete"]}]},{"type":"null"}]},"packagequantity":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string","enum":["$delete"]}]},{"type":"null"}]},"paysliptemplate":{"oneOf":[{"type":"string"},{"type":"null"}]},"payvalues":{"oneOf":[{"anyOf":[{"type":"string","enum":["$delete"]},{"allOf":[{"type":"string"},{}]}]},{"type":"null"}]},"payinputs":{"oneOf":[{"anyOf":[{"type":"string","enum":["$delete"]},{"allOf":[{"type":"string"},{}]}]},{"type":"null"}]},"jurisdiction":{"oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"department":{"oneOf":[{"type":"string"},{"type":"null"}]},"contact":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Update employee data","tags":["employee management"]}},"/api/employee/list":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"List the business's payroll employees with name, number, role, department, contact details, employments and standing package. ID and tax numbers are never returned. For one employee use get_employee; for their payslips use list_payslips.","tags":["employee management"]}},"/api/employee/get":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"One payroll employee by id, with the same fields list_employees returns. ID and tax numbers are never returned. An id that is not this business's employee is an error.","tags":["employee management"]}},"/api/employee/save":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"number":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"idnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"taxnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"identifiers":{"description":"The full list of the employee's ID, passport and tax numbers. It replaces the stored list: an identifier left out is removed. Leave the key out to keep the stored list; send [] to clear it. idnumber and taxnumber are kept in step with it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The identifier id. Send it to keep and update that identifier; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"description":"The kind, a lower-case slug: said (South African ID), passport, taxnumber, or another registration the country uses.","oneOf":[{"type":"string"},{"type":"null"}]},"value":{"description":"The number as it is written.","oneOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"The issuing country's name, for a passport.","oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false},"maxItems":20},{"type":"null"}]},"leaveentitlements":{"description":"The employee's own yearly leave days per leave type (PROD-3501). Accrual uses, for each month, the row for the type in force then, in place of the leave type's yearly rate; 0 stops that type for the employee. Each row applies from its effectivefrom date (PROD-3502), so a change adds a row and leaves the old one as history. The list replaces the stored one: leave the key out to keep it, send [] to clear it. A row that is in force on or before the employee's last finalised payslip cannot be changed or removed (leaveentitlement-affects-finalised-payslips, with lockedthrough).","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The entitlement id. With the same days, it keeps that row. With new days and no effectivefrom, it changes that row's days on its own date when the row starts after the last finalised payslip; otherwise that row stays as history and the new days apply from today, or the save is refused if that would re-rate a finalised payslip.","oneOf":[{"type":"string"},{"type":"null"}]},"leavetype":{"description":"The leave type id, from this business.","anyOf":[{"type":"string"},{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}]},"days":{"description":"Yearly days for this leave type, 0 or more.","anyOf":[{"type":"number"},{"type":"string"}]},"effectivefrom":{"description":"YYYY-MM-DD the days apply from. Left out: a row with the same type and days as a stored one keeps that row; any other row applies from today on update, and from the start on create.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["leavetype","days"],"additionalProperties":false},"maxItems":50},{"type":"null"}]},"employments":{"type":"array","items":{"type":"object","properties":{"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"startdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"enddate":{"oneOf":[{"type":"string"},{"type":"null"}]},"status":{"oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}},"birthdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"packagekind":{"description":"How the package is paid. annual, monthly and weekly: packageamount is the pay for that period and packagequantity is not sent. hourly and daily: packageamount is the RATE per hour or day and packagequantity is the normal hours or days per week. \"$delete\" clears it.","oneOf":[{"type":"string","enum":["annual","monthly","weekly","daily","hourly","$delete"]},{"type":"null"}]},"packageamount":{"description":"The package amount; see packagekind. \"$delete\" clears it.","oneOf":[{"anyOf":[{"type":"number"},{"type":"string","enum":["$delete"]}]},{"type":"null"}]},"packagequantity":{"description":"Normal hours or days per week, for an hourly or daily package only. \"$delete\" clears it.","oneOf":[{"anyOf":[{"type":"number"},{"type":"string","enum":["$delete"]}]},{"type":"null"}]},"paysliptemplate":{"description":"The id of the payslip template whose lines this employee's payslips start from.","oneOf":[{"type":"string"},{"type":"null"}]},"jurisdiction":{"description":"The employee's jurisdiction id within the business's payroll pack, when the pack has more than one.","oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"department":{"oneOf":[{"type":"string"},{"type":"null"}]},"contact":{"description":"The id of the contact this employee is linked to: a contact, customer or supplier id from this business. \"$delete\" unlinks it.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"number":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"idnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"taxnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"identifiers":{"description":"The full list of the employee's ID, passport and tax numbers. It replaces the stored list: an identifier left out is removed. Leave the key out to keep the stored list; send [] to clear it. idnumber and taxnumber are kept in step with it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The identifier id. Send it to keep and update that identifier; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"description":"The kind, a lower-case slug: said (South African ID), passport, taxnumber, or another registration the country uses.","oneOf":[{"type":"string"},{"type":"null"}]},"value":{"description":"The number as it is written.","oneOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"The issuing country's name, for a passport.","oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false},"maxItems":20},{"type":"null"}]},"leaveentitlements":{"description":"The employee's own yearly leave days per leave type (PROD-3501). Accrual uses, for each month, the row for the type in force then, in place of the leave type's yearly rate; 0 stops that type for the employee. Each row applies from its effectivefrom date (PROD-3502), so a change adds a row and leaves the old one as history. The list replaces the stored one: leave the key out to keep it, send [] to clear it. A row that is in force on or before the employee's last finalised payslip cannot be changed or removed (leaveentitlement-affects-finalised-payslips, with lockedthrough).","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The entitlement id. With the same days, it keeps that row. With new days and no effectivefrom, it changes that row's days on its own date when the row starts after the last finalised payslip; otherwise that row stays as history and the new days apply from today, or the save is refused if that would re-rate a finalised payslip.","oneOf":[{"type":"string"},{"type":"null"}]},"leavetype":{"description":"The leave type id, from this business.","anyOf":[{"type":"string"},{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}]},"days":{"description":"Yearly days for this leave type, 0 or more.","anyOf":[{"type":"number"},{"type":"string"}]},"effectivefrom":{"description":"YYYY-MM-DD the days apply from. Left out: a row with the same type and days as a stored one keeps that row; any other row applies from today on update, and from the start on create.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["leavetype","days"],"additionalProperties":false},"maxItems":50},{"type":"null"}]},"employments":{"type":"array","items":{"type":"object","properties":{"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"startdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"enddate":{"oneOf":[{"type":"string"},{"type":"null"}]},"status":{"oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}},"birthdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"packagekind":{"description":"How the package is paid. annual, monthly and weekly: packageamount is the pay for that period and packagequantity is not sent. hourly and daily: packageamount is the RATE per hour or day and packagequantity is the normal hours or days per week. \"$delete\" clears it.","oneOf":[{"type":"string","enum":["annual","monthly","weekly","daily","hourly","$delete"]},{"type":"null"}]},"packageamount":{"description":"The package amount; see packagekind. \"$delete\" clears it.","oneOf":[{"anyOf":[{"type":"number"},{"type":"string","enum":["$delete"]}]},{"type":"null"}]},"packagequantity":{"description":"Normal hours or days per week, for an hourly or daily package only. \"$delete\" clears it.","oneOf":[{"anyOf":[{"type":"number"},{"type":"string","enum":["$delete"]}]},{"type":"null"}]},"paysliptemplate":{"description":"The id of the payslip template whose lines this employee's payslips start from.","oneOf":[{"type":"string"},{"type":"null"}]},"jurisdiction":{"description":"The employee's jurisdiction id within the business's payroll pack, when the pack has more than one.","oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"department":{"oneOf":[{"type":"string"},{"type":"null"}]},"contact":{"description":"The id of the contact this employee is linked to: a contact, customer or supplier id from this business. \"$delete\" unlinks it.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"number":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"idnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"taxnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"identifiers":{"description":"The full list of the employee's ID, passport and tax numbers. It replaces the stored list: an identifier left out is removed. Leave the key out to keep the stored list; send [] to clear it. idnumber and taxnumber are kept in step with it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The identifier id. Send it to keep and update that identifier; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"description":"The kind, a lower-case slug: said (South African ID), passport, taxnumber, or another registration the country uses.","oneOf":[{"type":"string"},{"type":"null"}]},"value":{"description":"The number as it is written.","oneOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"The issuing country's name, for a passport.","oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false},"maxItems":20},{"type":"null"}]},"leaveentitlements":{"description":"The employee's own yearly leave days per leave type (PROD-3501). Accrual uses, for each month, the row for the type in force then, in place of the leave type's yearly rate; 0 stops that type for the employee. Each row applies from its effectivefrom date (PROD-3502), so a change adds a row and leaves the old one as history. The list replaces the stored one: leave the key out to keep it, send [] to clear it. A row that is in force on or before the employee's last finalised payslip cannot be changed or removed (leaveentitlement-affects-finalised-payslips, with lockedthrough).","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The entitlement id. With the same days, it keeps that row. With new days and no effectivefrom, it changes that row's days on its own date when the row starts after the last finalised payslip; otherwise that row stays as history and the new days apply from today, or the save is refused if that would re-rate a finalised payslip.","oneOf":[{"type":"string"},{"type":"null"}]},"leavetype":{"description":"The leave type id, from this business.","anyOf":[{"type":"string"},{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}]},"days":{"description":"Yearly days for this leave type, 0 or more.","anyOf":[{"type":"number"},{"type":"string"}]},"effectivefrom":{"description":"YYYY-MM-DD the days apply from. Left out: a row with the same type and days as a stored one keeps that row; any other row applies from today on update, and from the start on create.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["leavetype","days"],"additionalProperties":false},"maxItems":50},{"type":"null"}]},"employments":{"type":"array","items":{"type":"object","properties":{"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"startdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"enddate":{"oneOf":[{"type":"string"},{"type":"null"}]},"status":{"oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}},"birthdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"packagekind":{"description":"How the package is paid. annual, monthly and weekly: packageamount is the pay for that period and packagequantity is not sent. hourly and daily: packageamount is the RATE per hour or day and packagequantity is the normal hours or days per week. \"$delete\" clears it.","oneOf":[{"type":"string","enum":["annual","monthly","weekly","daily","hourly","$delete"]},{"type":"null"}]},"packageamount":{"description":"The package amount; see packagekind. \"$delete\" clears it.","oneOf":[{"anyOf":[{"type":"number"},{"type":"string","enum":["$delete"]}]},{"type":"null"}]},"packagequantity":{"description":"Normal hours or days per week, for an hourly or daily package only. \"$delete\" clears it.","oneOf":[{"anyOf":[{"type":"number"},{"type":"string","enum":["$delete"]}]},{"type":"null"}]},"paysliptemplate":{"description":"The id of the payslip template whose lines this employee's payslips start from.","oneOf":[{"type":"string"},{"type":"null"}]},"jurisdiction":{"description":"The employee's jurisdiction id within the business's payroll pack, when the pack has more than one.","oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"department":{"oneOf":[{"type":"string"},{"type":"null"}]},"contact":{"description":"The id of the contact this employee is linked to: a contact, customer or supplier id from this business. \"$delete\" unlinks it.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"number":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"contactnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"idnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"taxnumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"addresses":{"description":"The full list of addresses. It replaces the stored list: an address left out is removed. Leave the key out to keep the stored list; send [] to clear it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The address id. Send it to keep and update that address; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"label":{"description":"A name for the address, e.g. Head office.","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"oneOf":[{"type":"string"},{"type":"null"}]},"city":{"oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"country":{"oneOf":[{"type":"string"},{"type":"null"}]},"showoninvoices":{"description":"True on the ONE address that documents print. More than one is refused.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},"maxItems":50},{"type":"null"}]},"identifiers":{"description":"The full list of the employee's ID, passport and tax numbers. It replaces the stored list: an identifier left out is removed. Leave the key out to keep the stored list; send [] to clear it. idnumber and taxnumber are kept in step with it.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The identifier id. Send it to keep and update that identifier; leave it out to add a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"description":"The kind, a lower-case slug: said (South African ID), passport, taxnumber, or another registration the country uses.","oneOf":[{"type":"string"},{"type":"null"}]},"value":{"description":"The number as it is written.","oneOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"The issuing country's name, for a passport.","oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false},"maxItems":20},{"type":"null"}]},"leaveentitlements":{"description":"The employee's own yearly leave days per leave type (PROD-3501). Accrual uses, for each month, the row for the type in force then, in place of the leave type's yearly rate; 0 stops that type for the employee. Each row applies from its effectivefrom date (PROD-3502), so a change adds a row and leaves the old one as history. The list replaces the stored one: leave the key out to keep it, send [] to clear it. A row that is in force on or before the employee's last finalised payslip cannot be changed or removed (leaveentitlement-affects-finalised-payslips, with lockedthrough).","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The entitlement id. With the same days, it keeps that row. With new days and no effectivefrom, it changes that row's days on its own date when the row starts after the last finalised payslip; otherwise that row stays as history and the new days apply from today, or the save is refused if that would re-rate a finalised payslip.","oneOf":[{"type":"string"},{"type":"null"}]},"leavetype":{"description":"The leave type id, from this business.","anyOf":[{"type":"string"},{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}]},"days":{"description":"Yearly days for this leave type, 0 or more.","anyOf":[{"type":"number"},{"type":"string"}]},"effectivefrom":{"description":"YYYY-MM-DD the days apply from. Left out: a row with the same type and days as a stored one keeps that row; any other row applies from today on update, and from the start on create.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["leavetype","days"],"additionalProperties":false},"maxItems":50},{"type":"null"}]},"employments":{"type":"array","items":{"type":"object","properties":{"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"startdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"enddate":{"oneOf":[{"type":"string"},{"type":"null"}]},"status":{"oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}},"birthdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"packagekind":{"description":"How the package is paid. annual, monthly and weekly: packageamount is the pay for that period and packagequantity is not sent. hourly and daily: packageamount is the RATE per hour or day and packagequantity is the normal hours or days per week. \"$delete\" clears it.","oneOf":[{"type":"string","enum":["annual","monthly","weekly","daily","hourly","$delete"]},{"type":"null"}]},"packageamount":{"description":"The package amount; see packagekind. \"$delete\" clears it.","oneOf":[{"anyOf":[{"type":"number"},{"type":"string","enum":["$delete"]}]},{"type":"null"}]},"packagequantity":{"description":"Normal hours or days per week, for an hourly or daily package only. \"$delete\" clears it.","oneOf":[{"anyOf":[{"type":"number"},{"type":"string","enum":["$delete"]}]},{"type":"null"}]},"paysliptemplate":{"description":"The id of the payslip template whose lines this employee's payslips start from.","oneOf":[{"type":"string"},{"type":"null"}]},"jurisdiction":{"description":"The employee's jurisdiction id within the business's payroll pack, when the pack has more than one.","oneOf":[{"type":"string"},{"type":"null"}]},"starred":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"department":{"oneOf":[{"type":"string"},{"type":"null"}]},"contact":{"description":"The id of the contact this employee is linked to: a contact, customer or supplier id from this business. \"$delete\" unlinks it.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create or update a payroll employee: name, number, contact and identity details, role, department, employments and standing package. Omit id to create; pass an id to update that employee. An update that ends the employee's employment (a new end date with no employment starting the next day) files their tax certificates; a status change, a re-sent end date or a create files nothing. Writes no payslip and posts nothing to the ledger.","tags":["employee management"]}},"/api/employee/pay":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"employee":{"description":"The employee id, or the employee's name or number.","type":"string"},"rows":{"description":"Pay rows to set, one per line code. Each row replaces the stored row with the same code; codes not sent keep their stored row. amount fixes a line's figure, rate and quantity price a rate line, formula prices it with a formula, excluded true leaves the line off. An opt-in line (get_payroll_setup), such as eti, is turned on with {code, included true, since YYYY-MM}. A tax directive is set in the stub app only.","oneOf":[{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"rate":{"oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"oneOf":[{"type":"number"},{"type":"null"}]},"formula":{"oneOf":[{"type":"string"},{"type":"null"}]},"excluded":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"included":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"since":{"description":"YYYY-MM: the first month an opt-in line applies.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["code"],"additionalProperties":false}},{"type":"null"}]},"remove":{"description":"Line codes whose stored rows to remove. A row carrying a tax directive is never removed.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"inputs":{"description":"The employee's own figures the country's payroll reads, by field id: get_payroll_setup lists them under employeefields. Each sent field replaces the stored one; null clears it; fields not sent are kept. In South Africa: medicalMembers (people on the medical aid, the employee included), medicalOwn and retirementOwn (a month's medical aid and retirement annuity the employee pays outside payroll).","oneOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]},"packagekind":{"description":"How the package is paid. annual, monthly and weekly: packageamount is the pay for that period and packagequantity is not sent. hourly and daily: packageamount is the RATE per hour or day and packagequantity is the normal hours or days per week. \"$delete\" clears it.","oneOf":[{"type":"string","enum":["annual","monthly","weekly","daily","hourly","$delete"]},{"type":"null"}]},"packageamount":{"description":"The package amount; see packagekind. \"$delete\" clears it.","oneOf":[{"anyOf":[{"type":"number"},{"type":"string","enum":["$delete"]}]},{"type":"null"}]},"packagequantity":{"description":"Normal hours or days per week, for an hourly or daily package only. \"$delete\" clears it.","oneOf":[{"anyOf":[{"type":"number"},{"type":"string","enum":["$delete"]}]},{"type":"null"}]},"paysliptemplate":{"description":"The payslip template id or name whose lines this employee's payslips start from.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","employee"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"employee":{"description":"The employee id, or the employee's name or number.","type":"string"},"rows":{"description":"Pay rows to set, one per line code. Each row replaces the stored row with the same code; codes not sent keep their stored row. amount fixes a line's figure, rate and quantity price a rate line, formula prices it with a formula, excluded true leaves the line off. An opt-in line (get_payroll_setup), such as eti, is turned on with {code, included true, since YYYY-MM}. A tax directive is set in the stub app only.","oneOf":[{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"rate":{"oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"oneOf":[{"type":"number"},{"type":"null"}]},"formula":{"oneOf":[{"type":"string"},{"type":"null"}]},"excluded":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"included":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"since":{"description":"YYYY-MM: the first month an opt-in line applies.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["code"],"additionalProperties":false}},{"type":"null"}]},"remove":{"description":"Line codes whose stored rows to remove. A row carrying a tax directive is never removed.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"inputs":{"description":"The employee's own figures the country's payroll reads, by field id: get_payroll_setup lists them under employeefields. Each sent field replaces the stored one; null clears it; fields not sent are kept. In South Africa: medicalMembers (people on the medical aid, the employee included), medicalOwn and retirementOwn (a month's medical aid and retirement annuity the employee pays outside payroll).","oneOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]},"packagekind":{"description":"How the package is paid. annual, monthly and weekly: packageamount is the pay for that period and packagequantity is not sent. hourly and daily: packageamount is the RATE per hour or day and packagequantity is the normal hours or days per week. \"$delete\" clears it.","oneOf":[{"type":"string","enum":["annual","monthly","weekly","daily","hourly","$delete"]},{"type":"null"}]},"packageamount":{"description":"The package amount; see packagekind. \"$delete\" clears it.","oneOf":[{"anyOf":[{"type":"number"},{"type":"string","enum":["$delete"]}]},{"type":"null"}]},"packagequantity":{"description":"Normal hours or days per week, for an hourly or daily package only. \"$delete\" clears it.","oneOf":[{"anyOf":[{"type":"number"},{"type":"string","enum":["$delete"]}]},{"type":"null"}]},"paysliptemplate":{"description":"The payslip template id or name whose lines this employee's payslips start from.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","employee"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"employee":{"description":"The employee id, or the employee's name or number.","type":"string"},"rows":{"description":"Pay rows to set, one per line code. Each row replaces the stored row with the same code; codes not sent keep their stored row. amount fixes a line's figure, rate and quantity price a rate line, formula prices it with a formula, excluded true leaves the line off. An opt-in line (get_payroll_setup), such as eti, is turned on with {code, included true, since YYYY-MM}. A tax directive is set in the stub app only.","oneOf":[{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"rate":{"oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"oneOf":[{"type":"number"},{"type":"null"}]},"formula":{"oneOf":[{"type":"string"},{"type":"null"}]},"excluded":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"included":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"since":{"description":"YYYY-MM: the first month an opt-in line applies.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["code"],"additionalProperties":false}},{"type":"null"}]},"remove":{"description":"Line codes whose stored rows to remove. A row carrying a tax directive is never removed.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"inputs":{"description":"The employee's own figures the country's payroll reads, by field id: get_payroll_setup lists them under employeefields. Each sent field replaces the stored one; null clears it; fields not sent are kept. In South Africa: medicalMembers (people on the medical aid, the employee included), medicalOwn and retirementOwn (a month's medical aid and retirement annuity the employee pays outside payroll).","oneOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]},"packagekind":{"description":"How the package is paid. annual, monthly and weekly: packageamount is the pay for that period and packagequantity is not sent. hourly and daily: packageamount is the RATE per hour or day and packagequantity is the normal hours or days per week. \"$delete\" clears it.","oneOf":[{"type":"string","enum":["annual","monthly","weekly","daily","hourly","$delete"]},{"type":"null"}]},"packageamount":{"description":"The package amount; see packagekind. \"$delete\" clears it.","oneOf":[{"anyOf":[{"type":"number"},{"type":"string","enum":["$delete"]}]},{"type":"null"}]},"packagequantity":{"description":"Normal hours or days per week, for an hourly or daily package only. \"$delete\" clears it.","oneOf":[{"anyOf":[{"type":"number"},{"type":"string","enum":["$delete"]}]},{"type":"null"}]},"paysliptemplate":{"description":"The payslip template id or name whose lines this employee's payslips start from.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","employee"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"employee":{"description":"The employee id, or the employee's name or number.","type":"string"},"rows":{"description":"Pay rows to set, one per line code. Each row replaces the stored row with the same code; codes not sent keep their stored row. amount fixes a line's figure, rate and quantity price a rate line, formula prices it with a formula, excluded true leaves the line off. An opt-in line (get_payroll_setup), such as eti, is turned on with {code, included true, since YYYY-MM}. A tax directive is set in the stub app only.","oneOf":[{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"rate":{"oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"oneOf":[{"type":"number"},{"type":"null"}]},"formula":{"oneOf":[{"type":"string"},{"type":"null"}]},"excluded":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"included":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"since":{"description":"YYYY-MM: the first month an opt-in line applies.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["code"],"additionalProperties":false}},{"type":"null"}]},"remove":{"description":"Line codes whose stored rows to remove. A row carrying a tax directive is never removed.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"inputs":{"description":"The employee's own figures the country's payroll reads, by field id: get_payroll_setup lists them under employeefields. Each sent field replaces the stored one; null clears it; fields not sent are kept. In South Africa: medicalMembers (people on the medical aid, the employee included), medicalOwn and retirementOwn (a month's medical aid and retirement annuity the employee pays outside payroll).","oneOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]},"packagekind":{"description":"How the package is paid. annual, monthly and weekly: packageamount is the pay for that period and packagequantity is not sent. hourly and daily: packageamount is the RATE per hour or day and packagequantity is the normal hours or days per week. \"$delete\" clears it.","oneOf":[{"type":"string","enum":["annual","monthly","weekly","daily","hourly","$delete"]},{"type":"null"}]},"packageamount":{"description":"The package amount; see packagekind. \"$delete\" clears it.","oneOf":[{"anyOf":[{"type":"number"},{"type":"string","enum":["$delete"]}]},{"type":"null"}]},"packagequantity":{"description":"Normal hours or days per week, for an hourly or daily package only. \"$delete\" clears it.","oneOf":[{"anyOf":[{"type":"number"},{"type":"string","enum":["$delete"]}]},{"type":"null"}]},"paysliptemplate":{"description":"The payslip template id or name whose lines this employee's payslips start from.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","employee"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Set one employee's own pay: rows by line code over the stored ones, codes to remove, and the package and payslip template. Rows not named are kept. Turn on an opt-in line such as eti with included true and since. A tax directive is set in the stub app only: a row naming one is refused, and a stored directive row is kept. Writes no payslip and posts nothing to the ledger.","tags":["employee management"]}},"/api/employee/delete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Delete employee data","tags":["employee management"]}},"/api/employee/openingbalances":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"employeeid":{"type":"string"},"yearstart":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["employeeid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"employeeid":{"type":"string"},"yearstart":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["employeeid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"employeeid":{"type":"string"},"yearstart":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["employeeid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"employeeid":{"type":"string"},"yearstart":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["employeeid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"An employee's opening balances: the year so far another payroll paid them, one figure per IRP5 code (each month as paid, when known), with how they may change now: edit (only drafts have counted them), correct (a finalised payslip has; needs a reason) or locked (their tax year is in a locked period). Not a payslip: they post, file and send nothing.","tags":["employee management"]}},"/api/employee/openingbalances/save":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"employeeid":{"type":"string"},"upto":{"type":"string"},"periods":{"anyOf":[{"type":"number"},{"type":"string"}]},"lines":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string"},"amount":{"anyOf":[{"type":"number"},{"type":"string"}]},"month":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["role","amount"],"additionalProperties":false}},"reason":{"oneOf":[{"type":"string"},{"type":"null"}]},"resolution":{"oneOf":[{"type":"string","enum":["carry","post"]},{"type":"null"}]}},"required":["employeeid","upto","periods","lines"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"employeeid":{"type":"string"},"upto":{"type":"string"},"periods":{"anyOf":[{"type":"number"},{"type":"string"}]},"lines":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string"},"amount":{"anyOf":[{"type":"number"},{"type":"string"}]},"month":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["role","amount"],"additionalProperties":false}},"reason":{"oneOf":[{"type":"string"},{"type":"null"}]},"resolution":{"oneOf":[{"type":"string","enum":["carry","post"]},{"type":"null"}]}},"required":["employeeid","upto","periods","lines"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"employeeid":{"type":"string"},"upto":{"type":"string"},"periods":{"anyOf":[{"type":"number"},{"type":"string"}]},"lines":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string"},"amount":{"anyOf":[{"type":"number"},{"type":"string"}]},"month":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["role","amount"],"additionalProperties":false}},"reason":{"oneOf":[{"type":"string"},{"type":"null"}]},"resolution":{"oneOf":[{"type":"string","enum":["carry","post"]},{"type":"null"}]}},"required":["employeeid","upto","periods","lines"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"employeeid":{"type":"string"},"upto":{"type":"string"},"periods":{"anyOf":[{"type":"number"},{"type":"string"}]},"lines":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string"},"amount":{"anyOf":[{"type":"number"},{"type":"string"}]},"month":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["role","amount"],"additionalProperties":false}},"reason":{"oneOf":[{"type":"string"},{"type":"null"}]},"resolution":{"oneOf":[{"type":"string","enum":["carry","post"]},{"type":"null"}]}},"required":["employeeid","upto","periods","lines"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Make, edit or correct an employee's opening balances for the tax year `upto` falls in: `upto` (the old payroll's last pay date), `periods` and `lines`, each an IRP5 role (\"sars-3601\") with an amount and, optionally, the month (yyyy-MM) it was paid in. The lines replace the stored ones. Once a finalised payslip has counted them it is a correction: give `reason`, and `resolution` \"carry\" (the next payslip's PAYE takes the difference) or \"post\" (the finalised payslips go back to draft, refused in a locked period). Refused when their tax year is in a locked period, and for a business whose PAYE does not work from the year to date (nothing would read them). Posts nothing.","tags":["employee management"]}},"/api/payitem/create":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"type":{"oneOf":[{"type":"string"},{"type":"null"}]},"rate":{"oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"useamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"type":{"oneOf":[{"type":"string"},{"type":"null"}]},"rate":{"oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"useamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"type":{"oneOf":[{"type":"string"},{"type":"null"}]},"rate":{"oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"useamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"type":{"oneOf":[{"type":"string"},{"type":"null"}]},"rate":{"oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"useamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create new pay item","tags":["payitem management"]}},"/api/payitem/update":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"type":{"oneOf":[{"type":"string"},{"type":"null"}]},"rate":{"oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"useamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"type":{"oneOf":[{"type":"string"},{"type":"null"}]},"rate":{"oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"useamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"type":{"oneOf":[{"type":"string"},{"type":"null"}]},"rate":{"oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"useamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"type":{"oneOf":[{"type":"string"},{"type":"null"}]},"rate":{"oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"useamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Update pay item data","tags":["payitem management"]}},"/api/payitem/delete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Delete pay item data","tags":["payitem management"]}},"/api/payrunschedule/list":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"List the business's pay run schedules with enabled flag, frequency, pay day, next run, whether each run is populated with payslips, and what happens on the pay date. For the runs a schedule made use list_payruns.","tags":["payrun schedule management"]}},"/api/payrunschedule/create":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"enabled":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"frequency":{"oneOf":[{"type":"string"},{"type":"null"}]},"payday":{"oneOf":[{"anyOf":[{"type":"integer"},{"type":"string"}]},{"type":"null"}]},"populate":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"employees":{"oneOf":[{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"string","enum":["$delete"]}]},{"type":"null"}]},"payaction":{"oneOf":[{"type":"object","properties":{"send":{"type":"boolean"},"reports":{"type":"boolean"}},"additionalProperties":false},{"type":"null"}]},"payactionenabled":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"catchuplimit":{"oneOf":[{"type":"integer"},{"type":"null"}]},"returns":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"enabled":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"frequency":{"oneOf":[{"type":"string"},{"type":"null"}]},"payday":{"oneOf":[{"anyOf":[{"type":"integer"},{"type":"string"}]},{"type":"null"}]},"populate":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"employees":{"oneOf":[{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"string","enum":["$delete"]}]},{"type":"null"}]},"payaction":{"oneOf":[{"type":"object","properties":{"send":{"type":"boolean"},"reports":{"type":"boolean"}},"additionalProperties":false},{"type":"null"}]},"payactionenabled":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"catchuplimit":{"oneOf":[{"type":"integer"},{"type":"null"}]},"returns":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"enabled":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"frequency":{"oneOf":[{"type":"string"},{"type":"null"}]},"payday":{"oneOf":[{"anyOf":[{"type":"integer"},{"type":"string"}]},{"type":"null"}]},"populate":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"employees":{"oneOf":[{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"string","enum":["$delete"]}]},{"type":"null"}]},"payaction":{"oneOf":[{"type":"object","properties":{"send":{"type":"boolean"},"reports":{"type":"boolean"}},"additionalProperties":false},{"type":"null"}]},"payactionenabled":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"catchuplimit":{"oneOf":[{"type":"integer"},{"type":"null"}]},"returns":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"enabled":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"frequency":{"oneOf":[{"type":"string"},{"type":"null"}]},"payday":{"oneOf":[{"anyOf":[{"type":"integer"},{"type":"string"}]},{"type":"null"}]},"populate":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"employees":{"oneOf":[{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"string","enum":["$delete"]}]},{"type":"null"}]},"payaction":{"oneOf":[{"type":"object","properties":{"send":{"type":"boolean"},"reports":{"type":"boolean"}},"additionalProperties":false},{"type":"null"}]},"payactionenabled":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"catchuplimit":{"oneOf":[{"type":"integer"},{"type":"null"}]},"returns":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create a pay run schedule","tags":["payrun schedule management"]}},"/api/payrunschedule/update":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"enabled":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"frequency":{"oneOf":[{"type":"string"},{"type":"null"}]},"payday":{"oneOf":[{"anyOf":[{"type":"integer"},{"type":"string"}]},{"type":"null"}]},"populate":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"employees":{"oneOf":[{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"string","enum":["$delete"]}]},{"type":"null"}]},"payaction":{"oneOf":[{"type":"object","properties":{"send":{"type":"boolean"},"reports":{"type":"boolean"}},"additionalProperties":false},{"type":"null"}]},"payactionenabled":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"catchuplimit":{"oneOf":[{"type":"integer"},{"type":"null"}]},"returns":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"enabled":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"frequency":{"oneOf":[{"type":"string"},{"type":"null"}]},"payday":{"oneOf":[{"anyOf":[{"type":"integer"},{"type":"string"}]},{"type":"null"}]},"populate":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"employees":{"oneOf":[{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"string","enum":["$delete"]}]},{"type":"null"}]},"payaction":{"oneOf":[{"type":"object","properties":{"send":{"type":"boolean"},"reports":{"type":"boolean"}},"additionalProperties":false},{"type":"null"}]},"payactionenabled":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"catchuplimit":{"oneOf":[{"type":"integer"},{"type":"null"}]},"returns":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"enabled":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"frequency":{"oneOf":[{"type":"string"},{"type":"null"}]},"payday":{"oneOf":[{"anyOf":[{"type":"integer"},{"type":"string"}]},{"type":"null"}]},"populate":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"employees":{"oneOf":[{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"string","enum":["$delete"]}]},{"type":"null"}]},"payaction":{"oneOf":[{"type":"object","properties":{"send":{"type":"boolean"},"reports":{"type":"boolean"}},"additionalProperties":false},{"type":"null"}]},"payactionenabled":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"catchuplimit":{"oneOf":[{"type":"integer"},{"type":"null"}]},"returns":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"enabled":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"frequency":{"oneOf":[{"type":"string"},{"type":"null"}]},"payday":{"oneOf":[{"anyOf":[{"type":"integer"},{"type":"string"}]},{"type":"null"}]},"populate":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"employees":{"oneOf":[{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"string","enum":["$delete"]}]},{"type":"null"}]},"payaction":{"oneOf":[{"type":"object","properties":{"send":{"type":"boolean"},"reports":{"type":"boolean"}},"additionalProperties":false},{"type":"null"}]},"payactionenabled":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"catchuplimit":{"oneOf":[{"type":"integer"},{"type":"null"}]},"returns":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Update a pay run schedule","tags":["payrun schedule management"]}},"/api/payrunschedule/save":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"enabled":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"frequency":{"description":"How often the run pays: monthly, semimonthly (twice a month), fortnightly or weekly.","oneOf":[{"type":"string","enum":["monthly","semimonthly","fortnightly","weekly"]},{"type":"null"}]},"payday":{"description":"The pay day. monthly and semimonthly: a day 1-31 or \"last\". weekly and fortnightly: a weekday such as \"friday\".","oneOf":[{"anyOf":[{"type":"integer"},{"type":"string"}]},{"type":"null"}]},"populate":{"description":"true fills each new run with a draft payslip per employee on the roster.","oneOf":[{"type":"boolean"},{"type":"null"}]},"employees":{"description":"The employee ids the schedule pays; leave it out for everyone employed. \"$delete\" clears the list.","oneOf":[{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"string","enum":["$delete"]}]},{"type":"null"}]},"payaction":{"oneOf":[{"type":"object","properties":{"send":{"type":"boolean"},"reports":{"type":"boolean"}},"additionalProperties":false},{"type":"null"}]},"payactionenabled":{"description":"Whether each run the schedule opens finalises and posts itself on its pay date. A created schedule is always saved with false. On an update, true arms it; only arm a schedule the user has asked to arm.","oneOf":[{"type":"boolean"},{"type":"null"}]},"returns":{"description":"The tax returns finalising files, as source ids from get_payroll_setup. Leave it out for the country's defaults.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"enabled":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"frequency":{"description":"How often the run pays: monthly, semimonthly (twice a month), fortnightly or weekly.","oneOf":[{"type":"string","enum":["monthly","semimonthly","fortnightly","weekly"]},{"type":"null"}]},"payday":{"description":"The pay day. monthly and semimonthly: a day 1-31 or \"last\". weekly and fortnightly: a weekday such as \"friday\".","oneOf":[{"anyOf":[{"type":"integer"},{"type":"string"}]},{"type":"null"}]},"populate":{"description":"true fills each new run with a draft payslip per employee on the roster.","oneOf":[{"type":"boolean"},{"type":"null"}]},"employees":{"description":"The employee ids the schedule pays; leave it out for everyone employed. \"$delete\" clears the list.","oneOf":[{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"string","enum":["$delete"]}]},{"type":"null"}]},"payaction":{"oneOf":[{"type":"object","properties":{"send":{"type":"boolean"},"reports":{"type":"boolean"}},"additionalProperties":false},{"type":"null"}]},"payactionenabled":{"description":"Whether each run the schedule opens finalises and posts itself on its pay date. A created schedule is always saved with false. On an update, true arms it; only arm a schedule the user has asked to arm.","oneOf":[{"type":"boolean"},{"type":"null"}]},"returns":{"description":"The tax returns finalising files, as source ids from get_payroll_setup. Leave it out for the country's defaults.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"enabled":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"frequency":{"description":"How often the run pays: monthly, semimonthly (twice a month), fortnightly or weekly.","oneOf":[{"type":"string","enum":["monthly","semimonthly","fortnightly","weekly"]},{"type":"null"}]},"payday":{"description":"The pay day. monthly and semimonthly: a day 1-31 or \"last\". weekly and fortnightly: a weekday such as \"friday\".","oneOf":[{"anyOf":[{"type":"integer"},{"type":"string"}]},{"type":"null"}]},"populate":{"description":"true fills each new run with a draft payslip per employee on the roster.","oneOf":[{"type":"boolean"},{"type":"null"}]},"employees":{"description":"The employee ids the schedule pays; leave it out for everyone employed. \"$delete\" clears the list.","oneOf":[{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"string","enum":["$delete"]}]},{"type":"null"}]},"payaction":{"oneOf":[{"type":"object","properties":{"send":{"type":"boolean"},"reports":{"type":"boolean"}},"additionalProperties":false},{"type":"null"}]},"payactionenabled":{"description":"Whether each run the schedule opens finalises and posts itself on its pay date. A created schedule is always saved with false. On an update, true arms it; only arm a schedule the user has asked to arm.","oneOf":[{"type":"boolean"},{"type":"null"}]},"returns":{"description":"The tax returns finalising files, as source ids from get_payroll_setup. Leave it out for the country's defaults.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"enabled":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"frequency":{"description":"How often the run pays: monthly, semimonthly (twice a month), fortnightly or weekly.","oneOf":[{"type":"string","enum":["monthly","semimonthly","fortnightly","weekly"]},{"type":"null"}]},"payday":{"description":"The pay day. monthly and semimonthly: a day 1-31 or \"last\". weekly and fortnightly: a weekday such as \"friday\".","oneOf":[{"anyOf":[{"type":"integer"},{"type":"string"}]},{"type":"null"}]},"populate":{"description":"true fills each new run with a draft payslip per employee on the roster.","oneOf":[{"type":"boolean"},{"type":"null"}]},"employees":{"description":"The employee ids the schedule pays; leave it out for everyone employed. \"$delete\" clears the list.","oneOf":[{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"string","enum":["$delete"]}]},{"type":"null"}]},"payaction":{"oneOf":[{"type":"object","properties":{"send":{"type":"boolean"},"reports":{"type":"boolean"}},"additionalProperties":false},{"type":"null"}]},"payactionenabled":{"description":"Whether each run the schedule opens finalises and posts itself on its pay date. A created schedule is always saved with false. On an update, true arms it; only arm a schedule the user has asked to arm.","oneOf":[{"type":"boolean"},{"type":"null"}]},"returns":{"description":"The tax returns finalising files, as source ids from get_payroll_setup. Leave it out for the country's defaults.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create or update a pay run schedule: frequency, pay day, the employees it pays, whether each new run is filled with draft payslips, and the tax returns it files. Omit id to create; pass an id to update that schedule. A created schedule is saved with payactionenabled false, so its runs never finalise themselves; arm it with an update only when the user asks. Opens no run; trigger_payrun_schedule does.","tags":["payrun schedule management"]}},"/api/payrunschedule/delete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Delete a pay run schedule","tags":["payrun schedule management"]}},"/api/payrun/list":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"List the business's pay runs with period window, pay date, frequency, derived status and pay-date action. Pay runs are cycle headers; their amounts live on the payslips (list_payslips). For one run use get_payrun.","tags":["payrun management"]}},"/api/payrun/get":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"One pay run by id, with the same fields list_payruns returns. An id that is not this business's pay run is an error.","tags":["payrun management"]}},"/api/payrun/create":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodstart":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodend":{"oneOf":[{"type":"string"},{"type":"null"}]},"paydate":{"oneOf":[{"type":"string"},{"type":"null"}]},"frequency":{"oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"oneOf":[{"type":"string"},{"type":"null"}]},"competence":{"oneOf":[{"type":"string"},{"type":"null"}]},"payaction":{"oneOf":[{"type":"object","properties":{"send":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"reports":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]},"payactionenabled":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"returns":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodstart":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodend":{"oneOf":[{"type":"string"},{"type":"null"}]},"paydate":{"oneOf":[{"type":"string"},{"type":"null"}]},"frequency":{"oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"oneOf":[{"type":"string"},{"type":"null"}]},"competence":{"oneOf":[{"type":"string"},{"type":"null"}]},"payaction":{"oneOf":[{"type":"object","properties":{"send":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"reports":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]},"payactionenabled":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"returns":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodstart":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodend":{"oneOf":[{"type":"string"},{"type":"null"}]},"paydate":{"oneOf":[{"type":"string"},{"type":"null"}]},"frequency":{"oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"oneOf":[{"type":"string"},{"type":"null"}]},"competence":{"oneOf":[{"type":"string"},{"type":"null"}]},"payaction":{"oneOf":[{"type":"object","properties":{"send":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"reports":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]},"payactionenabled":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"returns":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodstart":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodend":{"oneOf":[{"type":"string"},{"type":"null"}]},"paydate":{"oneOf":[{"type":"string"},{"type":"null"}]},"frequency":{"oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"oneOf":[{"type":"string"},{"type":"null"}]},"competence":{"oneOf":[{"type":"string"},{"type":"null"}]},"payaction":{"oneOf":[{"type":"object","properties":{"send":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"reports":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]},"payactionenabled":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"returns":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create new pay run","tags":["payrun management"]}},"/api/payrun/update":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodstart":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodend":{"oneOf":[{"type":"string"},{"type":"null"}]},"paydate":{"oneOf":[{"type":"string"},{"type":"null"}]},"frequency":{"oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"oneOf":[{"type":"string"},{"type":"null"}]},"competence":{"oneOf":[{"type":"string"},{"type":"null"}]},"payaction":{"oneOf":[{"type":"object","properties":{"send":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"reports":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]},"payactionenabled":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"returns":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodstart":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodend":{"oneOf":[{"type":"string"},{"type":"null"}]},"paydate":{"oneOf":[{"type":"string"},{"type":"null"}]},"frequency":{"oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"oneOf":[{"type":"string"},{"type":"null"}]},"competence":{"oneOf":[{"type":"string"},{"type":"null"}]},"payaction":{"oneOf":[{"type":"object","properties":{"send":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"reports":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]},"payactionenabled":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"returns":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodstart":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodend":{"oneOf":[{"type":"string"},{"type":"null"}]},"paydate":{"oneOf":[{"type":"string"},{"type":"null"}]},"frequency":{"oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"oneOf":[{"type":"string"},{"type":"null"}]},"competence":{"oneOf":[{"type":"string"},{"type":"null"}]},"payaction":{"oneOf":[{"type":"object","properties":{"send":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"reports":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]},"payactionenabled":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"returns":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodstart":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodend":{"oneOf":[{"type":"string"},{"type":"null"}]},"paydate":{"oneOf":[{"type":"string"},{"type":"null"}]},"frequency":{"oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"oneOf":[{"type":"string"},{"type":"null"}]},"competence":{"oneOf":[{"type":"string"},{"type":"null"}]},"payaction":{"oneOf":[{"type":"object","properties":{"send":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"reports":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]},"payactionenabled":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"returns":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Update pay run data","tags":["payrun management"]}},"/api/payrun/save":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodstart":{"description":"The first day of the pay period, YYYY-MM-DD.","oneOf":[{"type":"string"},{"type":"null"}]},"periodend":{"description":"The last day of the pay period, YYYY-MM-DD.","oneOf":[{"type":"string"},{"type":"null"}]},"paydate":{"description":"The day the employees are paid, YYYY-MM-DD.","oneOf":[{"type":"string"},{"type":"null"}]},"frequency":{"description":"How often the run pays: monthly, semimonthly (twice a month), fortnightly or weekly.","oneOf":[{"type":"string","enum":["monthly","semimonthly","fortnightly","weekly"]},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"oneOf":[{"type":"string"},{"type":"null"}]},"competence":{"oneOf":[{"type":"string"},{"type":"null"}]},"payaction":{"oneOf":[{"type":"object","properties":{"send":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"reports":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]},"payactionenabled":{"description":"Whether the run finalises and posts its draft payslips itself on its pay date. A created run is always saved with false. On an update, false lets its drafts be edited again and true arms it; only arm a run the user has asked to arm.","oneOf":[{"type":"boolean"},{"type":"null"}]},"returns":{"description":"The tax returns finalising files, as source ids from get_payroll_setup. Leave it out for the country's defaults.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodstart":{"description":"The first day of the pay period, YYYY-MM-DD.","oneOf":[{"type":"string"},{"type":"null"}]},"periodend":{"description":"The last day of the pay period, YYYY-MM-DD.","oneOf":[{"type":"string"},{"type":"null"}]},"paydate":{"description":"The day the employees are paid, YYYY-MM-DD.","oneOf":[{"type":"string"},{"type":"null"}]},"frequency":{"description":"How often the run pays: monthly, semimonthly (twice a month), fortnightly or weekly.","oneOf":[{"type":"string","enum":["monthly","semimonthly","fortnightly","weekly"]},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"oneOf":[{"type":"string"},{"type":"null"}]},"competence":{"oneOf":[{"type":"string"},{"type":"null"}]},"payaction":{"oneOf":[{"type":"object","properties":{"send":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"reports":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]},"payactionenabled":{"description":"Whether the run finalises and posts its draft payslips itself on its pay date. A created run is always saved with false. On an update, false lets its drafts be edited again and true arms it; only arm a run the user has asked to arm.","oneOf":[{"type":"boolean"},{"type":"null"}]},"returns":{"description":"The tax returns finalising files, as source ids from get_payroll_setup. Leave it out for the country's defaults.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodstart":{"description":"The first day of the pay period, YYYY-MM-DD.","oneOf":[{"type":"string"},{"type":"null"}]},"periodend":{"description":"The last day of the pay period, YYYY-MM-DD.","oneOf":[{"type":"string"},{"type":"null"}]},"paydate":{"description":"The day the employees are paid, YYYY-MM-DD.","oneOf":[{"type":"string"},{"type":"null"}]},"frequency":{"description":"How often the run pays: monthly, semimonthly (twice a month), fortnightly or weekly.","oneOf":[{"type":"string","enum":["monthly","semimonthly","fortnightly","weekly"]},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"oneOf":[{"type":"string"},{"type":"null"}]},"competence":{"oneOf":[{"type":"string"},{"type":"null"}]},"payaction":{"oneOf":[{"type":"object","properties":{"send":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"reports":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]},"payactionenabled":{"description":"Whether the run finalises and posts its draft payslips itself on its pay date. A created run is always saved with false. On an update, false lets its drafts be edited again and true arms it; only arm a run the user has asked to arm.","oneOf":[{"type":"boolean"},{"type":"null"}]},"returns":{"description":"The tax returns finalising files, as source ids from get_payroll_setup. Leave it out for the country's defaults.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodstart":{"description":"The first day of the pay period, YYYY-MM-DD.","oneOf":[{"type":"string"},{"type":"null"}]},"periodend":{"description":"The last day of the pay period, YYYY-MM-DD.","oneOf":[{"type":"string"},{"type":"null"}]},"paydate":{"description":"The day the employees are paid, YYYY-MM-DD.","oneOf":[{"type":"string"},{"type":"null"}]},"frequency":{"description":"How often the run pays: monthly, semimonthly (twice a month), fortnightly or weekly.","oneOf":[{"type":"string","enum":["monthly","semimonthly","fortnightly","weekly"]},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"oneOf":[{"type":"string"},{"type":"null"}]},"competence":{"oneOf":[{"type":"string"},{"type":"null"}]},"payaction":{"oneOf":[{"type":"object","properties":{"send":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"reports":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]},"payactionenabled":{"description":"Whether the run finalises and posts its draft payslips itself on its pay date. A created run is always saved with false. On an update, false lets its drafts be edited again and true arms it; only arm a run the user has asked to arm.","oneOf":[{"type":"boolean"},{"type":"null"}]},"returns":{"description":"The tax returns finalising files, as source ids from get_payroll_setup. Leave it out for the country's defaults.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create or update a pay run header: period window, pay date, frequency and the tax returns it files. Omit id to create; pass an id to update that run. A created run is saved with payactionenabled false, so it never finalises itself and its drafts stay editable; arm it with an update only when the user asks. Writes no payslip and posts nothing to the ledger.","tags":["payrun management"]}},"/api/payrun/delete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Delete pay run data","tags":["payrun management"]}},"/api/payrun/fill":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"employees":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"employees":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"employees":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"employees":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Fill a pay run with a DRAFT payslip for each employee on its roster who has none yet; running it again skips those already there. Drafts post nothing to the ledger. A pay run that finalises itself on its pay date is refused.","tags":["payrun management"]}},"/api/payrun/bin":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"confirm":{"description":"Send true only after the user has agreed to the change the refusal described.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"confirm":{"description":"Send true only after the user has agreed to the change the refusal described.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"confirm":{"description":"Send true only after the user has agreed to the change the refusal described.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"confirm":{"description":"Send true only after the user has agreed to the change the refusal described.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Move a pay run and its payslips to the bin. Each finalised payslip's journal leaves the books until the run is restored from the bin, and the pay run's pay-date action is turned off. Without confirm true it changes nothing and answers reason confirm-required with what it would remove; ask the user, then call again with confirm true. A pay run with a finalised payslip dated in a locked period is refused.","tags":["payrun management"]}},"/api/payrun/populate":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"employees":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"employees":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"employees":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"employees":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Populate a pay run with draft payslips for its roster (idempotent)","tags":["payrun management"]}},"/api/payrun/finalise":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"send":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"reports":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"send":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"reports":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"send":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"reports":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"send":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"reports":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Finalise every draft payslip on a pay run (draft false → they post). send true emails the newly finalised slips to their employees.","tags":["payrun management"]}},"/api/payslip/list":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"List the business's payslips with employee, pay run, period, pay date, draft flag, gross, deductions, net and the earning, deduction and contribution lines. For one payslip use get_payslip; for the run headers use list_payruns.","tags":["payslip management"]}},"/api/payslip/get":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"One payslip by id, with the same fields list_payslips returns. An id that is not this business's payslip is an error.","tags":["payslip management"]}},"/api/payslip/save":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"payrun":{"oneOf":[{"type":"string"},{"type":"null"}]},"employee":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodstart":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodend":{"oneOf":[{"type":"string"},{"type":"null"}]},"paydate":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"lines":{"oneOf":[{"type":"array","items":{"type":"object","properties":{"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"category":{"description":"credit is an employer credit such as ETI: outside gross, net and cost. Only the pack's statutory credit line books to the ledger; a manual credit line books nothing.","oneOf":[{"type":"string","enum":["earning","deduction","contribution","benefit","credit"]},{"type":"null"}]},"code":{"description":"The line's code: letter-led, then letters, digits, _ or -. Formulas and pay values name a line by its code. A reserved code (get_payroll_setup) is refused. Omit it to mint one from the description.","oneOf":[{"type":"string"},{"type":"null"}]},"role":{"description":"A pack line role, \"<prefix>-<code>\", e.g. \"sars-3601\". get_payroll_setup lists the roles each category allows.","oneOf":[{"type":"string"},{"type":"null"}]},"rate":{"oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"sort":{"oneOf":[{"type":"integer"},{"type":"null"}]},"statutory":{"description":"A statutory id from get_payroll_setup, e.g. \"paye\". The server prices the line and ignores any figure sent.","oneOf":[{"type":"string"},{"type":"null"}]},"formula":{"description":"A formula over line codes, e.g. \"basic * 0.1\". get_payroll_setup lists the formula names. Null makes the line fixed.","oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"payrun":{"oneOf":[{"type":"string"},{"type":"null"}]},"employee":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodstart":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodend":{"oneOf":[{"type":"string"},{"type":"null"}]},"paydate":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"lines":{"oneOf":[{"type":"array","items":{"type":"object","properties":{"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"category":{"description":"credit is an employer credit such as ETI: outside gross, net and cost. Only the pack's statutory credit line books to the ledger; a manual credit line books nothing.","oneOf":[{"type":"string","enum":["earning","deduction","contribution","benefit","credit"]},{"type":"null"}]},"code":{"description":"The line's code: letter-led, then letters, digits, _ or -. Formulas and pay values name a line by its code. A reserved code (get_payroll_setup) is refused. Omit it to mint one from the description.","oneOf":[{"type":"string"},{"type":"null"}]},"role":{"description":"A pack line role, \"<prefix>-<code>\", e.g. \"sars-3601\". get_payroll_setup lists the roles each category allows.","oneOf":[{"type":"string"},{"type":"null"}]},"rate":{"oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"sort":{"oneOf":[{"type":"integer"},{"type":"null"}]},"statutory":{"description":"A statutory id from get_payroll_setup, e.g. \"paye\". The server prices the line and ignores any figure sent.","oneOf":[{"type":"string"},{"type":"null"}]},"formula":{"description":"A formula over line codes, e.g. \"basic * 0.1\". get_payroll_setup lists the formula names. Null makes the line fixed.","oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"payrun":{"oneOf":[{"type":"string"},{"type":"null"}]},"employee":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodstart":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodend":{"oneOf":[{"type":"string"},{"type":"null"}]},"paydate":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"lines":{"oneOf":[{"type":"array","items":{"type":"object","properties":{"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"category":{"description":"credit is an employer credit such as ETI: outside gross, net and cost. Only the pack's statutory credit line books to the ledger; a manual credit line books nothing.","oneOf":[{"type":"string","enum":["earning","deduction","contribution","benefit","credit"]},{"type":"null"}]},"code":{"description":"The line's code: letter-led, then letters, digits, _ or -. Formulas and pay values name a line by its code. A reserved code (get_payroll_setup) is refused. Omit it to mint one from the description.","oneOf":[{"type":"string"},{"type":"null"}]},"role":{"description":"A pack line role, \"<prefix>-<code>\", e.g. \"sars-3601\". get_payroll_setup lists the roles each category allows.","oneOf":[{"type":"string"},{"type":"null"}]},"rate":{"oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"sort":{"oneOf":[{"type":"integer"},{"type":"null"}]},"statutory":{"description":"A statutory id from get_payroll_setup, e.g. \"paye\". The server prices the line and ignores any figure sent.","oneOf":[{"type":"string"},{"type":"null"}]},"formula":{"description":"A formula over line codes, e.g. \"basic * 0.1\". get_payroll_setup lists the formula names. Null makes the line fixed.","oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"payrun":{"oneOf":[{"type":"string"},{"type":"null"}]},"employee":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodstart":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodend":{"oneOf":[{"type":"string"},{"type":"null"}]},"paydate":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"lines":{"oneOf":[{"type":"array","items":{"type":"object","properties":{"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"category":{"description":"credit is an employer credit such as ETI: outside gross, net and cost. Only the pack's statutory credit line books to the ledger; a manual credit line books nothing.","oneOf":[{"type":"string","enum":["earning","deduction","contribution","benefit","credit"]},{"type":"null"}]},"code":{"description":"The line's code: letter-led, then letters, digits, _ or -. Formulas and pay values name a line by its code. A reserved code (get_payroll_setup) is refused. Omit it to mint one from the description.","oneOf":[{"type":"string"},{"type":"null"}]},"role":{"description":"A pack line role, \"<prefix>-<code>\", e.g. \"sars-3601\". get_payroll_setup lists the roles each category allows.","oneOf":[{"type":"string"},{"type":"null"}]},"rate":{"oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"sort":{"oneOf":[{"type":"integer"},{"type":"null"}]},"statutory":{"description":"A statutory id from get_payroll_setup, e.g. \"paye\". The server prices the line and ignores any figure sent.","oneOf":[{"type":"string"},{"type":"null"}]},"formula":{"description":"A formula over line codes, e.g. \"basic * 0.1\". get_payroll_setup lists the formula names. Null makes the line fixed.","oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create or edit a DRAFT payslip: employee, pay run, period, pay date and the earning, deduction and contribution lines. Omit id to create; pass an id to edit that payslip. A created payslip is always a draft and an edit never changes the draft flag, so this never posts to the ledger; a finalised payslip refuses an edit. A payslip on a pay run that finalises itself on its pay date is refused.","tags":["payslip management"]}},"/api/payslip/post":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"ids":{"type":"array","items":{"type":"string"},"minItems":1},"confirm":{"description":"Send true only after the user has agreed to the change the refusal described.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","ids"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"ids":{"type":"array","items":{"type":"string"},"minItems":1},"confirm":{"description":"Send true only after the user has agreed to the change the refusal described.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","ids"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"ids":{"type":"array","items":{"type":"string"},"minItems":1},"confirm":{"description":"Send true only after the user has agreed to the change the refusal described.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","ids"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"ids":{"type":"array","items":{"type":"string"},"minItems":1},"confirm":{"description":"Send true only after the user has agreed to the change the refusal described.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","ids"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Finalise payslips by id, so each posts its journal to the books. Sends no email and files no returns. Without confirm true it changes nothing and answers reason confirm-required with what it would post; ask the user, then call again with confirm true. A payslip dated in a locked period, or on a pay run that finalises itself on its pay date, is refused. A missing or another business's id refuses the whole batch.","tags":["payslip management"]}},"/api/payslip/remove":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"ids":{"type":"array","items":{"type":"string"},"minItems":1},"confirm":{"description":"Send true only after the user has agreed to the change the refusal described.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","ids"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"ids":{"type":"array","items":{"type":"string"},"minItems":1},"confirm":{"description":"Send true only after the user has agreed to the change the refusal described.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","ids"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"ids":{"type":"array","items":{"type":"string"},"minItems":1},"confirm":{"description":"Send true only after the user has agreed to the change the refusal described.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","ids"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"ids":{"type":"array","items":{"type":"string"},"minItems":1},"confirm":{"description":"Send true only after the user has agreed to the change the refusal described.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","ids"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Delete payslips by id for good. A finalised payslip's journal leaves the books with it. Without confirm true it changes nothing and answers reason confirm-required with what it would delete; ask the user, then call again with confirm true. A finalised payslip dated in a locked period, or a payslip on a pay run that finalises itself on its pay date, is refused. A missing or another business's id refuses the whole batch.","tags":["payslip management"]}},"/api/payslip/create":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"payrun":{"oneOf":[{"type":"string"},{"type":"null"}]},"employee":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodstart":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodend":{"oneOf":[{"type":"string"},{"type":"null"}]},"paydate":{"oneOf":[{"type":"string"},{"type":"null"}]},"draft":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"lines":{"oneOf":[{"type":"array","items":{"type":"object","properties":{"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"category":{"oneOf":[{"type":"string"},{"type":"null"}]},"payitem":{"oneOf":[{"type":"string"},{"type":"null"}]},"code":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"rate":{"oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"sort":{"oneOf":[{"type":"integer"},{"type":"null"}]},"statutory":{"oneOf":[{"type":"string"},{"type":"null"}]},"formula":{"oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"payrun":{"oneOf":[{"type":"string"},{"type":"null"}]},"employee":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodstart":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodend":{"oneOf":[{"type":"string"},{"type":"null"}]},"paydate":{"oneOf":[{"type":"string"},{"type":"null"}]},"draft":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"lines":{"oneOf":[{"type":"array","items":{"type":"object","properties":{"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"category":{"oneOf":[{"type":"string"},{"type":"null"}]},"payitem":{"oneOf":[{"type":"string"},{"type":"null"}]},"code":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"rate":{"oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"sort":{"oneOf":[{"type":"integer"},{"type":"null"}]},"statutory":{"oneOf":[{"type":"string"},{"type":"null"}]},"formula":{"oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"payrun":{"oneOf":[{"type":"string"},{"type":"null"}]},"employee":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodstart":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodend":{"oneOf":[{"type":"string"},{"type":"null"}]},"paydate":{"oneOf":[{"type":"string"},{"type":"null"}]},"draft":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"lines":{"oneOf":[{"type":"array","items":{"type":"object","properties":{"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"category":{"oneOf":[{"type":"string"},{"type":"null"}]},"payitem":{"oneOf":[{"type":"string"},{"type":"null"}]},"code":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"rate":{"oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"sort":{"oneOf":[{"type":"integer"},{"type":"null"}]},"statutory":{"oneOf":[{"type":"string"},{"type":"null"}]},"formula":{"oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"payrun":{"oneOf":[{"type":"string"},{"type":"null"}]},"employee":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodstart":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodend":{"oneOf":[{"type":"string"},{"type":"null"}]},"paydate":{"oneOf":[{"type":"string"},{"type":"null"}]},"draft":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"lines":{"oneOf":[{"type":"array","items":{"type":"object","properties":{"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"category":{"oneOf":[{"type":"string"},{"type":"null"}]},"payitem":{"oneOf":[{"type":"string"},{"type":"null"}]},"code":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"rate":{"oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"sort":{"oneOf":[{"type":"integer"},{"type":"null"}]},"statutory":{"oneOf":[{"type":"string"},{"type":"null"}]},"formula":{"oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create new payslip","tags":["payslip management"]}},"/api/payslip/update":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"payrun":{"oneOf":[{"type":"string"},{"type":"null"}]},"employee":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodstart":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodend":{"oneOf":[{"type":"string"},{"type":"null"}]},"paydate":{"oneOf":[{"type":"string"},{"type":"null"}]},"draft":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"lines":{"oneOf":[{"type":"array","items":{"type":"object","properties":{"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"category":{"oneOf":[{"type":"string"},{"type":"null"}]},"payitem":{"oneOf":[{"type":"string"},{"type":"null"}]},"code":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"rate":{"oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"sort":{"oneOf":[{"type":"integer"},{"type":"null"}]},"statutory":{"oneOf":[{"type":"string"},{"type":"null"}]},"formula":{"oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"payrun":{"oneOf":[{"type":"string"},{"type":"null"}]},"employee":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodstart":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodend":{"oneOf":[{"type":"string"},{"type":"null"}]},"paydate":{"oneOf":[{"type":"string"},{"type":"null"}]},"draft":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"lines":{"oneOf":[{"type":"array","items":{"type":"object","properties":{"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"category":{"oneOf":[{"type":"string"},{"type":"null"}]},"payitem":{"oneOf":[{"type":"string"},{"type":"null"}]},"code":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"rate":{"oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"sort":{"oneOf":[{"type":"integer"},{"type":"null"}]},"statutory":{"oneOf":[{"type":"string"},{"type":"null"}]},"formula":{"oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"payrun":{"oneOf":[{"type":"string"},{"type":"null"}]},"employee":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodstart":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodend":{"oneOf":[{"type":"string"},{"type":"null"}]},"paydate":{"oneOf":[{"type":"string"},{"type":"null"}]},"draft":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"lines":{"oneOf":[{"type":"array","items":{"type":"object","properties":{"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"category":{"oneOf":[{"type":"string"},{"type":"null"}]},"payitem":{"oneOf":[{"type":"string"},{"type":"null"}]},"code":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"rate":{"oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"sort":{"oneOf":[{"type":"integer"},{"type":"null"}]},"statutory":{"oneOf":[{"type":"string"},{"type":"null"}]},"formula":{"oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"payrun":{"oneOf":[{"type":"string"},{"type":"null"}]},"employee":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodstart":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodend":{"oneOf":[{"type":"string"},{"type":"null"}]},"paydate":{"oneOf":[{"type":"string"},{"type":"null"}]},"draft":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"lines":{"oneOf":[{"type":"array","items":{"type":"object","properties":{"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"category":{"oneOf":[{"type":"string"},{"type":"null"}]},"payitem":{"oneOf":[{"type":"string"},{"type":"null"}]},"code":{"oneOf":[{"type":"string"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]},"rate":{"oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"sort":{"oneOf":[{"type":"integer"},{"type":"null"}]},"statutory":{"oneOf":[{"type":"string"},{"type":"null"}]},"formula":{"oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Update payslip data","tags":["payslip management"]}},"/api/payslip/pdf":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Download one payslip as a PDF, drawn from its stored lines and totals. A missing or another business's payslip answers {:error true} as JSON.","tags":["payslip management"]}},"/api/payslip/setdraft":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"ids":{"type":"array","items":{"type":"string"}},"draft":{"type":"boolean"},"send":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"reports":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","ids","draft"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"ids":{"type":"array","items":{"type":"string"}},"draft":{"type":"boolean"},"send":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"reports":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","ids","draft"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"ids":{"type":"array","items":{"type":"string"}},"draft":{"type":"boolean"},"send":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"reports":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","ids","draft"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"ids":{"type":"array","items":{"type":"string"}},"draft":{"type":"boolean"},"send":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"reports":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","ids","draft"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Per-payslip posting switch — flip a batch of payslips' draft flag (draft false posts to the GL, draft true un-posts). On finalise, send true emails the newly finalised slips to their employees.","tags":["payslip management"]}},"/api/payslip/send":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"ids":{"type":"array","items":{"type":"string"}}},"required":["token","ids"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"ids":{"type":"array","items":{"type":"string"}}},"required":["token","ids"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"ids":{"type":"array","items":{"type":"string"}}},"required":["token","ids"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"ids":{"type":"array","items":{"type":"string"}}},"required":["token","ids"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Email a batch of final payslips to their employees as PDFs and stamp sentat. A draft or an employee with no email is a warning; a missing or another business's id refuses the batch.","tags":["payslip management"]}},"/api/payslip/reports":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"ids":{"type":"array","items":{"type":"string"}}},"required":["token","ids"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"ids":{"type":"array","items":{"type":"string"}}},"required":["token","ids"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"ids":{"type":"array","items":{"type":"string"}}},"required":["token","ids"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"ids":{"type":"array","items":{"type":"string"}}},"required":["token","ids"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create the payroll returns (EMP201 and any other payroll-triggered catalog return) that a batch of final payslips falls into. Idempotent: an existing return answers created false. A draft is a warning; a missing or another business's id refuses the batch.","tags":["payslip management"]}},"/api/payslip/bulkdelete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"ids":{"type":"array","items":{"type":"string"}}},"required":["token","ids"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"ids":{"type":"array","items":{"type":"string"}}},"required":["token","ids"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"ids":{"type":"array","items":{"type":"string"}}},"required":["token","ids"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"ids":{"type":"array","items":{"type":"string"}}},"required":["token","ids"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Batch-delete payslips by id — the batch form of delete; un-posts any finalised payslips it removes (whole-batch refusal on a missing/cross-tenant id).","tags":["payslip management"]}},"/api/payslip/delete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Delete payslip data","tags":["payslip management"]}},"/api/paysliptemplate/list":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"List the business's payslip templates: each named line set (earnings, deductions, contributions) with each line's kind, rate, quantity, amount and formula. Templates are master data; for issued payslips use list_payslips.","tags":["paysliptemplate management"]}},"/api/paysliptemplate/save":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"statutory":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showcredits":{"description":"true prints employer credit lines (ETI) on the payslip PDF, outside net pay. Off by default.","oneOf":[{"type":"boolean"},{"type":"null"}]},"showregistrations":{"description":"true prints the business's statutory registration numbers (PAYE, UIF, SDL) on the payslip PDF. On by default; false leaves them off.","oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"lines":{"description":"The full set of lines. It replaces the stored set; send the id of every line you keep.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The id of a line you keep. Send the id on EVERY line you keep: the lines you send replace the stored set, and a line sent without its id is a new line with a new id.","oneOf":[{"type":"string"},{"type":"null"}]},"code":{"description":"The line's code: letter-led, then letters, digits, _ or -. Formulas and pay values name a line by its code. A reserved code (get_payroll_setup) is refused. Omit it to mint one from the description.","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"category":{"description":"credit is an employer credit such as ETI: outside gross, net and cost. Only the pack's statutory credit line books to the ledger; a manual credit line books nothing.","oneOf":[{"type":"string","enum":["earning","deduction","contribution","benefit","credit"]},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"sort":{"oneOf":[{"type":"integer"},{"type":"null"}]},"kind":{"description":"fixed: amount as sent. rate: rate times quantity. formula: the formula prices the line.","oneOf":[{"type":"string","enum":["fixed","rate","formula"]},{"type":"null"}]},"rate":{"oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"oneOf":[{"type":"number"},{"type":"null"}]},"formula":{"description":"A formula over line codes, e.g. \"basic * 0.1\". get_payroll_setup lists the formula names. Null makes the line fixed.","oneOf":[{"type":"string"},{"type":"null"}]},"prorate":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"role":{"description":"A pack line role, \"<prefix>-<code>\", e.g. \"sars-3601\". get_payroll_setup lists the roles each category allows.","oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"statutory":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showcredits":{"description":"true prints employer credit lines (ETI) on the payslip PDF, outside net pay. Off by default.","oneOf":[{"type":"boolean"},{"type":"null"}]},"showregistrations":{"description":"true prints the business's statutory registration numbers (PAYE, UIF, SDL) on the payslip PDF. On by default; false leaves them off.","oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"lines":{"description":"The full set of lines. It replaces the stored set; send the id of every line you keep.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The id of a line you keep. Send the id on EVERY line you keep: the lines you send replace the stored set, and a line sent without its id is a new line with a new id.","oneOf":[{"type":"string"},{"type":"null"}]},"code":{"description":"The line's code: letter-led, then letters, digits, _ or -. Formulas and pay values name a line by its code. A reserved code (get_payroll_setup) is refused. Omit it to mint one from the description.","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"category":{"description":"credit is an employer credit such as ETI: outside gross, net and cost. Only the pack's statutory credit line books to the ledger; a manual credit line books nothing.","oneOf":[{"type":"string","enum":["earning","deduction","contribution","benefit","credit"]},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"sort":{"oneOf":[{"type":"integer"},{"type":"null"}]},"kind":{"description":"fixed: amount as sent. rate: rate times quantity. formula: the formula prices the line.","oneOf":[{"type":"string","enum":["fixed","rate","formula"]},{"type":"null"}]},"rate":{"oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"oneOf":[{"type":"number"},{"type":"null"}]},"formula":{"description":"A formula over line codes, e.g. \"basic * 0.1\". get_payroll_setup lists the formula names. Null makes the line fixed.","oneOf":[{"type":"string"},{"type":"null"}]},"prorate":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"role":{"description":"A pack line role, \"<prefix>-<code>\", e.g. \"sars-3601\". get_payroll_setup lists the roles each category allows.","oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"statutory":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showcredits":{"description":"true prints employer credit lines (ETI) on the payslip PDF, outside net pay. Off by default.","oneOf":[{"type":"boolean"},{"type":"null"}]},"showregistrations":{"description":"true prints the business's statutory registration numbers (PAYE, UIF, SDL) on the payslip PDF. On by default; false leaves them off.","oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"lines":{"description":"The full set of lines. It replaces the stored set; send the id of every line you keep.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The id of a line you keep. Send the id on EVERY line you keep: the lines you send replace the stored set, and a line sent without its id is a new line with a new id.","oneOf":[{"type":"string"},{"type":"null"}]},"code":{"description":"The line's code: letter-led, then letters, digits, _ or -. Formulas and pay values name a line by its code. A reserved code (get_payroll_setup) is refused. Omit it to mint one from the description.","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"category":{"description":"credit is an employer credit such as ETI: outside gross, net and cost. Only the pack's statutory credit line books to the ledger; a manual credit line books nothing.","oneOf":[{"type":"string","enum":["earning","deduction","contribution","benefit","credit"]},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"sort":{"oneOf":[{"type":"integer"},{"type":"null"}]},"kind":{"description":"fixed: amount as sent. rate: rate times quantity. formula: the formula prices the line.","oneOf":[{"type":"string","enum":["fixed","rate","formula"]},{"type":"null"}]},"rate":{"oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"oneOf":[{"type":"number"},{"type":"null"}]},"formula":{"description":"A formula over line codes, e.g. \"basic * 0.1\". get_payroll_setup lists the formula names. Null makes the line fixed.","oneOf":[{"type":"string"},{"type":"null"}]},"prorate":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"role":{"description":"A pack line role, \"<prefix>-<code>\", e.g. \"sars-3601\". get_payroll_setup lists the roles each category allows.","oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"statutory":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showcredits":{"description":"true prints employer credit lines (ETI) on the payslip PDF, outside net pay. Off by default.","oneOf":[{"type":"boolean"},{"type":"null"}]},"showregistrations":{"description":"true prints the business's statutory registration numbers (PAYE, UIF, SDL) on the payslip PDF. On by default; false leaves them off.","oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"lines":{"description":"The full set of lines. It replaces the stored set; send the id of every line you keep.","oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"description":"The id of a line you keep. Send the id on EVERY line you keep: the lines you send replace the stored set, and a line sent without its id is a new line with a new id.","oneOf":[{"type":"string"},{"type":"null"}]},"code":{"description":"The line's code: letter-led, then letters, digits, _ or -. Formulas and pay values name a line by its code. A reserved code (get_payroll_setup) is refused. Omit it to mint one from the description.","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"category":{"description":"credit is an employer credit such as ETI: outside gross, net and cost. Only the pack's statutory credit line books to the ledger; a manual credit line books nothing.","oneOf":[{"type":"string","enum":["earning","deduction","contribution","benefit","credit"]},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"sort":{"oneOf":[{"type":"integer"},{"type":"null"}]},"kind":{"description":"fixed: amount as sent. rate: rate times quantity. formula: the formula prices the line.","oneOf":[{"type":"string","enum":["fixed","rate","formula"]},{"type":"null"}]},"rate":{"oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"oneOf":[{"type":"number"},{"type":"null"}]},"formula":{"description":"A formula over line codes, e.g. \"basic * 0.1\". get_payroll_setup lists the formula names. Null makes the line fixed.","oneOf":[{"type":"string"},{"type":"null"}]},"prorate":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"role":{"description":"A pack line role, \"<prefix>-<code>\", e.g. \"sars-3601\". get_payroll_setup lists the roles each category allows.","oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create or update a payslip template: a named line set of earnings, deductions and contributions with each line's kind, rate, quantity, amount and formula. Omit id to create; pass an id to update that template. On update, lines is the full set. A template is master data: it changes future payslips only and posts nothing to the ledger.","tags":["paysliptemplate management"]}},"/api/paysliptemplate/create":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"statutory":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showcredits":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showregistrations":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"lines":{"oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"code":{"oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"category":{"oneOf":[{"type":"string"},{"type":"null"}]},"payitem":{"oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"sort":{"oneOf":[{"type":"integer"},{"type":"null"}]},"kind":{"oneOf":[{"type":"string","enum":["fixed","rate","formula","item"]},{"type":"null"}]},"rate":{"oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"oneOf":[{"type":"number"},{"type":"null"}]},"formula":{"oneOf":[{"type":"string"},{"type":"null"}]},"prorate":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"statutory":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showcredits":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showregistrations":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"lines":{"oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"code":{"oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"category":{"oneOf":[{"type":"string"},{"type":"null"}]},"payitem":{"oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"sort":{"oneOf":[{"type":"integer"},{"type":"null"}]},"kind":{"oneOf":[{"type":"string","enum":["fixed","rate","formula","item"]},{"type":"null"}]},"rate":{"oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"oneOf":[{"type":"number"},{"type":"null"}]},"formula":{"oneOf":[{"type":"string"},{"type":"null"}]},"prorate":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"statutory":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showcredits":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showregistrations":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"lines":{"oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"code":{"oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"category":{"oneOf":[{"type":"string"},{"type":"null"}]},"payitem":{"oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"sort":{"oneOf":[{"type":"integer"},{"type":"null"}]},"kind":{"oneOf":[{"type":"string","enum":["fixed","rate","formula","item"]},{"type":"null"}]},"rate":{"oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"oneOf":[{"type":"number"},{"type":"null"}]},"formula":{"oneOf":[{"type":"string"},{"type":"null"}]},"prorate":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"statutory":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showcredits":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showregistrations":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"lines":{"oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"code":{"oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"category":{"oneOf":[{"type":"string"},{"type":"null"}]},"payitem":{"oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"sort":{"oneOf":[{"type":"integer"},{"type":"null"}]},"kind":{"oneOf":[{"type":"string","enum":["fixed","rate","formula","item"]},{"type":"null"}]},"rate":{"oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"oneOf":[{"type":"number"},{"type":"null"}]},"formula":{"oneOf":[{"type":"string"},{"type":"null"}]},"prorate":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create new payslip template","tags":["paysliptemplate management"]}},"/api/paysliptemplate/update":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"statutory":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showcredits":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showregistrations":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"lines":{"oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"code":{"oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"category":{"oneOf":[{"type":"string"},{"type":"null"}]},"payitem":{"oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"sort":{"oneOf":[{"type":"integer"},{"type":"null"}]},"kind":{"oneOf":[{"type":"string","enum":["fixed","rate","formula","item"]},{"type":"null"}]},"rate":{"oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"oneOf":[{"type":"number"},{"type":"null"}]},"formula":{"oneOf":[{"type":"string"},{"type":"null"}]},"prorate":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"statutory":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showcredits":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showregistrations":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"lines":{"oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"code":{"oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"category":{"oneOf":[{"type":"string"},{"type":"null"}]},"payitem":{"oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"sort":{"oneOf":[{"type":"integer"},{"type":"null"}]},"kind":{"oneOf":[{"type":"string","enum":["fixed","rate","formula","item"]},{"type":"null"}]},"rate":{"oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"oneOf":[{"type":"number"},{"type":"null"}]},"formula":{"oneOf":[{"type":"string"},{"type":"null"}]},"prorate":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"statutory":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showcredits":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showregistrations":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"lines":{"oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"code":{"oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"category":{"oneOf":[{"type":"string"},{"type":"null"}]},"payitem":{"oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"sort":{"oneOf":[{"type":"integer"},{"type":"null"}]},"kind":{"oneOf":[{"type":"string","enum":["fixed","rate","formula","item"]},{"type":"null"}]},"rate":{"oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"oneOf":[{"type":"number"},{"type":"null"}]},"formula":{"oneOf":[{"type":"string"},{"type":"null"}]},"prorate":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"statutory":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showcredits":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showregistrations":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"lines":{"oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"code":{"oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"category":{"oneOf":[{"type":"string"},{"type":"null"}]},"payitem":{"oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"sort":{"oneOf":[{"type":"integer"},{"type":"null"}]},"kind":{"oneOf":[{"type":"string","enum":["fixed","rate","formula","item"]},{"type":"null"}]},"rate":{"oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"oneOf":[{"type":"number"},{"type":"null"}]},"formula":{"oneOf":[{"type":"string"},{"type":"null"}]},"prorate":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"role":{"oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Update payslip template data","tags":["paysliptemplate management"]}},"/api/paysliptemplate/delete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Delete payslip template data","tags":["paysliptemplate management"]}},"/api/payroll/setup":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Read what this business's payroll accepts: pay frequencies, package kinds, statutory lines and whether each applies, line roles by category, reserved codes, formula names, the registrations held or missing, the payroll-liability accounts, how many templates, schedules and leave types exist, and the returns a pay run files (evaluate_report source ids). Read it before a payroll write. It reads only; nothing is changed.","tags":["payroll"]}},"/api/payroll/settings":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"settings":{"description":"Setting id to value, ids as get_payroll_setup lists them under settings. Only the ids you send change. A null value removes the stored value, and the pack default applies.","oneOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]},"jurisdiction":{"description":"A code from get_payroll_setup jurisdiction.options. \"$delete\" clears it. Omitted, it stays.","oneOf":[{"type":"string"},{"type":"null"}]},"payemethod":{"description":"How PAYE is worked out: \"ytd\" (year to date) or \"period\" (per period). get_payroll_setup lists the choices under payemethod.options. The move to \"ytd\" is one-way.","oneOf":[{"type":"string","enum":["ytd","period"]},{"type":"null"}]},"confirm":{"description":"Omitted, nothing is saved: the answer lists each change for the user to approve. Send true after the user approves.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"settings":{"description":"Setting id to value, ids as get_payroll_setup lists them under settings. Only the ids you send change. A null value removes the stored value, and the pack default applies.","oneOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]},"jurisdiction":{"description":"A code from get_payroll_setup jurisdiction.options. \"$delete\" clears it. Omitted, it stays.","oneOf":[{"type":"string"},{"type":"null"}]},"payemethod":{"description":"How PAYE is worked out: \"ytd\" (year to date) or \"period\" (per period). get_payroll_setup lists the choices under payemethod.options. The move to \"ytd\" is one-way.","oneOf":[{"type":"string","enum":["ytd","period"]},{"type":"null"}]},"confirm":{"description":"Omitted, nothing is saved: the answer lists each change for the user to approve. Send true after the user approves.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"settings":{"description":"Setting id to value, ids as get_payroll_setup lists them under settings. Only the ids you send change. A null value removes the stored value, and the pack default applies.","oneOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]},"jurisdiction":{"description":"A code from get_payroll_setup jurisdiction.options. \"$delete\" clears it. Omitted, it stays.","oneOf":[{"type":"string"},{"type":"null"}]},"payemethod":{"description":"How PAYE is worked out: \"ytd\" (year to date) or \"period\" (per period). get_payroll_setup lists the choices under payemethod.options. The move to \"ytd\" is one-way.","oneOf":[{"type":"string","enum":["ytd","period"]},{"type":"null"}]},"confirm":{"description":"Omitted, nothing is saved: the answer lists each change for the user to approve. Send true after the user approves.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"settings":{"description":"Setting id to value, ids as get_payroll_setup lists them under settings. Only the ids you send change. A null value removes the stored value, and the pack default applies.","oneOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]},"jurisdiction":{"description":"A code from get_payroll_setup jurisdiction.options. \"$delete\" clears it. Omitted, it stays.","oneOf":[{"type":"string"},{"type":"null"}]},"payemethod":{"description":"How PAYE is worked out: \"ytd\" (year to date) or \"period\" (per period). get_payroll_setup lists the choices under payemethod.options. The move to \"ytd\" is one-way.","oneOf":[{"type":"string","enum":["ytd","period"]},{"type":"null"}]},"confirm":{"description":"Omitted, nothing is saved: the answer lists each change for the user to approve. Send true after the user approves.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Change this business's payroll settings, the country pack's settings, the jurisdiction and the PAYE method that get_payroll_setup lists. Send only the settings to change. The first call saves nothing and answers the changes; call again with confirm true after the user approves them. Finalised payslips, closed periods and existing drafts keep their figures; only payslips created or re-populated after the change use the new settings.","tags":["payroll"]}},"/api/payroll/preview":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"employee":{"description":"The employee id. Their saved package, template and pay values price the slip.","type":"string"},"frequency":{"description":"The pay cadence to price at. Omitted, monthly.","oneOf":[{"type":"string","enum":["fortnightly","monthly","semimonthly","weekly"]},{"type":"null"}]},"paydate":{"description":"YYYY-MM-DD. The tax tables in force on this date price PAYE, UIF and SDL. Omitted, today.","oneOf":[{"type":"string"},{"type":"null"}]},"payvalues":{"description":"Rows put over the employee's saved pay values for this preview only, one per code. A sent row replaces the saved row for its code. Nothing is saved.","oneOf":[{"type":"array","items":{"type":"object","properties":{"code":{"description":"The template line code, or a statutory id such as \"paye\".","type":"string"},"amount":{"description":"A fixed amount for the line.","oneOf":[{"type":"number"},{"type":"null"}]},"rate":{"description":"With quantity: the line is rate times quantity.","oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"oneOf":[{"type":"number"},{"type":"null"}]},"formula":{"description":"A formula that prices the line.","oneOf":[{"type":"string"},{"type":"null"}]},"excluded":{"description":"true leaves the line off the slip.","oneOf":[{"type":"boolean"},{"type":"null"}]},"included":{"description":"true prices a statutory line the pack marks optIn, which is off unless included.","oneOf":[{"type":"boolean"},{"type":"null"}]},"since":{"description":"YYYY-MM: with included, the month the line applies from.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["code"],"additionalProperties":false}},{"type":"null"}]}},"required":["token","employee"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"employee":{"description":"The employee id. Their saved package, template and pay values price the slip.","type":"string"},"frequency":{"description":"The pay cadence to price at. Omitted, monthly.","oneOf":[{"type":"string","enum":["fortnightly","monthly","semimonthly","weekly"]},{"type":"null"}]},"paydate":{"description":"YYYY-MM-DD. The tax tables in force on this date price PAYE, UIF and SDL. Omitted, today.","oneOf":[{"type":"string"},{"type":"null"}]},"payvalues":{"description":"Rows put over the employee's saved pay values for this preview only, one per code. A sent row replaces the saved row for its code. Nothing is saved.","oneOf":[{"type":"array","items":{"type":"object","properties":{"code":{"description":"The template line code, or a statutory id such as \"paye\".","type":"string"},"amount":{"description":"A fixed amount for the line.","oneOf":[{"type":"number"},{"type":"null"}]},"rate":{"description":"With quantity: the line is rate times quantity.","oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"oneOf":[{"type":"number"},{"type":"null"}]},"formula":{"description":"A formula that prices the line.","oneOf":[{"type":"string"},{"type":"null"}]},"excluded":{"description":"true leaves the line off the slip.","oneOf":[{"type":"boolean"},{"type":"null"}]},"included":{"description":"true prices a statutory line the pack marks optIn, which is off unless included.","oneOf":[{"type":"boolean"},{"type":"null"}]},"since":{"description":"YYYY-MM: with included, the month the line applies from.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["code"],"additionalProperties":false}},{"type":"null"}]}},"required":["token","employee"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"employee":{"description":"The employee id. Their saved package, template and pay values price the slip.","type":"string"},"frequency":{"description":"The pay cadence to price at. Omitted, monthly.","oneOf":[{"type":"string","enum":["fortnightly","monthly","semimonthly","weekly"]},{"type":"null"}]},"paydate":{"description":"YYYY-MM-DD. The tax tables in force on this date price PAYE, UIF and SDL. Omitted, today.","oneOf":[{"type":"string"},{"type":"null"}]},"payvalues":{"description":"Rows put over the employee's saved pay values for this preview only, one per code. A sent row replaces the saved row for its code. Nothing is saved.","oneOf":[{"type":"array","items":{"type":"object","properties":{"code":{"description":"The template line code, or a statutory id such as \"paye\".","type":"string"},"amount":{"description":"A fixed amount for the line.","oneOf":[{"type":"number"},{"type":"null"}]},"rate":{"description":"With quantity: the line is rate times quantity.","oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"oneOf":[{"type":"number"},{"type":"null"}]},"formula":{"description":"A formula that prices the line.","oneOf":[{"type":"string"},{"type":"null"}]},"excluded":{"description":"true leaves the line off the slip.","oneOf":[{"type":"boolean"},{"type":"null"}]},"included":{"description":"true prices a statutory line the pack marks optIn, which is off unless included.","oneOf":[{"type":"boolean"},{"type":"null"}]},"since":{"description":"YYYY-MM: with included, the month the line applies from.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["code"],"additionalProperties":false}},{"type":"null"}]}},"required":["token","employee"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"employee":{"description":"The employee id. Their saved package, template and pay values price the slip.","type":"string"},"frequency":{"description":"The pay cadence to price at. Omitted, monthly.","oneOf":[{"type":"string","enum":["fortnightly","monthly","semimonthly","weekly"]},{"type":"null"}]},"paydate":{"description":"YYYY-MM-DD. The tax tables in force on this date price PAYE, UIF and SDL. Omitted, today.","oneOf":[{"type":"string"},{"type":"null"}]},"payvalues":{"description":"Rows put over the employee's saved pay values for this preview only, one per code. A sent row replaces the saved row for its code. Nothing is saved.","oneOf":[{"type":"array","items":{"type":"object","properties":{"code":{"description":"The template line code, or a statutory id such as \"paye\".","type":"string"},"amount":{"description":"A fixed amount for the line.","oneOf":[{"type":"number"},{"type":"null"}]},"rate":{"description":"With quantity: the line is rate times quantity.","oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"oneOf":[{"type":"number"},{"type":"null"}]},"formula":{"description":"A formula that prices the line.","oneOf":[{"type":"string"},{"type":"null"}]},"excluded":{"description":"true leaves the line off the slip.","oneOf":[{"type":"boolean"},{"type":"null"}]},"included":{"description":"true prices a statutory line the pack marks optIn, which is off unless included.","oneOf":[{"type":"boolean"},{"type":"null"}]},"since":{"description":"YYYY-MM: with included, the month the line applies from.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["code"],"additionalProperties":false}},{"type":"null"}]}},"required":["token","employee"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Price a payslip for a saved employee without saving it: gross, deductions, net and each line, with PAYE, UIF and SDL priced. Send rows in payvalues to see a change before you save it with save_employee. It reads only; nothing is stored or posted.","tags":["payroll"]}},"/api/payroll/optins":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"employees":{"description":"Employee ids to answer for. Omitted, every employee on the roster.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"payrun":{"description":"A pay run id: answer for that run's employees at its pay date. Omitted, this month.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"employees":{"description":"Employee ids to answer for. Omitted, every employee on the roster.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"payrun":{"description":"A pay run id: answer for that run's employees at its pay date. Omitted, this month.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"employees":{"description":"Employee ids to answer for. Omitted, every employee on the roster.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"payrun":{"description":"A pay run id: answer for that run's employees at its pay date. Omitted, this month.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"employees":{"description":"Employee ids to answer for. Omitted, every employee on the roster.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"payrun":{"description":"A pay run id: answer for that run's employees at its pay date. Omitted, this month.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"List, per employee, each opt-in statutory line (South Africa's ETI) the payroll could claim: whether it is claimed, whether the employee qualifies this month and why not, the day they age out, which of the 24 months this is, the amount it would be worth this month, and the earlier months still claimable. It prices a preview; nothing is saved. To claim, save the employee with an included pay value row.","tags":["payroll"]}},"/api/payroll/compute":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"employee":{"oneOf":[{"type":"string"},{"type":"null"}]},"packagekind":{"oneOf":[{"type":"string"},{"type":"null"}]},"packageamount":{"oneOf":[{"type":"number"},{"type":"null"}]},"packagequantity":{"oneOf":[{"type":"number"},{"type":"null"}]},"frequency":{"oneOf":[{"type":"string"},{"type":"null"}]},"paysliptemplate":{"oneOf":[{"type":"string"},{"type":"null"}]},"payvalues":{"oneOf":[{"type":"array","items":{"type":"object","properties":{"code":{},"amount":{},"rate":{},"quantity":{},"formula":{},"excluded":{},"included":{},"since":{},"directive":{}},"additionalProperties":false}},{"type":"null"}]},"paydate":{"oneOf":[{"type":"string"},{"type":"null"}]},"statutoryexcluded":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"payinputs":{"oneOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]},"jurisdiction":{"oneOf":[{"type":"string"},{"type":"null"}]},"payrunkind":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"employee":{"oneOf":[{"type":"string"},{"type":"null"}]},"packagekind":{"oneOf":[{"type":"string"},{"type":"null"}]},"packageamount":{"oneOf":[{"type":"number"},{"type":"null"}]},"packagequantity":{"oneOf":[{"type":"number"},{"type":"null"}]},"frequency":{"oneOf":[{"type":"string"},{"type":"null"}]},"paysliptemplate":{"oneOf":[{"type":"string"},{"type":"null"}]},"payvalues":{"oneOf":[{"type":"array","items":{"type":"object","properties":{"code":{},"amount":{},"rate":{},"quantity":{},"formula":{},"excluded":{},"included":{},"since":{},"directive":{}},"additionalProperties":false}},{"type":"null"}]},"paydate":{"oneOf":[{"type":"string"},{"type":"null"}]},"statutoryexcluded":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"payinputs":{"oneOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]},"jurisdiction":{"oneOf":[{"type":"string"},{"type":"null"}]},"payrunkind":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"employee":{"oneOf":[{"type":"string"},{"type":"null"}]},"packagekind":{"oneOf":[{"type":"string"},{"type":"null"}]},"packageamount":{"oneOf":[{"type":"number"},{"type":"null"}]},"packagequantity":{"oneOf":[{"type":"number"},{"type":"null"}]},"frequency":{"oneOf":[{"type":"string"},{"type":"null"}]},"paysliptemplate":{"oneOf":[{"type":"string"},{"type":"null"}]},"payvalues":{"oneOf":[{"type":"array","items":{"type":"object","properties":{"code":{},"amount":{},"rate":{},"quantity":{},"formula":{},"excluded":{},"included":{},"since":{},"directive":{}},"additionalProperties":false}},{"type":"null"}]},"paydate":{"oneOf":[{"type":"string"},{"type":"null"}]},"statutoryexcluded":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"payinputs":{"oneOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]},"jurisdiction":{"oneOf":[{"type":"string"},{"type":"null"}]},"payrunkind":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"employee":{"oneOf":[{"type":"string"},{"type":"null"}]},"packagekind":{"oneOf":[{"type":"string"},{"type":"null"}]},"packageamount":{"oneOf":[{"type":"number"},{"type":"null"}]},"packagequantity":{"oneOf":[{"type":"number"},{"type":"null"}]},"frequency":{"oneOf":[{"type":"string"},{"type":"null"}]},"paysliptemplate":{"oneOf":[{"type":"string"},{"type":"null"}]},"payvalues":{"oneOf":[{"type":"array","items":{"type":"object","properties":{"code":{},"amount":{},"rate":{},"quantity":{},"formula":{},"excluded":{},"included":{},"since":{},"directive":{}},"additionalProperties":false}},{"type":"null"}]},"paydate":{"oneOf":[{"type":"string"},{"type":"null"}]},"statutoryexcluded":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"payinputs":{"oneOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]},"jurisdiction":{"oneOf":[{"type":"string"},{"type":"null"}]},"payrunkind":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Stateless payslip compute preview (what-if; persists nothing)","tags":["payroll"]}},"/api/leaverequest/list":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"List the business's leave requests with employee, leave type, start and end date, units, status, reason and who approved or declined it. For the leave types use list_leave_types; for balance movements use list_leave_movements.","tags":["leave management"]}},"/api/leaverequest/save":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"employee":{"oneOf":[{"type":"string"},{"type":"null"}]},"leavetype":{"oneOf":[{"type":"string"},{"type":"null"}]},"startdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"enddate":{"oneOf":[{"type":"string"},{"type":"null"}]},"days":{"description":"The leave taken, in the leave type's unit. Fractions are allowed.","oneOf":[{"type":"number"},{"type":"null"}]},"sicknote":{"oneOf":[{"type":"string"},{"type":"null"}]},"reason":{"oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"employee":{"oneOf":[{"type":"string"},{"type":"null"}]},"leavetype":{"oneOf":[{"type":"string"},{"type":"null"}]},"startdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"enddate":{"oneOf":[{"type":"string"},{"type":"null"}]},"days":{"description":"The leave taken, in the leave type's unit. Fractions are allowed.","oneOf":[{"type":"number"},{"type":"null"}]},"sicknote":{"oneOf":[{"type":"string"},{"type":"null"}]},"reason":{"oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"employee":{"oneOf":[{"type":"string"},{"type":"null"}]},"leavetype":{"oneOf":[{"type":"string"},{"type":"null"}]},"startdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"enddate":{"oneOf":[{"type":"string"},{"type":"null"}]},"days":{"description":"The leave taken, in the leave type's unit. Fractions are allowed.","oneOf":[{"type":"number"},{"type":"null"}]},"sicknote":{"oneOf":[{"type":"string"},{"type":"null"}]},"reason":{"oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"employee":{"oneOf":[{"type":"string"},{"type":"null"}]},"leavetype":{"oneOf":[{"type":"string"},{"type":"null"}]},"startdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"enddate":{"oneOf":[{"type":"string"},{"type":"null"}]},"days":{"description":"The leave taken, in the leave type's unit. Fractions are allowed.","oneOf":[{"type":"number"},{"type":"null"}]},"sicknote":{"oneOf":[{"type":"string"},{"type":"null"}]},"reason":{"oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"File or edit a leave request: employee, leave type, start and end dates, days, reason and notes. Omit id to file a new request; pass an id to edit that request. A new request is always filed as requested, never approved; use decide_leave_request to approve, decline or cancel it. Leave requests post nothing to the ledger.","tags":["leave management"]}},"/api/leaverequest/decide":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"approveddate":{"oneOf":[{"type":"string"},{"type":"null"}]},"force":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"decision":{"type":"string","enum":["approve","decline","cancel"]}},"required":["token","id","decision"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"approveddate":{"oneOf":[{"type":"string"},{"type":"null"}]},"force":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"decision":{"type":"string","enum":["approve","decline","cancel"]}},"required":["token","id","decision"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"approveddate":{"oneOf":[{"type":"string"},{"type":"null"}]},"force":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"decision":{"type":"string","enum":["approve","decline","cancel"]}},"required":["token","id","decision"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"approveddate":{"oneOf":[{"type":"string"},{"type":"null"}]},"force":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"decision":{"type":"string","enum":["approve","decline","cancel"]}},"required":["token","id","decision"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Approve, decline or cancel a leave request by id. Approving records the leave taken against the employee's balance; declining or cancelling an approved request returns those days. The answer lists the employee's finalised payslips whose period the leave overlaps. Approving over such a payslip is refused unless force is true. This changes leave balances only and posts nothing to the ledger.","tags":["leave management"]}},"/api/leaverequest/create":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"employee":{"oneOf":[{"type":"string"},{"type":"null"}]},"leavetype":{"oneOf":[{"type":"string"},{"type":"null"}]},"startdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"enddate":{"oneOf":[{"type":"string"},{"type":"null"}]},"days":{"oneOf":[{"type":"number"},{"type":"null"}]},"units":{"oneOf":[{"type":"number"},{"type":"null"}]},"sicknote":{"oneOf":[{"type":"string"},{"type":"null"}]},"reason":{"oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"employee":{"oneOf":[{"type":"string"},{"type":"null"}]},"leavetype":{"oneOf":[{"type":"string"},{"type":"null"}]},"startdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"enddate":{"oneOf":[{"type":"string"},{"type":"null"}]},"days":{"oneOf":[{"type":"number"},{"type":"null"}]},"units":{"oneOf":[{"type":"number"},{"type":"null"}]},"sicknote":{"oneOf":[{"type":"string"},{"type":"null"}]},"reason":{"oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"employee":{"oneOf":[{"type":"string"},{"type":"null"}]},"leavetype":{"oneOf":[{"type":"string"},{"type":"null"}]},"startdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"enddate":{"oneOf":[{"type":"string"},{"type":"null"}]},"days":{"oneOf":[{"type":"number"},{"type":"null"}]},"units":{"oneOf":[{"type":"number"},{"type":"null"}]},"sicknote":{"oneOf":[{"type":"string"},{"type":"null"}]},"reason":{"oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"employee":{"oneOf":[{"type":"string"},{"type":"null"}]},"leavetype":{"oneOf":[{"type":"string"},{"type":"null"}]},"startdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"enddate":{"oneOf":[{"type":"string"},{"type":"null"}]},"days":{"oneOf":[{"type":"number"},{"type":"null"}]},"units":{"oneOf":[{"type":"number"},{"type":"null"}]},"sicknote":{"oneOf":[{"type":"string"},{"type":"null"}]},"reason":{"oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"File a new leave request (requested)","tags":["leave management"]}},"/api/leaverequest/update":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"employee":{"oneOf":[{"type":"string"},{"type":"null"}]},"leavetype":{"oneOf":[{"type":"string"},{"type":"null"}]},"startdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"enddate":{"oneOf":[{"type":"string"},{"type":"null"}]},"days":{"oneOf":[{"type":"number"},{"type":"null"}]},"units":{"oneOf":[{"type":"number"},{"type":"null"}]},"sicknote":{"oneOf":[{"type":"string"},{"type":"null"}]},"reason":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"employee":{"oneOf":[{"type":"string"},{"type":"null"}]},"leavetype":{"oneOf":[{"type":"string"},{"type":"null"}]},"startdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"enddate":{"oneOf":[{"type":"string"},{"type":"null"}]},"days":{"oneOf":[{"type":"number"},{"type":"null"}]},"units":{"oneOf":[{"type":"number"},{"type":"null"}]},"sicknote":{"oneOf":[{"type":"string"},{"type":"null"}]},"reason":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"employee":{"oneOf":[{"type":"string"},{"type":"null"}]},"leavetype":{"oneOf":[{"type":"string"},{"type":"null"}]},"startdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"enddate":{"oneOf":[{"type":"string"},{"type":"null"}]},"days":{"oneOf":[{"type":"number"},{"type":"null"}]},"units":{"oneOf":[{"type":"number"},{"type":"null"}]},"sicknote":{"oneOf":[{"type":"string"},{"type":"null"}]},"reason":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"employee":{"oneOf":[{"type":"string"},{"type":"null"}]},"leavetype":{"oneOf":[{"type":"string"},{"type":"null"}]},"startdate":{"oneOf":[{"type":"string"},{"type":"null"}]},"enddate":{"oneOf":[{"type":"string"},{"type":"null"}]},"days":{"oneOf":[{"type":"number"},{"type":"null"}]},"units":{"oneOf":[{"type":"number"},{"type":"null"}]},"sicknote":{"oneOf":[{"type":"string"},{"type":"null"}]},"reason":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Edit a leave request's header (while requested)","tags":["leave management"]}},"/api/leaverequest/approve":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"approveddate":{"oneOf":[{"type":"string"},{"type":"null"}]},"force":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"approveddate":{"oneOf":[{"type":"string"},{"type":"null"}]},"force":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"approveddate":{"oneOf":[{"type":"string"},{"type":"null"}]},"force":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"approveddate":{"oneOf":[{"type":"string"},{"type":"null"}]},"force":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Approve a leave request (mints or restores its stored taken movement)","tags":["leave management"]}},"/api/leaverequest/decline":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Decline a leave request (reverses an approved request's taken movement)","tags":["leave management"]}},"/api/leaverequest/cancel":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Cancel a leave request (reverses its stored taken movement)","tags":["leave management"]}},"/api/leaverequest/delete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Delete a leave request (hard retraction)","tags":["leave management"]}},"/api/leavetype/list":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"List the business's leave types with name, unit, paid flag, accrual method and rate, cycle and carry-over rules. For requests against them use list_leave_requests.","tags":["leave management"]}},"/api/leavetype/save":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"type":"string"},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"accrualmethod":{"description":"monthly spreads the yearly entitlement across the year. upfront grants it whole at each cycle start. none accrues nothing.","oneOf":[{"type":"string","enum":["monthly","upfront","none"]},{"type":"null"}]},"days":{"description":"The yearly entitlement per cycle, in the leave type's unit.","oneOf":[{"type":"number"},{"type":"null"}]},"cyclemonths":{"oneOf":[{"type":"number"},{"type":"null"}]},"accrualafter":{"oneOf":[{"type":"number"},{"type":"null"}]},"carryover":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"carryovercap":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"paid":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"primary":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"provision":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"unit":{"oneOf":[{"type":"string","enum":["days","hours"]},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"type":"string"},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"accrualmethod":{"description":"monthly spreads the yearly entitlement across the year. upfront grants it whole at each cycle start. none accrues nothing.","oneOf":[{"type":"string","enum":["monthly","upfront","none"]},{"type":"null"}]},"days":{"description":"The yearly entitlement per cycle, in the leave type's unit.","oneOf":[{"type":"number"},{"type":"null"}]},"cyclemonths":{"oneOf":[{"type":"number"},{"type":"null"}]},"accrualafter":{"oneOf":[{"type":"number"},{"type":"null"}]},"carryover":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"carryovercap":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"paid":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"primary":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"provision":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"unit":{"oneOf":[{"type":"string","enum":["days","hours"]},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"type":"string"},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"accrualmethod":{"description":"monthly spreads the yearly entitlement across the year. upfront grants it whole at each cycle start. none accrues nothing.","oneOf":[{"type":"string","enum":["monthly","upfront","none"]},{"type":"null"}]},"days":{"description":"The yearly entitlement per cycle, in the leave type's unit.","oneOf":[{"type":"number"},{"type":"null"}]},"cyclemonths":{"oneOf":[{"type":"number"},{"type":"null"}]},"accrualafter":{"oneOf":[{"type":"number"},{"type":"null"}]},"carryover":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"carryovercap":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"paid":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"primary":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"provision":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"unit":{"oneOf":[{"type":"string","enum":["days","hours"]},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"type":"string"},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"accrualmethod":{"description":"monthly spreads the yearly entitlement across the year. upfront grants it whole at each cycle start. none accrues nothing.","oneOf":[{"type":"string","enum":["monthly","upfront","none"]},{"type":"null"}]},"days":{"description":"The yearly entitlement per cycle, in the leave type's unit.","oneOf":[{"type":"number"},{"type":"null"}]},"cyclemonths":{"oneOf":[{"type":"number"},{"type":"null"}]},"accrualafter":{"oneOf":[{"type":"number"},{"type":"null"}]},"carryover":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"carryovercap":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"paid":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"primary":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"provision":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"unit":{"oneOf":[{"type":"string","enum":["days","hours"]},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create or update a leave type: name, accrual method (monthly, upfront or none), yearly entitlement in days, cycle months, carry-over, whether it is paid and whether the balance is paid out on exit (provision; omit it to derive it from the method and carry-over). Omit id to create; pass an id to update that leave type. Leave types are master data and post nothing to the ledger.","tags":["leave management"]}},"/api/leavetype/create":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"accrualmethod":{"oneOf":[{"type":"string"},{"type":"null"}]},"accrualrate":{"oneOf":[{"type":"number"},{"type":"null"}]},"days":{"oneOf":[{"type":"number"},{"type":"null"}]},"cyclemonths":{"oneOf":[{"type":"number"},{"type":"null"}]},"accrualafter":{"oneOf":[{"type":"number"},{"type":"null"}]},"carryover":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"carryovercap":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"paid":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"primary":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"provision":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"payitemid":{"oneOf":[{"anyOf":[{"type":"string"},{"type":"object"}]},{"type":"null"}]},"unit":{"oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"accrualmethod":{"oneOf":[{"type":"string"},{"type":"null"}]},"accrualrate":{"oneOf":[{"type":"number"},{"type":"null"}]},"days":{"oneOf":[{"type":"number"},{"type":"null"}]},"cyclemonths":{"oneOf":[{"type":"number"},{"type":"null"}]},"accrualafter":{"oneOf":[{"type":"number"},{"type":"null"}]},"carryover":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"carryovercap":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"paid":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"primary":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"provision":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"payitemid":{"oneOf":[{"anyOf":[{"type":"string"},{"type":"object"}]},{"type":"null"}]},"unit":{"oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"accrualmethod":{"oneOf":[{"type":"string"},{"type":"null"}]},"accrualrate":{"oneOf":[{"type":"number"},{"type":"null"}]},"days":{"oneOf":[{"type":"number"},{"type":"null"}]},"cyclemonths":{"oneOf":[{"type":"number"},{"type":"null"}]},"accrualafter":{"oneOf":[{"type":"number"},{"type":"null"}]},"carryover":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"carryovercap":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"paid":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"primary":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"provision":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"payitemid":{"oneOf":[{"anyOf":[{"type":"string"},{"type":"object"}]},{"type":"null"}]},"unit":{"oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"accrualmethod":{"oneOf":[{"type":"string"},{"type":"null"}]},"accrualrate":{"oneOf":[{"type":"number"},{"type":"null"}]},"days":{"oneOf":[{"type":"number"},{"type":"null"}]},"cyclemonths":{"oneOf":[{"type":"number"},{"type":"null"}]},"accrualafter":{"oneOf":[{"type":"number"},{"type":"null"}]},"carryover":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"carryovercap":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"paid":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"primary":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"provision":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"payitemid":{"oneOf":[{"anyOf":[{"type":"string"},{"type":"object"}]},{"type":"null"}]},"unit":{"oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create a leave type (accrual config)","tags":["leave management"]}},"/api/leavetype/update":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"accrualmethod":{"oneOf":[{"type":"string"},{"type":"null"}]},"accrualrate":{"oneOf":[{"type":"number"},{"type":"null"}]},"days":{"oneOf":[{"type":"number"},{"type":"null"}]},"cyclemonths":{"oneOf":[{"type":"number"},{"type":"null"}]},"accrualafter":{"oneOf":[{"type":"number"},{"type":"null"}]},"carryover":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"carryovercap":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"paid":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"primary":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"provision":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"payitemid":{"oneOf":[{"anyOf":[{"type":"string"},{"type":"object"}]},{"type":"null"}]},"unit":{"oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"accrualmethod":{"oneOf":[{"type":"string"},{"type":"null"}]},"accrualrate":{"oneOf":[{"type":"number"},{"type":"null"}]},"days":{"oneOf":[{"type":"number"},{"type":"null"}]},"cyclemonths":{"oneOf":[{"type":"number"},{"type":"null"}]},"accrualafter":{"oneOf":[{"type":"number"},{"type":"null"}]},"carryover":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"carryovercap":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"paid":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"primary":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"provision":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"payitemid":{"oneOf":[{"anyOf":[{"type":"string"},{"type":"object"}]},{"type":"null"}]},"unit":{"oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"accrualmethod":{"oneOf":[{"type":"string"},{"type":"null"}]},"accrualrate":{"oneOf":[{"type":"number"},{"type":"null"}]},"days":{"oneOf":[{"type":"number"},{"type":"null"}]},"cyclemonths":{"oneOf":[{"type":"number"},{"type":"null"}]},"accrualafter":{"oneOf":[{"type":"number"},{"type":"null"}]},"carryover":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"carryovercap":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"paid":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"primary":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"provision":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"payitemid":{"oneOf":[{"anyOf":[{"type":"string"},{"type":"object"}]},{"type":"null"}]},"unit":{"oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"accrualmethod":{"oneOf":[{"type":"string"},{"type":"null"}]},"accrualrate":{"oneOf":[{"type":"number"},{"type":"null"}]},"days":{"oneOf":[{"type":"number"},{"type":"null"}]},"cyclemonths":{"oneOf":[{"type":"number"},{"type":"null"}]},"accrualafter":{"oneOf":[{"type":"number"},{"type":"null"}]},"carryover":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"carryovercap":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"paid":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"primary":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"provision":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"payitemid":{"oneOf":[{"anyOf":[{"type":"string"},{"type":"object"}]},{"type":"null"}]},"unit":{"oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Edit a leave type's accrual config (id preserved)","tags":["leave management"]}},"/api/leavetype/delete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Delete a leave type (hard retraction; prefer archive)","tags":["leave management"]}},"/api/leavemovement/list":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"List the business's stored leave movements (opening balances and adjustments) with employee, leave type, kind, date and units. For applications for leave use list_leave_requests.","tags":["leave management"]}},"/api/leavemovement/save":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"employee":{"oneOf":[{"type":"string"},{"type":"null"}]},"leavetype":{"oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"description":"opening sets an opening balance. adjustment changes the balance.","oneOf":[{"type":"string","enum":["adjustment","opening"]},{"type":"null"}]},"date":{"oneOf":[{"type":"string"},{"type":"null"}]},"days":{"description":"Signed: a positive number grants leave and a negative number uses it.","oneOf":[{"type":"number"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"employee":{"oneOf":[{"type":"string"},{"type":"null"}]},"leavetype":{"oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"description":"opening sets an opening balance. adjustment changes the balance.","oneOf":[{"type":"string","enum":["adjustment","opening"]},{"type":"null"}]},"date":{"oneOf":[{"type":"string"},{"type":"null"}]},"days":{"description":"Signed: a positive number grants leave and a negative number uses it.","oneOf":[{"type":"number"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"employee":{"oneOf":[{"type":"string"},{"type":"null"}]},"leavetype":{"oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"description":"opening sets an opening balance. adjustment changes the balance.","oneOf":[{"type":"string","enum":["adjustment","opening"]},{"type":"null"}]},"date":{"oneOf":[{"type":"string"},{"type":"null"}]},"days":{"description":"Signed: a positive number grants leave and a negative number uses it.","oneOf":[{"type":"number"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"employee":{"oneOf":[{"type":"string"},{"type":"null"}]},"leavetype":{"oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"description":"opening sets an opening balance. adjustment changes the balance.","oneOf":[{"type":"string","enum":["adjustment","opening"]},{"type":"null"}]},"date":{"oneOf":[{"type":"string"},{"type":"null"}]},"days":{"description":"Signed: a positive number grants leave and a negative number uses it.","oneOf":[{"type":"number"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create or edit a leave opening balance or adjustment. To create, send employee, leavetype, kind (\"opening\" or \"adjustment\") and days (positive grants leave, negative uses it). Pass an id to edit that movement's kind, date, days or notes; its employee and leave type are fixed. Leave movements change leave balances only and post nothing to the ledger.","tags":["leave management"]}},"/api/leavemovement/create":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"employee":{"oneOf":[{"type":"string"},{"type":"null"}]},"leavetype":{"oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"type":"string"},"date":{"oneOf":[{"type":"string"},{"type":"null"}]},"days":{"type":"number"},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","kind","days"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"employee":{"oneOf":[{"type":"string"},{"type":"null"}]},"leavetype":{"oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"type":"string"},"date":{"oneOf":[{"type":"string"},{"type":"null"}]},"days":{"type":"number"},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","kind","days"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"employee":{"oneOf":[{"type":"string"},{"type":"null"}]},"leavetype":{"oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"type":"string"},"date":{"oneOf":[{"type":"string"},{"type":"null"}]},"days":{"type":"number"},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","kind","days"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"employee":{"oneOf":[{"type":"string"},{"type":"null"}]},"leavetype":{"oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"type":"string"},"date":{"oneOf":[{"type":"string"},{"type":"null"}]},"days":{"type":"number"},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","kind","days"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create a stored leave movement (opening balance or adjustment)","tags":["leave management"]}},"/api/leavemovement/update":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"kind":{"oneOf":[{"type":"string"},{"type":"null"}]},"date":{"oneOf":[{"type":"string"},{"type":"null"}]},"days":{"oneOf":[{"type":"number"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"kind":{"oneOf":[{"type":"string"},{"type":"null"}]},"date":{"oneOf":[{"type":"string"},{"type":"null"}]},"days":{"oneOf":[{"type":"number"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"kind":{"oneOf":[{"type":"string"},{"type":"null"}]},"date":{"oneOf":[{"type":"string"},{"type":"null"}]},"days":{"oneOf":[{"type":"number"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"kind":{"oneOf":[{"type":"string"},{"type":"null"}]},"date":{"oneOf":[{"type":"string"},{"type":"null"}]},"days":{"oneOf":[{"type":"number"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Edit a stored adjustment or opening balance in place (kind, date, days, notes)","tags":["leave management"]}},"/api/leavemovement/delete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Soft-delete a stored leave movement","tags":["leave management"]}},"/api/leave/balance":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"employee":{"type":"string"},"leavetype":{"type":"string"},"date":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","employee","leavetype"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"employee":{"type":"string"},"leavetype":{"type":"string"},"date":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","employee","leavetype"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"employee":{"type":"string"},"leavetype":{"type":"string"},"date":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","employee","leavetype"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"employee":{"type":"string"},"leavetype":{"type":"string"},"date":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","employee","leavetype"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"On-demand leave balance for one employee/leavetype (available + pending)","tags":["leave management"]}},"/api/entry/create":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the journal entry, required for updates","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Name or description of the journal entry","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Total amount of the journal entry","oneOf":[{"type":"number"},{"type":"null"}]},"date":{"description":"Date of the journal entry","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Additional notes for the journal entry","oneOf":[{"type":"string"},{"type":"null"}]},"opening":{"description":"Whether this is an opening balance entry","oneOf":[{"type":"boolean"},{"type":"null"}]},"lines":{"description":"Journal entry lines with account debits and credits","oneOf":[{"type":"array","items":{"type":"object","properties":{"accountid":{"description":"Chart-of-accounts account id for this line (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"debit":{"description":"Debit amount for this line (0 if this is a credit line).","oneOf":[{"type":"number"},{"type":"null"}]},"credit":{"description":"Credit amount for this line (0 if this is a debit line).","oneOf":[{"type":"number"},{"type":"null"}]},"role":{"description":"Optional line role: what the amount is (e.g. sars-3601), set by the producer. Lowercase letters, digits and hyphens, at most 64 characters. Send \"$delete\" to clear it; omit it to leave it alone.","oneOf":[{"type":"string"},{"type":"null"}]},"clientid":{"description":"PROD-2704. Optional: the customer (clientid) or supplier (supplierid) this line books to, at most one per line. It tags the line and adds no posting; the entry then shows on that contact's statement and balance. The id must be one of this business's clients or suppliers (see list_clients, list_suppliers). Send \"$delete\" to clear it; omit it or send null to leave it alone. Naming one kind clears the other.","oneOf":[{"type":"string"},{"type":"null"}]},"supplierid":{"description":"PROD-2704. Optional: the customer (clientid) or supplier (supplierid) this line books to, at most one per line. It tags the line and adds no posting; the entry then shows on that contact's statement and balance. The id must be one of this business's clients or suppliers (see list_clients, list_suppliers). Send \"$delete\" to clear it; omit it or send null to leave it alone. Naming one kind clears the other.","oneOf":[{"type":"string"},{"type":"null"}]},"employeeid":{"description":"PROD-3206. Optional: the employee this line books to, such as a PAYE correction (see list_employees). A line names one contact at most: a customer, a supplier or an employee. A line on PAYE Payable with role sars-4102, tagged to an employee, counts in EMP201 and EMP501 and on that employee's IRP5. Send \"$delete\" to clear it; omit it or send null to leave it alone. Needs payroll access: without it the write is refused, as is any change to a journal that already names an employee.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"Optional. The currency this line's foreign amount is in. A line on a foreign-currency account takes the account's own; name one on a rand account only for an amount owed in another currency, such as a euro receivable.","oneOf":[{"type":"string"},{"type":"null"}]},"foreignamount":{"description":"Optional. The line's amount in that currency, positive, as booked: €1,250.00 of a R25,060.00 line. Kept as written and never converted again. Omitted on a foreign-currency account, stub works it out at the business's closing rate for the day, else its daily rate.","oneOf":[{"type":"number"},{"type":"null"}]},"exchangerate":{"description":"Optional. Base currency per ONE unit of that currency, as booked (20.0480 rand per euro). Omitted, it is the line's rand amount over its foreign amount.","oneOf":[{"type":"number"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the journal entry, required for updates","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Name or description of the journal entry","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Total amount of the journal entry","oneOf":[{"type":"number"},{"type":"null"}]},"date":{"description":"Date of the journal entry","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Additional notes for the journal entry","oneOf":[{"type":"string"},{"type":"null"}]},"opening":{"description":"Whether this is an opening balance entry","oneOf":[{"type":"boolean"},{"type":"null"}]},"lines":{"description":"Journal entry lines with account debits and credits","oneOf":[{"type":"array","items":{"type":"object","properties":{"accountid":{"description":"Chart-of-accounts account id for this line (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"debit":{"description":"Debit amount for this line (0 if this is a credit line).","oneOf":[{"type":"number"},{"type":"null"}]},"credit":{"description":"Credit amount for this line (0 if this is a debit line).","oneOf":[{"type":"number"},{"type":"null"}]},"role":{"description":"Optional line role: what the amount is (e.g. sars-3601), set by the producer. Lowercase letters, digits and hyphens, at most 64 characters. Send \"$delete\" to clear it; omit it to leave it alone.","oneOf":[{"type":"string"},{"type":"null"}]},"clientid":{"description":"PROD-2704. Optional: the customer (clientid) or supplier (supplierid) this line books to, at most one per line. It tags the line and adds no posting; the entry then shows on that contact's statement and balance. The id must be one of this business's clients or suppliers (see list_clients, list_suppliers). Send \"$delete\" to clear it; omit it or send null to leave it alone. Naming one kind clears the other.","oneOf":[{"type":"string"},{"type":"null"}]},"supplierid":{"description":"PROD-2704. Optional: the customer (clientid) or supplier (supplierid) this line books to, at most one per line. It tags the line and adds no posting; the entry then shows on that contact's statement and balance. The id must be one of this business's clients or suppliers (see list_clients, list_suppliers). Send \"$delete\" to clear it; omit it or send null to leave it alone. Naming one kind clears the other.","oneOf":[{"type":"string"},{"type":"null"}]},"employeeid":{"description":"PROD-3206. Optional: the employee this line books to, such as a PAYE correction (see list_employees). A line names one contact at most: a customer, a supplier or an employee. A line on PAYE Payable with role sars-4102, tagged to an employee, counts in EMP201 and EMP501 and on that employee's IRP5. Send \"$delete\" to clear it; omit it or send null to leave it alone. Needs payroll access: without it the write is refused, as is any change to a journal that already names an employee.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"Optional. The currency this line's foreign amount is in. A line on a foreign-currency account takes the account's own; name one on a rand account only for an amount owed in another currency, such as a euro receivable.","oneOf":[{"type":"string"},{"type":"null"}]},"foreignamount":{"description":"Optional. The line's amount in that currency, positive, as booked: €1,250.00 of a R25,060.00 line. Kept as written and never converted again. Omitted on a foreign-currency account, stub works it out at the business's closing rate for the day, else its daily rate.","oneOf":[{"type":"number"},{"type":"null"}]},"exchangerate":{"description":"Optional. Base currency per ONE unit of that currency, as booked (20.0480 rand per euro). Omitted, it is the line's rand amount over its foreign amount.","oneOf":[{"type":"number"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the journal entry, required for updates","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Name or description of the journal entry","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Total amount of the journal entry","oneOf":[{"type":"number"},{"type":"null"}]},"date":{"description":"Date of the journal entry","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Additional notes for the journal entry","oneOf":[{"type":"string"},{"type":"null"}]},"opening":{"description":"Whether this is an opening balance entry","oneOf":[{"type":"boolean"},{"type":"null"}]},"lines":{"description":"Journal entry lines with account debits and credits","oneOf":[{"type":"array","items":{"type":"object","properties":{"accountid":{"description":"Chart-of-accounts account id for this line (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"debit":{"description":"Debit amount for this line (0 if this is a credit line).","oneOf":[{"type":"number"},{"type":"null"}]},"credit":{"description":"Credit amount for this line (0 if this is a debit line).","oneOf":[{"type":"number"},{"type":"null"}]},"role":{"description":"Optional line role: what the amount is (e.g. sars-3601), set by the producer. Lowercase letters, digits and hyphens, at most 64 characters. Send \"$delete\" to clear it; omit it to leave it alone.","oneOf":[{"type":"string"},{"type":"null"}]},"clientid":{"description":"PROD-2704. Optional: the customer (clientid) or supplier (supplierid) this line books to, at most one per line. It tags the line and adds no posting; the entry then shows on that contact's statement and balance. The id must be one of this business's clients or suppliers (see list_clients, list_suppliers). Send \"$delete\" to clear it; omit it or send null to leave it alone. Naming one kind clears the other.","oneOf":[{"type":"string"},{"type":"null"}]},"supplierid":{"description":"PROD-2704. Optional: the customer (clientid) or supplier (supplierid) this line books to, at most one per line. It tags the line and adds no posting; the entry then shows on that contact's statement and balance. The id must be one of this business's clients or suppliers (see list_clients, list_suppliers). Send \"$delete\" to clear it; omit it or send null to leave it alone. Naming one kind clears the other.","oneOf":[{"type":"string"},{"type":"null"}]},"employeeid":{"description":"PROD-3206. Optional: the employee this line books to, such as a PAYE correction (see list_employees). A line names one contact at most: a customer, a supplier or an employee. A line on PAYE Payable with role sars-4102, tagged to an employee, counts in EMP201 and EMP501 and on that employee's IRP5. Send \"$delete\" to clear it; omit it or send null to leave it alone. Needs payroll access: without it the write is refused, as is any change to a journal that already names an employee.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"Optional. The currency this line's foreign amount is in. A line on a foreign-currency account takes the account's own; name one on a rand account only for an amount owed in another currency, such as a euro receivable.","oneOf":[{"type":"string"},{"type":"null"}]},"foreignamount":{"description":"Optional. The line's amount in that currency, positive, as booked: €1,250.00 of a R25,060.00 line. Kept as written and never converted again. Omitted on a foreign-currency account, stub works it out at the business's closing rate for the day, else its daily rate.","oneOf":[{"type":"number"},{"type":"null"}]},"exchangerate":{"description":"Optional. Base currency per ONE unit of that currency, as booked (20.0480 rand per euro). Omitted, it is the line's rand amount over its foreign amount.","oneOf":[{"type":"number"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the journal entry, required for updates","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Name or description of the journal entry","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Total amount of the journal entry","oneOf":[{"type":"number"},{"type":"null"}]},"date":{"description":"Date of the journal entry","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Additional notes for the journal entry","oneOf":[{"type":"string"},{"type":"null"}]},"opening":{"description":"Whether this is an opening balance entry","oneOf":[{"type":"boolean"},{"type":"null"}]},"lines":{"description":"Journal entry lines with account debits and credits","oneOf":[{"type":"array","items":{"type":"object","properties":{"accountid":{"description":"Chart-of-accounts account id for this line (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"debit":{"description":"Debit amount for this line (0 if this is a credit line).","oneOf":[{"type":"number"},{"type":"null"}]},"credit":{"description":"Credit amount for this line (0 if this is a debit line).","oneOf":[{"type":"number"},{"type":"null"}]},"role":{"description":"Optional line role: what the amount is (e.g. sars-3601), set by the producer. Lowercase letters, digits and hyphens, at most 64 characters. Send \"$delete\" to clear it; omit it to leave it alone.","oneOf":[{"type":"string"},{"type":"null"}]},"clientid":{"description":"PROD-2704. Optional: the customer (clientid) or supplier (supplierid) this line books to, at most one per line. It tags the line and adds no posting; the entry then shows on that contact's statement and balance. The id must be one of this business's clients or suppliers (see list_clients, list_suppliers). Send \"$delete\" to clear it; omit it or send null to leave it alone. Naming one kind clears the other.","oneOf":[{"type":"string"},{"type":"null"}]},"supplierid":{"description":"PROD-2704. Optional: the customer (clientid) or supplier (supplierid) this line books to, at most one per line. It tags the line and adds no posting; the entry then shows on that contact's statement and balance. The id must be one of this business's clients or suppliers (see list_clients, list_suppliers). Send \"$delete\" to clear it; omit it or send null to leave it alone. Naming one kind clears the other.","oneOf":[{"type":"string"},{"type":"null"}]},"employeeid":{"description":"PROD-3206. Optional: the employee this line books to, such as a PAYE correction (see list_employees). A line names one contact at most: a customer, a supplier or an employee. A line on PAYE Payable with role sars-4102, tagged to an employee, counts in EMP201 and EMP501 and on that employee's IRP5. Send \"$delete\" to clear it; omit it or send null to leave it alone. Needs payroll access: without it the write is refused, as is any change to a journal that already names an employee.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"Optional. The currency this line's foreign amount is in. A line on a foreign-currency account takes the account's own; name one on a rand account only for an amount owed in another currency, such as a euro receivable.","oneOf":[{"type":"string"},{"type":"null"}]},"foreignamount":{"description":"Optional. The line's amount in that currency, positive, as booked: €1,250.00 of a R25,060.00 line. Kept as written and never converted again. Omitted on a foreign-currency account, stub works it out at the business's closing rate for the day, else its daily rate.","oneOf":[{"type":"number"},{"type":"null"}]},"exchangerate":{"description":"Optional. Base currency per ONE unit of that currency, as booked (20.0480 rand per euro). Omitted, it is the line's rand amount over its foreign amount.","oneOf":[{"type":"number"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create new journal entry","tags":["journal entry management"]}},"/api/entry/update":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the journal entry, required for updates","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Name or description of the journal entry","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Total amount of the journal entry","oneOf":[{"type":"number"},{"type":"null"}]},"date":{"description":"Date of the journal entry","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Additional notes for the journal entry","oneOf":[{"type":"string"},{"type":"null"}]},"opening":{"description":"Whether this is an opening balance entry","oneOf":[{"type":"boolean"},{"type":"null"}]},"lines":{"description":"Journal entry lines with account debits and credits","oneOf":[{"type":"array","items":{"type":"object","properties":{"accountid":{"description":"Chart-of-accounts account id for this line (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"debit":{"description":"Debit amount for this line (0 if this is a credit line).","oneOf":[{"type":"number"},{"type":"null"}]},"credit":{"description":"Credit amount for this line (0 if this is a debit line).","oneOf":[{"type":"number"},{"type":"null"}]},"role":{"description":"Optional line role: what the amount is (e.g. sars-3601), set by the producer. Lowercase letters, digits and hyphens, at most 64 characters. Send \"$delete\" to clear it; omit it to leave it alone.","oneOf":[{"type":"string"},{"type":"null"}]},"clientid":{"description":"PROD-2704. Optional: the customer (clientid) or supplier (supplierid) this line books to, at most one per line. It tags the line and adds no posting; the entry then shows on that contact's statement and balance. The id must be one of this business's clients or suppliers (see list_clients, list_suppliers). Send \"$delete\" to clear it; omit it or send null to leave it alone. Naming one kind clears the other.","oneOf":[{"type":"string"},{"type":"null"}]},"supplierid":{"description":"PROD-2704. Optional: the customer (clientid) or supplier (supplierid) this line books to, at most one per line. It tags the line and adds no posting; the entry then shows on that contact's statement and balance. The id must be one of this business's clients or suppliers (see list_clients, list_suppliers). Send \"$delete\" to clear it; omit it or send null to leave it alone. Naming one kind clears the other.","oneOf":[{"type":"string"},{"type":"null"}]},"employeeid":{"description":"PROD-3206. Optional: the employee this line books to, such as a PAYE correction (see list_employees). A line names one contact at most: a customer, a supplier or an employee. A line on PAYE Payable with role sars-4102, tagged to an employee, counts in EMP201 and EMP501 and on that employee's IRP5. Send \"$delete\" to clear it; omit it or send null to leave it alone. Needs payroll access: without it the write is refused, as is any change to a journal that already names an employee.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"Optional. The currency this line's foreign amount is in. A line on a foreign-currency account takes the account's own; name one on a rand account only for an amount owed in another currency, such as a euro receivable.","oneOf":[{"type":"string"},{"type":"null"}]},"foreignamount":{"description":"Optional. The line's amount in that currency, positive, as booked: €1,250.00 of a R25,060.00 line. Kept as written and never converted again. Omitted on a foreign-currency account, stub works it out at the business's closing rate for the day, else its daily rate.","oneOf":[{"type":"number"},{"type":"null"}]},"exchangerate":{"description":"Optional. Base currency per ONE unit of that currency, as booked (20.0480 rand per euro). Omitted, it is the line's rand amount over its foreign amount.","oneOf":[{"type":"number"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the journal entry, required for updates","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Name or description of the journal entry","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Total amount of the journal entry","oneOf":[{"type":"number"},{"type":"null"}]},"date":{"description":"Date of the journal entry","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Additional notes for the journal entry","oneOf":[{"type":"string"},{"type":"null"}]},"opening":{"description":"Whether this is an opening balance entry","oneOf":[{"type":"boolean"},{"type":"null"}]},"lines":{"description":"Journal entry lines with account debits and credits","oneOf":[{"type":"array","items":{"type":"object","properties":{"accountid":{"description":"Chart-of-accounts account id for this line (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"debit":{"description":"Debit amount for this line (0 if this is a credit line).","oneOf":[{"type":"number"},{"type":"null"}]},"credit":{"description":"Credit amount for this line (0 if this is a debit line).","oneOf":[{"type":"number"},{"type":"null"}]},"role":{"description":"Optional line role: what the amount is (e.g. sars-3601), set by the producer. Lowercase letters, digits and hyphens, at most 64 characters. Send \"$delete\" to clear it; omit it to leave it alone.","oneOf":[{"type":"string"},{"type":"null"}]},"clientid":{"description":"PROD-2704. Optional: the customer (clientid) or supplier (supplierid) this line books to, at most one per line. It tags the line and adds no posting; the entry then shows on that contact's statement and balance. The id must be one of this business's clients or suppliers (see list_clients, list_suppliers). Send \"$delete\" to clear it; omit it or send null to leave it alone. Naming one kind clears the other.","oneOf":[{"type":"string"},{"type":"null"}]},"supplierid":{"description":"PROD-2704. Optional: the customer (clientid) or supplier (supplierid) this line books to, at most one per line. It tags the line and adds no posting; the entry then shows on that contact's statement and balance. The id must be one of this business's clients or suppliers (see list_clients, list_suppliers). Send \"$delete\" to clear it; omit it or send null to leave it alone. Naming one kind clears the other.","oneOf":[{"type":"string"},{"type":"null"}]},"employeeid":{"description":"PROD-3206. Optional: the employee this line books to, such as a PAYE correction (see list_employees). A line names one contact at most: a customer, a supplier or an employee. A line on PAYE Payable with role sars-4102, tagged to an employee, counts in EMP201 and EMP501 and on that employee's IRP5. Send \"$delete\" to clear it; omit it or send null to leave it alone. Needs payroll access: without it the write is refused, as is any change to a journal that already names an employee.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"Optional. The currency this line's foreign amount is in. A line on a foreign-currency account takes the account's own; name one on a rand account only for an amount owed in another currency, such as a euro receivable.","oneOf":[{"type":"string"},{"type":"null"}]},"foreignamount":{"description":"Optional. The line's amount in that currency, positive, as booked: €1,250.00 of a R25,060.00 line. Kept as written and never converted again. Omitted on a foreign-currency account, stub works it out at the business's closing rate for the day, else its daily rate.","oneOf":[{"type":"number"},{"type":"null"}]},"exchangerate":{"description":"Optional. Base currency per ONE unit of that currency, as booked (20.0480 rand per euro). Omitted, it is the line's rand amount over its foreign amount.","oneOf":[{"type":"number"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the journal entry, required for updates","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Name or description of the journal entry","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Total amount of the journal entry","oneOf":[{"type":"number"},{"type":"null"}]},"date":{"description":"Date of the journal entry","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Additional notes for the journal entry","oneOf":[{"type":"string"},{"type":"null"}]},"opening":{"description":"Whether this is an opening balance entry","oneOf":[{"type":"boolean"},{"type":"null"}]},"lines":{"description":"Journal entry lines with account debits and credits","oneOf":[{"type":"array","items":{"type":"object","properties":{"accountid":{"description":"Chart-of-accounts account id for this line (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"debit":{"description":"Debit amount for this line (0 if this is a credit line).","oneOf":[{"type":"number"},{"type":"null"}]},"credit":{"description":"Credit amount for this line (0 if this is a debit line).","oneOf":[{"type":"number"},{"type":"null"}]},"role":{"description":"Optional line role: what the amount is (e.g. sars-3601), set by the producer. Lowercase letters, digits and hyphens, at most 64 characters. Send \"$delete\" to clear it; omit it to leave it alone.","oneOf":[{"type":"string"},{"type":"null"}]},"clientid":{"description":"PROD-2704. Optional: the customer (clientid) or supplier (supplierid) this line books to, at most one per line. It tags the line and adds no posting; the entry then shows on that contact's statement and balance. The id must be one of this business's clients or suppliers (see list_clients, list_suppliers). Send \"$delete\" to clear it; omit it or send null to leave it alone. Naming one kind clears the other.","oneOf":[{"type":"string"},{"type":"null"}]},"supplierid":{"description":"PROD-2704. Optional: the customer (clientid) or supplier (supplierid) this line books to, at most one per line. It tags the line and adds no posting; the entry then shows on that contact's statement and balance. The id must be one of this business's clients or suppliers (see list_clients, list_suppliers). Send \"$delete\" to clear it; omit it or send null to leave it alone. Naming one kind clears the other.","oneOf":[{"type":"string"},{"type":"null"}]},"employeeid":{"description":"PROD-3206. Optional: the employee this line books to, such as a PAYE correction (see list_employees). A line names one contact at most: a customer, a supplier or an employee. A line on PAYE Payable with role sars-4102, tagged to an employee, counts in EMP201 and EMP501 and on that employee's IRP5. Send \"$delete\" to clear it; omit it or send null to leave it alone. Needs payroll access: without it the write is refused, as is any change to a journal that already names an employee.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"Optional. The currency this line's foreign amount is in. A line on a foreign-currency account takes the account's own; name one on a rand account only for an amount owed in another currency, such as a euro receivable.","oneOf":[{"type":"string"},{"type":"null"}]},"foreignamount":{"description":"Optional. The line's amount in that currency, positive, as booked: €1,250.00 of a R25,060.00 line. Kept as written and never converted again. Omitted on a foreign-currency account, stub works it out at the business's closing rate for the day, else its daily rate.","oneOf":[{"type":"number"},{"type":"null"}]},"exchangerate":{"description":"Optional. Base currency per ONE unit of that currency, as booked (20.0480 rand per euro). Omitted, it is the line's rand amount over its foreign amount.","oneOf":[{"type":"number"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the journal entry, required for updates","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Name or description of the journal entry","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Total amount of the journal entry","oneOf":[{"type":"number"},{"type":"null"}]},"date":{"description":"Date of the journal entry","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Additional notes for the journal entry","oneOf":[{"type":"string"},{"type":"null"}]},"opening":{"description":"Whether this is an opening balance entry","oneOf":[{"type":"boolean"},{"type":"null"}]},"lines":{"description":"Journal entry lines with account debits and credits","oneOf":[{"type":"array","items":{"type":"object","properties":{"accountid":{"description":"Chart-of-accounts account id for this line (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"debit":{"description":"Debit amount for this line (0 if this is a credit line).","oneOf":[{"type":"number"},{"type":"null"}]},"credit":{"description":"Credit amount for this line (0 if this is a debit line).","oneOf":[{"type":"number"},{"type":"null"}]},"role":{"description":"Optional line role: what the amount is (e.g. sars-3601), set by the producer. Lowercase letters, digits and hyphens, at most 64 characters. Send \"$delete\" to clear it; omit it to leave it alone.","oneOf":[{"type":"string"},{"type":"null"}]},"clientid":{"description":"PROD-2704. Optional: the customer (clientid) or supplier (supplierid) this line books to, at most one per line. It tags the line and adds no posting; the entry then shows on that contact's statement and balance. The id must be one of this business's clients or suppliers (see list_clients, list_suppliers). Send \"$delete\" to clear it; omit it or send null to leave it alone. Naming one kind clears the other.","oneOf":[{"type":"string"},{"type":"null"}]},"supplierid":{"description":"PROD-2704. Optional: the customer (clientid) or supplier (supplierid) this line books to, at most one per line. It tags the line and adds no posting; the entry then shows on that contact's statement and balance. The id must be one of this business's clients or suppliers (see list_clients, list_suppliers). Send \"$delete\" to clear it; omit it or send null to leave it alone. Naming one kind clears the other.","oneOf":[{"type":"string"},{"type":"null"}]},"employeeid":{"description":"PROD-3206. Optional: the employee this line books to, such as a PAYE correction (see list_employees). A line names one contact at most: a customer, a supplier or an employee. A line on PAYE Payable with role sars-4102, tagged to an employee, counts in EMP201 and EMP501 and on that employee's IRP5. Send \"$delete\" to clear it; omit it or send null to leave it alone. Needs payroll access: without it the write is refused, as is any change to a journal that already names an employee.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"Optional. The currency this line's foreign amount is in. A line on a foreign-currency account takes the account's own; name one on a rand account only for an amount owed in another currency, such as a euro receivable.","oneOf":[{"type":"string"},{"type":"null"}]},"foreignamount":{"description":"Optional. The line's amount in that currency, positive, as booked: €1,250.00 of a R25,060.00 line. Kept as written and never converted again. Omitted on a foreign-currency account, stub works it out at the business's closing rate for the day, else its daily rate.","oneOf":[{"type":"number"},{"type":"null"}]},"exchangerate":{"description":"Optional. Base currency per ONE unit of that currency, as booked (20.0480 rand per euro). Omitted, it is the line's rand amount over its foreign amount.","oneOf":[{"type":"number"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Update journal entry","tags":["journal entry management"]}},"/api/entry/save":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Journal entry id. Present → update; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Description of the journal entry.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Total amount of the journal entry.","oneOf":[{"type":"number"},{"type":"null"}]},"date":{"description":"Journal entry date (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"opening":{"description":"Whether this is an opening balance entry.","oneOf":[{"type":"boolean"},{"type":"null"}]},"lines":{"description":"Journal lines. Each line debits or credits one account; total debits must equal total credits.","oneOf":[{"type":"array","items":{"type":"object","properties":{"accountid":{"description":"Chart-of-accounts account id for this line (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"debit":{"description":"Debit amount for this line (0 if this is a credit line).","oneOf":[{"type":"number"},{"type":"null"}]},"credit":{"description":"Credit amount for this line (0 if this is a debit line).","oneOf":[{"type":"number"},{"type":"null"}]},"role":{"description":"Optional line role: what the amount is (e.g. sars-3601), set by the producer. Lowercase letters, digits and hyphens, at most 64 characters. Send \"$delete\" to clear it; omit it to leave it alone.","oneOf":[{"type":"string"},{"type":"null"}]},"clientid":{"description":"PROD-2704. Optional: the customer (clientid) or supplier (supplierid) this line books to, at most one per line. It tags the line and adds no posting; the entry then shows on that contact's statement and balance. The id must be one of this business's clients or suppliers (see list_clients, list_suppliers). Send \"$delete\" to clear it; omit it or send null to leave it alone. Naming one kind clears the other.","oneOf":[{"type":"string"},{"type":"null"}]},"supplierid":{"description":"PROD-2704. Optional: the customer (clientid) or supplier (supplierid) this line books to, at most one per line. It tags the line and adds no posting; the entry then shows on that contact's statement and balance. The id must be one of this business's clients or suppliers (see list_clients, list_suppliers). Send \"$delete\" to clear it; omit it or send null to leave it alone. Naming one kind clears the other.","oneOf":[{"type":"string"},{"type":"null"}]},"employeeid":{"description":"PROD-3206. Optional: the employee this line books to, such as a PAYE correction (see list_employees). A line names one contact at most: a customer, a supplier or an employee. A line on PAYE Payable with role sars-4102, tagged to an employee, counts in EMP201 and EMP501 and on that employee's IRP5. Send \"$delete\" to clear it; omit it or send null to leave it alone. Needs payroll access: without it the write is refused, as is any change to a journal that already names an employee.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"Optional. The currency this line's foreign amount is in. A line on a foreign-currency account takes the account's own; name one on a rand account only for an amount owed in another currency, such as a euro receivable.","oneOf":[{"type":"string"},{"type":"null"}]},"foreignamount":{"description":"Optional. The line's amount in that currency, positive, as booked: €1,250.00 of a R25,060.00 line. Kept as written and never converted again. Omitted on a foreign-currency account, stub works it out at the business's closing rate for the day, else its daily rate.","oneOf":[{"type":"number"},{"type":"null"}]},"exchangerate":{"description":"Optional. Base currency per ONE unit of that currency, as booked (20.0480 rand per euro). Omitted, it is the line's rand amount over its foreign amount.","oneOf":[{"type":"number"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]},"items":{"description":"Vector of journal entry objects to create/update in one all-or-nothing batch. Preferred over repeated calls. Each item with an id updates; each without creates.","type":"array","items":{"type":"object","properties":{"id":{"description":"Journal entry id. Present → update; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Description of the journal entry.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Total amount of the journal entry.","oneOf":[{"type":"number"},{"type":"null"}]},"date":{"description":"Journal entry date (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"opening":{"description":"Whether this is an opening balance entry.","oneOf":[{"type":"boolean"},{"type":"null"}]},"lines":{"description":"Journal lines. Each line debits or credits one account; total debits must equal total credits.","oneOf":[{"type":"array","items":{"type":"object","properties":{"accountid":{"description":"Chart-of-accounts account id for this line (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"debit":{"description":"Debit amount for this line (0 if this is a credit line).","oneOf":[{"type":"number"},{"type":"null"}]},"credit":{"description":"Credit amount for this line (0 if this is a debit line).","oneOf":[{"type":"number"},{"type":"null"}]},"role":{"description":"Optional line role: what the amount is (e.g. sars-3601), set by the producer. Lowercase letters, digits and hyphens, at most 64 characters. Send \"$delete\" to clear it; omit it to leave it alone.","oneOf":[{"type":"string"},{"type":"null"}]},"clientid":{"description":"PROD-2704. Optional: the customer (clientid) or supplier (supplierid) this line books to, at most one per line. It tags the line and adds no posting; the entry then shows on that contact's statement and balance. The id must be one of this business's clients or suppliers (see list_clients, list_suppliers). Send \"$delete\" to clear it; omit it or send null to leave it alone. Naming one kind clears the other.","oneOf":[{"type":"string"},{"type":"null"}]},"supplierid":{"description":"PROD-2704. Optional: the customer (clientid) or supplier (supplierid) this line books to, at most one per line. It tags the line and adds no posting; the entry then shows on that contact's statement and balance. The id must be one of this business's clients or suppliers (see list_clients, list_suppliers). Send \"$delete\" to clear it; omit it or send null to leave it alone. Naming one kind clears the other.","oneOf":[{"type":"string"},{"type":"null"}]},"employeeid":{"description":"PROD-3206. Optional: the employee this line books to, such as a PAYE correction (see list_employees). A line names one contact at most: a customer, a supplier or an employee. A line on PAYE Payable with role sars-4102, tagged to an employee, counts in EMP201 and EMP501 and on that employee's IRP5. Send \"$delete\" to clear it; omit it or send null to leave it alone. Needs payroll access: without it the write is refused, as is any change to a journal that already names an employee.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"Optional. The currency this line's foreign amount is in. A line on a foreign-currency account takes the account's own; name one on a rand account only for an amount owed in another currency, such as a euro receivable.","oneOf":[{"type":"string"},{"type":"null"}]},"foreignamount":{"description":"Optional. The line's amount in that currency, positive, as booked: €1,250.00 of a R25,060.00 line. Kept as written and never converted again. Omitted on a foreign-currency account, stub works it out at the business's closing rate for the day, else its daily rate.","oneOf":[{"type":"number"},{"type":"null"}]},"exchangerate":{"description":"Optional. Base currency per ONE unit of that currency, as booked (20.0480 rand per euro). Omitted, it is the line's rand amount over its foreign amount.","oneOf":[{"type":"number"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]}},"additionalProperties":false}}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Journal entry id. Present → update; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Description of the journal entry.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Total amount of the journal entry.","oneOf":[{"type":"number"},{"type":"null"}]},"date":{"description":"Journal entry date (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"opening":{"description":"Whether this is an opening balance entry.","oneOf":[{"type":"boolean"},{"type":"null"}]},"lines":{"description":"Journal lines. Each line debits or credits one account; total debits must equal total credits.","oneOf":[{"type":"array","items":{"type":"object","properties":{"accountid":{"description":"Chart-of-accounts account id for this line (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"debit":{"description":"Debit amount for this line (0 if this is a credit line).","oneOf":[{"type":"number"},{"type":"null"}]},"credit":{"description":"Credit amount for this line (0 if this is a debit line).","oneOf":[{"type":"number"},{"type":"null"}]},"role":{"description":"Optional line role: what the amount is (e.g. sars-3601), set by the producer. Lowercase letters, digits and hyphens, at most 64 characters. Send \"$delete\" to clear it; omit it to leave it alone.","oneOf":[{"type":"string"},{"type":"null"}]},"clientid":{"description":"PROD-2704. Optional: the customer (clientid) or supplier (supplierid) this line books to, at most one per line. It tags the line and adds no posting; the entry then shows on that contact's statement and balance. The id must be one of this business's clients or suppliers (see list_clients, list_suppliers). Send \"$delete\" to clear it; omit it or send null to leave it alone. Naming one kind clears the other.","oneOf":[{"type":"string"},{"type":"null"}]},"supplierid":{"description":"PROD-2704. Optional: the customer (clientid) or supplier (supplierid) this line books to, at most one per line. It tags the line and adds no posting; the entry then shows on that contact's statement and balance. The id must be one of this business's clients or suppliers (see list_clients, list_suppliers). Send \"$delete\" to clear it; omit it or send null to leave it alone. Naming one kind clears the other.","oneOf":[{"type":"string"},{"type":"null"}]},"employeeid":{"description":"PROD-3206. Optional: the employee this line books to, such as a PAYE correction (see list_employees). A line names one contact at most: a customer, a supplier or an employee. A line on PAYE Payable with role sars-4102, tagged to an employee, counts in EMP201 and EMP501 and on that employee's IRP5. Send \"$delete\" to clear it; omit it or send null to leave it alone. Needs payroll access: without it the write is refused, as is any change to a journal that already names an employee.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"Optional. The currency this line's foreign amount is in. A line on a foreign-currency account takes the account's own; name one on a rand account only for an amount owed in another currency, such as a euro receivable.","oneOf":[{"type":"string"},{"type":"null"}]},"foreignamount":{"description":"Optional. The line's amount in that currency, positive, as booked: €1,250.00 of a R25,060.00 line. Kept as written and never converted again. Omitted on a foreign-currency account, stub works it out at the business's closing rate for the day, else its daily rate.","oneOf":[{"type":"number"},{"type":"null"}]},"exchangerate":{"description":"Optional. Base currency per ONE unit of that currency, as booked (20.0480 rand per euro). Omitted, it is the line's rand amount over its foreign amount.","oneOf":[{"type":"number"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]},"items":{"description":"Vector of journal entry objects to create/update in one all-or-nothing batch. Preferred over repeated calls. Each item with an id updates; each without creates.","type":"array","items":{"type":"object","properties":{"id":{"description":"Journal entry id. Present → update; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Description of the journal entry.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Total amount of the journal entry.","oneOf":[{"type":"number"},{"type":"null"}]},"date":{"description":"Journal entry date (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"opening":{"description":"Whether this is an opening balance entry.","oneOf":[{"type":"boolean"},{"type":"null"}]},"lines":{"description":"Journal lines. Each line debits or credits one account; total debits must equal total credits.","oneOf":[{"type":"array","items":{"type":"object","properties":{"accountid":{"description":"Chart-of-accounts account id for this line (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"debit":{"description":"Debit amount for this line (0 if this is a credit line).","oneOf":[{"type":"number"},{"type":"null"}]},"credit":{"description":"Credit amount for this line (0 if this is a debit line).","oneOf":[{"type":"number"},{"type":"null"}]},"role":{"description":"Optional line role: what the amount is (e.g. sars-3601), set by the producer. Lowercase letters, digits and hyphens, at most 64 characters. Send \"$delete\" to clear it; omit it to leave it alone.","oneOf":[{"type":"string"},{"type":"null"}]},"clientid":{"description":"PROD-2704. Optional: the customer (clientid) or supplier (supplierid) this line books to, at most one per line. It tags the line and adds no posting; the entry then shows on that contact's statement and balance. The id must be one of this business's clients or suppliers (see list_clients, list_suppliers). Send \"$delete\" to clear it; omit it or send null to leave it alone. Naming one kind clears the other.","oneOf":[{"type":"string"},{"type":"null"}]},"supplierid":{"description":"PROD-2704. Optional: the customer (clientid) or supplier (supplierid) this line books to, at most one per line. It tags the line and adds no posting; the entry then shows on that contact's statement and balance. The id must be one of this business's clients or suppliers (see list_clients, list_suppliers). Send \"$delete\" to clear it; omit it or send null to leave it alone. Naming one kind clears the other.","oneOf":[{"type":"string"},{"type":"null"}]},"employeeid":{"description":"PROD-3206. Optional: the employee this line books to, such as a PAYE correction (see list_employees). A line names one contact at most: a customer, a supplier or an employee. A line on PAYE Payable with role sars-4102, tagged to an employee, counts in EMP201 and EMP501 and on that employee's IRP5. Send \"$delete\" to clear it; omit it or send null to leave it alone. Needs payroll access: without it the write is refused, as is any change to a journal that already names an employee.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"Optional. The currency this line's foreign amount is in. A line on a foreign-currency account takes the account's own; name one on a rand account only for an amount owed in another currency, such as a euro receivable.","oneOf":[{"type":"string"},{"type":"null"}]},"foreignamount":{"description":"Optional. The line's amount in that currency, positive, as booked: €1,250.00 of a R25,060.00 line. Kept as written and never converted again. Omitted on a foreign-currency account, stub works it out at the business's closing rate for the day, else its daily rate.","oneOf":[{"type":"number"},{"type":"null"}]},"exchangerate":{"description":"Optional. Base currency per ONE unit of that currency, as booked (20.0480 rand per euro). Omitted, it is the line's rand amount over its foreign amount.","oneOf":[{"type":"number"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]}},"additionalProperties":false}}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Journal entry id. Present → update; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Description of the journal entry.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Total amount of the journal entry.","oneOf":[{"type":"number"},{"type":"null"}]},"date":{"description":"Journal entry date (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"opening":{"description":"Whether this is an opening balance entry.","oneOf":[{"type":"boolean"},{"type":"null"}]},"lines":{"description":"Journal lines. Each line debits or credits one account; total debits must equal total credits.","oneOf":[{"type":"array","items":{"type":"object","properties":{"accountid":{"description":"Chart-of-accounts account id for this line (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"debit":{"description":"Debit amount for this line (0 if this is a credit line).","oneOf":[{"type":"number"},{"type":"null"}]},"credit":{"description":"Credit amount for this line (0 if this is a debit line).","oneOf":[{"type":"number"},{"type":"null"}]},"role":{"description":"Optional line role: what the amount is (e.g. sars-3601), set by the producer. Lowercase letters, digits and hyphens, at most 64 characters. Send \"$delete\" to clear it; omit it to leave it alone.","oneOf":[{"type":"string"},{"type":"null"}]},"clientid":{"description":"PROD-2704. Optional: the customer (clientid) or supplier (supplierid) this line books to, at most one per line. It tags the line and adds no posting; the entry then shows on that contact's statement and balance. The id must be one of this business's clients or suppliers (see list_clients, list_suppliers). Send \"$delete\" to clear it; omit it or send null to leave it alone. Naming one kind clears the other.","oneOf":[{"type":"string"},{"type":"null"}]},"supplierid":{"description":"PROD-2704. Optional: the customer (clientid) or supplier (supplierid) this line books to, at most one per line. It tags the line and adds no posting; the entry then shows on that contact's statement and balance. The id must be one of this business's clients or suppliers (see list_clients, list_suppliers). Send \"$delete\" to clear it; omit it or send null to leave it alone. Naming one kind clears the other.","oneOf":[{"type":"string"},{"type":"null"}]},"employeeid":{"description":"PROD-3206. Optional: the employee this line books to, such as a PAYE correction (see list_employees). A line names one contact at most: a customer, a supplier or an employee. A line on PAYE Payable with role sars-4102, tagged to an employee, counts in EMP201 and EMP501 and on that employee's IRP5. Send \"$delete\" to clear it; omit it or send null to leave it alone. Needs payroll access: without it the write is refused, as is any change to a journal that already names an employee.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"Optional. The currency this line's foreign amount is in. A line on a foreign-currency account takes the account's own; name one on a rand account only for an amount owed in another currency, such as a euro receivable.","oneOf":[{"type":"string"},{"type":"null"}]},"foreignamount":{"description":"Optional. The line's amount in that currency, positive, as booked: €1,250.00 of a R25,060.00 line. Kept as written and never converted again. Omitted on a foreign-currency account, stub works it out at the business's closing rate for the day, else its daily rate.","oneOf":[{"type":"number"},{"type":"null"}]},"exchangerate":{"description":"Optional. Base currency per ONE unit of that currency, as booked (20.0480 rand per euro). Omitted, it is the line's rand amount over its foreign amount.","oneOf":[{"type":"number"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]},"items":{"description":"Vector of journal entry objects to create/update in one all-or-nothing batch. Preferred over repeated calls. Each item with an id updates; each without creates.","type":"array","items":{"type":"object","properties":{"id":{"description":"Journal entry id. Present → update; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Description of the journal entry.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Total amount of the journal entry.","oneOf":[{"type":"number"},{"type":"null"}]},"date":{"description":"Journal entry date (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"opening":{"description":"Whether this is an opening balance entry.","oneOf":[{"type":"boolean"},{"type":"null"}]},"lines":{"description":"Journal lines. Each line debits or credits one account; total debits must equal total credits.","oneOf":[{"type":"array","items":{"type":"object","properties":{"accountid":{"description":"Chart-of-accounts account id for this line (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"debit":{"description":"Debit amount for this line (0 if this is a credit line).","oneOf":[{"type":"number"},{"type":"null"}]},"credit":{"description":"Credit amount for this line (0 if this is a debit line).","oneOf":[{"type":"number"},{"type":"null"}]},"role":{"description":"Optional line role: what the amount is (e.g. sars-3601), set by the producer. Lowercase letters, digits and hyphens, at most 64 characters. Send \"$delete\" to clear it; omit it to leave it alone.","oneOf":[{"type":"string"},{"type":"null"}]},"clientid":{"description":"PROD-2704. Optional: the customer (clientid) or supplier (supplierid) this line books to, at most one per line. It tags the line and adds no posting; the entry then shows on that contact's statement and balance. The id must be one of this business's clients or suppliers (see list_clients, list_suppliers). Send \"$delete\" to clear it; omit it or send null to leave it alone. Naming one kind clears the other.","oneOf":[{"type":"string"},{"type":"null"}]},"supplierid":{"description":"PROD-2704. Optional: the customer (clientid) or supplier (supplierid) this line books to, at most one per line. It tags the line and adds no posting; the entry then shows on that contact's statement and balance. The id must be one of this business's clients or suppliers (see list_clients, list_suppliers). Send \"$delete\" to clear it; omit it or send null to leave it alone. Naming one kind clears the other.","oneOf":[{"type":"string"},{"type":"null"}]},"employeeid":{"description":"PROD-3206. Optional: the employee this line books to, such as a PAYE correction (see list_employees). A line names one contact at most: a customer, a supplier or an employee. A line on PAYE Payable with role sars-4102, tagged to an employee, counts in EMP201 and EMP501 and on that employee's IRP5. Send \"$delete\" to clear it; omit it or send null to leave it alone. Needs payroll access: without it the write is refused, as is any change to a journal that already names an employee.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"Optional. The currency this line's foreign amount is in. A line on a foreign-currency account takes the account's own; name one on a rand account only for an amount owed in another currency, such as a euro receivable.","oneOf":[{"type":"string"},{"type":"null"}]},"foreignamount":{"description":"Optional. The line's amount in that currency, positive, as booked: €1,250.00 of a R25,060.00 line. Kept as written and never converted again. Omitted on a foreign-currency account, stub works it out at the business's closing rate for the day, else its daily rate.","oneOf":[{"type":"number"},{"type":"null"}]},"exchangerate":{"description":"Optional. Base currency per ONE unit of that currency, as booked (20.0480 rand per euro). Omitted, it is the line's rand amount over its foreign amount.","oneOf":[{"type":"number"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]}},"additionalProperties":false}}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Journal entry id. Present → update; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Description of the journal entry.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Total amount of the journal entry.","oneOf":[{"type":"number"},{"type":"null"}]},"date":{"description":"Journal entry date (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"opening":{"description":"Whether this is an opening balance entry.","oneOf":[{"type":"boolean"},{"type":"null"}]},"lines":{"description":"Journal lines. Each line debits or credits one account; total debits must equal total credits.","oneOf":[{"type":"array","items":{"type":"object","properties":{"accountid":{"description":"Chart-of-accounts account id for this line (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"debit":{"description":"Debit amount for this line (0 if this is a credit line).","oneOf":[{"type":"number"},{"type":"null"}]},"credit":{"description":"Credit amount for this line (0 if this is a debit line).","oneOf":[{"type":"number"},{"type":"null"}]},"role":{"description":"Optional line role: what the amount is (e.g. sars-3601), set by the producer. Lowercase letters, digits and hyphens, at most 64 characters. Send \"$delete\" to clear it; omit it to leave it alone.","oneOf":[{"type":"string"},{"type":"null"}]},"clientid":{"description":"PROD-2704. Optional: the customer (clientid) or supplier (supplierid) this line books to, at most one per line. It tags the line and adds no posting; the entry then shows on that contact's statement and balance. The id must be one of this business's clients or suppliers (see list_clients, list_suppliers). Send \"$delete\" to clear it; omit it or send null to leave it alone. Naming one kind clears the other.","oneOf":[{"type":"string"},{"type":"null"}]},"supplierid":{"description":"PROD-2704. Optional: the customer (clientid) or supplier (supplierid) this line books to, at most one per line. It tags the line and adds no posting; the entry then shows on that contact's statement and balance. The id must be one of this business's clients or suppliers (see list_clients, list_suppliers). Send \"$delete\" to clear it; omit it or send null to leave it alone. Naming one kind clears the other.","oneOf":[{"type":"string"},{"type":"null"}]},"employeeid":{"description":"PROD-3206. Optional: the employee this line books to, such as a PAYE correction (see list_employees). A line names one contact at most: a customer, a supplier or an employee. A line on PAYE Payable with role sars-4102, tagged to an employee, counts in EMP201 and EMP501 and on that employee's IRP5. Send \"$delete\" to clear it; omit it or send null to leave it alone. Needs payroll access: without it the write is refused, as is any change to a journal that already names an employee.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"Optional. The currency this line's foreign amount is in. A line on a foreign-currency account takes the account's own; name one on a rand account only for an amount owed in another currency, such as a euro receivable.","oneOf":[{"type":"string"},{"type":"null"}]},"foreignamount":{"description":"Optional. The line's amount in that currency, positive, as booked: €1,250.00 of a R25,060.00 line. Kept as written and never converted again. Omitted on a foreign-currency account, stub works it out at the business's closing rate for the day, else its daily rate.","oneOf":[{"type":"number"},{"type":"null"}]},"exchangerate":{"description":"Optional. Base currency per ONE unit of that currency, as booked (20.0480 rand per euro). Omitted, it is the line's rand amount over its foreign amount.","oneOf":[{"type":"number"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]},"items":{"description":"Vector of journal entry objects to create/update in one all-or-nothing batch. Preferred over repeated calls. Each item with an id updates; each without creates.","type":"array","items":{"type":"object","properties":{"id":{"description":"Journal entry id. Present → update; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Description of the journal entry.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Total amount of the journal entry.","oneOf":[{"type":"number"},{"type":"null"}]},"date":{"description":"Journal entry date (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"opening":{"description":"Whether this is an opening balance entry.","oneOf":[{"type":"boolean"},{"type":"null"}]},"lines":{"description":"Journal lines. Each line debits or credits one account; total debits must equal total credits.","oneOf":[{"type":"array","items":{"type":"object","properties":{"accountid":{"description":"Chart-of-accounts account id for this line (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"debit":{"description":"Debit amount for this line (0 if this is a credit line).","oneOf":[{"type":"number"},{"type":"null"}]},"credit":{"description":"Credit amount for this line (0 if this is a debit line).","oneOf":[{"type":"number"},{"type":"null"}]},"role":{"description":"Optional line role: what the amount is (e.g. sars-3601), set by the producer. Lowercase letters, digits and hyphens, at most 64 characters. Send \"$delete\" to clear it; omit it to leave it alone.","oneOf":[{"type":"string"},{"type":"null"}]},"clientid":{"description":"PROD-2704. Optional: the customer (clientid) or supplier (supplierid) this line books to, at most one per line. It tags the line and adds no posting; the entry then shows on that contact's statement and balance. The id must be one of this business's clients or suppliers (see list_clients, list_suppliers). Send \"$delete\" to clear it; omit it or send null to leave it alone. Naming one kind clears the other.","oneOf":[{"type":"string"},{"type":"null"}]},"supplierid":{"description":"PROD-2704. Optional: the customer (clientid) or supplier (supplierid) this line books to, at most one per line. It tags the line and adds no posting; the entry then shows on that contact's statement and balance. The id must be one of this business's clients or suppliers (see list_clients, list_suppliers). Send \"$delete\" to clear it; omit it or send null to leave it alone. Naming one kind clears the other.","oneOf":[{"type":"string"},{"type":"null"}]},"employeeid":{"description":"PROD-3206. Optional: the employee this line books to, such as a PAYE correction (see list_employees). A line names one contact at most: a customer, a supplier or an employee. A line on PAYE Payable with role sars-4102, tagged to an employee, counts in EMP201 and EMP501 and on that employee's IRP5. Send \"$delete\" to clear it; omit it or send null to leave it alone. Needs payroll access: without it the write is refused, as is any change to a journal that already names an employee.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"Optional. The currency this line's foreign amount is in. A line on a foreign-currency account takes the account's own; name one on a rand account only for an amount owed in another currency, such as a euro receivable.","oneOf":[{"type":"string"},{"type":"null"}]},"foreignamount":{"description":"Optional. The line's amount in that currency, positive, as booked: €1,250.00 of a R25,060.00 line. Kept as written and never converted again. Omitted on a foreign-currency account, stub works it out at the business's closing rate for the day, else its daily rate.","oneOf":[{"type":"number"},{"type":"null"}]},"exchangerate":{"description":"Optional. Base currency per ONE unit of that currency, as booked (20.0480 rand per euro). Omitted, it is the line's rand amount over its foreign amount.","oneOf":[{"type":"number"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]}},"additionalProperties":false}}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create or replace a WHOLE journal entry with all its lines; to fix one line on an existing entry use update_journal_line, and to add one use add_journal_line. Pass an `id` to update it; omit `id` to create a new one. Returns the new journal entry id on create. To create/update many at once, send an `items` array — one all-or-nothing transaction with a single ledger recompute; each item with an `id` updates, each without creates.","tags":["journal entry management"]}},"/api/entry/import-trial-balance":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"date":{"description":"The trial balance's date, YYYY-MM-DD: the day before the business starts its books on stub.","type":"string"},"name":{"description":"The journal's name; \"Opening Balance\" when omitted.","oneOf":[{"type":"string"},{"type":"null"}]},"lines":{"description":"One row per account with a balance, as the old package's trial balance lists it.","type":"array","items":{"type":"object","properties":{"account":{"description":"The account's id, or its name as the old package gives it (\"Parent:Child\" is fine).","type":"string"},"debit":{"oneOf":[{"type":"number"},{"type":"null"}]},"credit":{"oneOf":[{"type":"number"},{"type":"null"}]}},"required":["account"],"additionalProperties":false}}},"required":["token","date","lines"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"date":{"description":"The trial balance's date, YYYY-MM-DD: the day before the business starts its books on stub.","type":"string"},"name":{"description":"The journal's name; \"Opening Balance\" when omitted.","oneOf":[{"type":"string"},{"type":"null"}]},"lines":{"description":"One row per account with a balance, as the old package's trial balance lists it.","type":"array","items":{"type":"object","properties":{"account":{"description":"The account's id, or its name as the old package gives it (\"Parent:Child\" is fine).","type":"string"},"debit":{"oneOf":[{"type":"number"},{"type":"null"}]},"credit":{"oneOf":[{"type":"number"},{"type":"null"}]}},"required":["account"],"additionalProperties":false}}},"required":["token","date","lines"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"date":{"description":"The trial balance's date, YYYY-MM-DD: the day before the business starts its books on stub.","type":"string"},"name":{"description":"The journal's name; \"Opening Balance\" when omitted.","oneOf":[{"type":"string"},{"type":"null"}]},"lines":{"description":"One row per account with a balance, as the old package's trial balance lists it.","type":"array","items":{"type":"object","properties":{"account":{"description":"The account's id, or its name as the old package gives it (\"Parent:Child\" is fine).","type":"string"},"debit":{"oneOf":[{"type":"number"},{"type":"null"}]},"credit":{"oneOf":[{"type":"number"},{"type":"null"}]}},"required":["account"],"additionalProperties":false}}},"required":["token","date","lines"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"date":{"description":"The trial balance's date, YYYY-MM-DD: the day before the business starts its books on stub.","type":"string"},"name":{"description":"The journal's name; \"Opening Balance\" when omitted.","oneOf":[{"type":"string"},{"type":"null"}]},"lines":{"description":"One row per account with a balance, as the old package's trial balance lists it.","type":"array","items":{"type":"object","properties":{"account":{"description":"The account's id, or its name as the old package gives it (\"Parent:Child\" is fine).","type":"string"},"debit":{"oneOf":[{"type":"number"},{"type":"null"}]},"credit":{"oneOf":[{"type":"number"},{"type":"null"}]}},"required":["account"],"additionalProperties":false}}},"required":["token","date","lines"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Post a trial balance from another package (Xero, Sage, QuickBooks) as the business's opening balances: lines named by account id or name, zero lines dropped, and it becomes the take-on that bank lines before it are cut off at. Refused when the business already has opening balances or a line names no account. Prefer this to save_journal_entry for opening balances.","tags":["journal entry management"]}},"/api/entry/delete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the journal entry","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the journal entry","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the journal entry","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the journal entry","type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Permanently delete a MANUAL journal entry by id. Immediate and irreversible. Only works on manually-created entries (ids like `ent…`). Journal entries auto-generated from a source document (invoice, bill, income, expense — ids like `ent-1-inv…`, `ent-1-cont…`, `ent-1-exp…`) cannot be removed this way: delete the SOURCE document instead, and its journal entry is removed with it. Confirm with the user before deleting.","tags":["journal entry management"]}},"/api/entry/get-all":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"List the business's journal entries — each with its date, description, financial year, and debit/credit lines (accountid + amounts). Includes both manual entries and the ones auto-generated from source documents. Paginated.","tags":["journal entry management"]}},"/api/entry/line/add":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Line id (for updating an existing line).","oneOf":[{"type":"string"},{"type":"null"}]},"entryid":{"description":"Id of the parent journal entry this line belongs to.","oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"Chart-of-accounts account id for this line (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"debit":{"description":"Debit amount for this line (0 if this is a credit line).","oneOf":[{"type":"number"},{"type":"null"}]},"credit":{"description":"Credit amount for this line (0 if this is a debit line).","oneOf":[{"type":"number"},{"type":"null"}]},"role":{"description":"Optional line role: what the amount is (e.g. sars-3601), set by the producer. Lowercase letters, digits and hyphens, at most 64 characters. Send \"$delete\" to clear it; omit it to leave it alone.","oneOf":[{"type":"string"},{"type":"null"}]},"clientid":{"description":"PROD-2704. Optional: the customer (clientid) or supplier (supplierid) this line books to, at most one per line. It tags the line and adds no posting; the entry then shows on that contact's statement and balance. The id must be one of this business's clients or suppliers (see list_clients, list_suppliers). Send \"$delete\" to clear it; omit it or send null to leave it alone. Naming one kind clears the other.","oneOf":[{"type":"string"},{"type":"null"}]},"supplierid":{"description":"PROD-2704. Optional: the customer (clientid) or supplier (supplierid) this line books to, at most one per line. It tags the line and adds no posting; the entry then shows on that contact's statement and balance. The id must be one of this business's clients or suppliers (see list_clients, list_suppliers). Send \"$delete\" to clear it; omit it or send null to leave it alone. Naming one kind clears the other.","oneOf":[{"type":"string"},{"type":"null"}]},"employeeid":{"description":"PROD-3206. Optional: the employee this line books to, such as a PAYE correction (see list_employees). A line names one contact at most: a customer, a supplier or an employee. A line on PAYE Payable with role sars-4102, tagged to an employee, counts in EMP201 and EMP501 and on that employee's IRP5. Send \"$delete\" to clear it; omit it or send null to leave it alone. Needs payroll access: without it the write is refused, as is any change to a journal that already names an employee.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"Optional. The currency this line's foreign amount is in. A line on a foreign-currency account takes the account's own; name one on a rand account only for an amount owed in another currency, such as a euro receivable.","oneOf":[{"type":"string"},{"type":"null"}]},"foreignamount":{"description":"Optional. The line's amount in that currency, positive, as booked: €1,250.00 of a R25,060.00 line. Kept as written and never converted again. Omitted on a foreign-currency account, stub works it out at the business's closing rate for the day, else its daily rate.","oneOf":[{"type":"number"},{"type":"null"}]},"exchangerate":{"description":"Optional. Base currency per ONE unit of that currency, as booked (20.0480 rand per euro). Omitted, it is the line's rand amount over its foreign amount.","oneOf":[{"type":"number"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Line id (for updating an existing line).","oneOf":[{"type":"string"},{"type":"null"}]},"entryid":{"description":"Id of the parent journal entry this line belongs to.","oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"Chart-of-accounts account id for this line (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"debit":{"description":"Debit amount for this line (0 if this is a credit line).","oneOf":[{"type":"number"},{"type":"null"}]},"credit":{"description":"Credit amount for this line (0 if this is a debit line).","oneOf":[{"type":"number"},{"type":"null"}]},"role":{"description":"Optional line role: what the amount is (e.g. sars-3601), set by the producer. Lowercase letters, digits and hyphens, at most 64 characters. Send \"$delete\" to clear it; omit it to leave it alone.","oneOf":[{"type":"string"},{"type":"null"}]},"clientid":{"description":"PROD-2704. Optional: the customer (clientid) or supplier (supplierid) this line books to, at most one per line. It tags the line and adds no posting; the entry then shows on that contact's statement and balance. The id must be one of this business's clients or suppliers (see list_clients, list_suppliers). Send \"$delete\" to clear it; omit it or send null to leave it alone. Naming one kind clears the other.","oneOf":[{"type":"string"},{"type":"null"}]},"supplierid":{"description":"PROD-2704. Optional: the customer (clientid) or supplier (supplierid) this line books to, at most one per line. It tags the line and adds no posting; the entry then shows on that contact's statement and balance. The id must be one of this business's clients or suppliers (see list_clients, list_suppliers). Send \"$delete\" to clear it; omit it or send null to leave it alone. Naming one kind clears the other.","oneOf":[{"type":"string"},{"type":"null"}]},"employeeid":{"description":"PROD-3206. Optional: the employee this line books to, such as a PAYE correction (see list_employees). A line names one contact at most: a customer, a supplier or an employee. A line on PAYE Payable with role sars-4102, tagged to an employee, counts in EMP201 and EMP501 and on that employee's IRP5. Send \"$delete\" to clear it; omit it or send null to leave it alone. Needs payroll access: without it the write is refused, as is any change to a journal that already names an employee.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"Optional. The currency this line's foreign amount is in. A line on a foreign-currency account takes the account's own; name one on a rand account only for an amount owed in another currency, such as a euro receivable.","oneOf":[{"type":"string"},{"type":"null"}]},"foreignamount":{"description":"Optional. The line's amount in that currency, positive, as booked: €1,250.00 of a R25,060.00 line. Kept as written and never converted again. Omitted on a foreign-currency account, stub works it out at the business's closing rate for the day, else its daily rate.","oneOf":[{"type":"number"},{"type":"null"}]},"exchangerate":{"description":"Optional. Base currency per ONE unit of that currency, as booked (20.0480 rand per euro). Omitted, it is the line's rand amount over its foreign amount.","oneOf":[{"type":"number"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Line id (for updating an existing line).","oneOf":[{"type":"string"},{"type":"null"}]},"entryid":{"description":"Id of the parent journal entry this line belongs to.","oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"Chart-of-accounts account id for this line (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"debit":{"description":"Debit amount for this line (0 if this is a credit line).","oneOf":[{"type":"number"},{"type":"null"}]},"credit":{"description":"Credit amount for this line (0 if this is a debit line).","oneOf":[{"type":"number"},{"type":"null"}]},"role":{"description":"Optional line role: what the amount is (e.g. sars-3601), set by the producer. Lowercase letters, digits and hyphens, at most 64 characters. Send \"$delete\" to clear it; omit it to leave it alone.","oneOf":[{"type":"string"},{"type":"null"}]},"clientid":{"description":"PROD-2704. Optional: the customer (clientid) or supplier (supplierid) this line books to, at most one per line. It tags the line and adds no posting; the entry then shows on that contact's statement and balance. The id must be one of this business's clients or suppliers (see list_clients, list_suppliers). Send \"$delete\" to clear it; omit it or send null to leave it alone. Naming one kind clears the other.","oneOf":[{"type":"string"},{"type":"null"}]},"supplierid":{"description":"PROD-2704. Optional: the customer (clientid) or supplier (supplierid) this line books to, at most one per line. It tags the line and adds no posting; the entry then shows on that contact's statement and balance. The id must be one of this business's clients or suppliers (see list_clients, list_suppliers). Send \"$delete\" to clear it; omit it or send null to leave it alone. Naming one kind clears the other.","oneOf":[{"type":"string"},{"type":"null"}]},"employeeid":{"description":"PROD-3206. Optional: the employee this line books to, such as a PAYE correction (see list_employees). A line names one contact at most: a customer, a supplier or an employee. A line on PAYE Payable with role sars-4102, tagged to an employee, counts in EMP201 and EMP501 and on that employee's IRP5. Send \"$delete\" to clear it; omit it or send null to leave it alone. Needs payroll access: without it the write is refused, as is any change to a journal that already names an employee.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"Optional. The currency this line's foreign amount is in. A line on a foreign-currency account takes the account's own; name one on a rand account only for an amount owed in another currency, such as a euro receivable.","oneOf":[{"type":"string"},{"type":"null"}]},"foreignamount":{"description":"Optional. The line's amount in that currency, positive, as booked: €1,250.00 of a R25,060.00 line. Kept as written and never converted again. Omitted on a foreign-currency account, stub works it out at the business's closing rate for the day, else its daily rate.","oneOf":[{"type":"number"},{"type":"null"}]},"exchangerate":{"description":"Optional. Base currency per ONE unit of that currency, as booked (20.0480 rand per euro). Omitted, it is the line's rand amount over its foreign amount.","oneOf":[{"type":"number"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Line id (for updating an existing line).","oneOf":[{"type":"string"},{"type":"null"}]},"entryid":{"description":"Id of the parent journal entry this line belongs to.","oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"Chart-of-accounts account id for this line (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"debit":{"description":"Debit amount for this line (0 if this is a credit line).","oneOf":[{"type":"number"},{"type":"null"}]},"credit":{"description":"Credit amount for this line (0 if this is a debit line).","oneOf":[{"type":"number"},{"type":"null"}]},"role":{"description":"Optional line role: what the amount is (e.g. sars-3601), set by the producer. Lowercase letters, digits and hyphens, at most 64 characters. Send \"$delete\" to clear it; omit it to leave it alone.","oneOf":[{"type":"string"},{"type":"null"}]},"clientid":{"description":"PROD-2704. Optional: the customer (clientid) or supplier (supplierid) this line books to, at most one per line. It tags the line and adds no posting; the entry then shows on that contact's statement and balance. The id must be one of this business's clients or suppliers (see list_clients, list_suppliers). Send \"$delete\" to clear it; omit it or send null to leave it alone. Naming one kind clears the other.","oneOf":[{"type":"string"},{"type":"null"}]},"supplierid":{"description":"PROD-2704. Optional: the customer (clientid) or supplier (supplierid) this line books to, at most one per line. It tags the line and adds no posting; the entry then shows on that contact's statement and balance. The id must be one of this business's clients or suppliers (see list_clients, list_suppliers). Send \"$delete\" to clear it; omit it or send null to leave it alone. Naming one kind clears the other.","oneOf":[{"type":"string"},{"type":"null"}]},"employeeid":{"description":"PROD-3206. Optional: the employee this line books to, such as a PAYE correction (see list_employees). A line names one contact at most: a customer, a supplier or an employee. A line on PAYE Payable with role sars-4102, tagged to an employee, counts in EMP201 and EMP501 and on that employee's IRP5. Send \"$delete\" to clear it; omit it or send null to leave it alone. Needs payroll access: without it the write is refused, as is any change to a journal that already names an employee.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"Optional. The currency this line's foreign amount is in. A line on a foreign-currency account takes the account's own; name one on a rand account only for an amount owed in another currency, such as a euro receivable.","oneOf":[{"type":"string"},{"type":"null"}]},"foreignamount":{"description":"Optional. The line's amount in that currency, positive, as booked: €1,250.00 of a R25,060.00 line. Kept as written and never converted again. Omitted on a foreign-currency account, stub works it out at the business's closing rate for the day, else its daily rate.","oneOf":[{"type":"number"},{"type":"null"}]},"exchangerate":{"description":"Optional. Base currency per ONE unit of that currency, as booked (20.0480 rand per euro). Omitted, it is the line's rand amount over its foreign amount.","oneOf":[{"type":"number"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Add ONE debit or credit line to an EXISTING journal entry; to create a whole new entry use save_journal_entry, and to change a line already there use update_journal_line.","tags":["journal entry management"]}},"/api/entry/line/update":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Line id (for updating an existing line).","oneOf":[{"type":"string"},{"type":"null"}]},"entryid":{"description":"Id of the parent journal entry this line belongs to.","oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"Chart-of-accounts account id for this line (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"debit":{"description":"Debit amount for this line (0 if this is a credit line).","oneOf":[{"type":"number"},{"type":"null"}]},"credit":{"description":"Credit amount for this line (0 if this is a debit line).","oneOf":[{"type":"number"},{"type":"null"}]},"role":{"description":"Optional line role: what the amount is (e.g. sars-3601), set by the producer. Lowercase letters, digits and hyphens, at most 64 characters. Send \"$delete\" to clear it; omit it to leave it alone.","oneOf":[{"type":"string"},{"type":"null"}]},"clientid":{"description":"PROD-2704. Optional: the customer (clientid) or supplier (supplierid) this line books to, at most one per line. It tags the line and adds no posting; the entry then shows on that contact's statement and balance. The id must be one of this business's clients or suppliers (see list_clients, list_suppliers). Send \"$delete\" to clear it; omit it or send null to leave it alone. Naming one kind clears the other.","oneOf":[{"type":"string"},{"type":"null"}]},"supplierid":{"description":"PROD-2704. Optional: the customer (clientid) or supplier (supplierid) this line books to, at most one per line. It tags the line and adds no posting; the entry then shows on that contact's statement and balance. The id must be one of this business's clients or suppliers (see list_clients, list_suppliers). Send \"$delete\" to clear it; omit it or send null to leave it alone. Naming one kind clears the other.","oneOf":[{"type":"string"},{"type":"null"}]},"employeeid":{"description":"PROD-3206. Optional: the employee this line books to, such as a PAYE correction (see list_employees). A line names one contact at most: a customer, a supplier or an employee. A line on PAYE Payable with role sars-4102, tagged to an employee, counts in EMP201 and EMP501 and on that employee's IRP5. Send \"$delete\" to clear it; omit it or send null to leave it alone. Needs payroll access: without it the write is refused, as is any change to a journal that already names an employee.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"Optional. The currency this line's foreign amount is in. A line on a foreign-currency account takes the account's own; name one on a rand account only for an amount owed in another currency, such as a euro receivable.","oneOf":[{"type":"string"},{"type":"null"}]},"foreignamount":{"description":"Optional. The line's amount in that currency, positive, as booked: €1,250.00 of a R25,060.00 line. Kept as written and never converted again. Omitted on a foreign-currency account, stub works it out at the business's closing rate for the day, else its daily rate.","oneOf":[{"type":"number"},{"type":"null"}]},"exchangerate":{"description":"Optional. Base currency per ONE unit of that currency, as booked (20.0480 rand per euro). Omitted, it is the line's rand amount over its foreign amount.","oneOf":[{"type":"number"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Line id (for updating an existing line).","oneOf":[{"type":"string"},{"type":"null"}]},"entryid":{"description":"Id of the parent journal entry this line belongs to.","oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"Chart-of-accounts account id for this line (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"debit":{"description":"Debit amount for this line (0 if this is a credit line).","oneOf":[{"type":"number"},{"type":"null"}]},"credit":{"description":"Credit amount for this line (0 if this is a debit line).","oneOf":[{"type":"number"},{"type":"null"}]},"role":{"description":"Optional line role: what the amount is (e.g. sars-3601), set by the producer. Lowercase letters, digits and hyphens, at most 64 characters. Send \"$delete\" to clear it; omit it to leave it alone.","oneOf":[{"type":"string"},{"type":"null"}]},"clientid":{"description":"PROD-2704. Optional: the customer (clientid) or supplier (supplierid) this line books to, at most one per line. It tags the line and adds no posting; the entry then shows on that contact's statement and balance. The id must be one of this business's clients or suppliers (see list_clients, list_suppliers). Send \"$delete\" to clear it; omit it or send null to leave it alone. Naming one kind clears the other.","oneOf":[{"type":"string"},{"type":"null"}]},"supplierid":{"description":"PROD-2704. Optional: the customer (clientid) or supplier (supplierid) this line books to, at most one per line. It tags the line and adds no posting; the entry then shows on that contact's statement and balance. The id must be one of this business's clients or suppliers (see list_clients, list_suppliers). Send \"$delete\" to clear it; omit it or send null to leave it alone. Naming one kind clears the other.","oneOf":[{"type":"string"},{"type":"null"}]},"employeeid":{"description":"PROD-3206. Optional: the employee this line books to, such as a PAYE correction (see list_employees). A line names one contact at most: a customer, a supplier or an employee. A line on PAYE Payable with role sars-4102, tagged to an employee, counts in EMP201 and EMP501 and on that employee's IRP5. Send \"$delete\" to clear it; omit it or send null to leave it alone. Needs payroll access: without it the write is refused, as is any change to a journal that already names an employee.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"Optional. The currency this line's foreign amount is in. A line on a foreign-currency account takes the account's own; name one on a rand account only for an amount owed in another currency, such as a euro receivable.","oneOf":[{"type":"string"},{"type":"null"}]},"foreignamount":{"description":"Optional. The line's amount in that currency, positive, as booked: €1,250.00 of a R25,060.00 line. Kept as written and never converted again. Omitted on a foreign-currency account, stub works it out at the business's closing rate for the day, else its daily rate.","oneOf":[{"type":"number"},{"type":"null"}]},"exchangerate":{"description":"Optional. Base currency per ONE unit of that currency, as booked (20.0480 rand per euro). Omitted, it is the line's rand amount over its foreign amount.","oneOf":[{"type":"number"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Line id (for updating an existing line).","oneOf":[{"type":"string"},{"type":"null"}]},"entryid":{"description":"Id of the parent journal entry this line belongs to.","oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"Chart-of-accounts account id for this line (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"debit":{"description":"Debit amount for this line (0 if this is a credit line).","oneOf":[{"type":"number"},{"type":"null"}]},"credit":{"description":"Credit amount for this line (0 if this is a debit line).","oneOf":[{"type":"number"},{"type":"null"}]},"role":{"description":"Optional line role: what the amount is (e.g. sars-3601), set by the producer. Lowercase letters, digits and hyphens, at most 64 characters. Send \"$delete\" to clear it; omit it to leave it alone.","oneOf":[{"type":"string"},{"type":"null"}]},"clientid":{"description":"PROD-2704. Optional: the customer (clientid) or supplier (supplierid) this line books to, at most one per line. It tags the line and adds no posting; the entry then shows on that contact's statement and balance. The id must be one of this business's clients or suppliers (see list_clients, list_suppliers). Send \"$delete\" to clear it; omit it or send null to leave it alone. Naming one kind clears the other.","oneOf":[{"type":"string"},{"type":"null"}]},"supplierid":{"description":"PROD-2704. Optional: the customer (clientid) or supplier (supplierid) this line books to, at most one per line. It tags the line and adds no posting; the entry then shows on that contact's statement and balance. The id must be one of this business's clients or suppliers (see list_clients, list_suppliers). Send \"$delete\" to clear it; omit it or send null to leave it alone. Naming one kind clears the other.","oneOf":[{"type":"string"},{"type":"null"}]},"employeeid":{"description":"PROD-3206. Optional: the employee this line books to, such as a PAYE correction (see list_employees). A line names one contact at most: a customer, a supplier or an employee. A line on PAYE Payable with role sars-4102, tagged to an employee, counts in EMP201 and EMP501 and on that employee's IRP5. Send \"$delete\" to clear it; omit it or send null to leave it alone. Needs payroll access: without it the write is refused, as is any change to a journal that already names an employee.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"Optional. The currency this line's foreign amount is in. A line on a foreign-currency account takes the account's own; name one on a rand account only for an amount owed in another currency, such as a euro receivable.","oneOf":[{"type":"string"},{"type":"null"}]},"foreignamount":{"description":"Optional. The line's amount in that currency, positive, as booked: €1,250.00 of a R25,060.00 line. Kept as written and never converted again. Omitted on a foreign-currency account, stub works it out at the business's closing rate for the day, else its daily rate.","oneOf":[{"type":"number"},{"type":"null"}]},"exchangerate":{"description":"Optional. Base currency per ONE unit of that currency, as booked (20.0480 rand per euro). Omitted, it is the line's rand amount over its foreign amount.","oneOf":[{"type":"number"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Line id (for updating an existing line).","oneOf":[{"type":"string"},{"type":"null"}]},"entryid":{"description":"Id of the parent journal entry this line belongs to.","oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"Chart-of-accounts account id for this line (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"debit":{"description":"Debit amount for this line (0 if this is a credit line).","oneOf":[{"type":"number"},{"type":"null"}]},"credit":{"description":"Credit amount for this line (0 if this is a debit line).","oneOf":[{"type":"number"},{"type":"null"}]},"role":{"description":"Optional line role: what the amount is (e.g. sars-3601), set by the producer. Lowercase letters, digits and hyphens, at most 64 characters. Send \"$delete\" to clear it; omit it to leave it alone.","oneOf":[{"type":"string"},{"type":"null"}]},"clientid":{"description":"PROD-2704. Optional: the customer (clientid) or supplier (supplierid) this line books to, at most one per line. It tags the line and adds no posting; the entry then shows on that contact's statement and balance. The id must be one of this business's clients or suppliers (see list_clients, list_suppliers). Send \"$delete\" to clear it; omit it or send null to leave it alone. Naming one kind clears the other.","oneOf":[{"type":"string"},{"type":"null"}]},"supplierid":{"description":"PROD-2704. Optional: the customer (clientid) or supplier (supplierid) this line books to, at most one per line. It tags the line and adds no posting; the entry then shows on that contact's statement and balance. The id must be one of this business's clients or suppliers (see list_clients, list_suppliers). Send \"$delete\" to clear it; omit it or send null to leave it alone. Naming one kind clears the other.","oneOf":[{"type":"string"},{"type":"null"}]},"employeeid":{"description":"PROD-3206. Optional: the employee this line books to, such as a PAYE correction (see list_employees). A line names one contact at most: a customer, a supplier or an employee. A line on PAYE Payable with role sars-4102, tagged to an employee, counts in EMP201 and EMP501 and on that employee's IRP5. Send \"$delete\" to clear it; omit it or send null to leave it alone. Needs payroll access: without it the write is refused, as is any change to a journal that already names an employee.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"Optional. The currency this line's foreign amount is in. A line on a foreign-currency account takes the account's own; name one on a rand account only for an amount owed in another currency, such as a euro receivable.","oneOf":[{"type":"string"},{"type":"null"}]},"foreignamount":{"description":"Optional. The line's amount in that currency, positive, as booked: €1,250.00 of a R25,060.00 line. Kept as written and never converted again. Omitted on a foreign-currency account, stub works it out at the business's closing rate for the day, else its daily rate.","oneOf":[{"type":"number"},{"type":"null"}]},"exchangerate":{"description":"Optional. Base currency per ONE unit of that currency, as booked (20.0480 rand per euro). Omitted, it is the line's rand amount over its foreign amount.","oneOf":[{"type":"number"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Change ONE debit or credit line of an existing journal entry in place; to rewrite the whole entry use save_journal_entry, and to add a line use add_journal_line. Changes its account, debit or credit amount; identify the line by its id.","tags":["journal entry management"]}},"/api/entry/line/delete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the journal entry line to delete","oneOf":[{"type":"string"},{"type":"null"}]},"_id":{"description":"Alternative internal ID for the line","oneOf":[{"type":"number"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the journal entry line to delete","oneOf":[{"type":"string"},{"type":"null"}]},"_id":{"description":"Alternative internal ID for the line","oneOf":[{"type":"number"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the journal entry line to delete","oneOf":[{"type":"string"},{"type":"null"}]},"_id":{"description":"Alternative internal ID for the line","oneOf":[{"type":"number"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the journal entry line to delete","oneOf":[{"type":"string"},{"type":"null"}]},"_id":{"description":"Alternative internal ID for the line","oneOf":[{"type":"number"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Delete line from journal entry","tags":["journal entry management"]}},"/api/snapshot/create":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"date":{"description":"Inclusive as-of date (YYYY-MM-DD) — the books up to and including this date are frozen, e.g. a financial year end or VAT period end.","type":"string"},"reason":{"description":"Why the snapshot was taken, e.g. \"ITR14 FY2026\" or \"VAT201 2026-07\".","oneOf":[{"type":"string"},{"type":"null"}]},"preview":{"description":"true = compute the window, trial balance, imbalance and warnings WITHOUT freezing anything — for the confirm step. Always preview before creating.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","date"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"date":{"description":"Inclusive as-of date (YYYY-MM-DD) — the books up to and including this date are frozen, e.g. a financial year end or VAT period end.","type":"string"},"reason":{"description":"Why the snapshot was taken, e.g. \"ITR14 FY2026\" or \"VAT201 2026-07\".","oneOf":[{"type":"string"},{"type":"null"}]},"preview":{"description":"true = compute the window, trial balance, imbalance and warnings WITHOUT freezing anything — for the confirm step. Always preview before creating.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","date"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"date":{"description":"Inclusive as-of date (YYYY-MM-DD) — the books up to and including this date are frozen, e.g. a financial year end or VAT period end.","type":"string"},"reason":{"description":"Why the snapshot was taken, e.g. \"ITR14 FY2026\" or \"VAT201 2026-07\".","oneOf":[{"type":"string"},{"type":"null"}]},"preview":{"description":"true = compute the window, trial balance, imbalance and warnings WITHOUT freezing anything — for the confirm step. Always preview before creating.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","date"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"date":{"description":"Inclusive as-of date (YYYY-MM-DD) — the books up to and including this date are frozen, e.g. a financial year end or VAT period end.","type":"string"},"reason":{"description":"Why the snapshot was taken, e.g. \"ITR14 FY2026\" or \"VAT201 2026-07\".","oneOf":[{"type":"string"},{"type":"null"}]},"preview":{"description":"true = compute the window, trial balance, imbalance and warnings WITHOUT freezing anything — for the confirm step. Always preview before creating.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","date"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Freeze the books as at a date (inclusive). The trial balance at that date becomes the opening balances going forward and the exact entry listing is kept as an immutable audit record. Snapshotting the same date again creates a new revision (a re-close); a later date chains a new baseline. Confirm with the user before creating one — it re-baselines their books.","tags":["books snapshots"]}},"/api/snapshot/get-all":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"List the business's books snapshots — as-of date, revision, status (active/superseded), reason, entry count, and the frozen per-account trial balance.","tags":["books snapshots"]}},"/api/snapshot/entries":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the books snapshot","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the books snapshot","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the books snapshot","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the books snapshot","type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"The exact journal entry listing a snapshot froze — what the business filed from — integrity-verified against the snapshot's stored hash before serving.","tags":["books snapshots"]}},"/api/snapshot/source":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the books snapshot","type":"string"},"types":{"description":"Optional subset of document collections to return: income, expenses, invoices, entries, assets, loans, contracts. Omit for all.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the books snapshot","type":"string"},"types":{"description":"Optional subset of document collections to return: income, expenses, invoices, entries, assets, loans, contracts. Omit for all.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the books snapshot","type":"string"},"types":{"description":"Optional subset of document collections to return: income, expenses, invoices, entries, assets, loans, contracts. Omit for all.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the books snapshot","type":"string"},"types":{"description":"Optional subset of document collections to return: income, expenses, invoices, entries, assets, loans, contracts. Omit for all.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"The source documents behind a snapshot — income, expenses, invoices, journal entries, assets, loans, contracts — exactly as they stood when the books were frozen, served from the database's own history (as-of the capture point). Later edits are invisible, later deletions still present. Includes the chart of accounts and sales taxes as at capture. Pass `types` to narrow collections.","tags":["books snapshots"]}},"/api/snapshot/taxflow":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the books snapshot","type":"string"},"periodStart":{"description":"Optional period start (YYYY-MM-DD) inside the snapshot's frozen window. Defaults to the window start.","oneOf":[{"type":"string"},{"type":"null"}]},"periodEnd":{"description":"Optional inclusive period end (YYYY-MM-DD) inside the snapshot's frozen window. Defaults to the as-of date.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the books snapshot","type":"string"},"periodStart":{"description":"Optional period start (YYYY-MM-DD) inside the snapshot's frozen window. Defaults to the window start.","oneOf":[{"type":"string"},{"type":"null"}]},"periodEnd":{"description":"Optional inclusive period end (YYYY-MM-DD) inside the snapshot's frozen window. Defaults to the as-of date.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the books snapshot","type":"string"},"periodStart":{"description":"Optional period start (YYYY-MM-DD) inside the snapshot's frozen window. Defaults to the window start.","oneOf":[{"type":"string"},{"type":"null"}]},"periodEnd":{"description":"Optional inclusive period end (YYYY-MM-DD) inside the snapshot's frozen window. Defaults to the as-of date.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the books snapshot","type":"string"},"periodStart":{"description":"Optional period start (YYYY-MM-DD) inside the snapshot's frozen window. Defaults to the window start.","oneOf":[{"type":"string"},{"type":"null"}]},"periodEnd":{"description":"Optional inclusive period end (YYYY-MM-DD) inside the snapshot's frozen window. Defaults to the as-of date.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"The tax-relevant flow of a snapshot period, computed from the FROZEN entry listing (hash-verified, immutable): the entries that moved sales tax, each with its signed movement and per-account breakdown, plus output/input/net totals. The salestax→account mapping is resolved as at capture, so later re-mapping never re-classifies a filed period. Pass periodStart/periodEnd to slice a sub-period (a VAT month inside a year-end snapshot); the period must sit inside the snapshot's frozen window.","tags":["books snapshots"]}},"/api/snapshot/carryforward":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the books snapshot","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the books snapshot","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the books snapshot","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the books snapshot","type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Resolve a snapshot's drift the accountant's way: post ONE adjustment entry in the current period equal to the unresolved per-account drift, so corrections made to the frozen period take effect going forward while the filed books stay untouched. The entry is dated today (never inside the snapshot's period), stays editable, and the drift check nets it out — running this again with no new drift is refused. Confirm with the user before posting.","tags":["books snapshots"]}},"/api/snapshot/delete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the books snapshot","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the books snapshot","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the books snapshot","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the books snapshot","type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Roll back the ACTIVE books snapshot into the bin (soft-delete — recoverable, nothing destroyed): the snapshot, its opening-balance entry, and its carry-forward adjustments are binned, and the previous snapshot (if any) becomes the active baseline again. Only the newest snapshot can be rolled back; unwind a chain newest-first. Confirm with the user before rolling back — it re-baselines their books.","tags":["books snapshots"]}},"/api/snapshot/changes":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the books snapshot","type":"string"},"types":{"description":"Optional subset of document collections to return: income, expenses, invoices, entries, assets, loans, contracts. Omit for all.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the books snapshot","type":"string"},"types":{"description":"Optional subset of document collections to return: income, expenses, invoices, entries, assets, loans, contracts. Omit for all.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the books snapshot","type":"string"},"types":{"description":"Optional subset of document collections to return: income, expenses, invoices, entries, assets, loans, contracts. Omit for all.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the books snapshot","type":"string"},"types":{"description":"Optional subset of document collections to return: income, expenses, invoices, entries, assets, loans, contracts. Omit for all.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Which documents inside a snapshot's period were edited, added or removed since it was taken — the document-level companion to the drift check. Edited items carry per-field was/now diffs; added and removed items say whether the document was created/deleted or merely dated into/out of the period. Pass `types` to narrow collections.","tags":["books snapshots"]}},"/api/snapshot/drift":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the books snapshot","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the books snapshot","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the books snapshot","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the books snapshot","type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Compare a snapshot's frozen trial balance against what the books produce for the same period today. Non-empty differences mean the period was edited (or pre-cut documents arrived) after it was filed — resolve by posting an adjustment in the open period, or by re-snapshotting to restate.","tags":["books snapshots"]}},"/api/lockedperiod/create":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"date":{"description":"Inclusive end date (YYYY-MM-DD). The period runs from the latest locked period's end, or from the opening-balance date for the first one.","type":"string"},"reason":{"description":"Why the period was locked, e.g. \"VAT201 2026-07\".","oneOf":[{"type":"string"},{"type":"null"}]},"preview":{"description":"true = return the window and trial balance WITHOUT locking anything, for the confirm step.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","date"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"date":{"description":"Inclusive end date (YYYY-MM-DD). The period runs from the latest locked period's end, or from the opening-balance date for the first one.","type":"string"},"reason":{"description":"Why the period was locked, e.g. \"VAT201 2026-07\".","oneOf":[{"type":"string"},{"type":"null"}]},"preview":{"description":"true = return the window and trial balance WITHOUT locking anything, for the confirm step.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","date"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"date":{"description":"Inclusive end date (YYYY-MM-DD). The period runs from the latest locked period's end, or from the opening-balance date for the first one.","type":"string"},"reason":{"description":"Why the period was locked, e.g. \"VAT201 2026-07\".","oneOf":[{"type":"string"},{"type":"null"}]},"preview":{"description":"true = return the window and trial balance WITHOUT locking anything, for the confirm step.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","date"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"date":{"description":"Inclusive end date (YYYY-MM-DD). The period runs from the latest locked period's end, or from the opening-balance date for the first one.","type":"string"},"reason":{"description":"Why the period was locked, e.g. \"VAT201 2026-07\".","oneOf":[{"type":"string"},{"type":"null"}]},"preview":{"description":"true = return the window and trial balance WITHOUT locking anything, for the confirm step.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","date"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Lock the books up to an end date (inclusive). Later changes to documents dated in the period show as pending instead of changing the locked figures.","tags":["locked periods"]}},"/api/lockedperiod/get-all":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"List the business's locked periods, newest first. A locked period freezes the books up to its end date: later changes to documents dated inside it wait as pending instead of moving the reported figures. Each period has its dates, reason, status, and how many changes wait as pending (added, edited, removed); the documents behind them are on the locked-periods page.","tags":["locked periods"]}},"/api/lockedperiod/pending":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Documents in a locked period that changed after it was locked, with the posted and live postings and the difference per account.","tags":["locked periods"]}},"/api/lockedperiod/items":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the locked period","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the locked period","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the locked period","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the locked period","type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"What one locked period holds that changed after it was locked, as {items}: each with its name, date, change, status, total and the locked, current and changed net per account.","tags":["locked periods"]}},"/api/lockedperiod/item":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"sourceid":{"description":"ID of the document: the income, expense, journal, invoice or asset","type":"string"},"periodid":{"description":"The locked period to read it in. Omitted: its pending period, else the earliest.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","sourceid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"sourceid":{"description":"ID of the document: the income, expense, journal, invoice or asset","type":"string"},"periodid":{"description":"The locked period to read it in. Omitted: its pending period, else the earliest.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","sourceid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"sourceid":{"description":"ID of the document: the income, expense, journal, invoice or asset","type":"string"},"periodid":{"description":"The locked period to read it in. Omitted: its pending period, else the earliest.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","sourceid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"sourceid":{"description":"ID of the document: the income, expense, journal, invoice or asset","type":"string"},"periodid":{"description":"The locked period to read it in. Omitted: its pending period, else the earliest.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","sourceid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"The change one document made to a locked period, for the resolver: {item, firstopendate}, plus the journal as entry for a manual journal. {error, notfound} when nothing is waiting.","tags":["locked periods"]}},"/api/lockedperiod/resolve":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"periodid":{"description":"The locked period the documents changed in","type":"string"},"sourceids":{"description":"The documents to decide, each pending in that period","type":"array","items":{"type":"string"}},"method":{"description":"\"restate\": the period's books take the documents as they are now (needs reason). \"post\": the period stays as locked and each change posts as an adjustment journal on date.","type":"string"},"date":{"description":"post only: the open date (YYYY-MM-DD) to post on. Omitted: the first open date.","oneOf":[{"type":"string"},{"type":"null"}]},"reason":{"description":"restate only, required there: why the locked period's books are changing.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","periodid","sourceids","method"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"periodid":{"description":"The locked period the documents changed in","type":"string"},"sourceids":{"description":"The documents to decide, each pending in that period","type":"array","items":{"type":"string"}},"method":{"description":"\"restate\": the period's books take the documents as they are now (needs reason). \"post\": the period stays as locked and each change posts as an adjustment journal on date.","type":"string"},"date":{"description":"post only: the open date (YYYY-MM-DD) to post on. Omitted: the first open date.","oneOf":[{"type":"string"},{"type":"null"}]},"reason":{"description":"restate only, required there: why the locked period's books are changing.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","periodid","sourceids","method"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"periodid":{"description":"The locked period the documents changed in","type":"string"},"sourceids":{"description":"The documents to decide, each pending in that period","type":"array","items":{"type":"string"}},"method":{"description":"\"restate\": the period's books take the documents as they are now (needs reason). \"post\": the period stays as locked and each change posts as an adjustment journal on date.","type":"string"},"date":{"description":"post only: the open date (YYYY-MM-DD) to post on. Omitted: the first open date.","oneOf":[{"type":"string"},{"type":"null"}]},"reason":{"description":"restate only, required there: why the locked period's books are changing.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","periodid","sourceids","method"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"periodid":{"description":"The locked period the documents changed in","type":"string"},"sourceids":{"description":"The documents to decide, each pending in that period","type":"array","items":{"type":"string"}},"method":{"description":"\"restate\": the period's books take the documents as they are now (needs reason). \"post\": the period stays as locked and each change posts as an adjustment journal on date.","type":"string"},"date":{"description":"post only: the open date (YYYY-MM-DD) to post on. Omitted: the first open date.","oneOf":[{"type":"string"},{"type":"null"}]},"reason":{"description":"restate only, required there: why the locked period's books are changing.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","periodid","sourceids","method"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Decide what changes in a locked period do: restate the period's books, or post each change as an adjustment on an open date. Returns {resolutions}.","tags":["locked periods"]}},"/api/lockedperiod/unresolve":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"resolutionid":{"description":"The decision to undo","type":"string"}},"required":["token","resolutionid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"resolutionid":{"description":"The decision to undo","type":"string"}},"required":["token","resolutionid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"resolutionid":{"description":"The decision to undo","type":"string"}},"required":["token","resolutionid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"resolutionid":{"description":"The decision to undo","type":"string"}},"required":["token","resolutionid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Undo one decision: it and its adjustment journal go to the bin, and the change waits again. Refused when the adjustment's date is locked now.","tags":["locked periods"]}},"/api/lockedperiod/carryforward":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the locked period","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the locked period","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the locked period","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the locked period","type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Carry every waiting change in a locked period forward to the first open date, one adjustment journal each. Returns {count, resolutions}.","tags":["locked periods"]}},"/api/lockedperiod/delete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the locked period","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the locked period","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the locked period","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the locked period","type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Unlock the latest locked period, undoing every decision on it. Only the latest can be unlocked.","tags":["locked periods"]}},"/api/onboarding/priorities":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"priorities":{"description":"The picked group ids, in the order picked: admin payroll paid chase reports vat.","type":"array","items":{"type":"string"}}},"required":["token","priorities"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"priorities":{"description":"The picked group ids, in the order picked: admin payroll paid chase reports vat.","type":"array","items":{"type":"string"}}},"required":["token","priorities"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"priorities":{"description":"The picked group ids, in the order picked: admin payroll paid chase reports vat.","type":"array","items":{"type":"string"}}},"required":["token","priorities"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"priorities":{"description":"The picked group ids, in the order picked: admin payroll paid chase reports vat.","type":"array","items":{"type":"string"}}},"required":["token","priorities"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Keep what is top of mind for the business and open the welcome chat. Returns {chatid}.","tags":["onboarding"]}},"/api/onboarding/later":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Remind me later: no prompt for this business for a week. Returns {promptafter}.","tags":["onboarding"]}},"/api/onboarding/about":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"chatid":{"description":"The opening chat","type":"string"},"text":{"description":"What she said about her business","type":"string"},"tour":{"description":"The app has the tour on offer: ask whether she wants it first","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","chatid","text"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"chatid":{"description":"The opening chat","type":"string"},"text":{"description":"What she said about her business","type":"string"},"tour":{"description":"The app has the tour on offer: ask whether she wants it first","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","chatid","text"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"chatid":{"description":"The opening chat","type":"string"},"text":{"description":"What she said about her business","type":"string"},"tour":{"description":"The app has the tour on offer: ask whether she wants it first","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","chatid","text"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"chatid":{"description":"The opening chat","type":"string"},"text":{"description":"What she said about her business","type":"string"},"tour":{"description":"The app has the tour on offer: ask whether she wants it first","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","chatid","text"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Her answer to the welcome chat: kept as what the business does, then the tour offer or the canned walk-through. Returns {turns}.","tags":["onboarding"]}},"/api/onboarding/tour-choice":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"chatid":{"description":"The opening chat","type":"string"},"choice":{"description":"Take a tour, Bring my books over, or Jump straight in","type":"string"}},"required":["token","chatid","choice"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"chatid":{"description":"The opening chat","type":"string"},"choice":{"description":"Take a tour, Bring my books over, or Jump straight in","type":"string"}},"required":["token","chatid","choice"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"chatid":{"description":"The opening chat","type":"string"},"choice":{"description":"Take a tour, Bring my books over, or Jump straight in","type":"string"}},"required":["token","chatid","choice"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"chatid":{"description":"The opening chat","type":"string"},"choice":{"description":"Take a tour, Bring my books over, or Jump straight in","type":"string"}},"required":["token","chatid","choice"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Her answer to the welcome offer: the tour to open, her switch to open after the walk-through, or the walk-through. Returns {turns, tour} or {turns, switch}.","tags":["onboarding"]}},"/api/onboarding/tour-ended":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"chatid":{"description":"The opening chat","type":"string"}},"required":["token","chatid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"chatid":{"description":"The opening chat","type":"string"}},"required":["token","chatid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"chatid":{"description":"The opening chat","type":"string"}},"required":["token","chatid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"chatid":{"description":"The opening chat","type":"string"}},"required":["token","chatid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Her tour is over: the welcome chat asks how it was, once. Returns {turns}.","tags":["onboarding"]}},"/api/onboarding/feedback":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"chatid":{"description":"The opening chat","type":"string"},"text":{"description":"What she thought of the tour","type":"string"}},"required":["token","chatid","text"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"chatid":{"description":"The opening chat","type":"string"},"text":{"description":"What she thought of the tour","type":"string"}},"required":["token","chatid","text"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"chatid":{"description":"The opening chat","type":"string"},"text":{"description":"What she thought of the tour","type":"string"}},"required":["token","chatid","text"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"chatid":{"description":"The opening chat","type":"string"},"text":{"description":"What she thought of the tour","type":"string"}},"required":["token","chatid","text"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"What she thought of the tour, then the canned walk-through. Returns {turns}.","tags":["onboarding"]}},"/api/switch/start":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"again":{"description":"Asked for from Settings: starts with books already in stub, and anew after a finished switch","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"again":{"description":"Asked for from Settings: starts with books already in stub, and anew after a finished switch","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"again":{"description":"Asked for from Settings: starts with books already in stub, and anew after a finished switch","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"again":{"description":"Asked for from Settings: starts with books already in stub, and anew after a finished switch","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Start or resume the switch to stub and open its chat. Returns {chatid}.","tags":["onboarding"]}},"/api/switch/decline":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"We don't need to switch.","tags":["onboarding"]}},"/api/switch/leave":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Leave switch mode; the draft is kept for 30 days.","tags":["onboarding"]}},"/api/switch/discard":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Throw the switch draft away. Files stay; switch mode ends.","tags":["onboarding"]}},"/api/switch/commit":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Make the switch real: every step's records are written, in step order.","tags":["onboarding"]}},"/api/switch/package":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"package":{"description":"A stub switch package (stub-switch/1), as a reader writes it.","type":"object"}},"required":["token","package"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"package":{"description":"A stub switch package (stub-switch/1), as a reader writes it.","type":"object"}},"required":["token","package"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"package":{"description":"A stub switch package (stub-switch/1), as a reader writes it.","type":"object"}},"required":["token","package"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"package":{"description":"A stub switch package (stub-switch/1), as a reader writes it.","type":"object"}},"required":["token","package"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Keep the switch package the customer's exports were read into. Returns {findings holds}.","tags":["onboarding"]}},"/api/switch/months/accept":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"month":{"description":"The stopped month end, YYYY-MM-DD","type":"string"}},"required":["token","month"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"month":{"description":"The stopped month end, YYYY-MM-DD","type":"string"}},"required":["token","month"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"month":{"description":"The stopped month end, YYYY-MM-DD","type":"string"}},"required":["token","month"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"month":{"description":"The stopped month end, YYYY-MM-DD","type":"string"}},"required":["token","month"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Accept one differing month's difference as it stands.","tags":["onboarding"]}},"/api/switch/months/accept-all":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Accept every month end that differs, and every one that differs only by its closing rate, at once.","tags":["onboarding"]}},"/api/switch/months/accept-rates":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Accept every month end that differs only by its closing rate, at once.","tags":["onboarding"]}},"/api/tour/start":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"The tour's welcome. Returns {turns}.","tags":["tour"]}},"/api/tour/step":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"choice":{"description":"The option's label, as shown","type":"string"}},"required":["token","choice"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"choice":{"description":"The option's label, as shown","type":"string"}},"required":["token","choice"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"choice":{"description":"The option's label, as shown","type":"string"}},"required":["token","choice"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"choice":{"description":"The option's label, as shown","type":"string"}},"required":["token","choice"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"The stop a tapped option leads to. Returns {turns, path}.","tags":["tour"]}},"/api/tour/ask":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"text":{"description":"What the visitor typed","type":"string"}},"required":["token","text"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"text":{"description":"What the visitor typed","type":"string"}},"required":["token","text"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"text":{"description":"What the visitor typed","type":"string"}},"required":["token","text"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"text":{"description":"What the visitor typed","type":"string"}},"required":["token","text"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"The stop a typed question leads to, or the menu. Returns {turns, path}.","tags":["tour"]}},"/api/report/classifications":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"periodStart":{"description":"Period start (YYYY-MM-DD), inclusive. Omit for no lower bound (or the snapshot's window start).","oneOf":[{"type":"string"},{"type":"null"}]},"periodEnd":{"description":"Period end (YYYY-MM-DD), inclusive. Required for live classifications; defaults to the snapshot's as-of date when snapshotid is given.","oneOf":[{"type":"string"},{"type":"null"}]},"snapshotid":{"description":"Evaluate FROZEN: read the period from this snapshot's filed listing with capture-time classification, instead of the live books.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"periodStart":{"description":"Period start (YYYY-MM-DD), inclusive. Omit for no lower bound (or the snapshot's window start).","oneOf":[{"type":"string"},{"type":"null"}]},"periodEnd":{"description":"Period end (YYYY-MM-DD), inclusive. Required for live classifications; defaults to the snapshot's as-of date when snapshotid is given.","oneOf":[{"type":"string"},{"type":"null"}]},"snapshotid":{"description":"Evaluate FROZEN: read the period from this snapshot's filed listing with capture-time classification, instead of the live books.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"periodStart":{"description":"Period start (YYYY-MM-DD), inclusive. Omit for no lower bound (or the snapshot's window start).","oneOf":[{"type":"string"},{"type":"null"}]},"periodEnd":{"description":"Period end (YYYY-MM-DD), inclusive. Required for live classifications; defaults to the snapshot's as-of date when snapshotid is given.","oneOf":[{"type":"string"},{"type":"null"}]},"snapshotid":{"description":"Evaluate FROZEN: read the period from this snapshot's filed listing with capture-time classification, instead of the live books.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"periodStart":{"description":"Period start (YYYY-MM-DD), inclusive. Omit for no lower bound (or the snapshot's window start).","oneOf":[{"type":"string"},{"type":"null"}]},"periodEnd":{"description":"Period end (YYYY-MM-DD), inclusive. Required for live classifications; defaults to the snapshot's as-of date when snapshotid is given.","oneOf":[{"type":"string"},{"type":"null"}]},"snapshotid":{"description":"Evaluate FROZEN: read the period from this snapshot's filed listing with capture-time classification, instead of the live books.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Per-entry sales-tax classifications for a period — the single feed every tax report reads: bucket, direction, capital, per-treatment and per-band splits, signed net/gross/tax. Live books through the flow filter, or a snapshot's frozen window with snapshotid.","tags":["report evaluation"]}},"/api/report/payroll-entries":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"periodStart":{"description":"Period start (YYYY-MM-DD), inclusive.","oneOf":[{"type":"string"},{"type":"null"}]},"periodEnd":{"description":"Period end (YYYY-MM-DD), inclusive.","type":"string"},"employeeid":{"description":"A certificate's employee: only their opening balances and payslips.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","periodEnd"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"periodStart":{"description":"Period start (YYYY-MM-DD), inclusive.","oneOf":[{"type":"string"},{"type":"null"}]},"periodEnd":{"description":"Period end (YYYY-MM-DD), inclusive.","type":"string"},"employeeid":{"description":"A certificate's employee: only their opening balances and payslips.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","periodEnd"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"periodStart":{"description":"Period start (YYYY-MM-DD), inclusive.","oneOf":[{"type":"string"},{"type":"null"}]},"periodEnd":{"description":"Period end (YYYY-MM-DD), inclusive.","type":"string"},"employeeid":{"description":"A certificate's employee: only their opening balances and payslips.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","periodEnd"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"periodStart":{"description":"Period start (YYYY-MM-DD), inclusive.","oneOf":[{"type":"string"},{"type":"null"}]},"periodEnd":{"description":"Period end (YYYY-MM-DD), inclusive.","type":"string"},"employeeid":{"description":"A certificate's employee: only their opening balances and payslips.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","periodEnd"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"What a payroll return resolved in the browser reads beyond the ledger: each employee's opening balances (another payroll's months) as the entries an IRP5 or EMP501 counts, and each finalised payslip's figures that are no ledger line (4005 medical contributions, 4116 and 4120 medical credits).","tags":["report evaluation"]}},"/api/report/sourcecodes":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"country":{"description":"Two-letter country code. Defaults to the business's own country.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"country":{"description":"Two-letter country code. Defaults to the business's own country.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"country":{"description":"Two-letter country code. Defaults to the business's own country.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"country":{"description":"Two-letter country code. Defaults to the business's own country.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"The statutory source codes a locale's returns print — for ZA, the ITR12: the 4000-series Other Deductions table (each box's code, section, whether the ledger can derive it, and the related carry-forward / variant / detail codes), the four PERSONAL deductions whose trade equivalents live in the business container instead (claiming both files the same expense twice), the rental container's 4210 profit / 4211 loss pair, and the trade source-code rules. Reference data: business-independent and stable, so read it once rather than per report.","tags":["report evaluation"]}},"/api/report/session/open":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Open a report session: the business's flow entries are classified once and cached (Redis in prod), so every subsequent session evaluate is a slice over pre-classified rows — the fast path for interactive report screens. Costs one report load cold, nothing warm. The returned sessionkey is the dataset's build basis-t; a change heartbeat means re-ask and the dataset rebuilds automatically. Call this first, then pass the sessionkey to evaluate_report_session (one view) or evaluate_report_batch (many at once); for a single one-off report without a session use evaluate_report.","tags":["report evaluation"]}},"/api/report/session/evaluate":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"source":{"description":"A statutory template source, e.g. \"locale:za/vat201\". Provide this, templateid, or view.","oneOf":[{"type":"string"},{"type":"null"}]},"version":{"oneOf":[{"type":"number"},{"type":"null"}]},"templateid":{"oneOf":[{"type":"string"},{"type":"null"}]},"employeeid":{"description":"A per-employee certificate's employee id (e.g. locale:za/irp5): only the entries their payslips post are read. Required for such a template, refused for any other.","oneOf":[{"type":"string"},{"type":"null"}]},"presentation":{"description":"trial-balance: \"net\" (default; one figure per account, Dr or Cr by sign; P&L netting to zero hidden; :profitLoss memo) or \"gross\" (summed Dr and Cr movements). Unknown values are refused.","oneOf":[{"type":"string"},{"type":"null"}]},"grouping":{"description":"\"reporting\" rolls accounts into their reporting groups in trial-balance, profit-and-loss, balance-sheet, cash-flow, account-totals and account-totals-as-at: one row per group per section, with :accountids and :members. Omit for one row per account.","oneOf":[{"type":"string"},{"type":"null"}]},"payrunid":{"description":"A per-pay-run return's pay run id (e.g. locale:gb/fps): only the entries that run posts are read. Refused for a template not filed per pay run.","oneOf":[{"type":"string"},{"type":"null"}]},"comparison":{"description":"profit-and-loss: \"lastYear\" = two columns, the same period a year earlier and the selected one (no Total column); \"yearly\" = one column per financial year, clamped to the period, at most 12. Takes precedence over monthly and compare; absent = those flags decide. cash-flow: \"yearly\" only, because each column's opening balance chains from the column before it.","oneOf":[{"type":"string","enum":["lastYear","yearly"]},{"type":"null"}]},"view":{"description":"An insight view instead of a template: account-totals, account-totals-as-at, trial-balance, profit-and-loss, balance-sheet, cash-flow, receivables, payables, customer-totals, supplier-totals, product-totals, salestax-summary, salestax-activity, income-tax-summary, inventory, clearing-residual. Provide this OR a template, not both.","oneOf":[{"type":"string"},{"type":"null"}]},"asAt":{"description":"For as-at views (account-totals-as-at, balance-sheet, clearing-residual): the position date (YYYY-MM-DD), inclusive. Synonym for periodEnd.","oneOf":[{"type":"string"},{"type":"null"}]},"monthly":{"description":"Views with columns (profit-and-loss, cash-flow): true = one column per calendar month in the period.","oneOf":[{"type":"boolean"},{"type":"null"}]},"compare":{"description":"profit-and-loss: true = two columns, the equal-length prior period and the current one.","oneOf":[{"type":"boolean"},{"type":"null"}]},"dimension":{"description":"cash-flow: \"category\" (default — counterpart categories) or \"baseaccount\" (per bank/cash account).","oneOf":[{"type":"string"},{"type":"null"}]},"journal":{"description":"account-totals and entity totals: restrict to one journal (1 income, 2 expenses, 3 assets, 4 liabilities, 5 equity).","oneOf":[{"type":"number"},{"type":"null"}]},"basis":{"description":"income-tax-summary: \"profit\" (default) or \"turnover\".","oneOf":[{"type":"string"},{"type":"null"}]},"mode":{"description":"trial-balance: \"cumulative\" (default — closing balances as at periodEnd, opening/retained included, ties to the balance sheet) or \"period\"/\"range\" (period-movement only within [periodStart..periodEnd], for error-checking a window).","oneOf":[{"type":"string"},{"type":"null"}]},"filters":{"description":"Row filters: [{\"property\": \"tags\"|\"customer\"|\"supplier\"|\"product\"|\"account\", \"value\": ...}]; tags value \"none\" means untagged.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]},"periodStart":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodEnd":{"description":"Inclusive period end (YYYY-MM-DD). Required.","oneOf":[{"type":"string"},{"type":"null"}]},"constants":{"oneOf":[{"type":"object"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"source":{"description":"A statutory template source, e.g. \"locale:za/vat201\". Provide this, templateid, or view.","oneOf":[{"type":"string"},{"type":"null"}]},"version":{"oneOf":[{"type":"number"},{"type":"null"}]},"templateid":{"oneOf":[{"type":"string"},{"type":"null"}]},"employeeid":{"description":"A per-employee certificate's employee id (e.g. locale:za/irp5): only the entries their payslips post are read. Required for such a template, refused for any other.","oneOf":[{"type":"string"},{"type":"null"}]},"presentation":{"description":"trial-balance: \"net\" (default; one figure per account, Dr or Cr by sign; P&L netting to zero hidden; :profitLoss memo) or \"gross\" (summed Dr and Cr movements). Unknown values are refused.","oneOf":[{"type":"string"},{"type":"null"}]},"grouping":{"description":"\"reporting\" rolls accounts into their reporting groups in trial-balance, profit-and-loss, balance-sheet, cash-flow, account-totals and account-totals-as-at: one row per group per section, with :accountids and :members. Omit for one row per account.","oneOf":[{"type":"string"},{"type":"null"}]},"payrunid":{"description":"A per-pay-run return's pay run id (e.g. locale:gb/fps): only the entries that run posts are read. Refused for a template not filed per pay run.","oneOf":[{"type":"string"},{"type":"null"}]},"comparison":{"description":"profit-and-loss: \"lastYear\" = two columns, the same period a year earlier and the selected one (no Total column); \"yearly\" = one column per financial year, clamped to the period, at most 12. Takes precedence over monthly and compare; absent = those flags decide. cash-flow: \"yearly\" only, because each column's opening balance chains from the column before it.","oneOf":[{"type":"string","enum":["lastYear","yearly"]},{"type":"null"}]},"view":{"description":"An insight view instead of a template: account-totals, account-totals-as-at, trial-balance, profit-and-loss, balance-sheet, cash-flow, receivables, payables, customer-totals, supplier-totals, product-totals, salestax-summary, salestax-activity, income-tax-summary, inventory, clearing-residual. Provide this OR a template, not both.","oneOf":[{"type":"string"},{"type":"null"}]},"asAt":{"description":"For as-at views (account-totals-as-at, balance-sheet, clearing-residual): the position date (YYYY-MM-DD), inclusive. Synonym for periodEnd.","oneOf":[{"type":"string"},{"type":"null"}]},"monthly":{"description":"Views with columns (profit-and-loss, cash-flow): true = one column per calendar month in the period.","oneOf":[{"type":"boolean"},{"type":"null"}]},"compare":{"description":"profit-and-loss: true = two columns, the equal-length prior period and the current one.","oneOf":[{"type":"boolean"},{"type":"null"}]},"dimension":{"description":"cash-flow: \"category\" (default — counterpart categories) or \"baseaccount\" (per bank/cash account).","oneOf":[{"type":"string"},{"type":"null"}]},"journal":{"description":"account-totals and entity totals: restrict to one journal (1 income, 2 expenses, 3 assets, 4 liabilities, 5 equity).","oneOf":[{"type":"number"},{"type":"null"}]},"basis":{"description":"income-tax-summary: \"profit\" (default) or \"turnover\".","oneOf":[{"type":"string"},{"type":"null"}]},"mode":{"description":"trial-balance: \"cumulative\" (default — closing balances as at periodEnd, opening/retained included, ties to the balance sheet) or \"period\"/\"range\" (period-movement only within [periodStart..periodEnd], for error-checking a window).","oneOf":[{"type":"string"},{"type":"null"}]},"filters":{"description":"Row filters: [{\"property\": \"tags\"|\"customer\"|\"supplier\"|\"product\"|\"account\", \"value\": ...}]; tags value \"none\" means untagged.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]},"periodStart":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodEnd":{"description":"Inclusive period end (YYYY-MM-DD). Required.","oneOf":[{"type":"string"},{"type":"null"}]},"constants":{"oneOf":[{"type":"object"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"source":{"description":"A statutory template source, e.g. \"locale:za/vat201\". Provide this, templateid, or view.","oneOf":[{"type":"string"},{"type":"null"}]},"version":{"oneOf":[{"type":"number"},{"type":"null"}]},"templateid":{"oneOf":[{"type":"string"},{"type":"null"}]},"employeeid":{"description":"A per-employee certificate's employee id (e.g. locale:za/irp5): only the entries their payslips post are read. Required for such a template, refused for any other.","oneOf":[{"type":"string"},{"type":"null"}]},"presentation":{"description":"trial-balance: \"net\" (default; one figure per account, Dr or Cr by sign; P&L netting to zero hidden; :profitLoss memo) or \"gross\" (summed Dr and Cr movements). Unknown values are refused.","oneOf":[{"type":"string"},{"type":"null"}]},"grouping":{"description":"\"reporting\" rolls accounts into their reporting groups in trial-balance, profit-and-loss, balance-sheet, cash-flow, account-totals and account-totals-as-at: one row per group per section, with :accountids and :members. Omit for one row per account.","oneOf":[{"type":"string"},{"type":"null"}]},"payrunid":{"description":"A per-pay-run return's pay run id (e.g. locale:gb/fps): only the entries that run posts are read. Refused for a template not filed per pay run.","oneOf":[{"type":"string"},{"type":"null"}]},"comparison":{"description":"profit-and-loss: \"lastYear\" = two columns, the same period a year earlier and the selected one (no Total column); \"yearly\" = one column per financial year, clamped to the period, at most 12. Takes precedence over monthly and compare; absent = those flags decide. cash-flow: \"yearly\" only, because each column's opening balance chains from the column before it.","oneOf":[{"type":"string","enum":["lastYear","yearly"]},{"type":"null"}]},"view":{"description":"An insight view instead of a template: account-totals, account-totals-as-at, trial-balance, profit-and-loss, balance-sheet, cash-flow, receivables, payables, customer-totals, supplier-totals, product-totals, salestax-summary, salestax-activity, income-tax-summary, inventory, clearing-residual. Provide this OR a template, not both.","oneOf":[{"type":"string"},{"type":"null"}]},"asAt":{"description":"For as-at views (account-totals-as-at, balance-sheet, clearing-residual): the position date (YYYY-MM-DD), inclusive. Synonym for periodEnd.","oneOf":[{"type":"string"},{"type":"null"}]},"monthly":{"description":"Views with columns (profit-and-loss, cash-flow): true = one column per calendar month in the period.","oneOf":[{"type":"boolean"},{"type":"null"}]},"compare":{"description":"profit-and-loss: true = two columns, the equal-length prior period and the current one.","oneOf":[{"type":"boolean"},{"type":"null"}]},"dimension":{"description":"cash-flow: \"category\" (default — counterpart categories) or \"baseaccount\" (per bank/cash account).","oneOf":[{"type":"string"},{"type":"null"}]},"journal":{"description":"account-totals and entity totals: restrict to one journal (1 income, 2 expenses, 3 assets, 4 liabilities, 5 equity).","oneOf":[{"type":"number"},{"type":"null"}]},"basis":{"description":"income-tax-summary: \"profit\" (default) or \"turnover\".","oneOf":[{"type":"string"},{"type":"null"}]},"mode":{"description":"trial-balance: \"cumulative\" (default — closing balances as at periodEnd, opening/retained included, ties to the balance sheet) or \"period\"/\"range\" (period-movement only within [periodStart..periodEnd], for error-checking a window).","oneOf":[{"type":"string"},{"type":"null"}]},"filters":{"description":"Row filters: [{\"property\": \"tags\"|\"customer\"|\"supplier\"|\"product\"|\"account\", \"value\": ...}]; tags value \"none\" means untagged.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]},"periodStart":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodEnd":{"description":"Inclusive period end (YYYY-MM-DD). Required.","oneOf":[{"type":"string"},{"type":"null"}]},"constants":{"oneOf":[{"type":"object"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"source":{"description":"A statutory template source, e.g. \"locale:za/vat201\". Provide this, templateid, or view.","oneOf":[{"type":"string"},{"type":"null"}]},"version":{"oneOf":[{"type":"number"},{"type":"null"}]},"templateid":{"oneOf":[{"type":"string"},{"type":"null"}]},"employeeid":{"description":"A per-employee certificate's employee id (e.g. locale:za/irp5): only the entries their payslips post are read. Required for such a template, refused for any other.","oneOf":[{"type":"string"},{"type":"null"}]},"presentation":{"description":"trial-balance: \"net\" (default; one figure per account, Dr or Cr by sign; P&L netting to zero hidden; :profitLoss memo) or \"gross\" (summed Dr and Cr movements). Unknown values are refused.","oneOf":[{"type":"string"},{"type":"null"}]},"grouping":{"description":"\"reporting\" rolls accounts into their reporting groups in trial-balance, profit-and-loss, balance-sheet, cash-flow, account-totals and account-totals-as-at: one row per group per section, with :accountids and :members. Omit for one row per account.","oneOf":[{"type":"string"},{"type":"null"}]},"payrunid":{"description":"A per-pay-run return's pay run id (e.g. locale:gb/fps): only the entries that run posts are read. Refused for a template not filed per pay run.","oneOf":[{"type":"string"},{"type":"null"}]},"comparison":{"description":"profit-and-loss: \"lastYear\" = two columns, the same period a year earlier and the selected one (no Total column); \"yearly\" = one column per financial year, clamped to the period, at most 12. Takes precedence over monthly and compare; absent = those flags decide. cash-flow: \"yearly\" only, because each column's opening balance chains from the column before it.","oneOf":[{"type":"string","enum":["lastYear","yearly"]},{"type":"null"}]},"view":{"description":"An insight view instead of a template: account-totals, account-totals-as-at, trial-balance, profit-and-loss, balance-sheet, cash-flow, receivables, payables, customer-totals, supplier-totals, product-totals, salestax-summary, salestax-activity, income-tax-summary, inventory, clearing-residual. Provide this OR a template, not both.","oneOf":[{"type":"string"},{"type":"null"}]},"asAt":{"description":"For as-at views (account-totals-as-at, balance-sheet, clearing-residual): the position date (YYYY-MM-DD), inclusive. Synonym for periodEnd.","oneOf":[{"type":"string"},{"type":"null"}]},"monthly":{"description":"Views with columns (profit-and-loss, cash-flow): true = one column per calendar month in the period.","oneOf":[{"type":"boolean"},{"type":"null"}]},"compare":{"description":"profit-and-loss: true = two columns, the equal-length prior period and the current one.","oneOf":[{"type":"boolean"},{"type":"null"}]},"dimension":{"description":"cash-flow: \"category\" (default — counterpart categories) or \"baseaccount\" (per bank/cash account).","oneOf":[{"type":"string"},{"type":"null"}]},"journal":{"description":"account-totals and entity totals: restrict to one journal (1 income, 2 expenses, 3 assets, 4 liabilities, 5 equity).","oneOf":[{"type":"number"},{"type":"null"}]},"basis":{"description":"income-tax-summary: \"profit\" (default) or \"turnover\".","oneOf":[{"type":"string"},{"type":"null"}]},"mode":{"description":"trial-balance: \"cumulative\" (default — closing balances as at periodEnd, opening/retained included, ties to the balance sheet) or \"period\"/\"range\" (period-movement only within [periodStart..periodEnd], for error-checking a window).","oneOf":[{"type":"string"},{"type":"null"}]},"filters":{"description":"Row filters: [{\"property\": \"tags\"|\"customer\"|\"supplier\"|\"product\"|\"account\", \"value\": ...}]; tags value \"none\" means untagged.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]},"periodStart":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodEnd":{"description":"Inclusive period end (YYYY-MM-DD). Required.","oneOf":[{"type":"string"},{"type":"null"}]},"constants":{"oneOf":[{"type":"object"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Evaluate a template (source/templateid) or an insight view (view: payables, receivables, profit-and-loss, balance-sheet, cash-flow, salestax-summary, salestax-activity, … — see the `view` param for the full list) against a period from the report session's cached dataset — identical answers to /report/evaluate, tens of milliseconds instead of a full pipeline run. For interactive use: period slides, template/view switches, constant tweaks. Live books only; frozen periods evaluate via /report/evaluate with snapshotid.","tags":["report evaluation"]}},"/api/report/session/batch":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"requests":{"description":"Up to 24 evaluate bodies ({view|source|templateid, periodStart?, periodEnd, ...}) answered from ONE session dataset build — one round trip paints a dashboard.","type":"array","items":{"type":"object"}}},"required":["token","requests"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"requests":{"description":"Up to 24 evaluate bodies ({view|source|templateid, periodStart?, periodEnd, ...}) answered from ONE session dataset build — one round trip paints a dashboard.","type":"array","items":{"type":"object"}}},"required":["token","requests"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"requests":{"description":"Up to 24 evaluate bodies ({view|source|templateid, periodStart?, periodEnd, ...}) answered from ONE session dataset build — one round trip paints a dashboard.","type":"array","items":{"type":"object"}}},"required":["token","requests"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"requests":{"description":"Up to 24 evaluate bodies ({view|source|templateid, periodStart?, periodEnd, ...}) answered from ONE session dataset build — one round trip paints a dashboard.","type":"array","items":{"type":"object"}}},"required":["token","requests"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Evaluate up to 24 templates/views in ONE round trip from the same session dataset build — a dashboard's dozen nuggets paint together and always agree. Each requests[] item is an evaluate body ({view|source|templateid, periodStart?, periodEnd, ...}); each results[] slot is exactly what /report/session/evaluate would return for it, errors inline per slot. Requires an open session (open_report_session first); for a single view use evaluate_report_session, or evaluate_report for a one-off outside any session.","tags":["report evaluation"]}},"/api/report/export":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"report":{"description":"profit-and-loss, balance-sheet, trial-balance, cash-flow, chart-of-accounts, statement (one customer's or supplier's account), overdue-invoices (each customer's overdue money by age; aged-debtors still works) or bank-transactions.","type":"string"},"format":{"description":"pdf or csv. A csv opens in Excel or Google Sheets.","type":"string"},"start":{"description":"First day, YYYY-MM-DD. Needed for profit-and-loss, cash-flow, statement and bank-transactions.","oneOf":[{"type":"string"},{"type":"null"}]},"end":{"description":"Last day, YYYY-MM-DD; the as-at date for balance-sheet, trial-balance and overdue-invoices. Needed for all but chart-of-accounts.","oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"description":"statement only: customer or supplier.","oneOf":[{"type":"string"},{"type":"null"}]},"id":{"description":"statement only: the customer's or supplier's id, from list_clients or list_suppliers.","oneOf":[{"type":"string"},{"type":"null"}]},"bankaccountid":{"description":"bank-transactions only: one bank account's id, from list_bank_accounts. Omit for every account.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","report","format"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"report":{"description":"profit-and-loss, balance-sheet, trial-balance, cash-flow, chart-of-accounts, statement (one customer's or supplier's account), overdue-invoices (each customer's overdue money by age; aged-debtors still works) or bank-transactions.","type":"string"},"format":{"description":"pdf or csv. A csv opens in Excel or Google Sheets.","type":"string"},"start":{"description":"First day, YYYY-MM-DD. Needed for profit-and-loss, cash-flow, statement and bank-transactions.","oneOf":[{"type":"string"},{"type":"null"}]},"end":{"description":"Last day, YYYY-MM-DD; the as-at date for balance-sheet, trial-balance and overdue-invoices. Needed for all but chart-of-accounts.","oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"description":"statement only: customer or supplier.","oneOf":[{"type":"string"},{"type":"null"}]},"id":{"description":"statement only: the customer's or supplier's id, from list_clients or list_suppliers.","oneOf":[{"type":"string"},{"type":"null"}]},"bankaccountid":{"description":"bank-transactions only: one bank account's id, from list_bank_accounts. Omit for every account.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","report","format"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"report":{"description":"profit-and-loss, balance-sheet, trial-balance, cash-flow, chart-of-accounts, statement (one customer's or supplier's account), overdue-invoices (each customer's overdue money by age; aged-debtors still works) or bank-transactions.","type":"string"},"format":{"description":"pdf or csv. A csv opens in Excel or Google Sheets.","type":"string"},"start":{"description":"First day, YYYY-MM-DD. Needed for profit-and-loss, cash-flow, statement and bank-transactions.","oneOf":[{"type":"string"},{"type":"null"}]},"end":{"description":"Last day, YYYY-MM-DD; the as-at date for balance-sheet, trial-balance and overdue-invoices. Needed for all but chart-of-accounts.","oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"description":"statement only: customer or supplier.","oneOf":[{"type":"string"},{"type":"null"}]},"id":{"description":"statement only: the customer's or supplier's id, from list_clients or list_suppliers.","oneOf":[{"type":"string"},{"type":"null"}]},"bankaccountid":{"description":"bank-transactions only: one bank account's id, from list_bank_accounts. Omit for every account.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","report","format"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"report":{"description":"profit-and-loss, balance-sheet, trial-balance, cash-flow, chart-of-accounts, statement (one customer's or supplier's account), overdue-invoices (each customer's overdue money by age; aged-debtors still works) or bank-transactions.","type":"string"},"format":{"description":"pdf or csv. A csv opens in Excel or Google Sheets.","type":"string"},"start":{"description":"First day, YYYY-MM-DD. Needed for profit-and-loss, cash-flow, statement and bank-transactions.","oneOf":[{"type":"string"},{"type":"null"}]},"end":{"description":"Last day, YYYY-MM-DD; the as-at date for balance-sheet, trial-balance and overdue-invoices. Needed for all but chart-of-accounts.","oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"description":"statement only: customer or supplier.","oneOf":[{"type":"string"},{"type":"null"}]},"id":{"description":"statement only: the customer's or supplier's id, from list_clients or list_suppliers.","oneOf":[{"type":"string"},{"type":"null"}]},"bankaccountid":{"description":"bank-transactions only: one bank account's id, from list_bank_accounts. Omit for every account.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","report","format"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Save a report to the business's Files as a PDF or a CSV, drawn from the same numbers the app shows: profit-and-loss, cash-flow or a statement for start to end, balance-sheet, trial-balance or overdue-invoices (what each customer owes by age, as stub-web's Overdue Invoices shows it) as at end, bank-transactions (one account with bankaccountid, else all) for start to end, or the chart-of-accounts (no dates). Answers the new file's id and name: cite it as a file tag so the user can open and download it. Each call saves a new copy, so call it once per request. The file is kept, not imported into the books. A missing or another business's contact is refused with reason report-contact-not-found.","tags":["report evaluation"]}},"/api/report/evaluate":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"source":{"description":"A statutory template source, e.g. \"locale:za/vat201\". Provide this or templateid.","oneOf":[{"type":"string"},{"type":"null"}]},"version":{"description":"Template version. Omit for the version in effect at the period end.","oneOf":[{"type":"number"},{"type":"null"}]},"templateid":{"description":"A stored user template id. Provide this or source.","oneOf":[{"type":"string"},{"type":"null"}]},"employeeid":{"description":"A per-employee certificate's employee id (e.g. locale:za/irp5): only the entries their payslips post are read. Required for such a template, refused for any other.","oneOf":[{"type":"string"},{"type":"null"}]},"presentation":{"description":"trial-balance: \"net\" (default; one figure per account, Dr or Cr by sign; P&L netting to zero hidden; :profitLoss memo) or \"gross\" (summed Dr and Cr movements). Unknown values are refused.","oneOf":[{"type":"string"},{"type":"null"}]},"grouping":{"description":"\"reporting\" rolls accounts into their reporting groups in trial-balance, profit-and-loss, balance-sheet, cash-flow, account-totals and account-totals-as-at: one row per group per section, with :accountids and :members. Omit for one row per account.","oneOf":[{"type":"string"},{"type":"null"}]},"payrunid":{"description":"A per-pay-run return's pay run id (e.g. locale:gb/fps): only the entries that run posts are read. Refused for a template not filed per pay run.","oneOf":[{"type":"string"},{"type":"null"}]},"comparison":{"description":"profit-and-loss: \"lastYear\" = two columns, the same period a year earlier and the selected one (no Total column); \"yearly\" = one column per financial year, clamped to the period, at most 12. Takes precedence over monthly and compare; absent = those flags decide. cash-flow: \"yearly\" only, because each column's opening balance chains from the column before it.","oneOf":[{"type":"string","enum":["lastYear","yearly"]},{"type":"null"}]},"view":{"description":"An insight view instead of a template: account-totals, account-totals-as-at, trial-balance, profit-and-loss, balance-sheet, cash-flow, receivables, payables, customer-totals, supplier-totals, product-totals, salestax-summary, salestax-activity, income-tax-summary, inventory, clearing-residual. Provide this OR a template, not both.","oneOf":[{"type":"string"},{"type":"null"}]},"asAt":{"description":"For as-at views (account-totals-as-at, balance-sheet, clearing-residual): the position date (YYYY-MM-DD), inclusive. Synonym for periodEnd.","oneOf":[{"type":"string"},{"type":"null"}]},"monthly":{"description":"Views with columns (profit-and-loss, cash-flow): true = one column per calendar month in the period.","oneOf":[{"type":"boolean"},{"type":"null"}]},"compare":{"description":"profit-and-loss: true = two columns, the equal-length prior period and the current one.","oneOf":[{"type":"boolean"},{"type":"null"}]},"dimension":{"description":"cash-flow: \"category\" (default — counterpart categories) or \"baseaccount\" (per bank/cash account).","oneOf":[{"type":"string"},{"type":"null"}]},"journal":{"description":"account-totals and entity totals: restrict to one journal (1 income, 2 expenses, 3 assets, 4 liabilities, 5 equity).","oneOf":[{"type":"number"},{"type":"null"}]},"basis":{"description":"income-tax-summary: \"profit\" (default) or \"turnover\".","oneOf":[{"type":"string"},{"type":"null"}]},"mode":{"description":"trial-balance: \"cumulative\" (default — closing balances as at periodEnd, opening/retained included, ties to the balance sheet) or \"period\"/\"range\" (period-movement only within [periodStart..periodEnd], for error-checking a window).","oneOf":[{"type":"string"},{"type":"null"}]},"filters":{"description":"Row filters: [{\"property\": \"tags\"|\"customer\"|\"supplier\"|\"product\"|\"account\", \"value\": ...}]; tags value \"none\" means untagged.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]},"snapshotid":{"description":"Evaluate FROZEN against this snapshot's filed listing (the period must sit inside its window) instead of the live books.","oneOf":[{"type":"string"},{"type":"null"}]},"periodStart":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodEnd":{"oneOf":[{"type":"string"},{"type":"null"}]},"constants":{"description":"Constants a template's formulas name ($salesTaxRate → {\"salesTaxRate\": 0.15}). Undeclared here, coercion would strip them and the formula would silently evaluate with 0.","oneOf":[{"type":"object"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"source":{"description":"A statutory template source, e.g. \"locale:za/vat201\". Provide this or templateid.","oneOf":[{"type":"string"},{"type":"null"}]},"version":{"description":"Template version. Omit for the version in effect at the period end.","oneOf":[{"type":"number"},{"type":"null"}]},"templateid":{"description":"A stored user template id. Provide this or source.","oneOf":[{"type":"string"},{"type":"null"}]},"employeeid":{"description":"A per-employee certificate's employee id (e.g. locale:za/irp5): only the entries their payslips post are read. Required for such a template, refused for any other.","oneOf":[{"type":"string"},{"type":"null"}]},"presentation":{"description":"trial-balance: \"net\" (default; one figure per account, Dr or Cr by sign; P&L netting to zero hidden; :profitLoss memo) or \"gross\" (summed Dr and Cr movements). Unknown values are refused.","oneOf":[{"type":"string"},{"type":"null"}]},"grouping":{"description":"\"reporting\" rolls accounts into their reporting groups in trial-balance, profit-and-loss, balance-sheet, cash-flow, account-totals and account-totals-as-at: one row per group per section, with :accountids and :members. Omit for one row per account.","oneOf":[{"type":"string"},{"type":"null"}]},"payrunid":{"description":"A per-pay-run return's pay run id (e.g. locale:gb/fps): only the entries that run posts are read. Refused for a template not filed per pay run.","oneOf":[{"type":"string"},{"type":"null"}]},"comparison":{"description":"profit-and-loss: \"lastYear\" = two columns, the same period a year earlier and the selected one (no Total column); \"yearly\" = one column per financial year, clamped to the period, at most 12. Takes precedence over monthly and compare; absent = those flags decide. cash-flow: \"yearly\" only, because each column's opening balance chains from the column before it.","oneOf":[{"type":"string","enum":["lastYear","yearly"]},{"type":"null"}]},"view":{"description":"An insight view instead of a template: account-totals, account-totals-as-at, trial-balance, profit-and-loss, balance-sheet, cash-flow, receivables, payables, customer-totals, supplier-totals, product-totals, salestax-summary, salestax-activity, income-tax-summary, inventory, clearing-residual. Provide this OR a template, not both.","oneOf":[{"type":"string"},{"type":"null"}]},"asAt":{"description":"For as-at views (account-totals-as-at, balance-sheet, clearing-residual): the position date (YYYY-MM-DD), inclusive. Synonym for periodEnd.","oneOf":[{"type":"string"},{"type":"null"}]},"monthly":{"description":"Views with columns (profit-and-loss, cash-flow): true = one column per calendar month in the period.","oneOf":[{"type":"boolean"},{"type":"null"}]},"compare":{"description":"profit-and-loss: true = two columns, the equal-length prior period and the current one.","oneOf":[{"type":"boolean"},{"type":"null"}]},"dimension":{"description":"cash-flow: \"category\" (default — counterpart categories) or \"baseaccount\" (per bank/cash account).","oneOf":[{"type":"string"},{"type":"null"}]},"journal":{"description":"account-totals and entity totals: restrict to one journal (1 income, 2 expenses, 3 assets, 4 liabilities, 5 equity).","oneOf":[{"type":"number"},{"type":"null"}]},"basis":{"description":"income-tax-summary: \"profit\" (default) or \"turnover\".","oneOf":[{"type":"string"},{"type":"null"}]},"mode":{"description":"trial-balance: \"cumulative\" (default — closing balances as at periodEnd, opening/retained included, ties to the balance sheet) or \"period\"/\"range\" (period-movement only within [periodStart..periodEnd], for error-checking a window).","oneOf":[{"type":"string"},{"type":"null"}]},"filters":{"description":"Row filters: [{\"property\": \"tags\"|\"customer\"|\"supplier\"|\"product\"|\"account\", \"value\": ...}]; tags value \"none\" means untagged.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]},"snapshotid":{"description":"Evaluate FROZEN against this snapshot's filed listing (the period must sit inside its window) instead of the live books.","oneOf":[{"type":"string"},{"type":"null"}]},"periodStart":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodEnd":{"oneOf":[{"type":"string"},{"type":"null"}]},"constants":{"description":"Constants a template's formulas name ($salesTaxRate → {\"salesTaxRate\": 0.15}). Undeclared here, coercion would strip them and the formula would silently evaluate with 0.","oneOf":[{"type":"object"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"source":{"description":"A statutory template source, e.g. \"locale:za/vat201\". Provide this or templateid.","oneOf":[{"type":"string"},{"type":"null"}]},"version":{"description":"Template version. Omit for the version in effect at the period end.","oneOf":[{"type":"number"},{"type":"null"}]},"templateid":{"description":"A stored user template id. Provide this or source.","oneOf":[{"type":"string"},{"type":"null"}]},"employeeid":{"description":"A per-employee certificate's employee id (e.g. locale:za/irp5): only the entries their payslips post are read. Required for such a template, refused for any other.","oneOf":[{"type":"string"},{"type":"null"}]},"presentation":{"description":"trial-balance: \"net\" (default; one figure per account, Dr or Cr by sign; P&L netting to zero hidden; :profitLoss memo) or \"gross\" (summed Dr and Cr movements). Unknown values are refused.","oneOf":[{"type":"string"},{"type":"null"}]},"grouping":{"description":"\"reporting\" rolls accounts into their reporting groups in trial-balance, profit-and-loss, balance-sheet, cash-flow, account-totals and account-totals-as-at: one row per group per section, with :accountids and :members. Omit for one row per account.","oneOf":[{"type":"string"},{"type":"null"}]},"payrunid":{"description":"A per-pay-run return's pay run id (e.g. locale:gb/fps): only the entries that run posts are read. Refused for a template not filed per pay run.","oneOf":[{"type":"string"},{"type":"null"}]},"comparison":{"description":"profit-and-loss: \"lastYear\" = two columns, the same period a year earlier and the selected one (no Total column); \"yearly\" = one column per financial year, clamped to the period, at most 12. Takes precedence over monthly and compare; absent = those flags decide. cash-flow: \"yearly\" only, because each column's opening balance chains from the column before it.","oneOf":[{"type":"string","enum":["lastYear","yearly"]},{"type":"null"}]},"view":{"description":"An insight view instead of a template: account-totals, account-totals-as-at, trial-balance, profit-and-loss, balance-sheet, cash-flow, receivables, payables, customer-totals, supplier-totals, product-totals, salestax-summary, salestax-activity, income-tax-summary, inventory, clearing-residual. Provide this OR a template, not both.","oneOf":[{"type":"string"},{"type":"null"}]},"asAt":{"description":"For as-at views (account-totals-as-at, balance-sheet, clearing-residual): the position date (YYYY-MM-DD), inclusive. Synonym for periodEnd.","oneOf":[{"type":"string"},{"type":"null"}]},"monthly":{"description":"Views with columns (profit-and-loss, cash-flow): true = one column per calendar month in the period.","oneOf":[{"type":"boolean"},{"type":"null"}]},"compare":{"description":"profit-and-loss: true = two columns, the equal-length prior period and the current one.","oneOf":[{"type":"boolean"},{"type":"null"}]},"dimension":{"description":"cash-flow: \"category\" (default — counterpart categories) or \"baseaccount\" (per bank/cash account).","oneOf":[{"type":"string"},{"type":"null"}]},"journal":{"description":"account-totals and entity totals: restrict to one journal (1 income, 2 expenses, 3 assets, 4 liabilities, 5 equity).","oneOf":[{"type":"number"},{"type":"null"}]},"basis":{"description":"income-tax-summary: \"profit\" (default) or \"turnover\".","oneOf":[{"type":"string"},{"type":"null"}]},"mode":{"description":"trial-balance: \"cumulative\" (default — closing balances as at periodEnd, opening/retained included, ties to the balance sheet) or \"period\"/\"range\" (period-movement only within [periodStart..periodEnd], for error-checking a window).","oneOf":[{"type":"string"},{"type":"null"}]},"filters":{"description":"Row filters: [{\"property\": \"tags\"|\"customer\"|\"supplier\"|\"product\"|\"account\", \"value\": ...}]; tags value \"none\" means untagged.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]},"snapshotid":{"description":"Evaluate FROZEN against this snapshot's filed listing (the period must sit inside its window) instead of the live books.","oneOf":[{"type":"string"},{"type":"null"}]},"periodStart":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodEnd":{"oneOf":[{"type":"string"},{"type":"null"}]},"constants":{"description":"Constants a template's formulas name ($salesTaxRate → {\"salesTaxRate\": 0.15}). Undeclared here, coercion would strip them and the formula would silently evaluate with 0.","oneOf":[{"type":"object"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"source":{"description":"A statutory template source, e.g. \"locale:za/vat201\". Provide this or templateid.","oneOf":[{"type":"string"},{"type":"null"}]},"version":{"description":"Template version. Omit for the version in effect at the period end.","oneOf":[{"type":"number"},{"type":"null"}]},"templateid":{"description":"A stored user template id. Provide this or source.","oneOf":[{"type":"string"},{"type":"null"}]},"employeeid":{"description":"A per-employee certificate's employee id (e.g. locale:za/irp5): only the entries their payslips post are read. Required for such a template, refused for any other.","oneOf":[{"type":"string"},{"type":"null"}]},"presentation":{"description":"trial-balance: \"net\" (default; one figure per account, Dr or Cr by sign; P&L netting to zero hidden; :profitLoss memo) or \"gross\" (summed Dr and Cr movements). Unknown values are refused.","oneOf":[{"type":"string"},{"type":"null"}]},"grouping":{"description":"\"reporting\" rolls accounts into their reporting groups in trial-balance, profit-and-loss, balance-sheet, cash-flow, account-totals and account-totals-as-at: one row per group per section, with :accountids and :members. Omit for one row per account.","oneOf":[{"type":"string"},{"type":"null"}]},"payrunid":{"description":"A per-pay-run return's pay run id (e.g. locale:gb/fps): only the entries that run posts are read. Refused for a template not filed per pay run.","oneOf":[{"type":"string"},{"type":"null"}]},"comparison":{"description":"profit-and-loss: \"lastYear\" = two columns, the same period a year earlier and the selected one (no Total column); \"yearly\" = one column per financial year, clamped to the period, at most 12. Takes precedence over monthly and compare; absent = those flags decide. cash-flow: \"yearly\" only, because each column's opening balance chains from the column before it.","oneOf":[{"type":"string","enum":["lastYear","yearly"]},{"type":"null"}]},"view":{"description":"An insight view instead of a template: account-totals, account-totals-as-at, trial-balance, profit-and-loss, balance-sheet, cash-flow, receivables, payables, customer-totals, supplier-totals, product-totals, salestax-summary, salestax-activity, income-tax-summary, inventory, clearing-residual. Provide this OR a template, not both.","oneOf":[{"type":"string"},{"type":"null"}]},"asAt":{"description":"For as-at views (account-totals-as-at, balance-sheet, clearing-residual): the position date (YYYY-MM-DD), inclusive. Synonym for periodEnd.","oneOf":[{"type":"string"},{"type":"null"}]},"monthly":{"description":"Views with columns (profit-and-loss, cash-flow): true = one column per calendar month in the period.","oneOf":[{"type":"boolean"},{"type":"null"}]},"compare":{"description":"profit-and-loss: true = two columns, the equal-length prior period and the current one.","oneOf":[{"type":"boolean"},{"type":"null"}]},"dimension":{"description":"cash-flow: \"category\" (default — counterpart categories) or \"baseaccount\" (per bank/cash account).","oneOf":[{"type":"string"},{"type":"null"}]},"journal":{"description":"account-totals and entity totals: restrict to one journal (1 income, 2 expenses, 3 assets, 4 liabilities, 5 equity).","oneOf":[{"type":"number"},{"type":"null"}]},"basis":{"description":"income-tax-summary: \"profit\" (default) or \"turnover\".","oneOf":[{"type":"string"},{"type":"null"}]},"mode":{"description":"trial-balance: \"cumulative\" (default — closing balances as at periodEnd, opening/retained included, ties to the balance sheet) or \"period\"/\"range\" (period-movement only within [periodStart..periodEnd], for error-checking a window).","oneOf":[{"type":"string"},{"type":"null"}]},"filters":{"description":"Row filters: [{\"property\": \"tags\"|\"customer\"|\"supplier\"|\"product\"|\"account\", \"value\": ...}]; tags value \"none\" means untagged.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]},"snapshotid":{"description":"Evaluate FROZEN against this snapshot's filed listing (the period must sit inside its window) instead of the live books.","oneOf":[{"type":"string"},{"type":"null"}]},"periodStart":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodEnd":{"oneOf":[{"type":"string"},{"type":"null"}]},"constants":{"description":"Constants a template's formulas name ($salesTaxRate → {\"salesTaxRate\": 0.15}). Undeclared here, coercion would strip them and the formula would silently evaluate with 0.","oneOf":[{"type":"object"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Resolve a report template OR an insight view against a period. Templates: every field measured off the ledger or derived by its formula, each with a drilldown — name a statutory template by source (e.g. locale:za/vat201) or a stored template by templateid. Views (view: payables, receivables, profit-and-loss, balance-sheet, cash-flow, trial-balance, salestax-summary, salestax-activity, … — see the `view` param for the full list; e.g. payables returns every outstanding bill with supplier, amount, due date and currency, receivables the same for invoices): the data-driven insight feeds stub-web's screens render. With snapshotid the period evaluates FROZEN from the snapshot's filed listing — the filed numbers, immutable; without, LIVE from the current books.","tags":["report evaluation"]}},"/api/report/email":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"report":{"description":"profit-and-loss, balance-sheet, trial-balance, cash-flow, chart-of-accounts, statement (one customer's or supplier's account), overdue-invoices (each customer's overdue money by age; aged-debtors still works) or bank-transactions.","type":"string"},"format":{"description":"pdf or csv. A csv opens in Excel or Google Sheets.","type":"string"},"start":{"description":"First day, YYYY-MM-DD. Needed for profit-and-loss, cash-flow, statement and bank-transactions.","oneOf":[{"type":"string"},{"type":"null"}]},"end":{"description":"Last day, YYYY-MM-DD; the as-at date for balance-sheet, trial-balance and overdue-invoices. Needed for all but chart-of-accounts.","oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"description":"statement only: customer or supplier.","oneOf":[{"type":"string"},{"type":"null"}]},"id":{"description":"statement only: the customer's or supplier's id, from list_clients or list_suppliers.","oneOf":[{"type":"string"},{"type":"null"}]},"bankaccountid":{"description":"bank-transactions only: one bank account's id, from list_bank_accounts. Omit for every account.","oneOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"The one address to send to, such as the user's accountant. Use exactly the address the user gave.","type":"string"},"message":{"description":"A short plain-text note above the report. No greeting or sign-off: the email has its own.","oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"description":"Id of the chat to show the card in.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","report","format","email"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"report":{"description":"profit-and-loss, balance-sheet, trial-balance, cash-flow, chart-of-accounts, statement (one customer's or supplier's account), overdue-invoices (each customer's overdue money by age; aged-debtors still works) or bank-transactions.","type":"string"},"format":{"description":"pdf or csv. A csv opens in Excel or Google Sheets.","type":"string"},"start":{"description":"First day, YYYY-MM-DD. Needed for profit-and-loss, cash-flow, statement and bank-transactions.","oneOf":[{"type":"string"},{"type":"null"}]},"end":{"description":"Last day, YYYY-MM-DD; the as-at date for balance-sheet, trial-balance and overdue-invoices. Needed for all but chart-of-accounts.","oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"description":"statement only: customer or supplier.","oneOf":[{"type":"string"},{"type":"null"}]},"id":{"description":"statement only: the customer's or supplier's id, from list_clients or list_suppliers.","oneOf":[{"type":"string"},{"type":"null"}]},"bankaccountid":{"description":"bank-transactions only: one bank account's id, from list_bank_accounts. Omit for every account.","oneOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"The one address to send to, such as the user's accountant. Use exactly the address the user gave.","type":"string"},"message":{"description":"A short plain-text note above the report. No greeting or sign-off: the email has its own.","oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"description":"Id of the chat to show the card in.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","report","format","email"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"report":{"description":"profit-and-loss, balance-sheet, trial-balance, cash-flow, chart-of-accounts, statement (one customer's or supplier's account), overdue-invoices (each customer's overdue money by age; aged-debtors still works) or bank-transactions.","type":"string"},"format":{"description":"pdf or csv. A csv opens in Excel or Google Sheets.","type":"string"},"start":{"description":"First day, YYYY-MM-DD. Needed for profit-and-loss, cash-flow, statement and bank-transactions.","oneOf":[{"type":"string"},{"type":"null"}]},"end":{"description":"Last day, YYYY-MM-DD; the as-at date for balance-sheet, trial-balance and overdue-invoices. Needed for all but chart-of-accounts.","oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"description":"statement only: customer or supplier.","oneOf":[{"type":"string"},{"type":"null"}]},"id":{"description":"statement only: the customer's or supplier's id, from list_clients or list_suppliers.","oneOf":[{"type":"string"},{"type":"null"}]},"bankaccountid":{"description":"bank-transactions only: one bank account's id, from list_bank_accounts. Omit for every account.","oneOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"The one address to send to, such as the user's accountant. Use exactly the address the user gave.","type":"string"},"message":{"description":"A short plain-text note above the report. No greeting or sign-off: the email has its own.","oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"description":"Id of the chat to show the card in.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","report","format","email"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"report":{"description":"profit-and-loss, balance-sheet, trial-balance, cash-flow, chart-of-accounts, statement (one customer's or supplier's account), overdue-invoices (each customer's overdue money by age; aged-debtors still works) or bank-transactions.","type":"string"},"format":{"description":"pdf or csv. A csv opens in Excel or Google Sheets.","type":"string"},"start":{"description":"First day, YYYY-MM-DD. Needed for profit-and-loss, cash-flow, statement and bank-transactions.","oneOf":[{"type":"string"},{"type":"null"}]},"end":{"description":"Last day, YYYY-MM-DD; the as-at date for balance-sheet, trial-balance and overdue-invoices. Needed for all but chart-of-accounts.","oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"description":"statement only: customer or supplier.","oneOf":[{"type":"string"},{"type":"null"}]},"id":{"description":"statement only: the customer's or supplier's id, from list_clients or list_suppliers.","oneOf":[{"type":"string"},{"type":"null"}]},"bankaccountid":{"description":"bank-transactions only: one bank account's id, from list_bank_accounts. Omit for every account.","oneOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"The one address to send to, such as the user's accountant. Use exactly the address the user gave.","type":"string"},"message":{"description":"A short plain-text note above the report. No greeting or sign-off: the email has its own.","oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"description":"Id of the chat to show the card in.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","report","format","email"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Email a report as a PDF or a CSV attachment to one address the user names, such as their accountant. Takes the same report, format, dates, kind, id and bankaccountid as export_report, plus email and an optional message. Nothing is saved to Files. The first call sends nothing: it puts a card on the chat that names the report and the address, and answers status awaiting-user. Stop and wait; if the user ticks Send it, call again with the same input. A changed address, report, period or message asks again. Runs only inside an Ask stub chat. An address that is not one email is refused with reason report-email-invalid; a file too large to attach with report-email-too-large.","tags":["report evaluation"]}},"/api/ledger/committed":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"The committed general ledger: the latest sealed record per entry across the snapshot chain (the filed values, revision-attributed), plus the live tail after the boundary. GL screens and reports read this same construction, so they always agree. Entry names render from the live documents — records carry money, not prose. With no snapshot yet, everything is live.","tags":["committed ledger"]}},"/api/ledger/pending":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"The pending tray: every entry whose current books disagree with its sealed (filed) record — edited, added (back-dated arrivals included), or removed — with both sides' values and the per-account delta ('changed by X on account Y'). Pending money posts to no report and no GL until a new snapshot absorbs it; resolve items by correcting or binning the documents, then re-snapshot.","tags":["committed ledger"]}},"/api/widget-status":{"get":{"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Widget status"}},"/api/auth/token":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"apikey":{"type":"string"}},"required":["appid","apikey"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"apikey":{"type":"string"}},"required":["appid","apikey"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"apikey":{"type":"string"}},"required":["appid","apikey"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"apikey":{"type":"string"}},"required":["appid","apikey"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create authentication token","tags":["Authentication for plugins"]}},"/api/push/business":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"apikey":{"type":"string"},"appid":{"type":"string","minLength":1},"businessname":{"type":"string"},"firstname":{"type":"string"},"lastname":{"type":"string"},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"},"region":{"oneOf":[{"type":"string"},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["apikey","appid","businessname","firstname","lastname","email"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"apikey":{"type":"string"},"appid":{"type":"string","minLength":1},"businessname":{"type":"string"},"firstname":{"type":"string"},"lastname":{"type":"string"},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"},"region":{"oneOf":[{"type":"string"},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["apikey","appid","businessname","firstname","lastname","email"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"apikey":{"type":"string"},"appid":{"type":"string","minLength":1},"businessname":{"type":"string"},"firstname":{"type":"string"},"lastname":{"type":"string"},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"},"region":{"oneOf":[{"type":"string"},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["apikey","appid","businessname","firstname","lastname","email"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"apikey":{"type":"string"},"appid":{"type":"string","minLength":1},"businessname":{"type":"string"},"firstname":{"type":"string"},"lastname":{"type":"string"},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"},"region":{"oneOf":[{"type":"string"},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["apikey","appid","businessname","firstname","lastname","email"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create new business via plugin","tags":["data push from plugin"]}},"/api/push/business/update":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"apikey":{"type":"string"},"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"businessname":{"oneOf":[{"type":"string"},{"type":"null"}]},"firstname":{"oneOf":[{"type":"string"},{"type":"null"}]},"lastname":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"region":{"oneOf":[{"type":"string"},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["apikey","appid","uid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"apikey":{"type":"string"},"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"businessname":{"oneOf":[{"type":"string"},{"type":"null"}]},"firstname":{"oneOf":[{"type":"string"},{"type":"null"}]},"lastname":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"region":{"oneOf":[{"type":"string"},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["apikey","appid","uid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"apikey":{"type":"string"},"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"businessname":{"oneOf":[{"type":"string"},{"type":"null"}]},"firstname":{"oneOf":[{"type":"string"},{"type":"null"}]},"lastname":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"region":{"oneOf":[{"type":"string"},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["apikey","appid","uid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"apikey":{"type":"string"},"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"businessname":{"oneOf":[{"type":"string"},{"type":"null"}]},"firstname":{"oneOf":[{"type":"string"},{"type":"null"}]},"lastname":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"region":{"oneOf":[{"type":"string"},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["apikey","appid","uid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Update an existing business via plugin","tags":["data push from plugin"]}},"/api/push/reset":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Reset a test business via plugin","tags":["data push from plugin"]}},"/api/push/subscription":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Sponsored subscription for a business via plugin","tags":["data push from plugin"]}},"/api/push/cancellation":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Cancel sponsored subscription for a business via plugin","tags":["data push from plugin"]}},"/api/push/uncancel":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Uncancel business subscription","tags":["data push from plugin"]}},"/api/push/invoice":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create new invoice for a given business via plugin","tags":["data push from plugin"]}},"/api/push/income":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create new income for a given business via plugin","tags":["data push from plugin"]}},"/api/push/expense":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create new expense for a given business via plugin","tags":["data push from plugin"]}},"/api/push/expense-update":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Add a category to an expense via plugin","tags":["data push from plugin"]}},"/api/push/income-update":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Add a category to an expense via plugin","tags":["data push from plugin"]}},"/api/push/many":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create multiple income and expenses for a given business via plugin","tags":["data push from plugin"]}},"/api/push/settlement":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create multiple income and expenses linked to a settlement a given business via plugin","tags":["data push from plugin"]}},"/api/push/settlement-file":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create a settlement from a remote file url","tags":["data push from plugin"]}},"/api/push/settlement-update":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Update existing income, expenses and settlements by matching external IDs","tags":["data push from plugin"]}},"/api/push/settlement-update-file":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Update existing settlements from a remote file url by matching external IDs","tags":["data push from plugin"]}},"/api/push/sale":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create new sales invoice for a given business via plugin","tags":["data push from plugin"]}},"/api/push/delete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Delete a test business","tags":["data push from plugin"]}},"/api/push/import":{"post":{"requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"apikey":{"type":"string"},"bankaccountid":{"type":"string"},"uid":{"type":"string"},"bank":{"type":"string"},"csv":{"type":"string","format":"binary"}},"required":["apikey","bankaccountid","uid","bank","csv"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Import transactions from bank account","tags":["data push from plugin"]}},"/api/push/capitec-check":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Check if Capitec consent is given","tags":["data push from plugin"]}},"/api/push/recurring-invoices":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"apikey":{"type":"string"},"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"entity-ids":{"type":"array","items":{"type":"string"}},"entity-type":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["apikey","appid","uid","entity-ids"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"apikey":{"type":"string"},"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"entity-ids":{"type":"array","items":{"type":"string"}},"entity-type":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["apikey","appid","uid","entity-ids"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"apikey":{"type":"string"},"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"entity-ids":{"type":"array","items":{"type":"string"}},"entity-type":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["apikey","appid","uid","entity-ids"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"apikey":{"type":"string"},"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"entity-ids":{"type":"array","items":{"type":"string"}},"entity-type":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["apikey","appid","uid","entity-ids"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Trigger immediate duplication of recurring invoice/contract templates","tags":["data push from plugin"]}},"/api/pull/business":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"apikey":{"type":"string"},"appid":{"type":"string","minLength":1},"email":{"type":"string"}},"required":["apikey","appid","email"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"apikey":{"type":"string"},"appid":{"type":"string","minLength":1},"email":{"type":"string"}},"required":["apikey","appid","email"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"apikey":{"type":"string"},"appid":{"type":"string","minLength":1},"email":{"type":"string"}},"required":["apikey","appid","email"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"apikey":{"type":"string"},"appid":{"type":"string","minLength":1},"email":{"type":"string"}},"required":["apikey","appid","email"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Pull basic data for a given business","tags":["data pull from plugin"]}},"/api/pull/profile":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"apikey":{"type":"string"},"appid":{"type":"string","minLength":1},"email":{"type":"string"}},"required":["apikey","appid","email"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"apikey":{"type":"string"},"appid":{"type":"string","minLength":1},"email":{"type":"string"}},"required":["apikey","appid","email"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"apikey":{"type":"string"},"appid":{"type":"string","minLength":1},"email":{"type":"string"}},"required":["apikey","appid","email"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"apikey":{"type":"string"},"appid":{"type":"string","minLength":1},"email":{"type":"string"}},"required":["apikey","appid","email"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Pull basic data for a given profile","tags":["data pull from plugin"]}},"/api/pull/token":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Get a client token","tags":["data pull from plugin"]}},"/api/pull/insights":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Pull insights for a given business","tags":["data pull from plugin"]}},"/api/pull/summary":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"token":{"type":"string"}},"required":["appid","token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"token":{"type":"string"}},"required":["appid","token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"token":{"type":"string"}},"required":["appid","token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"token":{"type":"string"}},"required":["appid","token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Pull summary for a given business","tags":["data pull from plugin"]}},"/api/pull/context":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Pull context for a given business","tags":["data pull from plugin"]}},"/api/pull/expenses":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Pull expenses for a given business","tags":["data pull from plugin"]}},"/api/pull/income":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Pull income for a given business","tags":["data pull from plugin"]}},"/api/pull/pubsub":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Generate pubsub token","tags":["data pull from plugin"]}},"/api/pull/bank-feed":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Trigger bank sync for a given business","tags":["data pull from plugin"]}},"/api/pull/bank-disconnect":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Disconnect bank sync","tags":["data pull from plugin"]}},"/api/pull/bank-refresh":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{},{"type":"null"}]},"webhook":{"oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Update bank account data","tags":["data pull from plugin"]}},"/api/order/place":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"businessid":{"description":"ID of the business receiving the order","type":"string"},"callback":{"description":"URL to redirect after payment","oneOf":[{"type":"string"},{"type":"null"}]},"message":{"description":"Message or instructions from customer","oneOf":[{"type":"string"},{"type":"null"}]},"items":{"description":"Items in the order","oneOf":[{"type":"array","items":{"type":"object","properties":{"productid":{"description":"ID of the product","type":"string"},"variantid":{"description":"ID of the product variant","oneOf":[{"type":"string"},{"type":"null"}]},"quantity":{"description":"Quantity to order","type":"number"}},"required":["productid","quantity"],"additionalProperties":false}},{"type":"null"}]},"customer":{"description":"Customer information","oneOf":[{"type":"object","properties":{"name":{"description":"Customer name","oneOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Customer email address","type":"string"},"contactnumber":{"description":"Customer phone number","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"description":"Street address line 1","oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"description":"Street address line 2","oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"description":"Suburb or district","oneOf":[{"type":"string"},{"type":"null"}]},"city":{"description":"City","oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"description":"Postal or ZIP code","oneOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"Country","oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"description":"VAT/Tax registration number","oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"description":"Business registration number","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["email"],"additionalProperties":false},{"type":"null"}]},"webhook":{"description":"Web hook destination","oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"description":"Arbitrary string to validate authenticity of the web hook","oneOf":[{"type":"string"},{"type":"null"}]},"ref":{"description":"The reference a product payment link carries (?ref=): up to 64 letters, digits, - and _. Shown to the buyer read-only and saved on the payment.","oneOf":[{"type":"string"},{"type":"null"}]},"metadata":{"description":"Metadata a product payment link carries (m[key]=): up to 10 keys, keys up to 40 characters, text values up to 200. Saved on the payment; never changes the amount.","oneOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]}},"required":["businessid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"businessid":{"description":"ID of the business receiving the order","type":"string"},"callback":{"description":"URL to redirect after payment","oneOf":[{"type":"string"},{"type":"null"}]},"message":{"description":"Message or instructions from customer","oneOf":[{"type":"string"},{"type":"null"}]},"items":{"description":"Items in the order","oneOf":[{"type":"array","items":{"type":"object","properties":{"productid":{"description":"ID of the product","type":"string"},"variantid":{"description":"ID of the product variant","oneOf":[{"type":"string"},{"type":"null"}]},"quantity":{"description":"Quantity to order","type":"number"}},"required":["productid","quantity"],"additionalProperties":false}},{"type":"null"}]},"customer":{"description":"Customer information","oneOf":[{"type":"object","properties":{"name":{"description":"Customer name","oneOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Customer email address","type":"string"},"contactnumber":{"description":"Customer phone number","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"description":"Street address line 1","oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"description":"Street address line 2","oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"description":"Suburb or district","oneOf":[{"type":"string"},{"type":"null"}]},"city":{"description":"City","oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"description":"Postal or ZIP code","oneOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"Country","oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"description":"VAT/Tax registration number","oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"description":"Business registration number","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["email"],"additionalProperties":false},{"type":"null"}]},"webhook":{"description":"Web hook destination","oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"description":"Arbitrary string to validate authenticity of the web hook","oneOf":[{"type":"string"},{"type":"null"}]},"ref":{"description":"The reference a product payment link carries (?ref=): up to 64 letters, digits, - and _. Shown to the buyer read-only and saved on the payment.","oneOf":[{"type":"string"},{"type":"null"}]},"metadata":{"description":"Metadata a product payment link carries (m[key]=): up to 10 keys, keys up to 40 characters, text values up to 200. Saved on the payment; never changes the amount.","oneOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]}},"required":["businessid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"businessid":{"description":"ID of the business receiving the order","type":"string"},"callback":{"description":"URL to redirect after payment","oneOf":[{"type":"string"},{"type":"null"}]},"message":{"description":"Message or instructions from customer","oneOf":[{"type":"string"},{"type":"null"}]},"items":{"description":"Items in the order","oneOf":[{"type":"array","items":{"type":"object","properties":{"productid":{"description":"ID of the product","type":"string"},"variantid":{"description":"ID of the product variant","oneOf":[{"type":"string"},{"type":"null"}]},"quantity":{"description":"Quantity to order","type":"number"}},"required":["productid","quantity"],"additionalProperties":false}},{"type":"null"}]},"customer":{"description":"Customer information","oneOf":[{"type":"object","properties":{"name":{"description":"Customer name","oneOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Customer email address","type":"string"},"contactnumber":{"description":"Customer phone number","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"description":"Street address line 1","oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"description":"Street address line 2","oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"description":"Suburb or district","oneOf":[{"type":"string"},{"type":"null"}]},"city":{"description":"City","oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"description":"Postal or ZIP code","oneOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"Country","oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"description":"VAT/Tax registration number","oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"description":"Business registration number","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["email"],"additionalProperties":false},{"type":"null"}]},"webhook":{"description":"Web hook destination","oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"description":"Arbitrary string to validate authenticity of the web hook","oneOf":[{"type":"string"},{"type":"null"}]},"ref":{"description":"The reference a product payment link carries (?ref=): up to 64 letters, digits, - and _. Shown to the buyer read-only and saved on the payment.","oneOf":[{"type":"string"},{"type":"null"}]},"metadata":{"description":"Metadata a product payment link carries (m[key]=): up to 10 keys, keys up to 40 characters, text values up to 200. Saved on the payment; never changes the amount.","oneOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]}},"required":["businessid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"businessid":{"description":"ID of the business receiving the order","type":"string"},"callback":{"description":"URL to redirect after payment","oneOf":[{"type":"string"},{"type":"null"}]},"message":{"description":"Message or instructions from customer","oneOf":[{"type":"string"},{"type":"null"}]},"items":{"description":"Items in the order","oneOf":[{"type":"array","items":{"type":"object","properties":{"productid":{"description":"ID of the product","type":"string"},"variantid":{"description":"ID of the product variant","oneOf":[{"type":"string"},{"type":"null"}]},"quantity":{"description":"Quantity to order","type":"number"}},"required":["productid","quantity"],"additionalProperties":false}},{"type":"null"}]},"customer":{"description":"Customer information","oneOf":[{"type":"object","properties":{"name":{"description":"Customer name","oneOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Customer email address","type":"string"},"contactnumber":{"description":"Customer phone number","oneOf":[{"type":"string"},{"type":"null"}]},"address":{"description":"Street address line 1","oneOf":[{"type":"string"},{"type":"null"}]},"address2":{"description":"Street address line 2","oneOf":[{"type":"string"},{"type":"null"}]},"suburb":{"description":"Suburb or district","oneOf":[{"type":"string"},{"type":"null"}]},"city":{"description":"City","oneOf":[{"type":"string"},{"type":"null"}]},"postalcode":{"description":"Postal or ZIP code","oneOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"Country","oneOf":[{"type":"string"},{"type":"null"}]},"vatnumber":{"description":"VAT/Tax registration number","oneOf":[{"type":"string"},{"type":"null"}]},"registrationnumber":{"description":"Business registration number","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["email"],"additionalProperties":false},{"type":"null"}]},"webhook":{"description":"Web hook destination","oneOf":[{"type":"string"},{"type":"null"}]},"signature":{"description":"Arbitrary string to validate authenticity of the web hook","oneOf":[{"type":"string"},{"type":"null"}]},"ref":{"description":"The reference a product payment link carries (?ref=): up to 64 letters, digits, - and _. Shown to the buyer read-only and saved on the payment.","oneOf":[{"type":"string"},{"type":"null"}]},"metadata":{"description":"Metadata a product payment link carries (m[key]=): up to 10 keys, keys up to 40 characters, text values up to 200. Saved on the payment; never changes the amount.","oneOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]}},"required":["businessid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Place an online order","tags":["order management"]}},"/api/app/create":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"App id. Present → update that app; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name of the developer app.","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"What the app does.","oneOf":[{"type":"string"},{"type":"null"}]},"logo":{"description":"URL of the app's logo image.","oneOf":[{"type":"string"},{"type":"null"}]},"website":{"description":"The app's website / homepage URL.","oneOf":[{"type":"string"},{"type":"null"}]},"appid":{"description":"Stable app identifier / slug.","oneOf":[{"type":"string"},{"type":"null"}]},"status":{"description":"Lifecycle status (e.g. \"draft\", \"published\").","oneOf":[{"type":"string"},{"type":"null"}]},"redirect-uris":{"description":"Allowed OAuth redirect URIs for this app.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"App id. Present → update that app; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name of the developer app.","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"What the app does.","oneOf":[{"type":"string"},{"type":"null"}]},"logo":{"description":"URL of the app's logo image.","oneOf":[{"type":"string"},{"type":"null"}]},"website":{"description":"The app's website / homepage URL.","oneOf":[{"type":"string"},{"type":"null"}]},"appid":{"description":"Stable app identifier / slug.","oneOf":[{"type":"string"},{"type":"null"}]},"status":{"description":"Lifecycle status (e.g. \"draft\", \"published\").","oneOf":[{"type":"string"},{"type":"null"}]},"redirect-uris":{"description":"Allowed OAuth redirect URIs for this app.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"App id. Present → update that app; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name of the developer app.","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"What the app does.","oneOf":[{"type":"string"},{"type":"null"}]},"logo":{"description":"URL of the app's logo image.","oneOf":[{"type":"string"},{"type":"null"}]},"website":{"description":"The app's website / homepage URL.","oneOf":[{"type":"string"},{"type":"null"}]},"appid":{"description":"Stable app identifier / slug.","oneOf":[{"type":"string"},{"type":"null"}]},"status":{"description":"Lifecycle status (e.g. \"draft\", \"published\").","oneOf":[{"type":"string"},{"type":"null"}]},"redirect-uris":{"description":"Allowed OAuth redirect URIs for this app.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"App id. Present → update that app; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name of the developer app.","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"What the app does.","oneOf":[{"type":"string"},{"type":"null"}]},"logo":{"description":"URL of the app's logo image.","oneOf":[{"type":"string"},{"type":"null"}]},"website":{"description":"The app's website / homepage URL.","oneOf":[{"type":"string"},{"type":"null"}]},"appid":{"description":"Stable app identifier / slug.","oneOf":[{"type":"string"},{"type":"null"}]},"status":{"description":"Lifecycle status (e.g. \"draft\", \"published\").","oneOf":[{"type":"string"},{"type":"null"}]},"redirect-uris":{"description":"Allowed OAuth redirect URIs for this app.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Register a new developer app (an OAuth/integration app with a name, redirect URIs and status).","tags":["app management"]}},"/api/app/update":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"App id. Present → update that app; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name of the developer app.","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"What the app does.","oneOf":[{"type":"string"},{"type":"null"}]},"logo":{"description":"URL of the app's logo image.","oneOf":[{"type":"string"},{"type":"null"}]},"website":{"description":"The app's website / homepage URL.","oneOf":[{"type":"string"},{"type":"null"}]},"appid":{"description":"Stable app identifier / slug.","oneOf":[{"type":"string"},{"type":"null"}]},"status":{"description":"Lifecycle status (e.g. \"draft\", \"published\").","oneOf":[{"type":"string"},{"type":"null"}]},"redirect-uris":{"description":"Allowed OAuth redirect URIs for this app.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"App id. Present → update that app; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name of the developer app.","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"What the app does.","oneOf":[{"type":"string"},{"type":"null"}]},"logo":{"description":"URL of the app's logo image.","oneOf":[{"type":"string"},{"type":"null"}]},"website":{"description":"The app's website / homepage URL.","oneOf":[{"type":"string"},{"type":"null"}]},"appid":{"description":"Stable app identifier / slug.","oneOf":[{"type":"string"},{"type":"null"}]},"status":{"description":"Lifecycle status (e.g. \"draft\", \"published\").","oneOf":[{"type":"string"},{"type":"null"}]},"redirect-uris":{"description":"Allowed OAuth redirect URIs for this app.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"App id. Present → update that app; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name of the developer app.","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"What the app does.","oneOf":[{"type":"string"},{"type":"null"}]},"logo":{"description":"URL of the app's logo image.","oneOf":[{"type":"string"},{"type":"null"}]},"website":{"description":"The app's website / homepage URL.","oneOf":[{"type":"string"},{"type":"null"}]},"appid":{"description":"Stable app identifier / slug.","oneOf":[{"type":"string"},{"type":"null"}]},"status":{"description":"Lifecycle status (e.g. \"draft\", \"published\").","oneOf":[{"type":"string"},{"type":"null"}]},"redirect-uris":{"description":"Allowed OAuth redirect URIs for this app.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"App id. Present → update that app; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name of the developer app.","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"What the app does.","oneOf":[{"type":"string"},{"type":"null"}]},"logo":{"description":"URL of the app's logo image.","oneOf":[{"type":"string"},{"type":"null"}]},"website":{"description":"The app's website / homepage URL.","oneOf":[{"type":"string"},{"type":"null"}]},"appid":{"description":"Stable app identifier / slug.","oneOf":[{"type":"string"},{"type":"null"}]},"status":{"description":"Lifecycle status (e.g. \"draft\", \"published\").","oneOf":[{"type":"string"},{"type":"null"}]},"redirect-uris":{"description":"Allowed OAuth redirect URIs for this app.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Update a developer app's name, description, logo, website, redirect URIs or status by id.","tags":["app management"]}},"/api/app/apikey/create":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create a new API key for the app.","tags":["app management"]}},"/api/app/apikey/update":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the app whose API key to update.","type":"string"},"name":{"description":"New display name for the API key.","type":"string"}},"required":["token","id","name"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the app whose API key to update.","type":"string"},"name":{"description":"New display name for the API key.","type":"string"}},"required":["token","id","name"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the app whose API key to update.","type":"string"},"name":{"description":"New display name for the API key.","type":"string"}},"required":["token","id","name"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the app whose API key to update.","type":"string"},"name":{"description":"New display name for the API key.","type":"string"}},"required":["token","id","name"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Update an API key for the app.","tags":["app management"]}},"/api/app/apikey/delete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Delete an API key for the app","tags":["app management"]}},"/api/app/account/create":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"For create: the app id to attach the account to. For update: the account id.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name of the account this app posts to.","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"What the account is for.","oneOf":[{"type":"string"},{"type":"null"}]},"icon":{"description":"Icon key for the account.","oneOf":[{"type":"string"},{"type":"null"}]},"journal":{"description":"Journal number the account belongs to (1 income, 2 expenses, 3 assets, 4 liabilities, 5 equity).","oneOf":[{"type":"integer"},{"type":"null"}]},"group":{"description":"Account group/category label (e.g. \"Current Assets\").","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"For create: the app id to attach the account to. For update: the account id.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name of the account this app posts to.","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"What the account is for.","oneOf":[{"type":"string"},{"type":"null"}]},"icon":{"description":"Icon key for the account.","oneOf":[{"type":"string"},{"type":"null"}]},"journal":{"description":"Journal number the account belongs to (1 income, 2 expenses, 3 assets, 4 liabilities, 5 equity).","oneOf":[{"type":"integer"},{"type":"null"}]},"group":{"description":"Account group/category label (e.g. \"Current Assets\").","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"For create: the app id to attach the account to. For update: the account id.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name of the account this app posts to.","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"What the account is for.","oneOf":[{"type":"string"},{"type":"null"}]},"icon":{"description":"Icon key for the account.","oneOf":[{"type":"string"},{"type":"null"}]},"journal":{"description":"Journal number the account belongs to (1 income, 2 expenses, 3 assets, 4 liabilities, 5 equity).","oneOf":[{"type":"integer"},{"type":"null"}]},"group":{"description":"Account group/category label (e.g. \"Current Assets\").","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"For create: the app id to attach the account to. For update: the account id.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name of the account this app posts to.","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"What the account is for.","oneOf":[{"type":"string"},{"type":"null"}]},"icon":{"description":"Icon key for the account.","oneOf":[{"type":"string"},{"type":"null"}]},"journal":{"description":"Journal number the account belongs to (1 income, 2 expenses, 3 assets, 4 liabilities, 5 equity).","oneOf":[{"type":"integer"},{"type":"null"}]},"group":{"description":"Account group/category label (e.g. \"Current Assets\").","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create a new account for the app.","tags":["app management"]}},"/api/app/account/update":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"For create: the app id to attach the account to. For update: the account id.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name of the account this app posts to.","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"What the account is for.","oneOf":[{"type":"string"},{"type":"null"}]},"icon":{"description":"Icon key for the account.","oneOf":[{"type":"string"},{"type":"null"}]},"journal":{"description":"Journal number the account belongs to (1 income, 2 expenses, 3 assets, 4 liabilities, 5 equity).","oneOf":[{"type":"integer"},{"type":"null"}]},"group":{"description":"Account group/category label (e.g. \"Current Assets\").","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"For create: the app id to attach the account to. For update: the account id.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name of the account this app posts to.","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"What the account is for.","oneOf":[{"type":"string"},{"type":"null"}]},"icon":{"description":"Icon key for the account.","oneOf":[{"type":"string"},{"type":"null"}]},"journal":{"description":"Journal number the account belongs to (1 income, 2 expenses, 3 assets, 4 liabilities, 5 equity).","oneOf":[{"type":"integer"},{"type":"null"}]},"group":{"description":"Account group/category label (e.g. \"Current Assets\").","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"For create: the app id to attach the account to. For update: the account id.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name of the account this app posts to.","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"What the account is for.","oneOf":[{"type":"string"},{"type":"null"}]},"icon":{"description":"Icon key for the account.","oneOf":[{"type":"string"},{"type":"null"}]},"journal":{"description":"Journal number the account belongs to (1 income, 2 expenses, 3 assets, 4 liabilities, 5 equity).","oneOf":[{"type":"integer"},{"type":"null"}]},"group":{"description":"Account group/category label (e.g. \"Current Assets\").","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"For create: the app id to attach the account to. For update: the account id.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name of the account this app posts to.","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"What the account is for.","oneOf":[{"type":"string"},{"type":"null"}]},"icon":{"description":"Icon key for the account.","oneOf":[{"type":"string"},{"type":"null"}]},"journal":{"description":"Journal number the account belongs to (1 income, 2 expenses, 3 assets, 4 liabilities, 5 equity).","oneOf":[{"type":"integer"},{"type":"null"}]},"group":{"description":"Account group/category label (e.g. \"Current Assets\").","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Update an account for the app.","tags":["app management"]}},"/api/app/account/delete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Delete an account from the app","tags":["app management"]}},"/api/app/delete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Delete app","tags":["app management"]}},"/api/app/get-all":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"The catalogue of integrations (apps) a business can connect — bank feeds, payment providers, sales channels and payroll. Each entry carries the app's id, name, description, category, region and connection config. This is the public app store, not the business's installed apps.","tags":["app management"]}},"/api/app/install":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string"},"appid":{"anyOf":[{"type":"string"},{"type":"integer"}]},"fields":{"type":"array","items":{}}},"required":["token","businessid","appid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string"},"appid":{"anyOf":[{"type":"string"},{"type":"integer"}]},"fields":{"type":"array","items":{}}},"required":["token","businessid","appid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string"},"appid":{"anyOf":[{"type":"string"},{"type":"integer"}]},"fields":{"type":"array","items":{}}},"required":["token","businessid","appid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string"},"appid":{"anyOf":[{"type":"string"},{"type":"integer"}]},"fields":{"type":"array","items":{}}},"required":["token","businessid","appid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Trigger the install process for the specified app","tags":["app management"]}},"/api/app/install-from-key":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string"},"installkey":{"type":"string"},"reconnect":{"type":"boolean"},"existing":{"type":"boolean"}},"required":["token","businessid","installkey"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string"},"installkey":{"type":"string"},"reconnect":{"type":"boolean"},"existing":{"type":"boolean"}},"required":["token","businessid","installkey"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string"},"installkey":{"type":"string"},"reconnect":{"type":"boolean"},"existing":{"type":"boolean"}},"required":["token","businessid","installkey"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string"},"installkey":{"type":"string"},"reconnect":{"type":"boolean"},"existing":{"type":"boolean"}},"required":["token","businessid","installkey"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Attach an app install to the authed business using an installkey minted by an app-initiated OAuth callback","tags":["app management"]}},"/api/app/uninstall":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string"},"id":{"anyOf":[{"type":"string"},{"type":"integer"}]}},"required":["token","businessid","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string"},"id":{"anyOf":[{"type":"string"},{"type":"integer"}]}},"required":["token","businessid","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string"},"id":{"anyOf":[{"type":"string"},{"type":"integer"}]}},"required":["token","businessid","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string"},"id":{"anyOf":[{"type":"string"},{"type":"integer"}]}},"required":["token","businessid","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Trigger the uninstall process for the specified app","tags":["app management"]}},"/api/app/action":{"post":{"requestBody":{"content":{"application/json":{"schema":{}},"application/transit+msgpack":{"schema":{}},"application/transit+json":{"schema":{}},"application/edn":{"schema":{}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Launch a bank feed action, or run an action the app defines","tags":["app management"]}},"/api/app/postinstall":{"post":{"requestBody":{"content":{"application/json":{"schema":{}},"application/transit+msgpack":{"schema":{}},"application/transit+json":{"schema":{}},"application/edn":{"schema":{}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Quick install's step after connecting: the labels to show, or what a press does next","tags":["app management"]}},"/api/app/sync-all":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Refresh data from all of the business's installed integrations now (pulls the latest transactions/records from each connected app). Returns per-app sync results. Note: this pulls from every connected provider in turn and can take a while — on a business with several live bank feeds it may run longer than a typical tool-call timeout; if it times out the sync still continues server-side, so re-read (e.g. list_expenses) shortly after rather than immediately retrying.","tags":["app management"]}},"/api/app/runs":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"installid":{"description":"The installed app's install id whose recent sync runs to list. Get it from list_apps — a connected app carries its $installid (and $installed true).","type":"string"},"limit":{"description":"Max number of recent runs to return (1-50, default 5).","oneOf":[{"type":"integer"},{"type":"null"}]}},"required":["token","installid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"installid":{"description":"The installed app's install id whose recent sync runs to list. Get it from list_apps — a connected app carries its $installid (and $installed true).","type":"string"},"limit":{"description":"Max number of recent runs to return (1-50, default 5).","oneOf":[{"type":"integer"},{"type":"null"}]}},"required":["token","installid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"installid":{"description":"The installed app's install id whose recent sync runs to list. Get it from list_apps — a connected app carries its $installid (and $installed true).","type":"string"},"limit":{"description":"Max number of recent runs to return (1-50, default 5).","oneOf":[{"type":"integer"},{"type":"null"}]}},"required":["token","installid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"installid":{"description":"The installed app's install id whose recent sync runs to list. Get it from list_apps — a connected app carries its $installid (and $installed true).","type":"string"},"limit":{"description":"Max number of recent runs to return (1-50, default 5).","oneOf":[{"type":"integer"},{"type":"null"}]}},"required":["token","installid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"The recent sync runs for one installed app: when each ran, what triggered it, what it wrote, and how many things it left for a person to deal with. Excludes the per-run detail — read one run for that.","tags":["app management"]}},"/api/app/run":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"runid":{"description":"The sync run id to fetch in full. Get it from list_app_runs (each run carries its :id).","type":"string"}},"required":["token","runid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"runid":{"description":"The sync run id to fetch in full. Get it from list_app_runs (each run carries its :id).","type":"string"}},"required":["token","runid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"runid":{"description":"The sync run id to fetch in full. Get it from list_app_runs (each run carries its :id).","type":"string"}},"required":["token","runid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"runid":{"description":"The sync run id to fetch in full. Get it from list_app_runs (each run carries its :id).","type":"string"}},"required":["token","runid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"One sync run in full, including what it wrote and what it could not — each with the reason and the one edit that unblocks it.","tags":["app management"]}},"/api/app/webhook/{install}/{uid}":{"get":{"requestBody":{"content":{"application/json":{"schema":{}},"application/transit+msgpack":{"schema":{}},"application/transit+json":{"schema":{}},"application/edn":{"schema":{}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Webhook entrypoint for apps","tags":["app management"]},"post":{"requestBody":{"content":{"application/json":{"schema":{}},"application/transit+msgpack":{"schema":{}},"application/transit+json":{"schema":{}},"application/edn":{"schema":{}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Webhook entrypoint for apps","tags":["app management"]}},"/api/app/update-installed":{"post":{"requestBody":{"content":{"application/json":{"schema":{}},"application/transit+msgpack":{"schema":{}},"application/transit+json":{"schema":{}},"application/edn":{"schema":{}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Update Fields for installation","tags":["app management"]}},"/api/app/callback/{appid}":{"get":{"parameters":[],"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Callback entrypoint for apps","tags":["app management"]},"post":{"requestBody":{"content":{"application/json":{"schema":{}},"application/transit+msgpack":{"schema":{}},"application/transit+json":{"schema":{}},"application/edn":{"schema":{}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Callback entrypoint for apps","tags":["app management"]}},"/api/app/callback-resolve":{"get":{"parameters":[],"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Generic OAuth callback: resolves the app from the state param and dispatches to its callback","tags":["app management"]},"post":{"requestBody":{"content":{"application/json":{"schema":{}},"application/transit+msgpack":{"schema":{}},"application/transit+json":{"schema":{}},"application/edn":{"schema":{}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Generic OAuth callback: resolves the app from the state param and dispatches to its callback","tags":["app management"]}},"/api/app/yoco/connect":{"get":{"parameters":[],"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Yoco-initiated OAuth signup/login","tags":["app management"]}},"/api/app/shopify/install":{"get":{"parameters":[],"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Shopify App Store install: the shop comes from Shopify's signed request","tags":["app management"]}},"/api/app/process-pending":{"post":{"requestBody":{"content":{"application/json":{"schema":{}},"application/transit+msgpack":{"schema":{}},"application/transit+json":{"schema":{}},"application/edn":{"schema":{}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Process a pending app install action (generic — dispatches by app prefix)","tags":["app management"]}},"/api/app/shopify/gdpr/customer_data_request":{"post":{"requestBody":{"content":{"application/json":{"schema":{}},"application/transit+msgpack":{"schema":{}},"application/transit+json":{"schema":{}},"application/edn":{"schema":{}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Shopify mandatory GDPR: customer data request","tags":["app management"]}},"/api/app/shopify/gdpr/customers_redact":{"post":{"requestBody":{"content":{"application/json":{"schema":{}},"application/transit+msgpack":{"schema":{}},"application/transit+json":{"schema":{}},"application/edn":{"schema":{}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Shopify mandatory GDPR: customer data erasure","tags":["app management"]}},"/api/app/shopify/gdpr/shop_redact":{"post":{"requestBody":{"content":{"application/json":{"schema":{}},"application/transit+msgpack":{"schema":{}},"application/transit+json":{"schema":{}},"application/edn":{"schema":{}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Shopify mandatory GDPR: shop data erasure","tags":["app management"]}},"/api/utils/report":{"post":{"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"report issue","tags":["utilities"]}},"/api/feedback/mcp":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"feedback":{"description":"Your feedback about the MCP tools — what worked, what didn't, what's missing.","type":"string"},"tool":{"description":"Optional: the MCP tool name this feedback is about (e.g. list_invoices).","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","feedback"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"feedback":{"description":"Your feedback about the MCP tools — what worked, what didn't, what's missing.","type":"string"},"tool":{"description":"Optional: the MCP tool name this feedback is about (e.g. list_invoices).","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","feedback"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"feedback":{"description":"Your feedback about the MCP tools — what worked, what didn't, what's missing.","type":"string"},"tool":{"description":"Optional: the MCP tool name this feedback is about (e.g. list_invoices).","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","feedback"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"feedback":{"description":"Your feedback about the MCP tools — what worked, what didn't, what's missing.","type":"string"},"tool":{"description":"Optional: the MCP tool name this feedback is about (e.g. list_invoices).","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","feedback"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Send feedback about the MCP tools to the stub team.","tags":["feedback"]}},"/api/feedback/team":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"feedback":{"description":"The entrepreneur's feedback, in THEIR OWN WORDS. Quote what they said rather than summarising it — a paraphrase of feedback is not the feedback. Include the whole thought, not just the last sentence.","type":"string"},"kind":{"description":"\"feedback\" (the default): their words. \"fault\": something in stub is broken that you found yourself; `feedback` then says plainly what is wrong.","oneOf":[{"type":"string","enum":["feedback","fault"]},{"type":"null"}]},"ids":{"description":"For a fault: the ids of the records involved, as your tools gave them.","oneOf":[{"type":"array","items":{"type":"string","maxLength":64},"maxItems":20},{"type":"null"}]},"chatid":{"description":"Set automatically — do not supply. The conversation this feedback came from.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","feedback"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"feedback":{"description":"The entrepreneur's feedback, in THEIR OWN WORDS. Quote what they said rather than summarising it — a paraphrase of feedback is not the feedback. Include the whole thought, not just the last sentence.","type":"string"},"kind":{"description":"\"feedback\" (the default): their words. \"fault\": something in stub is broken that you found yourself; `feedback` then says plainly what is wrong.","oneOf":[{"type":"string","enum":["feedback","fault"]},{"type":"null"}]},"ids":{"description":"For a fault: the ids of the records involved, as your tools gave them.","oneOf":[{"type":"array","items":{"type":"string","maxLength":64},"maxItems":20},{"type":"null"}]},"chatid":{"description":"Set automatically — do not supply. The conversation this feedback came from.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","feedback"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"feedback":{"description":"The entrepreneur's feedback, in THEIR OWN WORDS. Quote what they said rather than summarising it — a paraphrase of feedback is not the feedback. Include the whole thought, not just the last sentence.","type":"string"},"kind":{"description":"\"feedback\" (the default): their words. \"fault\": something in stub is broken that you found yourself; `feedback` then says plainly what is wrong.","oneOf":[{"type":"string","enum":["feedback","fault"]},{"type":"null"}]},"ids":{"description":"For a fault: the ids of the records involved, as your tools gave them.","oneOf":[{"type":"array","items":{"type":"string","maxLength":64},"maxItems":20},{"type":"null"}]},"chatid":{"description":"Set automatically — do not supply. The conversation this feedback came from.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","feedback"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"feedback":{"description":"The entrepreneur's feedback, in THEIR OWN WORDS. Quote what they said rather than summarising it — a paraphrase of feedback is not the feedback. Include the whole thought, not just the last sentence.","type":"string"},"kind":{"description":"\"feedback\" (the default): their words. \"fault\": something in stub is broken that you found yourself; `feedback` then says plainly what is wrong.","oneOf":[{"type":"string","enum":["feedback","fault"]},{"type":"null"}]},"ids":{"description":"For a fault: the ids of the records involved, as your tools gave them.","oneOf":[{"type":"array","items":{"type":"string","maxLength":64},"maxItems":20},{"type":"null"}]},"chatid":{"description":"Set automatically — do not supply. The conversation this feedback came from.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","feedback"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Pass the entrepreneur's feedback, praise, complaint or feature request to the stub team, who read it in Slack. Use this whenever they ask you to send something on — \"send this to the team\", \"tell stub that…\", \"can you report this\", \"they should fix…\" — and offer it when they voice a clear frustration or want something stub cannot currently do. Quote their own words rather than summarising them. This is NOT feedback about the MCP tools (that is send_feedback), it does not open a support ticket, and nobody will reply in the chat — say so. ALWAYS check the returned `sent` field: when it is false the feedback reached nobody, and you must tell them it did not go through instead of thanking them for it. With kind fault, report a stub fault you found in a tool result (a voided invoice still owing, duplicate feed lines, an import error, a missing control): say what is wrong and pass the records' ids. Do not ask them first.","tags":["feedback"]}},"/api/navigate/open":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"destination":{"description":"Where to take the customer in the app. A page: assets, customers, employees, expenses, files, general-ledger, insights, products, reports, sales, settings/apps, settings/bank-accounts, settings/billing, settings/business, settings/finance, settings/notifications, settings/payments, settings/preferences, settings/tags, settings/team, settings/usage, suppliers, transactions. One record, with its id: bill, customer, invoice, product, quote, supplier. \"support\" opens the support chat.","type":"string"},"id":{"description":"The record's id from a tool result. Only for a record destination such as invoice or customer.","oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"description":"Set automatically — do not supply.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","destination"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"destination":{"description":"Where to take the customer in the app. A page: assets, customers, employees, expenses, files, general-ledger, insights, products, reports, sales, settings/apps, settings/bank-accounts, settings/billing, settings/business, settings/finance, settings/notifications, settings/payments, settings/preferences, settings/tags, settings/team, settings/usage, suppliers, transactions. One record, with its id: bill, customer, invoice, product, quote, supplier. \"support\" opens the support chat.","type":"string"},"id":{"description":"The record's id from a tool result. Only for a record destination such as invoice or customer.","oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"description":"Set automatically — do not supply.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","destination"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"destination":{"description":"Where to take the customer in the app. A page: assets, customers, employees, expenses, files, general-ledger, insights, products, reports, sales, settings/apps, settings/bank-accounts, settings/billing, settings/business, settings/finance, settings/notifications, settings/payments, settings/preferences, settings/tags, settings/team, settings/usage, suppliers, transactions. One record, with its id: bill, customer, invoice, product, quote, supplier. \"support\" opens the support chat.","type":"string"},"id":{"description":"The record's id from a tool result. Only for a record destination such as invoice or customer.","oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"description":"Set automatically — do not supply.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","destination"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"destination":{"description":"Where to take the customer in the app. A page: assets, customers, employees, expenses, files, general-ledger, insights, products, reports, sales, settings/apps, settings/bank-accounts, settings/billing, settings/business, settings/finance, settings/notifications, settings/payments, settings/preferences, settings/tags, settings/team, settings/usage, suppliers, transactions. One record, with its id: bill, customer, invoice, product, quote, supplier. \"support\" opens the support chat.","type":"string"},"id":{"description":"The record's id from a tool result. Only for a record destination such as invoice or customer.","oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"description":"Set automatically — do not supply.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","destination"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Open an allowlisted place in the app for the customer. Call it when they say \"take me to\", \"go to\", \"open it\" or \"show me\" a page, or a record you just named. For a record, pass its kind as destination and its id from a tool result as id. Never say you can't open pages. Not how to reach a person: when they ask for one — \"can I speak to someone\", \"talk to a person\" — or one of hand_over's reasons comes up, call hand_over. It passes the team the case and opens the support chat itself. Open \"support\" here only when hand_over came back with sent false, or when they ask to see the support chat without needing anyone to act. Only allowlisted destinations work; an unknown one comes back as an error for you to relay. Reply warmly and briefly once you've called it.","tags":["navigate"]}},"/api/navigate/handover":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"question":{"description":"Their question, in their own words, whole.","type":"string"},"reason":{"description":"Why a person must act. One of: `person` (they asked for a person), `refund` (they asked for a refund or a reversal), `legal-privacy` (a legal, privacy, POPIA or data request), `fault` (something in the app is broken and needs fixing), `billing-error` (a charge looks wrong and money may need to move), `account-security` (someone else may have got into the account, or they are locked out of it because their second-factor recovery codes fail).","type":"string"},"found":{"description":"What you found this turn, plainly, for the team.","oneOf":[{"type":"string"},{"type":"null"}]},"tried":{"description":"What you already told them, and why it didn't settle it.","oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"description":"billing, bank_feed, app, account, accounting, feature or other.","oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"description":"Set automatically — do not supply.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","question","reason"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"question":{"description":"Their question, in their own words, whole.","type":"string"},"reason":{"description":"Why a person must act. One of: `person` (they asked for a person), `refund` (they asked for a refund or a reversal), `legal-privacy` (a legal, privacy, POPIA or data request), `fault` (something in the app is broken and needs fixing), `billing-error` (a charge looks wrong and money may need to move), `account-security` (someone else may have got into the account, or they are locked out of it because their second-factor recovery codes fail).","type":"string"},"found":{"description":"What you found this turn, plainly, for the team.","oneOf":[{"type":"string"},{"type":"null"}]},"tried":{"description":"What you already told them, and why it didn't settle it.","oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"description":"billing, bank_feed, app, account, accounting, feature or other.","oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"description":"Set automatically — do not supply.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","question","reason"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"question":{"description":"Their question, in their own words, whole.","type":"string"},"reason":{"description":"Why a person must act. One of: `person` (they asked for a person), `refund` (they asked for a refund or a reversal), `legal-privacy` (a legal, privacy, POPIA or data request), `fault` (something in the app is broken and needs fixing), `billing-error` (a charge looks wrong and money may need to move), `account-security` (someone else may have got into the account, or they are locked out of it because their second-factor recovery codes fail).","type":"string"},"found":{"description":"What you found this turn, plainly, for the team.","oneOf":[{"type":"string"},{"type":"null"}]},"tried":{"description":"What you already told them, and why it didn't settle it.","oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"description":"billing, bank_feed, app, account, accounting, feature or other.","oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"description":"Set automatically — do not supply.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","question","reason"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"question":{"description":"Their question, in their own words, whole.","type":"string"},"reason":{"description":"Why a person must act. One of: `person` (they asked for a person), `refund` (they asked for a refund or a reversal), `legal-privacy` (a legal, privacy, POPIA or data request), `fault` (something in the app is broken and needs fixing), `billing-error` (a charge looks wrong and money may need to move), `account-security` (someone else may have got into the account, or they are locked out of it because their second-factor recovery codes fail).","type":"string"},"found":{"description":"What you found this turn, plainly, for the team.","oneOf":[{"type":"string"},{"type":"null"}]},"tried":{"description":"What you already told them, and why it didn't settle it.","oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"description":"billing, bank_feed, app, account, accounting, feature or other.","oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"description":"Set automatically — do not supply.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","question","reason"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Hand the question to the support team with the case written, so the customer never repeats themselves. Use it ONLY when a person must act, for one of these reasons: `person` (they asked for a person), `refund` (they asked for a refund or a reversal), `legal-privacy` (a legal, privacy, POPIA or data request), `fault` (something in the app is broken and needs fixing), `billing-error` (a charge looks wrong and money may need to move), `account-security` (someone else may have got into the account, or they are locked out of it because their second-factor recovery codes fail). Never to avoid a hard question. It opens a support conversation as them, with the case on it for the team, then opens the support chat. Check `sent`: when it is false nothing reached the team.","tags":["navigate"]}},"/api/hq/summary":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Business summary","tags":["stub HQ"]}},"/api/hq/business/search":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Business search","tags":["stub HQ"]}},"/api/hq/business/get":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Business retrieval","tags":["stub HQ"]}},"/api/hq/partner/get-all":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"All partners","tags":["stub HQ"]}},"/api/hq/partner/get":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Get partner","tags":["stub HQ"]}},"/api/hq/spark/activation":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"stubSpark: recent signups and live trials, with HQ's activation and the day counts behind it","tags":["stub HQ"]}},"/api/hq/spark/calls":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"stubSpark: the call log of every business on the activation feed or in its win-back reach","tags":["stub HQ"]}},"/api/hq/spark/call":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string","minLength":1},"result":{"oneOf":[{"type":"string","enum":["answered","noanswer"]},{"type":"null"}]},"followup":{"oneOf":[{"type":"string","enum":["callback","email","none"]},{"type":"null"}]},"callbackdate":{"oneOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"callbacktime":{"oneOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"disposition":{"oneOf":[{"type":"string","enum":["noanswer","callback","checkin_notstarted","checkin_allgood","help","closed"]},{"type":"null"}]},"voicemail":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"helptype":{"oneOf":[{"type":"string","enum":["demo","support"]},{"type":"null"}]},"closereason":{"oneOf":[{"type":"string","enum":["not_interested","not_ready","competitor","price","invalid_number","did_not_sign_up","other"]},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"noteid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","businessid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string","minLength":1},"result":{"oneOf":[{"type":"string","enum":["answered","noanswer"]},{"type":"null"}]},"followup":{"oneOf":[{"type":"string","enum":["callback","email","none"]},{"type":"null"}]},"callbackdate":{"oneOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"callbacktime":{"oneOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"disposition":{"oneOf":[{"type":"string","enum":["noanswer","callback","checkin_notstarted","checkin_allgood","help","closed"]},{"type":"null"}]},"voicemail":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"helptype":{"oneOf":[{"type":"string","enum":["demo","support"]},{"type":"null"}]},"closereason":{"oneOf":[{"type":"string","enum":["not_interested","not_ready","competitor","price","invalid_number","did_not_sign_up","other"]},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"noteid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","businessid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string","minLength":1},"result":{"oneOf":[{"type":"string","enum":["answered","noanswer"]},{"type":"null"}]},"followup":{"oneOf":[{"type":"string","enum":["callback","email","none"]},{"type":"null"}]},"callbackdate":{"oneOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"callbacktime":{"oneOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"disposition":{"oneOf":[{"type":"string","enum":["noanswer","callback","checkin_notstarted","checkin_allgood","help","closed"]},{"type":"null"}]},"voicemail":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"helptype":{"oneOf":[{"type":"string","enum":["demo","support"]},{"type":"null"}]},"closereason":{"oneOf":[{"type":"string","enum":["not_interested","not_ready","competitor","price","invalid_number","did_not_sign_up","other"]},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"noteid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","businessid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string","minLength":1},"result":{"oneOf":[{"type":"string","enum":["answered","noanswer"]},{"type":"null"}]},"followup":{"oneOf":[{"type":"string","enum":["callback","email","none"]},{"type":"null"}]},"callbackdate":{"oneOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"callbacktime":{"oneOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"disposition":{"oneOf":[{"type":"string","enum":["noanswer","callback","checkin_notstarted","checkin_allgood","help","closed"]},{"type":"null"}]},"voicemail":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"helptype":{"oneOf":[{"type":"string","enum":["demo","support"]},{"type":"null"}]},"closereason":{"oneOf":[{"type":"string","enum":["not_interested","not_ready","competitor","price","invalid_number","did_not_sign_up","other"]},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"noteid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","businessid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"stubSpark: save one call as a call note, and send the demo link or the support hand-off a help call asks for","tags":["stub HQ"]}},"/api/hq/spark/outcome":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string","minLength":1},"outcome":{"type":"string","enum":["unanswered","callback","checkin","needs-help","closed"]},"callback_at":{"oneOf":[{"type":"string"},{"type":"null"}]},"checkin_on":{"oneOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"close_reason":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"noteid":{"oneOf":[{"type":"string"},{"type":"null"}]},"inbound":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","businessid","outcome"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string","minLength":1},"outcome":{"type":"string","enum":["unanswered","callback","checkin","needs-help","closed"]},"callback_at":{"oneOf":[{"type":"string"},{"type":"null"}]},"checkin_on":{"oneOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"close_reason":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"noteid":{"oneOf":[{"type":"string"},{"type":"null"}]},"inbound":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","businessid","outcome"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string","minLength":1},"outcome":{"type":"string","enum":["unanswered","callback","checkin","needs-help","closed"]},"callback_at":{"oneOf":[{"type":"string"},{"type":"null"}]},"checkin_on":{"oneOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"close_reason":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"noteid":{"oneOf":[{"type":"string"},{"type":"null"}]},"inbound":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","businessid","outcome"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string","minLength":1},"outcome":{"type":"string","enum":["unanswered","callback","checkin","needs-help","closed"]},"callback_at":{"oneOf":[{"type":"string"},{"type":"null"}]},"checkin_on":{"oneOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"close_reason":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"noteid":{"oneOf":[{"type":"string"},{"type":"null"}]},"inbound":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","businessid","outcome"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"stubSpark: record one call's outcome (unanswered, callback, checkin, needs-help or closed) for the queue to read","tags":["stub HQ"]}},"/api/hq/spark/help":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string","minLength":1},"action":{"type":"string","enum":["demo","guide","extend","support"]},"guide_slug":{"oneOf":[{"type":"string"},{"type":"null"}]},"context":{"oneOf":[{"type":"string"},{"type":"null"}]},"noteid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","businessid","action"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string","minLength":1},"action":{"type":"string","enum":["demo","guide","extend","support"]},"guide_slug":{"oneOf":[{"type":"string"},{"type":"null"}]},"context":{"oneOf":[{"type":"string"},{"type":"null"}]},"noteid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","businessid","action"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string","minLength":1},"action":{"type":"string","enum":["demo","guide","extend","support"]},"guide_slug":{"oneOf":[{"type":"string"},{"type":"null"}]},"context":{"oneOf":[{"type":"string"},{"type":"null"}]},"noteid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","businessid","action"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string","minLength":1},"action":{"type":"string","enum":["demo","guide","extend","support"]},"guide_slug":{"oneOf":[{"type":"string"},{"type":"null"}]},"context":{"oneOf":[{"type":"string"},{"type":"null"}]},"noteid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","businessid","action"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"stubSpark: email a Needs help business the demo link, a website guide or the trial extension code, or hand the call to Barb as a SUP ticket, logged on the call","tags":["stub HQ"]}},"/api/hq/spark/guides":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"query":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"query":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"query":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"query":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"stubSpark: the website's guides a Needs help guide send picks from, searched by title, label, subtitle or category","tags":["stub HQ"]}},"/api/hq/spark/insights":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"period":{"oneOf":[{"type":"string"},{"type":"null"}]},"to":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"period":{"oneOf":[{"type":"string"},{"type":"null"}]},"to":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"period":{"oneOf":[{"type":"string"},{"type":"null"}]},"to":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"period":{"oneOf":[{"type":"string"},{"type":"null"}]},"to":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"stubSpark: the Insights page for a week or month: conversions by source, Needs help hand-offs, the call heat map, close-out reasons and themes from call notes","tags":["stub HQ"]}},"/api/hq/spark/settings":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"stubSpark: the Needs help email templates, demo link and extension code in use, with each template's placeholders","tags":["stub HQ"]}},"/api/hq/spark/settings/save":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"demo_url":{"oneOf":[{"type":"string"},{"type":"null"}]},"extension_code":{"oneOf":[{"type":"string"},{"type":"null"}]},"templates":{"oneOf":[{"type":"object","properties":{"demo":{"type":"object","properties":{"subject":{"oneOf":[{"type":"string"},{"type":"null"}]},"body":{"oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false},"guide":{"type":"object","properties":{"subject":{"oneOf":[{"type":"string"},{"type":"null"}]},"body":{"oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false},"extend":{"type":"object","properties":{"subject":{"oneOf":[{"type":"string"},{"type":"null"}]},"body":{"oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}},"additionalProperties":false},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"demo_url":{"oneOf":[{"type":"string"},{"type":"null"}]},"extension_code":{"oneOf":[{"type":"string"},{"type":"null"}]},"templates":{"oneOf":[{"type":"object","properties":{"demo":{"type":"object","properties":{"subject":{"oneOf":[{"type":"string"},{"type":"null"}]},"body":{"oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false},"guide":{"type":"object","properties":{"subject":{"oneOf":[{"type":"string"},{"type":"null"}]},"body":{"oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false},"extend":{"type":"object","properties":{"subject":{"oneOf":[{"type":"string"},{"type":"null"}]},"body":{"oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}},"additionalProperties":false},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"demo_url":{"oneOf":[{"type":"string"},{"type":"null"}]},"extension_code":{"oneOf":[{"type":"string"},{"type":"null"}]},"templates":{"oneOf":[{"type":"object","properties":{"demo":{"type":"object","properties":{"subject":{"oneOf":[{"type":"string"},{"type":"null"}]},"body":{"oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false},"guide":{"type":"object","properties":{"subject":{"oneOf":[{"type":"string"},{"type":"null"}]},"body":{"oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false},"extend":{"type":"object","properties":{"subject":{"oneOf":[{"type":"string"},{"type":"null"}]},"body":{"oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}},"additionalProperties":false},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"demo_url":{"oneOf":[{"type":"string"},{"type":"null"}]},"extension_code":{"oneOf":[{"type":"string"},{"type":"null"}]},"templates":{"oneOf":[{"type":"object","properties":{"demo":{"type":"object","properties":{"subject":{"oneOf":[{"type":"string"},{"type":"null"}]},"body":{"oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false},"guide":{"type":"object","properties":{"subject":{"oneOf":[{"type":"string"},{"type":"null"}]},"body":{"oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false},"extend":{"type":"object","properties":{"subject":{"oneOf":[{"type":"string"},{"type":"null"}]},"body":{"oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}},"additionalProperties":false},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"stubSpark: save the Needs help email templates, demo link or extension code (core group only), audited","tags":["stub HQ"]}},"/api/hq/spark/business":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string"}},"required":["token","businessid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string"}},"required":["token","businessid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string"}},"required":["token","businessid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string"}},"required":["token","businessid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"stubSpark: the call page for one business: header, why now, activation, top of mind, about the business, history and contact","tags":["stub HQ"]}},"/api/hq/spark/shift":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"stubSpark: the signed-in grad's open shift and hours today","tags":["stub HQ"]}},"/api/hq/spark/shift/start":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"stubSpark: Start shift for the signed-in grad (a second press answers the open shift)","tags":["stub HQ"]}},"/api/hq/spark/shift/end":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"stubSpark: End shift for the signed-in grad","tags":["stub HQ"]}},"/api/hq/spark/shift/correct":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string","minLength":1},"start":{"type":"integer"},"end":{"type":"integer"},"reason":{"type":"string"}},"required":["token","id","start","end","reason"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string","minLength":1},"start":{"type":"integer"},"end":{"type":"integer"},"reason":{"type":"string"}},"required":["token","id","start","end","reason"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string","minLength":1},"start":{"type":"integer"},"end":{"type":"integer"},"reason":{"type":"string"}},"required":["token","id","start","end","reason"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string","minLength":1},"start":{"type":"integer"},"end":{"type":"integer"},"reason":{"type":"string"}},"required":["token","id","start","end","reason"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"stubSpark: a lead corrects a grad's shift start and end, with a reason (core group only), audited","tags":["stub HQ"]}},"/api/hq/spark/grads":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"from":{"oneOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"to":{"oneOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"from":{"oneOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"to":{"oneOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"from":{"oneOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"to":{"oneOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"from":{"oneOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"to":{"oneOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"stubSpark: every grad's dialled, answered, converted, rate, hours and earned for a window (core group only)","tags":["stub HQ"]}},"/api/hq/spark/grads/me":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"from":{"oneOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"to":{"oneOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"from":{"oneOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"to":{"oneOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"from":{"oneOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"to":{"oneOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"from":{"oneOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"to":{"oneOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"stubSpark: My progress, the signed-in grad's own figures, personal bests and conversions","tags":["stub HQ"]}},"/api/hq/spark/contacts":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"query":{"oneOf":[{"type":"string"},{"type":"null"}]},"status":{"oneOf":[{"type":"string","enum":["all","trial","held","expired","converted","closed"]},{"type":"null"}]},"page":{"oneOf":[{"type":"integer","minimum":1},{"type":"null"}]},"per_page":{"oneOf":[{"type":"integer","minimum":1,"maximum":200},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"query":{"oneOf":[{"type":"string"},{"type":"null"}]},"status":{"oneOf":[{"type":"string","enum":["all","trial","held","expired","converted","closed"]},{"type":"null"}]},"page":{"oneOf":[{"type":"integer","minimum":1},{"type":"null"}]},"per_page":{"oneOf":[{"type":"integer","minimum":1,"maximum":200},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"query":{"oneOf":[{"type":"string"},{"type":"null"}]},"status":{"oneOf":[{"type":"string","enum":["all","trial","held","expired","converted","closed"]},{"type":"null"}]},"page":{"oneOf":[{"type":"integer","minimum":1},{"type":"null"}]},"per_page":{"oneOf":[{"type":"integer","minimum":1,"maximum":200},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"query":{"oneOf":[{"type":"string"},{"type":"null"}]},"status":{"oneOf":[{"type":"string","enum":["all","trial","held","expired","converted","closed"]},{"type":"null"}]},"page":{"oneOf":[{"type":"integer","minimum":1},{"type":"null"}]},"per_page":{"oneOf":[{"type":"integer","minimum":1,"maximum":200},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"stubSpark: every Spark sign-up with its status, callback and last contact, searchable by name, email or number and grouped by owner, a page of owner groups at a time","tags":["stub HQ"]}},"/api/hq/spark/todos":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"scope":{"oneOf":[{"type":"string","enum":["mine","everyone"]},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"scope":{"oneOf":[{"type":"string","enum":["mine","everyone"]},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"scope":{"oneOf":[{"type":"string","enum":["mine","everyone"]},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"scope":{"oneOf":[{"type":"string","enum":["mine","everyone"]},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"stubSpark: the To-do page: to-dos and booked callbacks, each with its tab (overdue, today, upcoming, no date, done in the last week), for everyone or mine","tags":["stub HQ"]}},"/api/hq/spark/todos/save":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"owner":{"oneOf":[{"type":"string"},{"type":"null"}]},"type":{"oneOf":[{"type":"string"},{"type":"null"}]},"tag":{"oneOf":[{"type":"string"},{"type":"null"}]},"date":{"oneOf":[{"type":"string"},{"type":"null"}]},"time":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"done":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"subtasks":{"oneOf":[{"type":"array","items":{"type":"object","properties":{"title":{"oneOf":[{"type":"string"},{"type":"null"}]},"done":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"owner":{"oneOf":[{"type":"string"},{"type":"null"}]},"type":{"oneOf":[{"type":"string"},{"type":"null"}]},"tag":{"oneOf":[{"type":"string"},{"type":"null"}]},"date":{"oneOf":[{"type":"string"},{"type":"null"}]},"time":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"done":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"subtasks":{"oneOf":[{"type":"array","items":{"type":"object","properties":{"title":{"oneOf":[{"type":"string"},{"type":"null"}]},"done":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"owner":{"oneOf":[{"type":"string"},{"type":"null"}]},"type":{"oneOf":[{"type":"string"},{"type":"null"}]},"tag":{"oneOf":[{"type":"string"},{"type":"null"}]},"date":{"oneOf":[{"type":"string"},{"type":"null"}]},"time":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"done":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"subtasks":{"oneOf":[{"type":"array","items":{"type":"object","properties":{"title":{"oneOf":[{"type":"string"},{"type":"null"}]},"done":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"owner":{"oneOf":[{"type":"string"},{"type":"null"}]},"type":{"oneOf":[{"type":"string"},{"type":"null"}]},"tag":{"oneOf":[{"type":"string"},{"type":"null"}]},"date":{"oneOf":[{"type":"string"},{"type":"null"}]},"time":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"done":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"subtasks":{"oneOf":[{"type":"array","items":{"type":"object","properties":{"title":{"oneOf":[{"type":"string"},{"type":"null"}]},"done":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"stubSpark: add a to-do, edit one, or save a booked callback's to-do notes and sub-tasks, audited","tags":["stub HQ"]}},"/api/hq/spark/todos/delete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string","minLength":1}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string","minLength":1}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string","minLength":1}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string","minLength":1}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"stubSpark: delete a to-do a grad added, audited","tags":["stub HQ"]}},"/api/hq/spark/dashboard":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"date":{"oneOf":[{"type":"string"},{"type":"null"}]},"scope":{"oneOf":[{"type":"string","enum":["team","mine"]},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"date":{"oneOf":[{"type":"string"},{"type":"null"}]},"scope":{"oneOf":[{"type":"string","enum":["team","mine"]},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"date":{"oneOf":[{"type":"string"},{"type":"null"}]},"scope":{"oneOf":[{"type":"string","enum":["team","mine"]},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"date":{"oneOf":[{"type":"string"},{"type":"null"}]},"scope":{"oneOf":[{"type":"string","enum":["team","mine"]},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"stubSpark: the Dashboard: a day's dialled, answered and converted with the change, callbacks overdue and due today, today's hand-offs to Support and the leads still to call by source, for the team or a grad's own","tags":["stub HQ"]}},"/api/hq/revenue":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"from":{"oneOf":[{"type":"string"},{"type":"null"}]},"to":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"from":{"oneOf":[{"type":"string"},{"type":"null"}]},"to":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"from":{"oneOf":[{"type":"string"},{"type":"null"}]},"to":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"from":{"oneOf":[{"type":"string"},{"type":"null"}]},"to":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"stub's own revenue — subscription payments only, gross, in SAST","tags":["stub HQ"]}},"/api/hq/metrics":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"MRR, ARR, growth, bridge, retention, engagement, unit economics — the fund-raise set with its assumptions","tags":["stub HQ"]}},"/api/hq/features":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"window":{"oneOf":[{"type":"integer"},{"type":"null"}]},"channel":{"oneOf":[{"type":"string"},{"type":"null"}]},"app":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"window":{"oneOf":[{"type":"integer"},{"type":"null"}]},"channel":{"oneOf":[{"type":"string"},{"type":"null"}]},"app":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"window":{"oneOf":[{"type":"integer"},{"type":"null"}]},"channel":{"oneOf":[{"type":"string"},{"type":"null"}]},"app":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"window":{"oneOf":[{"type":"integer"},{"type":"null"}]},"channel":{"oneOf":[{"type":"string"},{"type":"null"}]},"app":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Feature adoption across the fleet — what is used, what is entitled and unused, and what the server cannot measure","tags":["stub HQ"]}},"/api/hq/features/drilldown":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"feature":{"type":"string"},"window":{"oneOf":[{"type":"integer"},{"type":"null"}]},"limit":{"oneOf":[{"type":"integer"},{"type":"null"}]},"channel":{"oneOf":[{"type":"string"},{"type":"null"}]},"app":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","feature"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"feature":{"type":"string"},"window":{"oneOf":[{"type":"integer"},{"type":"null"}]},"limit":{"oneOf":[{"type":"integer"},{"type":"null"}]},"channel":{"oneOf":[{"type":"string"},{"type":"null"}]},"app":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","feature"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"feature":{"type":"string"},"window":{"oneOf":[{"type":"integer"},{"type":"null"}]},"limit":{"oneOf":[{"type":"integer"},{"type":"null"}]},"channel":{"oneOf":[{"type":"string"},{"type":"null"}]},"app":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","feature"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"feature":{"type":"string"},"window":{"oneOf":[{"type":"integer"},{"type":"null"}]},"limit":{"oneOf":[{"type":"integer"},{"type":"null"}]},"channel":{"oneOf":[{"type":"string"},{"type":"null"}]},"app":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","feature"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"The businesses behind one feature, ranked by uses","tags":["stub HQ"]}},"/api/hq/metrics/export.csv":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"The same document as one CSV for the data room","tags":["stub HQ"]}},"/api/hq/metrics/refresh":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Recompute the cached metrics document now (janitor does this hourly)","tags":["stub HQ"]}},"/api/hq/revenue/reconcile":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"month":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"month":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"month":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"month":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Reconcile a month's cash against Stripe's paid invoices","tags":["stub HQ"]}},"/api/hq/revenue/backfill":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"since":{"oneOf":[{"type":"string"},{"type":"null"}]},"dry_run":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"since":{"oneOf":[{"type":"string"},{"type":"null"}]},"dry_run":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"since":{"oneOf":[{"type":"string"},{"type":"null"}]},"dry_run":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"since":{"oneOf":[{"type":"string"},{"type":"null"}]},"dry_run":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Backfill Stripe refunds, disputes and processor fees into the revenue store","tags":["stub HQ"]}},"/api/hq/report/all":{"get":{"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"List all customers","tags":["stub HQ"]}},"/api/hq/partner/report":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"start":{"oneOf":[{"type":"string"},{"type":"null"}]},"end":{"oneOf":[{"type":"string"},{"type":"null"}]},"year":{"oneOf":[{"type":"integer"},{"type":"null"}]},"month":{"oneOf":[{"type":"integer"},{"type":"null"}]},"id":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"start":{"oneOf":[{"type":"string"},{"type":"null"}]},"end":{"oneOf":[{"type":"string"},{"type":"null"}]},"year":{"oneOf":[{"type":"integer"},{"type":"null"}]},"month":{"oneOf":[{"type":"integer"},{"type":"null"}]},"id":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"start":{"oneOf":[{"type":"string"},{"type":"null"}]},"end":{"oneOf":[{"type":"string"},{"type":"null"}]},"year":{"oneOf":[{"type":"integer"},{"type":"null"}]},"month":{"oneOf":[{"type":"integer"},{"type":"null"}]},"id":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"start":{"oneOf":[{"type":"string"},{"type":"null"}]},"end":{"oneOf":[{"type":"string"},{"type":"null"}]},"year":{"oneOf":[{"type":"integer"},{"type":"null"}]},"month":{"oneOf":[{"type":"integer"},{"type":"null"}]},"id":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Partner report","tags":["stub HQ"]}},"/api/hq/referrer/report":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"start":{"oneOf":[{"type":"string"},{"type":"null"}]},"end":{"oneOf":[{"type":"string"},{"type":"null"}]},"year":{"oneOf":[{"type":"integer"},{"type":"null"}]},"month":{"oneOf":[{"type":"integer"},{"type":"null"}]},"id":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"start":{"oneOf":[{"type":"string"},{"type":"null"}]},"end":{"oneOf":[{"type":"string"},{"type":"null"}]},"year":{"oneOf":[{"type":"integer"},{"type":"null"}]},"month":{"oneOf":[{"type":"integer"},{"type":"null"}]},"id":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"start":{"oneOf":[{"type":"string"},{"type":"null"}]},"end":{"oneOf":[{"type":"string"},{"type":"null"}]},"year":{"oneOf":[{"type":"integer"},{"type":"null"}]},"month":{"oneOf":[{"type":"integer"},{"type":"null"}]},"id":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"start":{"oneOf":[{"type":"string"},{"type":"null"}]},"end":{"oneOf":[{"type":"string"},{"type":"null"}]},"year":{"oneOf":[{"type":"integer"},{"type":"null"}]},"month":{"oneOf":[{"type":"integer"},{"type":"null"}]},"id":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Partner report","tags":["stub HQ"]}},"/api/hq/source/report":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"start":{"oneOf":[{"type":"string"},{"type":"null"}]},"end":{"oneOf":[{"type":"string"},{"type":"null"}]},"year":{"oneOf":[{"type":"integer"},{"type":"null"}]},"month":{"oneOf":[{"type":"integer"},{"type":"null"}]},"id":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"start":{"oneOf":[{"type":"string"},{"type":"null"}]},"end":{"oneOf":[{"type":"string"},{"type":"null"}]},"year":{"oneOf":[{"type":"integer"},{"type":"null"}]},"month":{"oneOf":[{"type":"integer"},{"type":"null"}]},"id":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"start":{"oneOf":[{"type":"string"},{"type":"null"}]},"end":{"oneOf":[{"type":"string"},{"type":"null"}]},"year":{"oneOf":[{"type":"integer"},{"type":"null"}]},"month":{"oneOf":[{"type":"integer"},{"type":"null"}]},"id":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"start":{"oneOf":[{"type":"string"},{"type":"null"}]},"end":{"oneOf":[{"type":"string"},{"type":"null"}]},"year":{"oneOf":[{"type":"integer"},{"type":"null"}]},"month":{"oneOf":[{"type":"integer"},{"type":"null"}]},"id":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Partner report","tags":["stub HQ"]}},"/api/hq/partner/report/{not-relevant}":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"start":{"oneOf":[{"type":"string"},{"type":"null"}]},"end":{"oneOf":[{"type":"string"},{"type":"null"}]},"year":{"oneOf":[{"type":"integer"},{"type":"null"}]},"month":{"oneOf":[{"type":"integer"},{"type":"null"}]},"id":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"start":{"oneOf":[{"type":"string"},{"type":"null"}]},"end":{"oneOf":[{"type":"string"},{"type":"null"}]},"year":{"oneOf":[{"type":"integer"},{"type":"null"}]},"month":{"oneOf":[{"type":"integer"},{"type":"null"}]},"id":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"start":{"oneOf":[{"type":"string"},{"type":"null"}]},"end":{"oneOf":[{"type":"string"},{"type":"null"}]},"year":{"oneOf":[{"type":"integer"},{"type":"null"}]},"month":{"oneOf":[{"type":"integer"},{"type":"null"}]},"id":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"start":{"oneOf":[{"type":"string"},{"type":"null"}]},"end":{"oneOf":[{"type":"string"},{"type":"null"}]},"year":{"oneOf":[{"type":"integer"},{"type":"null"}]},"month":{"oneOf":[{"type":"integer"},{"type":"null"}]},"id":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Partner report","tags":["stub HQ"]}},"/api/hq/actions/transact":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"secret":{"type":"string"},"retract":{"type":"boolean"},"transactions":{"type":"string"}},"required":["token","secret","transactions"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"secret":{"type":"string"},"retract":{"type":"boolean"},"transactions":{"type":"string"}},"required":["token","secret","transactions"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"secret":{"type":"string"},"retract":{"type":"boolean"},"transactions":{"type":"string"}},"required":["token","secret","transactions"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"secret":{"type":"string"},"retract":{"type":"boolean"},"transactions":{"type":"string"}},"required":["token","secret","transactions"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"transact","tags":["stub HQ","hq reports"]}},"/api/hq/actions/categorize":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"expenses":{"type":"array","items":{"type":"object","properties":{"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"predictedid":{"oneOf":[{"type":"string"},{"type":"null"}]},"matched":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false}}},"required":["token","expenses"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"expenses":{"type":"array","items":{"type":"object","properties":{"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"predictedid":{"oneOf":[{"type":"string"},{"type":"null"}]},"matched":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false}}},"required":["token","expenses"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"expenses":{"type":"array","items":{"type":"object","properties":{"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"predictedid":{"oneOf":[{"type":"string"},{"type":"null"}]},"matched":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false}}},"required":["token","expenses"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"expenses":{"type":"array","items":{"type":"object","properties":{"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"predictedid":{"oneOf":[{"type":"string"},{"type":"null"}]},"matched":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false}}},"required":["token","expenses"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"categorize","tags":["stub HQ","hq reports"]}},"/api/hq/actions/make-sensitive":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string"}},"required":["token","businessid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string"}},"required":["token","businessid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string"}},"required":["token","businessid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string"}},"required":["token","businessid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"make sensitive","tags":["stub HQ","hq reports"]}},"/api/hq/actions/query":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"secret":{"type":"string"},"query":{"type":"string"},"args":{"type":"string"},"history":{"oneOf":[{"type":"string"},{"type":"null"}]},"timepoint":{"oneOf":[{"type":"string"},{"type":"null"}]},"timeout-ms":{"oneOf":[{"type":"integer","minimum":1},{"type":"null"}]}},"required":["token","secret","query"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"secret":{"type":"string"},"query":{"type":"string"},"args":{"type":"string"},"history":{"oneOf":[{"type":"string"},{"type":"null"}]},"timepoint":{"oneOf":[{"type":"string"},{"type":"null"}]},"timeout-ms":{"oneOf":[{"type":"integer","minimum":1},{"type":"null"}]}},"required":["token","secret","query"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"secret":{"type":"string"},"query":{"type":"string"},"args":{"type":"string"},"history":{"oneOf":[{"type":"string"},{"type":"null"}]},"timepoint":{"oneOf":[{"type":"string"},{"type":"null"}]},"timeout-ms":{"oneOf":[{"type":"integer","minimum":1},{"type":"null"}]}},"required":["token","secret","query"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"secret":{"type":"string"},"query":{"type":"string"},"args":{"type":"string"},"history":{"oneOf":[{"type":"string"},{"type":"null"}]},"timepoint":{"oneOf":[{"type":"string"},{"type":"null"}]},"timeout-ms":{"oneOf":[{"type":"integer","minimum":1},{"type":"null"}]}},"required":["token","secret","query"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"query","tags":["stub HQ","hq reports"]}},"/api/hq/actions/pull":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"secret":{"type":"string"},"pattern":{"type":"string"},"selector":{"type":"string"}},"required":["token","secret","pattern","selector"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"secret":{"type":"string"},"pattern":{"type":"string"},"selector":{"type":"string"}},"required":["token","secret","pattern","selector"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"secret":{"type":"string"},"pattern":{"type":"string"},"selector":{"type":"string"}},"required":["token","secret","pattern","selector"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"secret":{"type":"string"},"pattern":{"type":"string"},"selector":{"type":"string"}},"required":["token","secret","pattern","selector"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"pull","tags":["stub HQ","hq reports"]}},"/api/hq/actions/delete-test-business":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string"}},"required":["token","businessid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string"}},"required":["token","businessid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string"}},"required":["token","businessid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string"}},"required":["token","businessid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"delete test business","tags":["stub HQ","hq reports"]}},"/api/hq/actions/toggle-developer-access":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string"}},"required":["token","businessid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string"}},"required":["token","businessid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string"}},"required":["token","businessid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string"}},"required":["token","businessid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"toggle developer access","tags":["stub HQ","hq reports"]}},"/api/hq/actions/uncancel":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string"}},"required":["token","businessid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string"}},"required":["token","businessid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string"}},"required":["token","businessid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string"}},"required":["token","businessid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"uncancel subscription","tags":["stub HQ","hq reports"]}},"/api/hq/actions/disconnect-bank":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string"}},"required":["token","businessid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string"}},"required":["token","businessid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string"}},"required":["token","businessid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string"}},"required":["token","businessid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"disconnect bank account","tags":["stub HQ","hq reports"]}},"/api/hq/actions/refresh-bank":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string"}},"required":["token","businessid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string"}},"required":["token","businessid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string"}},"required":["token","businessid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string"}},"required":["token","businessid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"refresh bank account","tags":["stub HQ","hq reports"]}},"/api/hq/actions/sync-bi":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"batch-size":{"oneOf":[{"type":"integer"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"batch-size":{"oneOf":[{"type":"integer"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"batch-size":{"oneOf":[{"type":"integer"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"batch-size":{"oneOf":[{"type":"integer"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Sync all businesses to BI database (core data only)","tags":["stub HQ","hq reports"]}},"/hq/billing/watchlist":{"get":{"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"HQ billing watchlist"}},"/api/tag/list":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"List the business's tags: each label's name, colour, group and whether it is archived. Read this before tagging a record, so an existing tag is reused rather than a near-duplicate created.","tags":["accounting tag management"]}},"/api/tag/create":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Tag id. Present → update that tag; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name of the tag.","oneOf":[{"type":"string"},{"type":"null"}]},"color":{"description":"Hex colour for the tag (e.g. \"#8a8d82\"), used for display.","oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"description":"Whether the tag is archived. Omit on create to default to unarchived.","oneOf":[{"type":"boolean"},{"type":"null"}]},"group":{"description":"Free-text group the tag belongs to. On update, passing null or \"\" clears an existing group; omitting the key leaves it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Tag id. Present → update that tag; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name of the tag.","oneOf":[{"type":"string"},{"type":"null"}]},"color":{"description":"Hex colour for the tag (e.g. \"#8a8d82\"), used for display.","oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"description":"Whether the tag is archived. Omit on create to default to unarchived.","oneOf":[{"type":"boolean"},{"type":"null"}]},"group":{"description":"Free-text group the tag belongs to. On update, passing null or \"\" clears an existing group; omitting the key leaves it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Tag id. Present → update that tag; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name of the tag.","oneOf":[{"type":"string"},{"type":"null"}]},"color":{"description":"Hex colour for the tag (e.g. \"#8a8d82\"), used for display.","oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"description":"Whether the tag is archived. Omit on create to default to unarchived.","oneOf":[{"type":"boolean"},{"type":"null"}]},"group":{"description":"Free-text group the tag belongs to. On update, passing null or \"\" clears an existing group; omitting the key leaves it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Tag id. Present → update that tag; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name of the tag.","oneOf":[{"type":"string"},{"type":"null"}]},"color":{"description":"Hex colour for the tag (e.g. \"#8a8d82\"), used for display.","oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"description":"Whether the tag is archived. Omit on create to default to unarchived.","oneOf":[{"type":"boolean"},{"type":"null"}]},"group":{"description":"Free-text group the tag belongs to. On update, passing null or \"\" clears an existing group; omitting the key leaves it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create a tag — a coloured label for categorising transactions, entries and other records. Use when you need a new label to apply across records; to rename or recolour an existing tag use update_tag, and to remove one use delete_tag. Note this is an accounting tag applied to records, not the business's own segmentation label — for that use set_business_tag.","tags":["accounting tag management"]}},"/api/tag/update":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Tag id. Present → update that tag; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name of the tag.","oneOf":[{"type":"string"},{"type":"null"}]},"color":{"description":"Hex colour for the tag (e.g. \"#8a8d82\"), used for display.","oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"description":"Whether the tag is archived. Omit on create to default to unarchived.","oneOf":[{"type":"boolean"},{"type":"null"}]},"group":{"description":"Free-text group the tag belongs to. On update, passing null or \"\" clears an existing group; omitting the key leaves it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Tag id. Present → update that tag; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name of the tag.","oneOf":[{"type":"string"},{"type":"null"}]},"color":{"description":"Hex colour for the tag (e.g. \"#8a8d82\"), used for display.","oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"description":"Whether the tag is archived. Omit on create to default to unarchived.","oneOf":[{"type":"boolean"},{"type":"null"}]},"group":{"description":"Free-text group the tag belongs to. On update, passing null or \"\" clears an existing group; omitting the key leaves it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Tag id. Present → update that tag; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name of the tag.","oneOf":[{"type":"string"},{"type":"null"}]},"color":{"description":"Hex colour for the tag (e.g. \"#8a8d82\"), used for display.","oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"description":"Whether the tag is archived. Omit on create to default to unarchived.","oneOf":[{"type":"boolean"},{"type":"null"}]},"group":{"description":"Free-text group the tag belongs to. On update, passing null or \"\" clears an existing group; omitting the key leaves it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Tag id. Present → update that tag; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name of the tag.","oneOf":[{"type":"string"},{"type":"null"}]},"color":{"description":"Hex colour for the tag (e.g. \"#8a8d82\"), used for display.","oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"description":"Whether the tag is archived. Omit on create to default to unarchived.","oneOf":[{"type":"boolean"},{"type":"null"}]},"group":{"description":"Free-text group the tag belongs to. On update, passing null or \"\" clears an existing group; omitting the key leaves it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Update an existing tag's name or colour by id. To make a new tag use create_tag, and to remove one use delete_tag.","tags":["accounting tag management"]}},"/api/tag/delete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Delete a tag by id. The tag moves to the bin: list_binned shows it and restore_deleted brings it back. Offer archiving with update_tag first, and confirm with the user before deleting.","tags":["accounting tag management"]}},"/api/filterview/list":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"entity":{"description":"Restrict to one list page's views; omit for all.","oneOf":[{"type":"string","enum":["income","expense","transaction","entry","customer","supplier","product","asset","insights","employee","payslip","contact","invoice"]},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"entity":{"description":"Restrict to one list page's views; omit for all.","oneOf":[{"type":"string","enum":["income","expense","transaction","entry","customer","supplier","product","asset","insights","employee","payslip","contact","invoice"]},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"entity":{"description":"Restrict to one list page's views; omit for all.","oneOf":[{"type":"string","enum":["income","expense","transaction","entry","customer","supplier","product","asset","insights","employee","payslip","contact","invoice"]},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"entity":{"description":"Restrict to one list page's views; omit for all.","oneOf":[{"type":"string","enum":["income","expense","transaction","entry","customer","supplier","product","asset","insights","employee","payslip","contact","invoice"]},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"List the business's saved filter views, optionally for one entity.","tags":["filter views"]}},"/api/filterview/create":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Client-generated uuid. Preserved verbatim by the server.","type":"string","minLength":1,"maxLength":128},"entity":{"description":"Which list page the view belongs to.","type":"string","enum":["income","expense","transaction","entry","customer","supplier","product","asset","insights","employee","payslip","contact","invoice"]},"name":{"description":"User-supplied label (~100 chars).","type":"string","maxLength":200},"filters":{"description":"Opaque array of filter chips ({property,value,label}). Stored + returned verbatim."},"extra":{"description":"Opaque entity-specific domain filter, or null."},"sort":{"description":"Opaque {sort,order}, or null (page default)."},"rollup":{"description":"Optional list roll up (day | tag | account), or null.","oneOf":[{"type":"string","minLength":1,"maxLength":32},{"type":"null"}]}},"required":["token","id","entity","name"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Client-generated uuid. Preserved verbatim by the server.","type":"string","minLength":1,"maxLength":128},"entity":{"description":"Which list page the view belongs to.","type":"string","enum":["income","expense","transaction","entry","customer","supplier","product","asset","insights","employee","payslip","contact","invoice"]},"name":{"description":"User-supplied label (~100 chars).","type":"string","maxLength":200},"filters":{"description":"Opaque array of filter chips ({property,value,label}). Stored + returned verbatim."},"extra":{"description":"Opaque entity-specific domain filter, or null."},"sort":{"description":"Opaque {sort,order}, or null (page default)."},"rollup":{"description":"Optional list roll up (day | tag | account), or null.","oneOf":[{"type":"string","minLength":1,"maxLength":32},{"type":"null"}]}},"required":["token","id","entity","name"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Client-generated uuid. Preserved verbatim by the server.","type":"string","minLength":1,"maxLength":128},"entity":{"description":"Which list page the view belongs to.","type":"string","enum":["income","expense","transaction","entry","customer","supplier","product","asset","insights","employee","payslip","contact","invoice"]},"name":{"description":"User-supplied label (~100 chars).","type":"string","maxLength":200},"filters":{"description":"Opaque array of filter chips ({property,value,label}). Stored + returned verbatim."},"extra":{"description":"Opaque entity-specific domain filter, or null."},"sort":{"description":"Opaque {sort,order}, or null (page default)."},"rollup":{"description":"Optional list roll up (day | tag | account), or null.","oneOf":[{"type":"string","minLength":1,"maxLength":32},{"type":"null"}]}},"required":["token","id","entity","name"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Client-generated uuid. Preserved verbatim by the server.","type":"string","minLength":1,"maxLength":128},"entity":{"description":"Which list page the view belongs to.","type":"string","enum":["income","expense","transaction","entry","customer","supplier","product","asset","insights","employee","payslip","contact","invoice"]},"name":{"description":"User-supplied label (~100 chars).","type":"string","maxLength":200},"filters":{"description":"Opaque array of filter chips ({property,value,label}). Stored + returned verbatim."},"extra":{"description":"Opaque entity-specific domain filter, or null."},"sort":{"description":"Opaque {sort,order}, or null (page default)."},"rollup":{"description":"Optional list roll up (day | tag | account), or null.","oneOf":[{"type":"string","minLength":1,"maxLength":32},{"type":"null"}]}},"required":["token","id","entity","name"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create a saved filter view, preserving the client-supplied id.","tags":["filter views"]}},"/api/filterview/update":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string","minLength":1,"maxLength":128},"name":{"oneOf":[{"type":"string","maxLength":200},{"type":"null"}]},"filters":{},"extra":{},"sort":{},"rollup":{"description":"Optional list roll up (day | tag | account), or null.","oneOf":[{"type":"string","minLength":1,"maxLength":32},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string","minLength":1,"maxLength":128},"name":{"oneOf":[{"type":"string","maxLength":200},{"type":"null"}]},"filters":{},"extra":{},"sort":{},"rollup":{"description":"Optional list roll up (day | tag | account), or null.","oneOf":[{"type":"string","minLength":1,"maxLength":32},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string","minLength":1,"maxLength":128},"name":{"oneOf":[{"type":"string","maxLength":200},{"type":"null"}]},"filters":{},"extra":{},"sort":{},"rollup":{"description":"Optional list roll up (day | tag | account), or null.","oneOf":[{"type":"string","minLength":1,"maxLength":32},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string","minLength":1,"maxLength":128},"name":{"oneOf":[{"type":"string","maxLength":200},{"type":"null"}]},"filters":{},"extra":{},"sort":{},"rollup":{"description":"Optional list roll up (day | tag | account), or null.","oneOf":[{"type":"string","minLength":1,"maxLength":32},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Replace a saved view's name/filters/extra/sort/rollup by id.","tags":["filter views"]}},"/api/filterview/delete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string","minLength":1,"maxLength":128}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string","minLength":1,"maxLength":128}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string","minLength":1,"maxLength":128}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string","minLength":1,"maxLength":128}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Delete a saved filter view by id.","tags":["filter views"]}},"/api/dashboard/list":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"List the business's dashboards: the Overview first, then each custom one with its name, position and tile count.","tags":["insights dashboards"]}},"/api/dashboard/get":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string","minLength":1,"maxLength":128}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string","minLength":1,"maxLength":128}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string","minLength":1,"maxLength":128}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string","minLength":1,"maxLength":128}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Read one dashboard with its tiles. An Overview still on its preset comes back resolved: true, its tiles built for this business.","tags":["insights dashboards"]}},"/api/dashboard/create":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Client-chosen id; one is made when left out. Sending the same id again replaces that dashboard.","type":"string","minLength":1,"maxLength":128},"name":{"description":"The dashboard's name.","type":"string","minLength":1,"maxLength":200},"description":{"oneOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"tiles":{"description":"The tiles, each {id, type, x, y, w, h, title?, …config}. Read list_dashboard_tile_types for every type's config.","oneOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]}},"required":["token","name"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Client-chosen id; one is made when left out. Sending the same id again replaces that dashboard.","type":"string","minLength":1,"maxLength":128},"name":{"description":"The dashboard's name.","type":"string","minLength":1,"maxLength":200},"description":{"oneOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"tiles":{"description":"The tiles, each {id, type, x, y, w, h, title?, …config}. Read list_dashboard_tile_types for every type's config.","oneOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]}},"required":["token","name"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Client-chosen id; one is made when left out. Sending the same id again replaces that dashboard.","type":"string","minLength":1,"maxLength":128},"name":{"description":"The dashboard's name.","type":"string","minLength":1,"maxLength":200},"description":{"oneOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"tiles":{"description":"The tiles, each {id, type, x, y, w, h, title?, …config}. Read list_dashboard_tile_types for every type's config.","oneOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]}},"required":["token","name"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Client-chosen id; one is made when left out. Sending the same id again replaces that dashboard.","type":"string","minLength":1,"maxLength":128},"name":{"description":"The dashboard's name.","type":"string","minLength":1,"maxLength":200},"description":{"oneOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"tiles":{"description":"The tiles, each {id, type, x, y, w, h, title?, …config}. Read list_dashboard_tile_types for every type's config.","oneOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]}},"required":["token","name"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create a custom dashboard, optionally with its tiles.","tags":["insights dashboards"]}},"/api/dashboard/update":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string","minLength":1,"maxLength":128},"baseUpdatedAt":{"description":"The updatedAt the edit was made from. A dashboard changed since then refuses as stale.","type":"string"},"name":{"oneOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"description":{"oneOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"position":{"oneOf":[{"type":"integer"},{"type":"null"}]},"tiles":{"description":"The whole new set of tiles; replaces the old set.","type":"array","items":{"type":"object","additionalProperties":{}}}},"required":["token","id","baseUpdatedAt"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string","minLength":1,"maxLength":128},"baseUpdatedAt":{"description":"The updatedAt the edit was made from. A dashboard changed since then refuses as stale.","type":"string"},"name":{"oneOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"description":{"oneOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"position":{"oneOf":[{"type":"integer"},{"type":"null"}]},"tiles":{"description":"The whole new set of tiles; replaces the old set.","type":"array","items":{"type":"object","additionalProperties":{}}}},"required":["token","id","baseUpdatedAt"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string","minLength":1,"maxLength":128},"baseUpdatedAt":{"description":"The updatedAt the edit was made from. A dashboard changed since then refuses as stale.","type":"string"},"name":{"oneOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"description":{"oneOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"position":{"oneOf":[{"type":"integer"},{"type":"null"}]},"tiles":{"description":"The whole new set of tiles; replaces the old set.","type":"array","items":{"type":"object","additionalProperties":{}}}},"required":["token","id","baseUpdatedAt"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string","minLength":1,"maxLength":128},"baseUpdatedAt":{"description":"The updatedAt the edit was made from. A dashboard changed since then refuses as stale.","type":"string"},"name":{"oneOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"description":{"oneOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"position":{"oneOf":[{"type":"integer"},{"type":"null"}]},"tiles":{"description":"The whole new set of tiles; replaces the old set.","type":"array","items":{"type":"object","additionalProperties":{}}}},"required":["token","id","baseUpdatedAt"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Change a dashboard's name, description, position or whole set of tiles. Send the updatedAt you read as baseUpdatedAt.","tags":["insights dashboards"]}},"/api/dashboard/delete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string","minLength":1,"maxLength":128}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string","minLength":1,"maxLength":128}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string","minLength":1,"maxLength":128}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string","minLength":1,"maxLength":128}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Delete a custom dashboard. The Overview can't be deleted.","tags":["insights dashboards"]}},"/api/dashboard/reset":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string","minLength":1,"maxLength":128}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string","minLength":1,"maxLength":128}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string","minLength":1,"maxLength":128}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string","minLength":1,"maxLength":128}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Put the Overview back on its preset, dropping its edited tiles.","tags":["insights dashboards"]}},"/api/dashboard/tile-types":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"The tile catalogue: every tile type, its sizes and its config keys with their values and defaults.","tags":["insights dashboards"]}},"/api/dashboard/tile/add":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"dashboardId":{"type":"string","minLength":1,"maxLength":128},"tile":{"description":"{type, id?, x?, y?, w?, h?, title?, …config}. Config left out takes the type's default; left without x and y, the tile goes on a new row at the bottom.","type":"object","additionalProperties":{}}},"required":["token","dashboardId","tile"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"dashboardId":{"type":"string","minLength":1,"maxLength":128},"tile":{"description":"{type, id?, x?, y?, w?, h?, title?, …config}. Config left out takes the type's default; left without x and y, the tile goes on a new row at the bottom.","type":"object","additionalProperties":{}}},"required":["token","dashboardId","tile"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"dashboardId":{"type":"string","minLength":1,"maxLength":128},"tile":{"description":"{type, id?, x?, y?, w?, h?, title?, …config}. Config left out takes the type's default; left without x and y, the tile goes on a new row at the bottom.","type":"object","additionalProperties":{}}},"required":["token","dashboardId","tile"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"dashboardId":{"type":"string","minLength":1,"maxLength":128},"tile":{"description":"{type, id?, x?, y?, w?, h?, title?, …config}. Config left out takes the type's default; left without x and y, the tile goes on a new row at the bottom.","type":"object","additionalProperties":{}}},"required":["token","dashboardId","tile"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Add one tile to a dashboard.","tags":["insights dashboards"]}},"/api/dashboard/tile/update":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"dashboardId":{"type":"string","minLength":1,"maxLength":128},"tileId":{"type":"string","minLength":1,"maxLength":128},"tile":{"description":"The fields to change. A field sent as null is cleared.","type":"object","additionalProperties":{}}},"required":["token","dashboardId","tileId","tile"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"dashboardId":{"type":"string","minLength":1,"maxLength":128},"tileId":{"type":"string","minLength":1,"maxLength":128},"tile":{"description":"The fields to change. A field sent as null is cleared.","type":"object","additionalProperties":{}}},"required":["token","dashboardId","tileId","tile"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"dashboardId":{"type":"string","minLength":1,"maxLength":128},"tileId":{"type":"string","minLength":1,"maxLength":128},"tile":{"description":"The fields to change. A field sent as null is cleared.","type":"object","additionalProperties":{}}},"required":["token","dashboardId","tileId","tile"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"dashboardId":{"type":"string","minLength":1,"maxLength":128},"tileId":{"type":"string","minLength":1,"maxLength":128},"tile":{"description":"The fields to change. A field sent as null is cleared.","type":"object","additionalProperties":{}}},"required":["token","dashboardId","tileId","tile"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Change one tile on a dashboard.","tags":["insights dashboards"]}},"/api/dashboard/tile/remove":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"dashboardId":{"type":"string","minLength":1,"maxLength":128},"tileId":{"type":"string","minLength":1,"maxLength":128}},"required":["token","dashboardId","tileId"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"dashboardId":{"type":"string","minLength":1,"maxLength":128},"tileId":{"type":"string","minLength":1,"maxLength":128}},"required":["token","dashboardId","tileId"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"dashboardId":{"type":"string","minLength":1,"maxLength":128},"tileId":{"type":"string","minLength":1,"maxLength":128}},"required":["token","dashboardId","tileId"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"dashboardId":{"type":"string","minLength":1,"maxLength":128},"tileId":{"type":"string","minLength":1,"maxLength":128}},"required":["token","dashboardId","tileId"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Remove one tile from a dashboard.","tags":["insights dashboards"]}},"/api/dashboard/evaluate":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string","minLength":1,"maxLength":128},"periodStart":{"description":"First day of the period, YYYY-MM-DD.","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"periodEnd":{"description":"Last day of the period, YYYY-MM-DD.","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["token","id","periodStart","periodEnd"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string","minLength":1,"maxLength":128},"periodStart":{"description":"First day of the period, YYYY-MM-DD.","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"periodEnd":{"description":"Last day of the period, YYYY-MM-DD.","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["token","id","periodStart","periodEnd"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string","minLength":1,"maxLength":128},"periodStart":{"description":"First day of the period, YYYY-MM-DD.","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"periodEnd":{"description":"Last day of the period, YYYY-MM-DD.","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["token","id","periodStart","periodEnd"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string","minLength":1,"maxLength":128},"periodStart":{"description":"First day of the period, YYYY-MM-DD.","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"periodEnd":{"description":"Last day of the period, YYYY-MM-DD.","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["token","id","periodStart","periodEnd"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Every tile's figure for a period, with the period before it for comparison. A tile the plan or the data can't answer comes back unavailable, never as 0.","tags":["insights dashboards"]}},"/api/documentdesign/list":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"List the business's live document designs, each with its current version.","tags":["document designs"]}},"/api/documentdesign/get":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string","minLength":1,"maxLength":128}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string","minLength":1,"maxLength":128}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string","minLength":1,"maxLength":128}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string","minLength":1,"maxLength":128}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Read one document design, archived ones included.","tags":["document designs"]}},"/api/documentdesign/version":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"versionId":{"type":"string","minLength":1,"maxLength":128},"id":{"type":"string","minLength":1,"maxLength":128},"at":{"description":"An ISO instant: the version a document pinned then reads.","type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"versionId":{"type":"string","minLength":1,"maxLength":128},"id":{"type":"string","minLength":1,"maxLength":128},"at":{"description":"An ISO instant: the version a document pinned then reads.","type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"versionId":{"type":"string","minLength":1,"maxLength":128},"id":{"type":"string","minLength":1,"maxLength":128},"at":{"description":"An ISO instant: the version a document pinned then reads.","type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"versionId":{"type":"string","minLength":1,"maxLength":128},"id":{"type":"string","minLength":1,"maxLength":128},"at":{"description":"An ISO instant: the version a document pinned then reads.","type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Read one version of a design: by versionId, or by id and the instant a document was pinned at.","tags":["document designs"]}},"/api/documentdesign/create":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Client-chosen id; one is made when left out. Sending an id the business already holds answers that design unchanged.","type":"string","minLength":1,"maxLength":128},"name":{"type":"string","minLength":1,"maxLength":200},"content":{"description":"The design: a JSON object with schema, theme, header, footer and bodies."}},"required":["token","name","content"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Client-chosen id; one is made when left out. Sending an id the business already holds answers that design unchanged.","type":"string","minLength":1,"maxLength":128},"name":{"type":"string","minLength":1,"maxLength":200},"content":{"description":"The design: a JSON object with schema, theme, header, footer and bodies."}},"required":["token","name","content"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Client-chosen id; one is made when left out. Sending an id the business already holds answers that design unchanged.","type":"string","minLength":1,"maxLength":128},"name":{"type":"string","minLength":1,"maxLength":200},"content":{"description":"The design: a JSON object with schema, theme, header, footer and bodies."}},"required":["token","name","content"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Client-chosen id; one is made when left out. Sending an id the business already holds answers that design unchanged.","type":"string","minLength":1,"maxLength":128},"name":{"type":"string","minLength":1,"maxLength":200},"content":{"description":"The design: a JSON object with schema, theme, header, footer and bodies."}},"required":["token","name","content"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create a document design. The business's first one becomes its default.","tags":["document designs"]}},"/api/documentdesign/update":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string","minLength":1,"maxLength":128},"baseUpdatedAt":{"description":"The updatedAt the edit was made from. A design changed since then refuses as stale.","type":"string"},"name":{"oneOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"content":{"description":"New content. It becomes the next version unless it equals the current one."}},"required":["token","id","baseUpdatedAt"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string","minLength":1,"maxLength":128},"baseUpdatedAt":{"description":"The updatedAt the edit was made from. A design changed since then refuses as stale.","type":"string"},"name":{"oneOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"content":{"description":"New content. It becomes the next version unless it equals the current one."}},"required":["token","id","baseUpdatedAt"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string","minLength":1,"maxLength":128},"baseUpdatedAt":{"description":"The updatedAt the edit was made from. A design changed since then refuses as stale.","type":"string"},"name":{"oneOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"content":{"description":"New content. It becomes the next version unless it equals the current one."}},"required":["token","id","baseUpdatedAt"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string","minLength":1,"maxLength":128},"baseUpdatedAt":{"description":"The updatedAt the edit was made from. A design changed since then refuses as stale.","type":"string"},"name":{"oneOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"content":{"description":"New content. It becomes the next version unless it equals the current one."}},"required":["token","id","baseUpdatedAt"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Rename a design or save new content as its next version. Send the updatedAt you read as baseUpdatedAt.","tags":["document designs"]}},"/api/documentdesign/setdefault":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string","minLength":1,"maxLength":128}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string","minLength":1,"maxLength":128}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string","minLength":1,"maxLength":128}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string","minLength":1,"maxLength":128}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Make a design the business's default.","tags":["document designs"]}},"/api/documentdesign/delete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string","minLength":1,"maxLength":128}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string","minLength":1,"maxLength":128}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string","minLength":1,"maxLength":128}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string","minLength":1,"maxLength":128}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Archive a design. The default and the last design can't be deleted.","tags":["document designs"]}},"/api/account/list":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"The business's chart of accounts: its own accounts, the default accounts, app and customer accounts. For the category-to-account mapping use list_account_mappings. When the full chart is slow to build, the answer is the chart without customer and uninstalled-app accounts, with `partial: true` and a `hint`; call again in a minute before concluding an account is missing.","tags":["accounting account management"]}},"/api/account/create":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"name":{"description":"Account name (e.g. \"Consulting income\", \"Rent\").","oneOf":[{"type":"string"},{"type":"null"}]},"icon":{"description":"Icon identifier for the account (UI display).","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"Free-text description of what the account is used for.","oneOf":[{"type":"string"},{"type":"null"}]},"journal":{"description":"Journal number classifying the account; maps to a standard journal name (e.g. sales, purchases, general).","oneOf":[{"type":"number"},{"type":"null"}]},"parentid":{"description":"Id of the parent account this nests under in the chart-of-accounts tree.","oneOf":[{"type":"string"},{"type":"null"}]},"defaultid":{"description":"Built-in account id this custom account maps to: a number such as \"410\" or a string such as \"za-coida\" or \"defaultvat\".","oneOf":[{"type":"string"},{"type":"null"}]},"group":{"description":"Group label the account is organised under in the chart of accounts.","oneOf":[{"type":"string"},{"type":"null"}]},"reportinggroup":{"description":"The reporting group reports roll this account into, e.g. \"Motor vehicle costs\" (free text; not the balance-sheet group). Trimmed; blank means none.","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccount":{"description":"Whether this is a base/system account rather than a user-created one.","oneOf":[{"type":"boolean"},{"type":"null"}]},"meta":{"description":"Opaque metadata string stored on the account.","oneOf":[{"type":"string"},{"type":"null"}]},"deleted":{"description":"Soft-delete flag; true hides the account from active use.","oneOf":[{"type":"boolean"},{"type":"null"}]},"premium":{"description":"Whether the account is a premium-plan-only account.","oneOf":[{"type":"boolean"},{"type":"null"}]},"hidden":{"description":"Whether the account is hidden from the chart-of-accounts UI.","oneOf":[{"type":"boolean"},{"type":"null"}]},"role":{"description":"Semantic reporting role: \"tax\" (income-tax expense), \"taxprovision\" (tax provision/liability), or \"salestax\" (VAT control account). Omit for an ordinary account.","oneOf":[{"type":"string"},{"type":"null"}]},"primary":{"description":"Whether this is the primary account of its kind.","oneOf":[{"type":"boolean"},{"type":"null"}]},"code":{"description":"The business's own account code (e.g. \"4000\"). Trimmed; blank means no code.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"name":{"description":"Account name (e.g. \"Consulting income\", \"Rent\").","oneOf":[{"type":"string"},{"type":"null"}]},"icon":{"description":"Icon identifier for the account (UI display).","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"Free-text description of what the account is used for.","oneOf":[{"type":"string"},{"type":"null"}]},"journal":{"description":"Journal number classifying the account; maps to a standard journal name (e.g. sales, purchases, general).","oneOf":[{"type":"number"},{"type":"null"}]},"parentid":{"description":"Id of the parent account this nests under in the chart-of-accounts tree.","oneOf":[{"type":"string"},{"type":"null"}]},"defaultid":{"description":"Built-in account id this custom account maps to: a number such as \"410\" or a string such as \"za-coida\" or \"defaultvat\".","oneOf":[{"type":"string"},{"type":"null"}]},"group":{"description":"Group label the account is organised under in the chart of accounts.","oneOf":[{"type":"string"},{"type":"null"}]},"reportinggroup":{"description":"The reporting group reports roll this account into, e.g. \"Motor vehicle costs\" (free text; not the balance-sheet group). Trimmed; blank means none.","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccount":{"description":"Whether this is a base/system account rather than a user-created one.","oneOf":[{"type":"boolean"},{"type":"null"}]},"meta":{"description":"Opaque metadata string stored on the account.","oneOf":[{"type":"string"},{"type":"null"}]},"deleted":{"description":"Soft-delete flag; true hides the account from active use.","oneOf":[{"type":"boolean"},{"type":"null"}]},"premium":{"description":"Whether the account is a premium-plan-only account.","oneOf":[{"type":"boolean"},{"type":"null"}]},"hidden":{"description":"Whether the account is hidden from the chart-of-accounts UI.","oneOf":[{"type":"boolean"},{"type":"null"}]},"role":{"description":"Semantic reporting role: \"tax\" (income-tax expense), \"taxprovision\" (tax provision/liability), or \"salestax\" (VAT control account). Omit for an ordinary account.","oneOf":[{"type":"string"},{"type":"null"}]},"primary":{"description":"Whether this is the primary account of its kind.","oneOf":[{"type":"boolean"},{"type":"null"}]},"code":{"description":"The business's own account code (e.g. \"4000\"). Trimmed; blank means no code.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"name":{"description":"Account name (e.g. \"Consulting income\", \"Rent\").","oneOf":[{"type":"string"},{"type":"null"}]},"icon":{"description":"Icon identifier for the account (UI display).","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"Free-text description of what the account is used for.","oneOf":[{"type":"string"},{"type":"null"}]},"journal":{"description":"Journal number classifying the account; maps to a standard journal name (e.g. sales, purchases, general).","oneOf":[{"type":"number"},{"type":"null"}]},"parentid":{"description":"Id of the parent account this nests under in the chart-of-accounts tree.","oneOf":[{"type":"string"},{"type":"null"}]},"defaultid":{"description":"Built-in account id this custom account maps to: a number such as \"410\" or a string such as \"za-coida\" or \"defaultvat\".","oneOf":[{"type":"string"},{"type":"null"}]},"group":{"description":"Group label the account is organised under in the chart of accounts.","oneOf":[{"type":"string"},{"type":"null"}]},"reportinggroup":{"description":"The reporting group reports roll this account into, e.g. \"Motor vehicle costs\" (free text; not the balance-sheet group). Trimmed; blank means none.","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccount":{"description":"Whether this is a base/system account rather than a user-created one.","oneOf":[{"type":"boolean"},{"type":"null"}]},"meta":{"description":"Opaque metadata string stored on the account.","oneOf":[{"type":"string"},{"type":"null"}]},"deleted":{"description":"Soft-delete flag; true hides the account from active use.","oneOf":[{"type":"boolean"},{"type":"null"}]},"premium":{"description":"Whether the account is a premium-plan-only account.","oneOf":[{"type":"boolean"},{"type":"null"}]},"hidden":{"description":"Whether the account is hidden from the chart-of-accounts UI.","oneOf":[{"type":"boolean"},{"type":"null"}]},"role":{"description":"Semantic reporting role: \"tax\" (income-tax expense), \"taxprovision\" (tax provision/liability), or \"salestax\" (VAT control account). Omit for an ordinary account.","oneOf":[{"type":"string"},{"type":"null"}]},"primary":{"description":"Whether this is the primary account of its kind.","oneOf":[{"type":"boolean"},{"type":"null"}]},"code":{"description":"The business's own account code (e.g. \"4000\"). Trimmed; blank means no code.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"name":{"description":"Account name (e.g. \"Consulting income\", \"Rent\").","oneOf":[{"type":"string"},{"type":"null"}]},"icon":{"description":"Icon identifier for the account (UI display).","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"Free-text description of what the account is used for.","oneOf":[{"type":"string"},{"type":"null"}]},"journal":{"description":"Journal number classifying the account; maps to a standard journal name (e.g. sales, purchases, general).","oneOf":[{"type":"number"},{"type":"null"}]},"parentid":{"description":"Id of the parent account this nests under in the chart-of-accounts tree.","oneOf":[{"type":"string"},{"type":"null"}]},"defaultid":{"description":"Built-in account id this custom account maps to: a number such as \"410\" or a string such as \"za-coida\" or \"defaultvat\".","oneOf":[{"type":"string"},{"type":"null"}]},"group":{"description":"Group label the account is organised under in the chart of accounts.","oneOf":[{"type":"string"},{"type":"null"}]},"reportinggroup":{"description":"The reporting group reports roll this account into, e.g. \"Motor vehicle costs\" (free text; not the balance-sheet group). Trimmed; blank means none.","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccount":{"description":"Whether this is a base/system account rather than a user-created one.","oneOf":[{"type":"boolean"},{"type":"null"}]},"meta":{"description":"Opaque metadata string stored on the account.","oneOf":[{"type":"string"},{"type":"null"}]},"deleted":{"description":"Soft-delete flag; true hides the account from active use.","oneOf":[{"type":"boolean"},{"type":"null"}]},"premium":{"description":"Whether the account is a premium-plan-only account.","oneOf":[{"type":"boolean"},{"type":"null"}]},"hidden":{"description":"Whether the account is hidden from the chart-of-accounts UI.","oneOf":[{"type":"boolean"},{"type":"null"}]},"role":{"description":"Semantic reporting role: \"tax\" (income-tax expense), \"taxprovision\" (tax provision/liability), or \"salestax\" (VAT control account). Omit for an ordinary account.","oneOf":[{"type":"string"},{"type":"null"}]},"primary":{"description":"Whether this is the primary account of its kind.","oneOf":[{"type":"boolean"},{"type":"null"}]},"code":{"description":"The business's own account code (e.g. \"4000\"). Trimmed; blank means no code.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create a new chart-of-accounts ledger account (an income, expense, asset, liability or equity account used to categorise transactions). Not a bank account — for that use create_bank_account.","tags":["accounting account management"]}},"/api/account/import":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"items":{"description":"The chart's accounts, one row each, as the old package lists them.","type":"array","items":{"type":"object","properties":{"name":{"description":"Account name as in the old package.","type":"string"},"code":{"description":"The account's code in the old package (e.g. \"200\").","oneOf":[{"type":"string"},{"type":"null"}]},"type":{"description":"The old package's account type: Revenue, Sales, Other Income, Direct Costs, Expense, Overhead, Depreciation, Bank, Current Asset, Inventory, Fixed Asset, Accounts Receivable, Current Liability, Non-current Liability, Accounts Payable, VAT, Equity, Retained Earnings.","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"parentname":{"description":"The account it sits under, by name.","oneOf":[{"type":"string"},{"type":"null"}]},"reportinggroup":{"description":"The reporting group reports roll the account into, if any.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["name"],"additionalProperties":false}}},"required":["token","items"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"items":{"description":"The chart's accounts, one row each, as the old package lists them.","type":"array","items":{"type":"object","properties":{"name":{"description":"Account name as in the old package.","type":"string"},"code":{"description":"The account's code in the old package (e.g. \"200\").","oneOf":[{"type":"string"},{"type":"null"}]},"type":{"description":"The old package's account type: Revenue, Sales, Other Income, Direct Costs, Expense, Overhead, Depreciation, Bank, Current Asset, Inventory, Fixed Asset, Accounts Receivable, Current Liability, Non-current Liability, Accounts Payable, VAT, Equity, Retained Earnings.","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"parentname":{"description":"The account it sits under, by name.","oneOf":[{"type":"string"},{"type":"null"}]},"reportinggroup":{"description":"The reporting group reports roll the account into, if any.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["name"],"additionalProperties":false}}},"required":["token","items"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"items":{"description":"The chart's accounts, one row each, as the old package lists them.","type":"array","items":{"type":"object","properties":{"name":{"description":"Account name as in the old package.","type":"string"},"code":{"description":"The account's code in the old package (e.g. \"200\").","oneOf":[{"type":"string"},{"type":"null"}]},"type":{"description":"The old package's account type: Revenue, Sales, Other Income, Direct Costs, Expense, Overhead, Depreciation, Bank, Current Asset, Inventory, Fixed Asset, Accounts Receivable, Current Liability, Non-current Liability, Accounts Payable, VAT, Equity, Retained Earnings.","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"parentname":{"description":"The account it sits under, by name.","oneOf":[{"type":"string"},{"type":"null"}]},"reportinggroup":{"description":"The reporting group reports roll the account into, if any.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["name"],"additionalProperties":false}}},"required":["token","items"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"items":{"description":"The chart's accounts, one row each, as the old package lists them.","type":"array","items":{"type":"object","properties":{"name":{"description":"Account name as in the old package.","type":"string"},"code":{"description":"The account's code in the old package (e.g. \"200\").","oneOf":[{"type":"string"},{"type":"null"}]},"type":{"description":"The old package's account type: Revenue, Sales, Other Income, Direct Costs, Expense, Overhead, Depreciation, Bank, Current Asset, Inventory, Fixed Asset, Accounts Receivable, Current Liability, Non-current Liability, Accounts Payable, VAT, Equity, Retained Earnings.","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"parentname":{"description":"The account it sits under, by name.","oneOf":[{"type":"string"},{"type":"null"}]},"reportinggroup":{"description":"The reporting group reports roll the account into, if any.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["name"],"additionalProperties":false}}},"required":["token","items"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Bring a whole chart of accounts in from another package (Xero, Sage, QuickBooks), one row per account with its type. An account the chart already has (Sales, Accounts Receivable, Accounts Payable, VAT, Retained Earnings) is reused, not made twice, so reports read as one chart. Prefer this to create_account for more than one account. Returns a summary to read to the customer.","tags":["accounting account management"]}},"/api/account/update":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Account id to update (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Account name (e.g. \"Consulting income\", \"Rent\").","oneOf":[{"type":"string"},{"type":"null"}]},"icon":{"description":"Icon identifier for the account (UI display).","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"Free-text description of what the account is used for.","oneOf":[{"type":"string"},{"type":"null"}]},"journal":{"description":"Journal number classifying the account; maps to a standard journal name (e.g. sales, purchases, general).","oneOf":[{"type":"number"},{"type":"null"}]},"parentid":{"description":"Id of the parent account this nests under in the chart-of-accounts tree.","oneOf":[{"type":"string"},{"type":"null"}]},"defaultid":{"description":"Built-in account id this custom account maps to: a number such as \"410\" or a string such as \"za-coida\" or \"defaultvat\".","oneOf":[{"type":"string"},{"type":"null"}]},"group":{"description":"Group label the account is organised under in the chart of accounts.","oneOf":[{"type":"string"},{"type":"null"}]},"reportinggroup":{"description":"The reporting group reports roll this account into, e.g. \"Motor vehicle costs\" (free text; not the balance-sheet group). \"$delete\" removes it; omit to leave it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccount":{"description":"Whether this is a base/system account rather than a user-created one.","oneOf":[{"type":"boolean"},{"type":"null"}]},"meta":{"description":"Opaque metadata string stored on the account.","oneOf":[{"type":"string"},{"type":"null"}]},"deleted":{"description":"Soft-delete flag; true hides the account from active use.","oneOf":[{"type":"boolean"},{"type":"null"}]},"premium":{"description":"Whether the account is a premium-plan-only account.","oneOf":[{"type":"boolean"},{"type":"null"}]},"hidden":{"description":"Whether the account is hidden from the chart-of-accounts UI.","oneOf":[{"type":"boolean"},{"type":"null"}]},"role":{"description":"Semantic reporting role: \"tax\" (income-tax expense), \"taxprovision\" (tax provision/liability), or \"salestax\" (VAT control account). Omit for an ordinary account.","oneOf":[{"type":"string"},{"type":"null"}]},"primary":{"description":"Whether this is the primary account of its kind.","oneOf":[{"type":"boolean"},{"type":"null"}]},"code":{"description":"The business's own account code (e.g. \"4000\"). Trimmed; an empty string clears it; omit to leave it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Account id to update (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Account name (e.g. \"Consulting income\", \"Rent\").","oneOf":[{"type":"string"},{"type":"null"}]},"icon":{"description":"Icon identifier for the account (UI display).","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"Free-text description of what the account is used for.","oneOf":[{"type":"string"},{"type":"null"}]},"journal":{"description":"Journal number classifying the account; maps to a standard journal name (e.g. sales, purchases, general).","oneOf":[{"type":"number"},{"type":"null"}]},"parentid":{"description":"Id of the parent account this nests under in the chart-of-accounts tree.","oneOf":[{"type":"string"},{"type":"null"}]},"defaultid":{"description":"Built-in account id this custom account maps to: a number such as \"410\" or a string such as \"za-coida\" or \"defaultvat\".","oneOf":[{"type":"string"},{"type":"null"}]},"group":{"description":"Group label the account is organised under in the chart of accounts.","oneOf":[{"type":"string"},{"type":"null"}]},"reportinggroup":{"description":"The reporting group reports roll this account into, e.g. \"Motor vehicle costs\" (free text; not the balance-sheet group). \"$delete\" removes it; omit to leave it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccount":{"description":"Whether this is a base/system account rather than a user-created one.","oneOf":[{"type":"boolean"},{"type":"null"}]},"meta":{"description":"Opaque metadata string stored on the account.","oneOf":[{"type":"string"},{"type":"null"}]},"deleted":{"description":"Soft-delete flag; true hides the account from active use.","oneOf":[{"type":"boolean"},{"type":"null"}]},"premium":{"description":"Whether the account is a premium-plan-only account.","oneOf":[{"type":"boolean"},{"type":"null"}]},"hidden":{"description":"Whether the account is hidden from the chart-of-accounts UI.","oneOf":[{"type":"boolean"},{"type":"null"}]},"role":{"description":"Semantic reporting role: \"tax\" (income-tax expense), \"taxprovision\" (tax provision/liability), or \"salestax\" (VAT control account). Omit for an ordinary account.","oneOf":[{"type":"string"},{"type":"null"}]},"primary":{"description":"Whether this is the primary account of its kind.","oneOf":[{"type":"boolean"},{"type":"null"}]},"code":{"description":"The business's own account code (e.g. \"4000\"). Trimmed; an empty string clears it; omit to leave it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Account id to update (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Account name (e.g. \"Consulting income\", \"Rent\").","oneOf":[{"type":"string"},{"type":"null"}]},"icon":{"description":"Icon identifier for the account (UI display).","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"Free-text description of what the account is used for.","oneOf":[{"type":"string"},{"type":"null"}]},"journal":{"description":"Journal number classifying the account; maps to a standard journal name (e.g. sales, purchases, general).","oneOf":[{"type":"number"},{"type":"null"}]},"parentid":{"description":"Id of the parent account this nests under in the chart-of-accounts tree.","oneOf":[{"type":"string"},{"type":"null"}]},"defaultid":{"description":"Built-in account id this custom account maps to: a number such as \"410\" or a string such as \"za-coida\" or \"defaultvat\".","oneOf":[{"type":"string"},{"type":"null"}]},"group":{"description":"Group label the account is organised under in the chart of accounts.","oneOf":[{"type":"string"},{"type":"null"}]},"reportinggroup":{"description":"The reporting group reports roll this account into, e.g. \"Motor vehicle costs\" (free text; not the balance-sheet group). \"$delete\" removes it; omit to leave it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccount":{"description":"Whether this is a base/system account rather than a user-created one.","oneOf":[{"type":"boolean"},{"type":"null"}]},"meta":{"description":"Opaque metadata string stored on the account.","oneOf":[{"type":"string"},{"type":"null"}]},"deleted":{"description":"Soft-delete flag; true hides the account from active use.","oneOf":[{"type":"boolean"},{"type":"null"}]},"premium":{"description":"Whether the account is a premium-plan-only account.","oneOf":[{"type":"boolean"},{"type":"null"}]},"hidden":{"description":"Whether the account is hidden from the chart-of-accounts UI.","oneOf":[{"type":"boolean"},{"type":"null"}]},"role":{"description":"Semantic reporting role: \"tax\" (income-tax expense), \"taxprovision\" (tax provision/liability), or \"salestax\" (VAT control account). Omit for an ordinary account.","oneOf":[{"type":"string"},{"type":"null"}]},"primary":{"description":"Whether this is the primary account of its kind.","oneOf":[{"type":"boolean"},{"type":"null"}]},"code":{"description":"The business's own account code (e.g. \"4000\"). Trimmed; an empty string clears it; omit to leave it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Account id to update (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Account name (e.g. \"Consulting income\", \"Rent\").","oneOf":[{"type":"string"},{"type":"null"}]},"icon":{"description":"Icon identifier for the account (UI display).","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"Free-text description of what the account is used for.","oneOf":[{"type":"string"},{"type":"null"}]},"journal":{"description":"Journal number classifying the account; maps to a standard journal name (e.g. sales, purchases, general).","oneOf":[{"type":"number"},{"type":"null"}]},"parentid":{"description":"Id of the parent account this nests under in the chart-of-accounts tree.","oneOf":[{"type":"string"},{"type":"null"}]},"defaultid":{"description":"Built-in account id this custom account maps to: a number such as \"410\" or a string such as \"za-coida\" or \"defaultvat\".","oneOf":[{"type":"string"},{"type":"null"}]},"group":{"description":"Group label the account is organised under in the chart of accounts.","oneOf":[{"type":"string"},{"type":"null"}]},"reportinggroup":{"description":"The reporting group reports roll this account into, e.g. \"Motor vehicle costs\" (free text; not the balance-sheet group). \"$delete\" removes it; omit to leave it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccount":{"description":"Whether this is a base/system account rather than a user-created one.","oneOf":[{"type":"boolean"},{"type":"null"}]},"meta":{"description":"Opaque metadata string stored on the account.","oneOf":[{"type":"string"},{"type":"null"}]},"deleted":{"description":"Soft-delete flag; true hides the account from active use.","oneOf":[{"type":"boolean"},{"type":"null"}]},"premium":{"description":"Whether the account is a premium-plan-only account.","oneOf":[{"type":"boolean"},{"type":"null"}]},"hidden":{"description":"Whether the account is hidden from the chart-of-accounts UI.","oneOf":[{"type":"boolean"},{"type":"null"}]},"role":{"description":"Semantic reporting role: \"tax\" (income-tax expense), \"taxprovision\" (tax provision/liability), or \"salestax\" (VAT control account). Omit for an ordinary account.","oneOf":[{"type":"string"},{"type":"null"}]},"primary":{"description":"Whether this is the primary account of its kind.","oneOf":[{"type":"boolean"},{"type":"null"}]},"code":{"description":"The business's own account code (e.g. \"4000\"). Trimmed; an empty string clears it; omit to leave it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Update a chart-of-accounts LEDGER account by id, not a bank account; for a bank account, use update_bank_account. Changes its name, description, group or settings. See list_accounts for ids.","tags":["accounting account management"]}},"/api/account/delete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Delete account","tags":["accounting account management"]}},"/api/accounting/create":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the decorator only required to update: its dco- id, or the default slot number it sets","oneOf":[{"anyOf":[{"type":"string"},{"type":"number"}]},{"type":"null"}]},"name":{"description":"The name of the decorator","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"A short description of the decorator","oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"The accountid of that the default is to be remapped to","oneOf":[{"type":"string"},{"type":"null"}]},"defaultid":{"description":"The default id to be remapped","oneOf":[{"type":"number"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the decorator only required to update: its dco- id, or the default slot number it sets","oneOf":[{"anyOf":[{"type":"string"},{"type":"number"}]},{"type":"null"}]},"name":{"description":"The name of the decorator","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"A short description of the decorator","oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"The accountid of that the default is to be remapped to","oneOf":[{"type":"string"},{"type":"null"}]},"defaultid":{"description":"The default id to be remapped","oneOf":[{"type":"number"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the decorator only required to update: its dco- id, or the default slot number it sets","oneOf":[{"anyOf":[{"type":"string"},{"type":"number"}]},{"type":"null"}]},"name":{"description":"The name of the decorator","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"A short description of the decorator","oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"The accountid of that the default is to be remapped to","oneOf":[{"type":"string"},{"type":"null"}]},"defaultid":{"description":"The default id to be remapped","oneOf":[{"type":"number"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the decorator only required to update: its dco- id, or the default slot number it sets","oneOf":[{"anyOf":[{"type":"string"},{"type":"number"}]},{"type":"null"}]},"name":{"description":"The name of the decorator","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"A short description of the decorator","oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"The accountid of that the default is to be remapped to","oneOf":[{"type":"string"},{"type":"null"}]},"defaultid":{"description":"The default id to be remapped","oneOf":[{"type":"number"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create new accounting decorator ","tags":["accounting decorator management"]}},"/api/accounting/update":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the decorator only required to update: its dco- id, or the default slot number it sets","oneOf":[{"anyOf":[{"type":"string"},{"type":"number"}]},{"type":"null"}]},"name":{"description":"The name of the decorator","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"A short description of the decorator","oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"The accountid of that the default is to be remapped to","oneOf":[{"type":"string"},{"type":"null"}]},"defaultid":{"description":"The default id to be remapped","oneOf":[{"type":"number"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the decorator only required to update: its dco- id, or the default slot number it sets","oneOf":[{"anyOf":[{"type":"string"},{"type":"number"}]},{"type":"null"}]},"name":{"description":"The name of the decorator","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"A short description of the decorator","oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"The accountid of that the default is to be remapped to","oneOf":[{"type":"string"},{"type":"null"}]},"defaultid":{"description":"The default id to be remapped","oneOf":[{"type":"number"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the decorator only required to update: its dco- id, or the default slot number it sets","oneOf":[{"anyOf":[{"type":"string"},{"type":"number"}]},{"type":"null"}]},"name":{"description":"The name of the decorator","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"A short description of the decorator","oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"The accountid of that the default is to be remapped to","oneOf":[{"type":"string"},{"type":"null"}]},"defaultid":{"description":"The default id to be remapped","oneOf":[{"type":"number"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the decorator only required to update: its dco- id, or the default slot number it sets","oneOf":[{"anyOf":[{"type":"string"},{"type":"number"}]},{"type":"null"}]},"name":{"description":"The name of the decorator","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"A short description of the decorator","oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"The accountid of that the default is to be remapped to","oneOf":[{"type":"string"},{"type":"null"}]},"defaultid":{"description":"The default id to be remapped","oneOf":[{"type":"number"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Update accounting decorator ","tags":["accounting decorator management"]}},"/api/accounting/delete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the decorator","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the decorator","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the decorator","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the decorator","type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Delete accounting decorator ","tags":["accounting decorator management"]}},"/api/file/upload":{"post":{"requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"},"name":{"type":"string"},"folderid":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"type":"string"}},"required":["file","token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Upload file","tags":["file management"]}},"/api/file/upload-content":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"name":{"description":"File name with its extension, for example invoice-1042.pdf","type":"string","minLength":1,"maxLength":255},"type":{"description":"The file's media type, for example application/pdf","type":"string","minLength":1,"maxLength":255},"content":{"description":"The file itself, base64 encoded. At most 5 MB once decoded.","type":"string","minLength":1,"maxLength":6990508},"entity":{"description":"The kind of record entityid is: bill, expense, income, invoice. A bill or invoice id names its own kind.","oneOf":[{"type":"string"},{"type":"null"}]},"entityid":{"description":"Attach the stored file to this record, for example a bill (cont-…). Omit to only store the file.","oneOf":[{"type":"string"},{"type":"null"}]},"folderid":{"description":"Folder to file it in","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","name","type","content"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"name":{"description":"File name with its extension, for example invoice-1042.pdf","type":"string","minLength":1,"maxLength":255},"type":{"description":"The file's media type, for example application/pdf","type":"string","minLength":1,"maxLength":255},"content":{"description":"The file itself, base64 encoded. At most 5 MB once decoded.","type":"string","minLength":1,"maxLength":6990508},"entity":{"description":"The kind of record entityid is: bill, expense, income, invoice. A bill or invoice id names its own kind.","oneOf":[{"type":"string"},{"type":"null"}]},"entityid":{"description":"Attach the stored file to this record, for example a bill (cont-…). Omit to only store the file.","oneOf":[{"type":"string"},{"type":"null"}]},"folderid":{"description":"Folder to file it in","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","name","type","content"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"name":{"description":"File name with its extension, for example invoice-1042.pdf","type":"string","minLength":1,"maxLength":255},"type":{"description":"The file's media type, for example application/pdf","type":"string","minLength":1,"maxLength":255},"content":{"description":"The file itself, base64 encoded. At most 5 MB once decoded.","type":"string","minLength":1,"maxLength":6990508},"entity":{"description":"The kind of record entityid is: bill, expense, income, invoice. A bill or invoice id names its own kind.","oneOf":[{"type":"string"},{"type":"null"}]},"entityid":{"description":"Attach the stored file to this record, for example a bill (cont-…). Omit to only store the file.","oneOf":[{"type":"string"},{"type":"null"}]},"folderid":{"description":"Folder to file it in","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","name","type","content"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"name":{"description":"File name with its extension, for example invoice-1042.pdf","type":"string","minLength":1,"maxLength":255},"type":{"description":"The file's media type, for example application/pdf","type":"string","minLength":1,"maxLength":255},"content":{"description":"The file itself, base64 encoded. At most 5 MB once decoded.","type":"string","minLength":1,"maxLength":6990508},"entity":{"description":"The kind of record entityid is: bill, expense, income, invoice. A bill or invoice id names its own kind.","oneOf":[{"type":"string"},{"type":"null"}]},"entityid":{"description":"Attach the stored file to this record, for example a bill (cont-…). Omit to only store the file.","oneOf":[{"type":"string"},{"type":"null"}]},"folderid":{"description":"Folder to file it in","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","name","type","content"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Upload a file, such as a supplier invoice PDF, sent as base64, and attach it to a record such as a bill in the same call. The file is stored as it is: stub does not read it into a new bill. Returns the file id; to attach it to another record later, use attach_file.","tags":["file management"]}},"/api/file/list":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"folderid":{"description":"Only files in this folder. Omit for all of them.","oneOf":[{"type":"string"},{"type":"null"}]},"paired":{"description":"PROD-1302 pairing filter. true = only files already cross-linked to their invoice/receipt counterpart; false = only files not yet paired; omit for all.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"folderid":{"description":"Only files in this folder. Omit for all of them.","oneOf":[{"type":"string"},{"type":"null"}]},"paired":{"description":"PROD-1302 pairing filter. true = only files already cross-linked to their invoice/receipt counterpart; false = only files not yet paired; omit for all.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"folderid":{"description":"Only files in this folder. Omit for all of them.","oneOf":[{"type":"string"},{"type":"null"}]},"paired":{"description":"PROD-1302 pairing filter. true = only files already cross-linked to their invoice/receipt counterpart; false = only files not yet paired; omit for all.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"folderid":{"description":"Only files in this folder. Omit for all of them.","oneOf":[{"type":"string"},{"type":"null"}]},"paired":{"description":"PROD-1302 pairing filter. true = only files already cross-linked to their invoice/receipt counterpart; false = only files not yet paired; omit for all.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"The files in a folder — name, type, whether stub has finished reading it, and what it decided the document was. Omit folderid for every file. Contents are not returned here: read_file_rows reads what is inside one, a page at a time.","tags":["file management"]}},"/api/file/columns":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"fileid":{"description":"The file to read.","type":"string"}},"required":["token","fileid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"fileid":{"description":"The file to read.","type":"string"}},"required":["token","fileid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"fileid":{"description":"The file to read.","type":"string"}},"required":["token","fileid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"fileid":{"description":"The file to read.","type":"string"}},"required":["token","fileid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"The column headings of an uploaded CSV, and how many rows are under them. Read this before folding a column, so you name one that is actually there. To read the rows themselves, or a workbook or a PDF, use read_file_rows.","tags":["file management"]}},"/api/file/fold":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"fileid":{"description":"The file to read.","type":"string"},"folds":{"description":"What to work out, e.g. [{\"column\": \"Net\", \"fold\": \"sum\"}]. Folds over numbers: count | sum | min | max | avg. Over a date column: earliest | latest, which answer an ISO date — use them to find what period a file covers.","type":"array","items":{"type":"object","properties":{"column":{"type":"string"},"fold":{"type":"string"}},"required":["column","fold"],"additionalProperties":false},"maxItems":12}},"required":["token","fileid","folds"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"fileid":{"description":"The file to read.","type":"string"},"folds":{"description":"What to work out, e.g. [{\"column\": \"Net\", \"fold\": \"sum\"}]. Folds over numbers: count | sum | min | max | avg. Over a date column: earliest | latest, which answer an ISO date — use them to find what period a file covers.","type":"array","items":{"type":"object","properties":{"column":{"type":"string"},"fold":{"type":"string"}},"required":["column","fold"],"additionalProperties":false},"maxItems":12}},"required":["token","fileid","folds"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"fileid":{"description":"The file to read.","type":"string"},"folds":{"description":"What to work out, e.g. [{\"column\": \"Net\", \"fold\": \"sum\"}]. Folds over numbers: count | sum | min | max | avg. Over a date column: earliest | latest, which answer an ISO date — use them to find what period a file covers.","type":"array","items":{"type":"object","properties":{"column":{"type":"string"},"fold":{"type":"string"}},"required":["column","fold"],"additionalProperties":false},"maxItems":12}},"required":["token","fileid","folds"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"fileid":{"description":"The file to read.","type":"string"},"folds":{"description":"What to work out, e.g. [{\"column\": \"Net\", \"fold\": \"sum\"}]. Folds over numbers: count | sum | min | max | avg. Over a date column: earliest | latest, which answer an ISO date — use them to find what period a file covers.","type":"array","items":{"type":"object","properties":{"column":{"type":"string"},"fold":{"type":"string"}},"required":["column","fold"],"additionalProperties":false},"maxItems":12}},"required":["token","fileid","folds"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Fold columns of an uploaded CSV into single values — count, sum, min, max or avg over numbers, and earliest or latest over a date column (which is how you find the period a file covers). Ask for several at once: each call reads the file again. Only the numbers come back, never the rows. A sum refuses when any value in the column cannot be read as a number, rather than answering with a total short by those rows.","tags":["file management"]}},"/api/file/rows":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"fileid":{"description":"The file to read.","type":"string"},"sheet":{"description":"A workbook's sheet, by name. Omit for the first; the answer lists every sheet.","oneOf":[{"type":"string"},{"type":"null"}]},"line":{"description":"The row to start from, as the answer's :nextline gives it. Omit for the first.","oneOf":[{"type":"integer","minimum":1},{"type":"null"}]},"page":{"description":"A PDF's page, from 1. Omit for the first.","oneOf":[{"type":"integer","minimum":1},{"type":"null"}]}},"required":["token","fileid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"fileid":{"description":"The file to read.","type":"string"},"sheet":{"description":"A workbook's sheet, by name. Omit for the first; the answer lists every sheet.","oneOf":[{"type":"string"},{"type":"null"}]},"line":{"description":"The row to start from, as the answer's :nextline gives it. Omit for the first.","oneOf":[{"type":"integer","minimum":1},{"type":"null"}]},"page":{"description":"A PDF's page, from 1. Omit for the first.","oneOf":[{"type":"integer","minimum":1},{"type":"null"}]}},"required":["token","fileid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"fileid":{"description":"The file to read.","type":"string"},"sheet":{"description":"A workbook's sheet, by name. Omit for the first; the answer lists every sheet.","oneOf":[{"type":"string"},{"type":"null"}]},"line":{"description":"The row to start from, as the answer's :nextline gives it. Omit for the first.","oneOf":[{"type":"integer","minimum":1},{"type":"null"}]},"page":{"description":"A PDF's page, from 1. Omit for the first.","oneOf":[{"type":"integer","minimum":1},{"type":"null"}]}},"required":["token","fileid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"fileid":{"description":"The file to read.","type":"string"},"sheet":{"description":"A workbook's sheet, by name. Omit for the first; the answer lists every sheet.","oneOf":[{"type":"string"},{"type":"null"}]},"line":{"description":"The row to start from, as the answer's :nextline gives it. Omit for the first.","oneOf":[{"type":"integer","minimum":1},{"type":"null"}]},"page":{"description":"A PDF's page, from 1. Omit for the first.","oneOf":[{"type":"integer","minimum":1},{"type":"null"}]}},"required":["token","fileid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Read an uploaded file line by line: the rows of a CSV or of one sheet of an Excel workbook, up to 100 rows a call, or the text of one page of a PDF. An image, such as a photo of a receipt, comes back as the picture itself. Read the file before you say you cannot. When :more is true, call again from :nextline (rows) or the next :page (PDF) for the rest. A refusal's message is the reason to give the customer.","tags":["file management"]}},"/api/file/parse":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"hint":{"type":"string"},"prompt":{"type":"string"},"update-existing-products":{"description":"Accepted and ignored (PROD-2011): a product row with a SKU always updates the product or variant holding that SKU.","type":"boolean"}},"required":["token","id","hint"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"hint":{"type":"string"},"prompt":{"type":"string"},"update-existing-products":{"description":"Accepted and ignored (PROD-2011): a product row with a SKU always updates the product or variant holding that SKU.","type":"boolean"}},"required":["token","id","hint"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"hint":{"type":"string"},"prompt":{"type":"string"},"update-existing-products":{"description":"Accepted and ignored (PROD-2011): a product row with a SKU always updates the product or variant holding that SKU.","type":"boolean"}},"required":["token","id","hint"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"hint":{"type":"string"},"prompt":{"type":"string"},"update-existing-products":{"description":"Accepted and ignored (PROD-2011): a product row with a SKU always updates the product or variant holding that SKU.","type":"boolean"}},"required":["token","id","hint"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Parse data from a file using an agent","tags":["file management"]}},"/api/file/rerun":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"The file to read again (fil-…), from list_files","type":"string"},"confirm":{"description":"Set true only after the user agreed to read the file again","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"The file to read again (fil-…), from list_files","type":"string"},"confirm":{"description":"Set true only after the user agreed to read the file again","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"The file to read again (fil-…), from list_files","type":"string"},"confirm":{"description":"Set true only after the user agreed to read the file again","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"The file to read again (fil-…), from list_files","type":"string"},"confirm":{"description":"Set true only after the user agreed to read the file again","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Read a rejected file again, the same way as a new upload: stub identifies it and imports it, so the same rule may refuse it again. Only a file whose status is rejected; any other status, failed included, is not-rejected, and a password-protected file needs unlocking in the app first. Without confirm true it changes nothing and answers reason confirm-required naming the file; ask the user, then call again with confirm true. Answers the file's new status: processing (being read; check list_files later), stored or review. A file already being read again is already-rerunning. A file in a locked folder is refused. A missing or another business's id is not-found.","tags":["file management"]}},"/api/file/unlock":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"password":{"type":"string","minLength":1,"maxLength":256}},"required":["token","id","password"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"password":{"type":"string","minLength":1,"maxLength":256}},"required":["token","id","password"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"password":{"type":"string","minLength":1,"maxLength":256}},"required":["token","id","password"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"password":{"type":"string","minLength":1,"maxLength":256}},"required":["token","id","password"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Unlock a password-protected PDF into a new file","tags":["file management"]}},"/api/file/get":{"get":{"parameters":[{"in":"query","name":"token","required":true,"schema":{"type":"string"}},{"in":"query","name":"path","required":true,"schema":{"type":"string"}},{"in":"query","name":"downloadfilename","required":false,"schema":{"type":"string"}},{"in":"query","name":"businessid","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Get file","tags":["file management"]}},"/api/file/get/{filename}":{"get":{"parameters":[{"in":"query","name":"token","required":true,"schema":{"type":"string"}},{"in":"query","name":"path","required":true,"schema":{"type":"string"}},{"in":"query","name":"downloadfilename","required":false,"schema":{"type":"string"}},{"in":"query","name":"businessid","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Get file","tags":["file management"]}},"/api/file/update":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"folderid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"folderid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"folderid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"folderid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Update file","tags":["file management"]}},"/api/file/delete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"deleteentities":{"type":"boolean"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"deleteentities":{"type":"boolean"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"deleteentities":{"type":"boolean"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"deleteentities":{"type":"boolean"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Delete file","tags":["file management"]}},"/api/files/reorganize":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Reorganise all files: bank statements (a statement period, or a file that generated multiple transactions) into statements/yyyy/mm (name kept), expense-linked files into expenses/yyyy/mm, bill-linked into bills/yyyy/mm (renamed to the entity), unlinked root files into an 'unassigned' folder. Files already filed, or linked to a single income/invoice, are left alone. Returns a counts summary incl. :orphans (unlinked root files remaining, should be 0).","tags":["file management"]}},"/api/reconcile/dedupe":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"limit":{"description":"Max number of the largest duplicate groups to return PER kind (1-50, default 20). Each group lists its leader plus up to 10 member ids with :membercount / :more for the rest. The per-kind duplicate + group COUNTS and the :truncated flag always cover the full set regardless of this.","oneOf":[{"type":"integer"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"limit":{"description":"Max number of the largest duplicate groups to return PER kind (1-50, default 20). Each group lists its leader plus up to 10 member ids with :membercount / :more for the rest. The per-kind duplicate + group COUNTS and the :truncated flag always cover the full set regardless of this.","oneOf":[{"type":"integer"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"limit":{"description":"Max number of the largest duplicate groups to return PER kind (1-50, default 20). Each group lists its leader plus up to 10 member ids with :membercount / :more for the rest. The per-kind duplicate + group COUNTS and the :truncated flag always cover the full set regardless of this.","oneOf":[{"type":"integer"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"limit":{"description":"Max number of the largest duplicate groups to return PER kind (1-50, default 20). Each group lists its leader plus up to 10 member ids with :membercount / :more for the rest. The per-kind duplicate + group COUNTS and the :truncated flag always cover the full set regardless of this.","oneOf":[{"type":"integer"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Run the reconciler and report, per money/party kind, how many duplicate rows and groups it found plus the largest groups (leader + member ids). Bounded — returns the top `limit` groups per kind (default 20) with a :truncated flag and full COUNTS; raise `limit` for more. Keeps every row in the ledger; persists advisory group ids. Use before matching so only group leaders are reconciled.","tags":["reconciliation"]}},"/api/reconcile/categorize":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"preview":{"description":"When true, run a READ-ONLY proposal pass: return per-entry {account, confidence, reason} proposals for every uncategorised income/expense row and WRITE NOTHING — the caller decides what to apply (mirrors suggest_suppliers). Omit or false = the default persisting behaviour.","oneOf":[{"type":"boolean"},{"type":"null"}]},"ids":{"description":"Optional entry-id allowlist that SCOPES the persisting pass. When present, ONLY these income/expense entries (the ids you picked from a preview) are categorised and written — every other entry is left completely untouched (no inference, no supplier/client creation, no LLM spend). Omit = the business-wide default. Use this to apply a reviewed subset instead of mutating the whole book, which has no undo.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"preview":{"description":"When true, run a READ-ONLY proposal pass: return per-entry {account, confidence, reason} proposals for every uncategorised income/expense row and WRITE NOTHING — the caller decides what to apply (mirrors suggest_suppliers). Omit or false = the default persisting behaviour.","oneOf":[{"type":"boolean"},{"type":"null"}]},"ids":{"description":"Optional entry-id allowlist that SCOPES the persisting pass. When present, ONLY these income/expense entries (the ids you picked from a preview) are categorised and written — every other entry is left completely untouched (no inference, no supplier/client creation, no LLM spend). Omit = the business-wide default. Use this to apply a reviewed subset instead of mutating the whole book, which has no undo.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"preview":{"description":"When true, run a READ-ONLY proposal pass: return per-entry {account, confidence, reason} proposals for every uncategorised income/expense row and WRITE NOTHING — the caller decides what to apply (mirrors suggest_suppliers). Omit or false = the default persisting behaviour.","oneOf":[{"type":"boolean"},{"type":"null"}]},"ids":{"description":"Optional entry-id allowlist that SCOPES the persisting pass. When present, ONLY these income/expense entries (the ids you picked from a preview) are categorised and written — every other entry is left completely untouched (no inference, no supplier/client creation, no LLM spend). Omit = the business-wide default. Use this to apply a reviewed subset instead of mutating the whole book, which has no undo.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"preview":{"description":"When true, run a READ-ONLY proposal pass: return per-entry {account, confidence, reason} proposals for every uncategorised income/expense row and WRITE NOTHING — the caller decides what to apply (mirrors suggest_suppliers). Omit or false = the default persisting behaviour.","oneOf":[{"type":"boolean"},{"type":"null"}]},"ids":{"description":"Optional entry-id allowlist that SCOPES the persisting pass. When present, ONLY these income/expense entries (the ids you picked from a preview) are categorised and written — every other entry is left completely untouched (no inference, no supplier/client creation, no LLM spend). Omit = the business-wide default. Use this to apply a reviewed subset instead of mutating the whole book, which has no undo.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Takes NO account: to put an entry on an account the user chose, use save_expense / save_income with accountid. BUSINESS-WIDE by default, DESTRUCTIVE, NO UNDO. With no `ids`, runs SuperCat over EVERY uncategorised income/expense entry in the whole business and PERSISTS the inferred account (accountid) on each — immediately, all in one pass; returns how many rows were placed/written. SAFER FLOW: pass preview=true first for a READ-ONLY proposal pass — it returns proposals [{id, type, account, confidence, reason, support, topsim, source}] plus unmatched [{id, type, name}] and WRITES NOTHING (mirrors suggest_suppliers). The preview also returns billproposals [{paymentid, billid, supplierid, confidence, requires_confirmation, proposal, reason}]: an uncategorised payment that looks like it settles an open bill in ANOTHER currency (converted at the payment's date, within 3%), with the FX gain/loss the pair would need. Show these to the user as possible bill payments; they are never applied automatically and a categorize run leaves those payments uncategorised. Do not settle or link one yet: confirming a cross-currency bill payment needs its FX line booked, which is not supported yet. Then apply a reviewed subset by passing `ids` (an entry-id allowlist): ONLY those entries are categorised and written; every other entry is left untouched (no write, no supplier/client creation, no LLM spend). There is still no undo, so prefer preview→ids over a business-wide run.","tags":["reconciliation"]}},"/api/reconcile/match":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"name":{"description":"The entry's name/description text; used for text-similarity scoring against each candidate.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"The entry's amount to match on (required). Compared against each candidate's value.","oneOf":[{"type":"number"},{"type":"null"}]},"date":{"description":"The entry's date (YYYY-MM-DD); used for date-proximity scoring.","oneOf":[{"type":"string"},{"type":"null"}]},"direction":{"description":"Which side the entry sits on: \"expense\" or \"income\" (required).","type":"string","enum":["expense","income"]},"candidates":{"description":"Candidate bank transactions to weigh, typically from search_amount — each a map with at least id, value, date and description. Required in practice; an empty or absent list yields no match.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]},"currency":{"description":"The entry's ISO currency (e.g. ZAR). When given, a candidate in another currency is converted at its own date's rate and kept only within 3% of the amount; such a match is capped below 0.9, carries requires_confirmation=true and the FX gain/loss proposal. Omit for same-currency matching.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","amount","direction"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"name":{"description":"The entry's name/description text; used for text-similarity scoring against each candidate.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"The entry's amount to match on (required). Compared against each candidate's value.","oneOf":[{"type":"number"},{"type":"null"}]},"date":{"description":"The entry's date (YYYY-MM-DD); used for date-proximity scoring.","oneOf":[{"type":"string"},{"type":"null"}]},"direction":{"description":"Which side the entry sits on: \"expense\" or \"income\" (required).","type":"string","enum":["expense","income"]},"candidates":{"description":"Candidate bank transactions to weigh, typically from search_amount — each a map with at least id, value, date and description. Required in practice; an empty or absent list yields no match.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]},"currency":{"description":"The entry's ISO currency (e.g. ZAR). When given, a candidate in another currency is converted at its own date's rate and kept only within 3% of the amount; such a match is capped below 0.9, carries requires_confirmation=true and the FX gain/loss proposal. Omit for same-currency matching.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","amount","direction"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"name":{"description":"The entry's name/description text; used for text-similarity scoring against each candidate.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"The entry's amount to match on (required). Compared against each candidate's value.","oneOf":[{"type":"number"},{"type":"null"}]},"date":{"description":"The entry's date (YYYY-MM-DD); used for date-proximity scoring.","oneOf":[{"type":"string"},{"type":"null"}]},"direction":{"description":"Which side the entry sits on: \"expense\" or \"income\" (required).","type":"string","enum":["expense","income"]},"candidates":{"description":"Candidate bank transactions to weigh, typically from search_amount — each a map with at least id, value, date and description. Required in practice; an empty or absent list yields no match.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]},"currency":{"description":"The entry's ISO currency (e.g. ZAR). When given, a candidate in another currency is converted at its own date's rate and kept only within 3% of the amount; such a match is capped below 0.9, carries requires_confirmation=true and the FX gain/loss proposal. Omit for same-currency matching.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","amount","direction"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"name":{"description":"The entry's name/description text; used for text-similarity scoring against each candidate.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"The entry's amount to match on (required). Compared against each candidate's value.","oneOf":[{"type":"number"},{"type":"null"}]},"date":{"description":"The entry's date (YYYY-MM-DD); used for date-proximity scoring.","oneOf":[{"type":"string"},{"type":"null"}]},"direction":{"description":"Which side the entry sits on: \"expense\" or \"income\" (required).","type":"string","enum":["expense","income"]},"candidates":{"description":"Candidate bank transactions to weigh, typically from search_amount — each a map with at least id, value, date and description. Required in practice; an empty or absent list yields no match.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]},"currency":{"description":"The entry's ISO currency (e.g. ZAR). When given, a candidate in another currency is converted at its own date's rate and kept only within 3% of the amount; such a match is capped below 0.9, carries requires_confirmation=true and the FX gain/loss proposal. Omit for same-currency matching.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","amount","direction"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"READ-ONLY scorer that links nothing: given ONE income or expense entry and the candidate bank transactions you already fetched, it says which candidate the entry most likely is; to reconcile the whole business, use match_transactions instead. To link one invoice or bill to its payment, use find_candidate_transactions, then settle_bills or record_document_payment. Pass the entry (name/amount/date/direction) and amount-filtered candidate transactions; returns {transactionid, confidence 0.0-1.0, reason}. confidence >= 0.9 is a confident link; below that, escalate to a human/LLM judge.","tags":["reconciliation"]}},"/api/reconcile/candidates":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"documentid":{"description":"The invoice / bill / purchase document id (cont-… or inv-…) to find candidate settling bank transactions for.","type":"string"}},"required":["token","documentid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"documentid":{"description":"The invoice / bill / purchase document id (cont-… or inv-…) to find candidate settling bank transactions for.","type":"string"}},"required":["token","documentid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"documentid":{"description":"The invoice / bill / purchase document id (cont-… or inv-…) to find candidate settling bank transactions for.","type":"string"}},"required":["token","documentid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"documentid":{"description":"The invoice / bill / purchase document id (cont-… or inv-…) to find candidate settling bank transactions for.","type":"string"}},"required":["token","documentid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"For an OUTSTANDING or OVERDUE invoice or bill, surface the candidate bank transactions that could settle it: OPEN (unreconciled) transactions within ±7 days of the document's due date whose amount matches its outstanding balance. Returns {documentid, direction, duedate, amount, doccurrency, basecurrency, candidates [transactions], best {transactionid, confidence 0.0-1.0, reason, proposal}} — best is the single strongest match (confidence >= 0.9 is a confident match). A bank line in another currency is offered when, converted at its own date's rate, it lands within 3% of the balance; its best never reaches 0.9 and carries requires_confirmation=true, because settling it needs the FX gain/loss the user confirms. Each candidate (and best) also carries a `proposal`: the adjusting line settling with it would require — {type :bank-charge|:fx-gain|:fx-loss, amount, currency, …} when the payment does not land exactly on the outstanding balance (a bank charge when the currencies match, an FX gain/loss when they differ), null for an exact match, or {type :indeterminate} when the dated FX rate is unavailable. READ-ONLY: it suggests a match and the adjusting line, never records either (settle bills via settle_bills; the adjusting line is for the user to confirm). To settle an invoice, first check whether the candidate's bank line already has its own income: list_transactions shows it in that line's `$incomeids`. If it does, settle with save_income, `id` = that income and `accountid` = the invoice id. Use record_document_payment only when the line has no income, because it always creates a new income and would count the money twice. Pass the document id (cont-… or inv-…). Run this whenever you report an overdue/outstanding invoice or bill so the likely payment is offered alongside it.","tags":["reconciliation"]}},"/api/reconcile/convert":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"amount":{"description":"The amount to convert, in the `from` currency.","type":"number"},"from":{"description":"ISO currency code of the amount (e.g. GBP).","type":"string"},"to":{"description":"ISO currency code to convert into (e.g. ZAR).","type":"string"},"date":{"description":"The date whose rate to use (YYYY-MM-DD). Defaults to today; a future date uses today's rate.","oneOf":[{"type":"string"},{"type":"null"}]},"target":{"description":"Optional amount in the `to` currency to test the converted amount against (e.g. a bill's outstanding balance).","oneOf":[{"type":"number"},{"type":"null"}]},"tolerance":{"description":"Optional band for `target`, as a fraction (0.03 = 3%). Must be above 0 and at most 0.03; defaults to 0.03, the cross-currency matching band.","oneOf":[{"type":"number"},{"type":"null"}]}},"required":["token","amount","from","to"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"amount":{"description":"The amount to convert, in the `from` currency.","type":"number"},"from":{"description":"ISO currency code of the amount (e.g. GBP).","type":"string"},"to":{"description":"ISO currency code to convert into (e.g. ZAR).","type":"string"},"date":{"description":"The date whose rate to use (YYYY-MM-DD). Defaults to today; a future date uses today's rate.","oneOf":[{"type":"string"},{"type":"null"}]},"target":{"description":"Optional amount in the `to` currency to test the converted amount against (e.g. a bill's outstanding balance).","oneOf":[{"type":"number"},{"type":"null"}]},"tolerance":{"description":"Optional band for `target`, as a fraction (0.03 = 3%). Must be above 0 and at most 0.03; defaults to 0.03, the cross-currency matching band.","oneOf":[{"type":"number"},{"type":"null"}]}},"required":["token","amount","from","to"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"amount":{"description":"The amount to convert, in the `from` currency.","type":"number"},"from":{"description":"ISO currency code of the amount (e.g. GBP).","type":"string"},"to":{"description":"ISO currency code to convert into (e.g. ZAR).","type":"string"},"date":{"description":"The date whose rate to use (YYYY-MM-DD). Defaults to today; a future date uses today's rate.","oneOf":[{"type":"string"},{"type":"null"}]},"target":{"description":"Optional amount in the `to` currency to test the converted amount against (e.g. a bill's outstanding balance).","oneOf":[{"type":"number"},{"type":"null"}]},"tolerance":{"description":"Optional band for `target`, as a fraction (0.03 = 3%). Must be above 0 and at most 0.03; defaults to 0.03, the cross-currency matching band.","oneOf":[{"type":"number"},{"type":"null"}]}},"required":["token","amount","from","to"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"amount":{"description":"The amount to convert, in the `from` currency.","type":"number"},"from":{"description":"ISO currency code of the amount (e.g. GBP).","type":"string"},"to":{"description":"ISO currency code to convert into (e.g. ZAR).","type":"string"},"date":{"description":"The date whose rate to use (YYYY-MM-DD). Defaults to today; a future date uses today's rate.","oneOf":[{"type":"string"},{"type":"null"}]},"target":{"description":"Optional amount in the `to` currency to test the converted amount against (e.g. a bill's outstanding balance).","oneOf":[{"type":"number"},{"type":"null"}]},"tolerance":{"description":"Optional band for `target`, as a fraction (0.03 = 3%). Must be above 0 and at most 0.03; defaults to 0.03, the cross-currency matching band.","oneOf":[{"type":"number"},{"type":"null"}]}},"required":["token","amount","from","to"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Convert an amount between currencies at the OpenExchangeRates rate for a date (the same dated rate find_candidate_transactions matches with). Returns {amount, from, to, converted, rate, ratedate}; ratedate is the day the rate is for (a future date uses today's). Pass `target` (an amount in the `to` currency, e.g. a bill's outstanding balance) to also get within_tolerance: whether the converted amount lands within `tolerance` of it (a fraction, default and maximum 0.03 = the 3% cross-currency matching band). No rate for that date reads the latest earlier rate that weekends or market closures explain, marked stale: true with its ratedate; display only, never posted. An exact rate says stale: false. Otherwise it returns {error true, reason no-rate}. READ-ONLY: it converts, never records anything.","tags":["reconciliation"]}},"/api/reconcile/candidates-bulk":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"documentids":{"description":"Explicit list of document ids (cont-… or inv-…) to fetch candidates for. When given, the filter fields below are ignored. Foreign/missing ids are silently dropped.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"type":{"description":"Filter the document set by kind (invoice, bill, …). Ignored when :documentids is given.","oneOf":[{"type":"string","enum":["invoice","quote","recurring","debit_note","credit_note","purchase_order","bill","grn"]},{"type":"null"}]},"direction":{"description":"Filter by money direction: \"in\" (invoices, quotes, credit notes) or \"out\" (bills, purchase orders, debit notes).","oneOf":[{"type":"string","enum":["in","out"]},{"type":"null"}]},"contact":{"description":"Filter to documents for this contact id (a client or supplier).","oneOf":[{"type":"string"},{"type":"null"}]},"status":{"description":"Filter to documents whose computed status matches (case-insensitive), e.g. \"overdue\", \"due\", \"partiallypaid\".","oneOf":[{"type":"string"},{"type":"null"}]},"from":{"description":"Only documents with a due date on/after this date (inclusive, ISO 8601). Documents with no due date are kept.","oneOf":[{"type":"string"},{"type":"null"}]},"to":{"description":"Only documents with a due date on/before this date (inclusive, ISO 8601). Documents with no due date are kept.","oneOf":[{"type":"string"},{"type":"null"}]},"unpaid":{"description":"When true, only documents with an outstanding balance (excludes fully paid rows). Recommended for reconciliation.","oneOf":[{"type":"boolean"},{"type":"null"}]},"min_outstanding":{"description":"Only documents whose outstanding balance is at least this amount (inclusive).","oneOf":[{"type":"number"},{"type":"null"}]},"limit":{"description":"Max documents to process this call (default 50, hard max 200). If more match, :truncated is true and :matched reports the full count — narrow the filter or page.","oneOf":[{"type":"integer"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"documentids":{"description":"Explicit list of document ids (cont-… or inv-…) to fetch candidates for. When given, the filter fields below are ignored. Foreign/missing ids are silently dropped.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"type":{"description":"Filter the document set by kind (invoice, bill, …). Ignored when :documentids is given.","oneOf":[{"type":"string","enum":["invoice","quote","recurring","debit_note","credit_note","purchase_order","bill","grn"]},{"type":"null"}]},"direction":{"description":"Filter by money direction: \"in\" (invoices, quotes, credit notes) or \"out\" (bills, purchase orders, debit notes).","oneOf":[{"type":"string","enum":["in","out"]},{"type":"null"}]},"contact":{"description":"Filter to documents for this contact id (a client or supplier).","oneOf":[{"type":"string"},{"type":"null"}]},"status":{"description":"Filter to documents whose computed status matches (case-insensitive), e.g. \"overdue\", \"due\", \"partiallypaid\".","oneOf":[{"type":"string"},{"type":"null"}]},"from":{"description":"Only documents with a due date on/after this date (inclusive, ISO 8601). Documents with no due date are kept.","oneOf":[{"type":"string"},{"type":"null"}]},"to":{"description":"Only documents with a due date on/before this date (inclusive, ISO 8601). Documents with no due date are kept.","oneOf":[{"type":"string"},{"type":"null"}]},"unpaid":{"description":"When true, only documents with an outstanding balance (excludes fully paid rows). Recommended for reconciliation.","oneOf":[{"type":"boolean"},{"type":"null"}]},"min_outstanding":{"description":"Only documents whose outstanding balance is at least this amount (inclusive).","oneOf":[{"type":"number"},{"type":"null"}]},"limit":{"description":"Max documents to process this call (default 50, hard max 200). If more match, :truncated is true and :matched reports the full count — narrow the filter or page.","oneOf":[{"type":"integer"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"documentids":{"description":"Explicit list of document ids (cont-… or inv-…) to fetch candidates for. When given, the filter fields below are ignored. Foreign/missing ids are silently dropped.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"type":{"description":"Filter the document set by kind (invoice, bill, …). Ignored when :documentids is given.","oneOf":[{"type":"string","enum":["invoice","quote","recurring","debit_note","credit_note","purchase_order","bill","grn"]},{"type":"null"}]},"direction":{"description":"Filter by money direction: \"in\" (invoices, quotes, credit notes) or \"out\" (bills, purchase orders, debit notes).","oneOf":[{"type":"string","enum":["in","out"]},{"type":"null"}]},"contact":{"description":"Filter to documents for this contact id (a client or supplier).","oneOf":[{"type":"string"},{"type":"null"}]},"status":{"description":"Filter to documents whose computed status matches (case-insensitive), e.g. \"overdue\", \"due\", \"partiallypaid\".","oneOf":[{"type":"string"},{"type":"null"}]},"from":{"description":"Only documents with a due date on/after this date (inclusive, ISO 8601). Documents with no due date are kept.","oneOf":[{"type":"string"},{"type":"null"}]},"to":{"description":"Only documents with a due date on/before this date (inclusive, ISO 8601). Documents with no due date are kept.","oneOf":[{"type":"string"},{"type":"null"}]},"unpaid":{"description":"When true, only documents with an outstanding balance (excludes fully paid rows). Recommended for reconciliation.","oneOf":[{"type":"boolean"},{"type":"null"}]},"min_outstanding":{"description":"Only documents whose outstanding balance is at least this amount (inclusive).","oneOf":[{"type":"number"},{"type":"null"}]},"limit":{"description":"Max documents to process this call (default 50, hard max 200). If more match, :truncated is true and :matched reports the full count — narrow the filter or page.","oneOf":[{"type":"integer"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"documentids":{"description":"Explicit list of document ids (cont-… or inv-…) to fetch candidates for. When given, the filter fields below are ignored. Foreign/missing ids are silently dropped.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"type":{"description":"Filter the document set by kind (invoice, bill, …). Ignored when :documentids is given.","oneOf":[{"type":"string","enum":["invoice","quote","recurring","debit_note","credit_note","purchase_order","bill","grn"]},{"type":"null"}]},"direction":{"description":"Filter by money direction: \"in\" (invoices, quotes, credit notes) or \"out\" (bills, purchase orders, debit notes).","oneOf":[{"type":"string","enum":["in","out"]},{"type":"null"}]},"contact":{"description":"Filter to documents for this contact id (a client or supplier).","oneOf":[{"type":"string"},{"type":"null"}]},"status":{"description":"Filter to documents whose computed status matches (case-insensitive), e.g. \"overdue\", \"due\", \"partiallypaid\".","oneOf":[{"type":"string"},{"type":"null"}]},"from":{"description":"Only documents with a due date on/after this date (inclusive, ISO 8601). Documents with no due date are kept.","oneOf":[{"type":"string"},{"type":"null"}]},"to":{"description":"Only documents with a due date on/before this date (inclusive, ISO 8601). Documents with no due date are kept.","oneOf":[{"type":"string"},{"type":"null"}]},"unpaid":{"description":"When true, only documents with an outstanding balance (excludes fully paid rows). Recommended for reconciliation.","oneOf":[{"type":"boolean"},{"type":"null"}]},"min_outstanding":{"description":"Only documents whose outstanding balance is at least this amount (inclusive).","oneOf":[{"type":"number"},{"type":"null"}]},"limit":{"description":"Max documents to process this call (default 50, hard max 200). If more match, :truncated is true and :matched reports the full count — narrow the filter or page.","oneOf":[{"type":"integer"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"BULK / multi-document version of find_candidate_transactions: for MANY outstanding documents at once, return each document alongside its candidate settling bank transactions + best match, in ONE read-only call — so reconciling a large AP/AR backlog needs one call, not one round-trip per bill. Select the document set EITHER by passing an explicit `documentids` list, OR with the same filters as list_documents (`type`, `direction` in/out, `contact`, `status` e.g. overdue, `from`/`to` due-date range, `unpaid`, `min_outstanding`) — e.g. type=bill + unpaid + status=overdue to pull candidates for every overdue bill. Capped at `limit` documents (default 50, hard max 200); when more match, `truncated` is true and `matched` reports the full count, so narrow the filter or page. Returns {results [{document {...}, candidates [transactions], best {transactionid, confidence, reason}}], count, matched, truncated, limit}. READ-ONLY: it suggests matches, never records them (settle bills via settle_bills). To settle an invoice, first check whether the candidate's bank line already has its own income: list_transactions shows it in that line's `$incomeids`. If it does, settle with save_income, `id` = that income and `accountid` = the invoice id. Use record_document_payment only when the line has no income, because it always creates a new income and would count the money twice.","tags":["reconciliation"]}},"/api/reconcile/set-match":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"supplier":{"description":"The supplier id (sup-…) whose open bills to pair.","type":"string"},"from":{"description":"Only bills due on/after this date (inclusive, ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"to":{"description":"Only bills due on/before this date (inclusive, ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","supplier"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"supplier":{"description":"The supplier id (sup-…) whose open bills to pair.","type":"string"},"from":{"description":"Only bills due on/after this date (inclusive, ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"to":{"description":"Only bills due on/before this date (inclusive, ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","supplier"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"supplier":{"description":"The supplier id (sup-…) whose open bills to pair.","type":"string"},"from":{"description":"Only bills due on/after this date (inclusive, ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"to":{"description":"Only bills due on/before this date (inclusive, ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","supplier"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"supplier":{"description":"The supplier id (sup-…) whose open bills to pair.","type":"string"},"from":{"description":"Only bills due on/after this date (inclusive, ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"to":{"description":"Only bills due on/before this date (inclusive, ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","supplier"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Pair ONE supplier's open bills to bank payments as a set, in one read-only call: each bill and each money-out bank line is used at most once, so a supplier who bills the same amounts every month cannot have one payment claimed by two bills. Pass `supplier` (sup-…) and optionally a `from`/`to` due-date range. A line in another currency is converted at its own date's rate and must land within 2% of the bill; among those, a line one day after the bill wins, then same-day, then by smallest FX gap. Returns {pairs [{bill, transaction, lag_days, gap_percent, tied}], settle_batches, unmatched_bills, unmatched_candidate_lines, unconvertible_lines, totals, matched, truncated, limit}. `tied` = true means another line fit that bill equally well, so ask the user about that pair. READ-ONLY: it proposes, never settles. Show the pairs; once the user confirms, send each `settle_batches` entry ({pairs [{bill, transaction}]}, at most 100 pairs) to settle_bills as its arguments. A bill in a foreign currency paid from a base-currency line may come back from settle_bills as \"failed\" with code \"cross-currency-needs-fx\"; leave those for the user.","tags":["reconciliation"]}},"/api/reconcile/suppliers":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"For every expense missing a supplier, use SuperCat to predict which existing supplier it belongs to, canonicalised to the supplier's dedupe-group leader. Returns proposals [{id, supplierid, confidence, support, topsim}] — a proposal to review/apply, plus the three signals SuperCat's strong-prediction bar uses — and unmatched [{id, name}], the expenses no supplier could be predicted for (name = the raw expense text, for offering an inline supplier-create). Propose-only: this tool never writes; the match_suppliers workflow decides which proposals clear the bar and get applied via save_expense, leaving the rest for confirmation.","tags":["reconciliation"]}},"/api/reconcile/settle":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"pairs":{"description":"The confirmed bill↔payment pairs to reconcile. Each is applied independently.","type":"array","items":{"type":"object","properties":{"bill":{"description":"The bill / purchase order / GRN document id (cont-…) to settle.","type":"string"},"expense":{"description":"An existing expense id to link to the bill as its payment. Provide this OR :transaction, not both.","oneOf":[{"type":"string"},{"type":"null"}]},"transaction":{"description":"A bank transaction id to settle the bill from. A bank-feed transaction's own unallocated expense is re-pointed at the bill; an unlinked transaction gets a new expense linking it to the bill. Provide this OR :expense, not both.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Payment amount for the :transaction case; defaults to the transaction's own value.","oneOf":[{"type":"number"},{"type":"null"}]},"date":{"description":"Payment date for the :transaction case; defaults to the transaction's date.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Label for the created expense in the :transaction case; defaults to the transaction description.","oneOf":[{"type":"string"},{"type":"null"}]},"bankcharge":{"description":"Confirms a proposed bank-charges line (:transaction case). A payment above the bill by at most 3% of its outstanding comes back \"proposed\" with the fee and writes nothing. Re-send the pair with bankcharge = that proposal's amount, only after the user confirms, to settle the bill and post the fee to Bank Charges.","oneOf":[{"type":"number"},{"type":"null"}]},"fxadjustment":{"description":"Confirms a proposed FX gain/loss line (:transaction case). A bank payment in another currency from a base-currency bill, worth within 3% of the outstanding at the payment date's rate, comes back \"proposed\" with the FX line and writes nothing. Re-send the pair with fxadjustment = that proposal's amount, only after the user confirms, to settle the bill and post the difference to the Foreign Exchange account.","oneOf":[{"type":"number"},{"type":"null"}]}},"required":["bill"],"additionalProperties":false}}},"required":["token","pairs"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"pairs":{"description":"The confirmed bill↔payment pairs to reconcile. Each is applied independently.","type":"array","items":{"type":"object","properties":{"bill":{"description":"The bill / purchase order / GRN document id (cont-…) to settle.","type":"string"},"expense":{"description":"An existing expense id to link to the bill as its payment. Provide this OR :transaction, not both.","oneOf":[{"type":"string"},{"type":"null"}]},"transaction":{"description":"A bank transaction id to settle the bill from. A bank-feed transaction's own unallocated expense is re-pointed at the bill; an unlinked transaction gets a new expense linking it to the bill. Provide this OR :expense, not both.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Payment amount for the :transaction case; defaults to the transaction's own value.","oneOf":[{"type":"number"},{"type":"null"}]},"date":{"description":"Payment date for the :transaction case; defaults to the transaction's date.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Label for the created expense in the :transaction case; defaults to the transaction description.","oneOf":[{"type":"string"},{"type":"null"}]},"bankcharge":{"description":"Confirms a proposed bank-charges line (:transaction case). A payment above the bill by at most 3% of its outstanding comes back \"proposed\" with the fee and writes nothing. Re-send the pair with bankcharge = that proposal's amount, only after the user confirms, to settle the bill and post the fee to Bank Charges.","oneOf":[{"type":"number"},{"type":"null"}]},"fxadjustment":{"description":"Confirms a proposed FX gain/loss line (:transaction case). A bank payment in another currency from a base-currency bill, worth within 3% of the outstanding at the payment date's rate, comes back \"proposed\" with the FX line and writes nothing. Re-send the pair with fxadjustment = that proposal's amount, only after the user confirms, to settle the bill and post the difference to the Foreign Exchange account.","oneOf":[{"type":"number"},{"type":"null"}]}},"required":["bill"],"additionalProperties":false}}},"required":["token","pairs"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"pairs":{"description":"The confirmed bill↔payment pairs to reconcile. Each is applied independently.","type":"array","items":{"type":"object","properties":{"bill":{"description":"The bill / purchase order / GRN document id (cont-…) to settle.","type":"string"},"expense":{"description":"An existing expense id to link to the bill as its payment. Provide this OR :transaction, not both.","oneOf":[{"type":"string"},{"type":"null"}]},"transaction":{"description":"A bank transaction id to settle the bill from. A bank-feed transaction's own unallocated expense is re-pointed at the bill; an unlinked transaction gets a new expense linking it to the bill. Provide this OR :expense, not both.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Payment amount for the :transaction case; defaults to the transaction's own value.","oneOf":[{"type":"number"},{"type":"null"}]},"date":{"description":"Payment date for the :transaction case; defaults to the transaction's date.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Label for the created expense in the :transaction case; defaults to the transaction description.","oneOf":[{"type":"string"},{"type":"null"}]},"bankcharge":{"description":"Confirms a proposed bank-charges line (:transaction case). A payment above the bill by at most 3% of its outstanding comes back \"proposed\" with the fee and writes nothing. Re-send the pair with bankcharge = that proposal's amount, only after the user confirms, to settle the bill and post the fee to Bank Charges.","oneOf":[{"type":"number"},{"type":"null"}]},"fxadjustment":{"description":"Confirms a proposed FX gain/loss line (:transaction case). A bank payment in another currency from a base-currency bill, worth within 3% of the outstanding at the payment date's rate, comes back \"proposed\" with the FX line and writes nothing. Re-send the pair with fxadjustment = that proposal's amount, only after the user confirms, to settle the bill and post the difference to the Foreign Exchange account.","oneOf":[{"type":"number"},{"type":"null"}]}},"required":["bill"],"additionalProperties":false}}},"required":["token","pairs"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"pairs":{"description":"The confirmed bill↔payment pairs to reconcile. Each is applied independently.","type":"array","items":{"type":"object","properties":{"bill":{"description":"The bill / purchase order / GRN document id (cont-…) to settle.","type":"string"},"expense":{"description":"An existing expense id to link to the bill as its payment. Provide this OR :transaction, not both.","oneOf":[{"type":"string"},{"type":"null"}]},"transaction":{"description":"A bank transaction id to settle the bill from. A bank-feed transaction's own unallocated expense is re-pointed at the bill; an unlinked transaction gets a new expense linking it to the bill. Provide this OR :expense, not both.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Payment amount for the :transaction case; defaults to the transaction's own value.","oneOf":[{"type":"number"},{"type":"null"}]},"date":{"description":"Payment date for the :transaction case; defaults to the transaction's date.","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Label for the created expense in the :transaction case; defaults to the transaction description.","oneOf":[{"type":"string"},{"type":"null"}]},"bankcharge":{"description":"Confirms a proposed bank-charges line (:transaction case). A payment above the bill by at most 3% of its outstanding comes back \"proposed\" with the fee and writes nothing. Re-send the pair with bankcharge = that proposal's amount, only after the user confirms, to settle the bill and post the fee to Bank Charges.","oneOf":[{"type":"number"},{"type":"null"}]},"fxadjustment":{"description":"Confirms a proposed FX gain/loss line (:transaction case). A bank payment in another currency from a base-currency bill, worth within 3% of the outstanding at the payment date's rate, comes back \"proposed\" with the FX line and writes nothing. Re-send the pair with fxadjustment = that proposal's amount, only after the user confirms, to settle the bill and post the difference to the Foreign Exchange account.","oneOf":[{"type":"number"},{"type":"null"}]}},"required":["bill"],"additionalProperties":false}}},"required":["token","pairs"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Settle a batch of bills in one call (bills only: an invoice's leftover FX or rounding gap is settled with save_document settled true) — each pair links a bill / purchase order / GRN (cont-…) to its payment: either an existing expense (`expense`) or a bank transaction (`transaction`: a bank-feed transaction's own unallocated expense is re-pointed at the bill; an unlinked transaction gets a new expense linking the two). Money-out settle = an expense whose accountid is the bill's id. record_document_payment settles ONE bill at a time (minting the expense from payment fields); this tool instead LINKS an existing expense or bank transaction and settles a whole batch, which the chat loop can't do with N single settles. Each pair is applied INDEPENDENTLY: one failing (missing/locked/bad ref) never aborts the rest. Every id (bill, expense, transaction) is owner-scoped; an already-settled bill, or a transaction whose expense already pays that bill, is a safe no-op (not a failure), so re-running the same batch is harmless. A transaction allocated elsewhere (income, another bill or category, several expenses) fails with a reason naming the allocation. A bank transaction slightly ABOVE the bill (a bank fee, at most 3% of the outstanding, same currency) is not refused: it comes back status \"proposed\" with a `proposal` {type bank-charge, amount, accountid 201, accountname Bank Charges, outstanding, paid} and NOTHING is written. Show the user the fee; only once they confirm, re-send the same pair with `bankcharge` = proposal.amount to settle the bill and post the fee to Bank Charges in one transaction (re-sending again is an already-settled no-op). Above 3% the over-settle refusal stands. A bank transaction in a DIFFERENT currency from the bill, worth within 3% of the outstanding at its date's rate, comes back status \"proposed\" with a `proposal` {type fx-gain|fx-loss, amount, currency, accountid, accountname, outstanding, paid, paidcurrency, paidbase, exchangerate; for a bill in a foreign currency also billcurrency, carrying (the bill's base value), paidbill} and NOTHING is written. Show the user the FX line; only once they confirm, re-send the same pair with `fxadjustment` = proposal.amount to settle the bill and post the difference to the Foreign Exchange account (when the business has autofxadjustment on, it is booked without asking). A bill in a foreign currency paid from a bank line in that same currency settles at once and books the rate move since the bill date to Foreign Exchange (fxadjustment, autobooked); with no dated rate it settles with no FX line and fxunsized true. Any other currency mismatch (an `expense` pair, no dated rate, outside 3%, a partial payment in another currency) is refused with status \"failed\", code \"cross-currency-needs-fx\", billcurrency and paymentcurrency, and NOTHING is written. Returns {results [{bill, status \"settled\"|\"already-settled\"|\"proposed\"|\"failed\", expenseid, created, bankchargeid, fxadjustmentid, fxadjustment, proposal, reason}], settled, already-settled, proposed, failed} — expenseid is the undo handle and created=false means the expense pre-existed (undo by UNLINKING it, never deleting); bankchargeid is the minted fee expense (safe to delete); fxadjustmentid is removed automatically when its expenseid is unlinked from the bill or deleted, so do NOT delete it separately (restoring a deleted expense does not bring its FX line back). Max 100 pairs per call. Only run after the user has confirmed the proposed matches.","tags":["reconciliation"]}},"/api/reportedbalance/create":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"accountid":{"description":"Chart-of-accounts id of the account.","anyOf":[{"type":"string"},{"type":"integer"}]},"balance":{"description":"The balance the third party reports, in the account's own currency.","type":"number"},"date":{"description":"ISO instant the balance is as at. A day is sent as its last millisecond, UTC.","type":"string"},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","accountid","balance","date"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"accountid":{"description":"Chart-of-accounts id of the account.","anyOf":[{"type":"string"},{"type":"integer"}]},"balance":{"description":"The balance the third party reports, in the account's own currency.","type":"number"},"date":{"description":"ISO instant the balance is as at. A day is sent as its last millisecond, UTC.","type":"string"},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","accountid","balance","date"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"accountid":{"description":"Chart-of-accounts id of the account.","anyOf":[{"type":"string"},{"type":"integer"}]},"balance":{"description":"The balance the third party reports, in the account's own currency.","type":"number"},"date":{"description":"ISO instant the balance is as at. A day is sent as its last millisecond, UTC.","type":"string"},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","accountid","balance","date"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"accountid":{"description":"Chart-of-accounts id of the account.","anyOf":[{"type":"string"},{"type":"integer"}]},"balance":{"description":"The balance the third party reports, in the account's own currency.","type":"number"},"date":{"description":"ISO instant the balance is as at. A day is sent as its last millisecond, UTC.","type":"string"},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","accountid","balance","date"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Record a balance a third party reports for an account at an instant.","tags":["accounting reported balances"]}},"/api/reportedbalance/delete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Delete a reported balance. It moves to the bin.","tags":["accounting reported balances"]}},"/api/reportedbalance/list":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"accountid":{"description":"Chart-of-accounts id of the account.","anyOf":[{"type":"string"},{"type":"integer"}]}},"required":["token","accountid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"accountid":{"description":"Chart-of-accounts id of the account.","anyOf":[{"type":"string"},{"type":"integer"}]}},"required":["token","accountid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"accountid":{"description":"Chart-of-accounts id of the account.","anyOf":[{"type":"string"},{"type":"integer"}]}},"required":["token","accountid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"accountid":{"description":"Chart-of-accounts id of the account.","anyOf":[{"type":"string"},{"type":"integer"}]}},"required":["token","accountid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"List one account's reported balances, latest in effect first.","tags":["accounting reported balances"]}},"/api/reportedbalance/asat":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"accountid":{"anyOf":[{"type":"string"},{"type":"integer"}]},"date":{"description":"ISO instant to read the balance as at.","type":"string"}},"required":["token","accountid","date"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"accountid":{"anyOf":[{"type":"string"},{"type":"integer"}]},"date":{"description":"ISO instant to read the balance as at.","type":"string"}},"required":["token","accountid","date"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"accountid":{"anyOf":[{"type":"string"},{"type":"integer"}]},"date":{"description":"ISO instant to read the balance as at.","type":"string"}},"required":["token","accountid","date"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"accountid":{"anyOf":[{"type":"string"},{"type":"integer"}]},"date":{"description":"ISO instant to read the balance as at.","type":"string"}},"required":["token","accountid","date"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"The reported balance as at an instant, beside the ledger's own.","tags":["accounting reported balances"]}},"/api/reportedbalance/drift":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"accountid":{"anyOf":[{"type":"string"},{"type":"integer"}]},"period":{"type":"string","enum":["day","week","month"]},"start":{"type":"string"},"end":{"type":"string"}},"required":["token","accountid","period","start","end"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"accountid":{"anyOf":[{"type":"string"},{"type":"integer"}]},"period":{"type":"string","enum":["day","week","month"]},"start":{"type":"string"},"end":{"type":"string"}},"required":["token","accountid","period","start","end"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"accountid":{"anyOf":[{"type":"string"},{"type":"integer"}]},"period":{"type":"string","enum":["day","week","month"]},"start":{"type":"string"},"end":{"type":"string"}},"required":["token","accountid","period","start","end"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"accountid":{"anyOf":[{"type":"string"},{"type":"integer"}]},"period":{"type":"string","enum":["day","week","month"]},"start":{"type":"string"},"end":{"type":"string"}},"required":["token","accountid","period","start","end"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Reported less calculated per day, week or month.","tags":["accounting reported balances"]}},"/api/folder/list":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Every folder this business has, with the parent each sits under. Use it to find a folder by name before listing what is in it.","tags":["file management"]}},"/api/folder/create":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"name":{"description":"Name for the new folder (required).","type":"string"},"parentid":{"description":"Id of the parent folder to nest this one under; omit for a top-level folder.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","name"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"name":{"description":"Name for the new folder (required).","type":"string"},"parentid":{"description":"Id of the parent folder to nest this one under; omit for a top-level folder.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","name"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"name":{"description":"Name for the new folder (required).","type":"string"},"parentid":{"description":"Id of the parent folder to nest this one under; omit for a top-level folder.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","name"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"name":{"description":"Name for the new folder (required).","type":"string"},"parentid":{"description":"Id of the parent folder to nest this one under; omit for a top-level folder.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","name"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create a new folder for organising the business's uploaded files and documents. To rename or re-parent an existing folder use update_folder instead.","tags":["file management"]}},"/api/folder/update":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the folder to update (required).","type":"string"},"name":{"description":"New name for the folder; omit to leave it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]},"parentid":{"description":"New parent folder id to move this folder under; omit to leave it where it is.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the folder to update (required).","type":"string"},"name":{"description":"New name for the folder; omit to leave it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]},"parentid":{"description":"New parent folder id to move this folder under; omit to leave it where it is.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the folder to update (required).","type":"string"},"name":{"description":"New name for the folder; omit to leave it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]},"parentid":{"description":"New parent folder id to move this folder under; omit to leave it where it is.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the folder to update (required).","type":"string"},"name":{"description":"New name for the folder; omit to leave it unchanged.","oneOf":[{"type":"string"},{"type":"null"}]},"parentid":{"description":"New parent folder id to move this folder under; omit to leave it where it is.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Update a file folder by id — rename it or change its parent. To create a brand-new folder use create_folder instead.","tags":["file management"]}},"/api/folder/lock":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the folder to lock, share or unlock (required).","type":"string"},"on":{"description":"true makes this folder a locked folder; false turns the locked folder off and leaves an ordinary folder behind.","type":"boolean"},"members":{"description":"Profile uids who may open the locked folder BEYOND its owners, who always hold every locked folder. Omit to keep the current list; a list replaces it, and [] clears it. Owners are dropped from it.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token","id","on"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the folder to lock, share or unlock (required).","type":"string"},"on":{"description":"true makes this folder a locked folder; false turns the locked folder off and leaves an ordinary folder behind.","type":"boolean"},"members":{"description":"Profile uids who may open the locked folder BEYOND its owners, who always hold every locked folder. Omit to keep the current list; a list replaces it, and [] clears it. Owners are dropped from it.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token","id","on"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the folder to lock, share or unlock (required).","type":"string"},"on":{"description":"true makes this folder a locked folder; false turns the locked folder off and leaves an ordinary folder behind.","type":"boolean"},"members":{"description":"Profile uids who may open the locked folder BEYOND its owners, who always hold every locked folder. Omit to keep the current list; a list replaces it, and [] clears it. Owners are dropped from it.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token","id","on"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the folder to lock, share or unlock (required).","type":"string"},"on":{"description":"true makes this folder a locked folder; false turns the locked folder off and leaves an ordinary folder behind.","type":"boolean"},"members":{"description":"Profile uids who may open the locked folder BEYOND its owners, who always hold every locked folder. Omit to keep the current list; a list replaces it, and [] clears it. Owners are dropped from it.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token","id","on"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Lock a folder, change who can open it, or unlock it. Owners can open every locked folder and are never listed; `members` names everybody else who may open it.","tags":["file management"]}},"/api/folder/delete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Delete a folder by id, along with any folders nested inside it. Files filed under the folder (or its subfolders) are kept; only their folder reference is cleared, so they move back to the unfiled list.","tags":["file management"]}},"/api/entity/file/add":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"entity":{"description":"Entity kind to attach the file to, e.g. \"expense\", \"income\", \"asset\", \"transaction\", \"entry\", \"client\", \"supplier\", \"product\". For any document — invoice, quote, credit/debit note, purchase order, bill or goods-received note — use \"contract\" (its id may start with cont-, inv- or order-); the correct storage attribute is resolved from the id, so a bill (cont-… id) also resolves whether you pass \"contract\", \"bill\" or \"invoice\".","type":"string"},"entityid":{"description":"Id of the entity to attach the file to.","type":"string"},"fileid":{"description":"Id of the uploaded file to attach (see /file/upload).","type":"string"},"updates":{"description":"Internal: optimistic-update hints applied alongside the change.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]}},"required":["token","entity","entityid","fileid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"entity":{"description":"Entity kind to attach the file to, e.g. \"expense\", \"income\", \"asset\", \"transaction\", \"entry\", \"client\", \"supplier\", \"product\". For any document — invoice, quote, credit/debit note, purchase order, bill or goods-received note — use \"contract\" (its id may start with cont-, inv- or order-); the correct storage attribute is resolved from the id, so a bill (cont-… id) also resolves whether you pass \"contract\", \"bill\" or \"invoice\".","type":"string"},"entityid":{"description":"Id of the entity to attach the file to.","type":"string"},"fileid":{"description":"Id of the uploaded file to attach (see /file/upload).","type":"string"},"updates":{"description":"Internal: optimistic-update hints applied alongside the change.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]}},"required":["token","entity","entityid","fileid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"entity":{"description":"Entity kind to attach the file to, e.g. \"expense\", \"income\", \"asset\", \"transaction\", \"entry\", \"client\", \"supplier\", \"product\". For any document — invoice, quote, credit/debit note, purchase order, bill or goods-received note — use \"contract\" (its id may start with cont-, inv- or order-); the correct storage attribute is resolved from the id, so a bill (cont-… id) also resolves whether you pass \"contract\", \"bill\" or \"invoice\".","type":"string"},"entityid":{"description":"Id of the entity to attach the file to.","type":"string"},"fileid":{"description":"Id of the uploaded file to attach (see /file/upload).","type":"string"},"updates":{"description":"Internal: optimistic-update hints applied alongside the change.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]}},"required":["token","entity","entityid","fileid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"entity":{"description":"Entity kind to attach the file to, e.g. \"expense\", \"income\", \"asset\", \"transaction\", \"entry\", \"client\", \"supplier\", \"product\". For any document — invoice, quote, credit/debit note, purchase order, bill or goods-received note — use \"contract\" (its id may start with cont-, inv- or order-); the correct storage attribute is resolved from the id, so a bill (cont-… id) also resolves whether you pass \"contract\", \"bill\" or \"invoice\".","type":"string"},"entityid":{"description":"Id of the entity to attach the file to.","type":"string"},"fileid":{"description":"Id of the uploaded file to attach (see /file/upload).","type":"string"},"updates":{"description":"Internal: optimistic-update hints applied alongside the change.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]}},"required":["token","entity","entityid","fileid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Attach a file to an entity (invoice, expense, etc.).","tags":["entity management"]}},"/api/entity/file/remove":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"entity":{"description":"Entity kind to attach the file to, e.g. \"expense\", \"income\", \"asset\", \"transaction\", \"entry\", \"client\", \"supplier\", \"product\". For any document — invoice, quote, credit/debit note, purchase order, bill or goods-received note — use \"contract\" (its id may start with cont-, inv- or order-); the correct storage attribute is resolved from the id, so a bill (cont-… id) also resolves whether you pass \"contract\", \"bill\" or \"invoice\".","type":"string"},"entityid":{"description":"Id of the entity to attach the file to.","type":"string"},"fileid":{"description":"Id of the uploaded file to attach (see /file/upload).","type":"string"},"updates":{"description":"Internal: optimistic-update hints applied alongside the change.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]}},"required":["token","entity","entityid","fileid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"entity":{"description":"Entity kind to attach the file to, e.g. \"expense\", \"income\", \"asset\", \"transaction\", \"entry\", \"client\", \"supplier\", \"product\". For any document — invoice, quote, credit/debit note, purchase order, bill or goods-received note — use \"contract\" (its id may start with cont-, inv- or order-); the correct storage attribute is resolved from the id, so a bill (cont-… id) also resolves whether you pass \"contract\", \"bill\" or \"invoice\".","type":"string"},"entityid":{"description":"Id of the entity to attach the file to.","type":"string"},"fileid":{"description":"Id of the uploaded file to attach (see /file/upload).","type":"string"},"updates":{"description":"Internal: optimistic-update hints applied alongside the change.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]}},"required":["token","entity","entityid","fileid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"entity":{"description":"Entity kind to attach the file to, e.g. \"expense\", \"income\", \"asset\", \"transaction\", \"entry\", \"client\", \"supplier\", \"product\". For any document — invoice, quote, credit/debit note, purchase order, bill or goods-received note — use \"contract\" (its id may start with cont-, inv- or order-); the correct storage attribute is resolved from the id, so a bill (cont-… id) also resolves whether you pass \"contract\", \"bill\" or \"invoice\".","type":"string"},"entityid":{"description":"Id of the entity to attach the file to.","type":"string"},"fileid":{"description":"Id of the uploaded file to attach (see /file/upload).","type":"string"},"updates":{"description":"Internal: optimistic-update hints applied alongside the change.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]}},"required":["token","entity","entityid","fileid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"entity":{"description":"Entity kind to attach the file to, e.g. \"expense\", \"income\", \"asset\", \"transaction\", \"entry\", \"client\", \"supplier\", \"product\". For any document — invoice, quote, credit/debit note, purchase order, bill or goods-received note — use \"contract\" (its id may start with cont-, inv- or order-); the correct storage attribute is resolved from the id, so a bill (cont-… id) also resolves whether you pass \"contract\", \"bill\" or \"invoice\".","type":"string"},"entityid":{"description":"Id of the entity to attach the file to.","type":"string"},"fileid":{"description":"Id of the uploaded file to attach (see /file/upload).","type":"string"},"updates":{"description":"Internal: optimistic-update hints applied alongside the change.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]}},"required":["token","entity","entityid","fileid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Remove (detach) a file from an entity by id. This only retracts the link between the file and the record — the underlying file is not deleted from storage and the entity itself is unchanged. Unlike the delete_* tools (delete_document, delete_folder, delete_expense, …) which remove whole records or folders, this leaves both the file and the entity intact.","tags":["entity management"]}},"/api/entity/taglist/update":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"entity":{"description":"Entity kind to tag, e.g. \"expense\", \"income\", \"invoice\", \"transaction\", \"client\", \"supplier\", \"employee\", \"payslip\".","type":"string"},"entityid":{"description":"Id of the entity to tag.","type":"string"},"taglist":{"description":"Tag ids to set on the entity (replaces the existing set; empty clears all tags).","type":"array","items":{"type":"string"}},"append":{"description":"True to add the tags to the ones the entity has instead of replacing them; a tag it has already is not added twice.","type":"boolean"},"updates":{"description":"Internal: optimistic-update hints applied alongside the change.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]}},"required":["token","entity","entityid","taglist"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"entity":{"description":"Entity kind to tag, e.g. \"expense\", \"income\", \"invoice\", \"transaction\", \"client\", \"supplier\", \"employee\", \"payslip\".","type":"string"},"entityid":{"description":"Id of the entity to tag.","type":"string"},"taglist":{"description":"Tag ids to set on the entity (replaces the existing set; empty clears all tags).","type":"array","items":{"type":"string"}},"append":{"description":"True to add the tags to the ones the entity has instead of replacing them; a tag it has already is not added twice.","type":"boolean"},"updates":{"description":"Internal: optimistic-update hints applied alongside the change.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]}},"required":["token","entity","entityid","taglist"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"entity":{"description":"Entity kind to tag, e.g. \"expense\", \"income\", \"invoice\", \"transaction\", \"client\", \"supplier\", \"employee\", \"payslip\".","type":"string"},"entityid":{"description":"Id of the entity to tag.","type":"string"},"taglist":{"description":"Tag ids to set on the entity (replaces the existing set; empty clears all tags).","type":"array","items":{"type":"string"}},"append":{"description":"True to add the tags to the ones the entity has instead of replacing them; a tag it has already is not added twice.","type":"boolean"},"updates":{"description":"Internal: optimistic-update hints applied alongside the change.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]}},"required":["token","entity","entityid","taglist"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"entity":{"description":"Entity kind to tag, e.g. \"expense\", \"income\", \"invoice\", \"transaction\", \"client\", \"supplier\", \"employee\", \"payslip\".","type":"string"},"entityid":{"description":"Id of the entity to tag.","type":"string"},"taglist":{"description":"Tag ids to set on the entity (replaces the existing set; empty clears all tags).","type":"array","items":{"type":"string"}},"append":{"description":"True to add the tags to the ones the entity has instead of replacing them; a tag it has already is not added twice.","type":"boolean"},"updates":{"description":"Internal: optimistic-update hints applied alongside the change.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]}},"required":["token","entity","entityid","taglist"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Set the tags on an entity (replaces its tag list, or adds to it with append true), e.g. an expense, invoice, client, employee or payslip. A new payslip copies its employee's tags when it is created. For several entities, prefer set_entity_tags_bulk — one call instead of many.","tags":["entity management"]}},"/api/entity/taglist/update-many":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"items":{"description":"Entities to tag in one call. Each item sets the full tag list on one entity.","type":"array","items":{"type":"object","properties":{"entity":{"description":"Entity kind, e.g. \"expense\", \"income\", \"invoice\", \"client\", \"supplier\", \"employee\", \"payslip\".","type":"string"},"entityid":{"description":"Id of the entity to tag.","type":"string"},"taglist":{"description":"Tag ids to set on this entity (replaces the existing set).","type":"array","items":{"type":"string"}},"deleted":{"description":"When true, this row's tags are cleared/removed instead of set.","type":"boolean"}},"required":["entity","entityid","taglist"],"additionalProperties":false}},"updates":{"description":"Internal: optimistic-update hints applied alongside the change.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]}},"required":["token","items"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"items":{"description":"Entities to tag in one call. Each item sets the full tag list on one entity.","type":"array","items":{"type":"object","properties":{"entity":{"description":"Entity kind, e.g. \"expense\", \"income\", \"invoice\", \"client\", \"supplier\", \"employee\", \"payslip\".","type":"string"},"entityid":{"description":"Id of the entity to tag.","type":"string"},"taglist":{"description":"Tag ids to set on this entity (replaces the existing set).","type":"array","items":{"type":"string"}},"deleted":{"description":"When true, this row's tags are cleared/removed instead of set.","type":"boolean"}},"required":["entity","entityid","taglist"],"additionalProperties":false}},"updates":{"description":"Internal: optimistic-update hints applied alongside the change.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]}},"required":["token","items"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"items":{"description":"Entities to tag in one call. Each item sets the full tag list on one entity.","type":"array","items":{"type":"object","properties":{"entity":{"description":"Entity kind, e.g. \"expense\", \"income\", \"invoice\", \"client\", \"supplier\", \"employee\", \"payslip\".","type":"string"},"entityid":{"description":"Id of the entity to tag.","type":"string"},"taglist":{"description":"Tag ids to set on this entity (replaces the existing set).","type":"array","items":{"type":"string"}},"deleted":{"description":"When true, this row's tags are cleared/removed instead of set.","type":"boolean"}},"required":["entity","entityid","taglist"],"additionalProperties":false}},"updates":{"description":"Internal: optimistic-update hints applied alongside the change.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]}},"required":["token","items"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"items":{"description":"Entities to tag in one call. Each item sets the full tag list on one entity.","type":"array","items":{"type":"object","properties":{"entity":{"description":"Entity kind, e.g. \"expense\", \"income\", \"invoice\", \"client\", \"supplier\", \"employee\", \"payslip\".","type":"string"},"entityid":{"description":"Id of the entity to tag.","type":"string"},"taglist":{"description":"Tag ids to set on this entity (replaces the existing set).","type":"array","items":{"type":"string"}},"deleted":{"description":"When true, this row's tags are cleared/removed instead of set.","type":"boolean"}},"required":["entity","entityid","taglist"],"additionalProperties":false}},"updates":{"description":"Internal: optimistic-update hints applied alongside the change.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]}},"required":["token","items"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Set tags on many entities at once (replaces each entity's tag list), e.g. every payslip in a pay run. For a single entity use set_entity_tags.","tags":["entity management"]}},"/api/entity/taglist/remove":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"entity":{"description":"Entity kind whose tags to clear, e.g. \"expense\", \"income\", \"invoice\".","type":"string"},"entityid":{"description":"Id of the entity to clear tags from.","type":"string"},"updates":{"description":"Internal: optimistic-update hints applied alongside the change.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]}},"required":["token","entity","entityid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"entity":{"description":"Entity kind whose tags to clear, e.g. \"expense\", \"income\", \"invoice\".","type":"string"},"entityid":{"description":"Id of the entity to clear tags from.","type":"string"},"updates":{"description":"Internal: optimistic-update hints applied alongside the change.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]}},"required":["token","entity","entityid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"entity":{"description":"Entity kind whose tags to clear, e.g. \"expense\", \"income\", \"invoice\".","type":"string"},"entityid":{"description":"Id of the entity to clear tags from.","type":"string"},"updates":{"description":"Internal: optimistic-update hints applied alongside the change.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]}},"required":["token","entity","entityid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"entity":{"description":"Entity kind whose tags to clear, e.g. \"expense\", \"income\", \"invoice\".","type":"string"},"entityid":{"description":"Id of the entity to clear tags from.","type":"string"},"updates":{"description":"Internal: optimistic-update hints applied alongside the change.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]}},"required":["token","entity","entityid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Clear all tags from an entity.","tags":["entity management"]}},"/api/entity/salestax/add":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"entity":{"description":"Entity kind to add the sales tax to, e.g. \"expense\", \"invoice\".","type":"string"},"entityid":{"description":"Id of the entity to add the sales tax to.","type":"string"},"name":{"description":"Display name of the sales tax (e.g. \"VAT\").","type":"string"},"referencenumber":{"description":"Sales tax registration/reference number.","oneOf":[{"type":"string"},{"type":"null"}]},"parentid":{"description":"Id of an existing salestax definition to link, instead of defining one inline.","oneOf":[{"type":"string"},{"type":"null"}]},"recoverable":{"description":"Whether this sales tax is recoverable (claimable as input tax).","oneOf":[{"type":"boolean"},{"type":"null"}]},"exclusive":{"description":"Whether the entity amount excludes this sales tax (tax added on top).","oneOf":[{"type":"boolean"},{"type":"null"}]},"rate":{"description":"Sales tax rate as a DECIMAL FRACTION, e.g. 0.15 = 15% (NOT 15). A rate of 1.0 (100%) or higher is rejected.","oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"description":"Explicit sales tax amount; used instead of the rate when useamount is true.","oneOf":[{"type":"number"},{"type":"null"}]},"useamount":{"description":"When true, use amount as the tax figure instead of computing from the rate.","oneOf":[{"type":"boolean"},{"type":"null"}]},"taxsource":{"description":"Stable locale rate-band identity, e.g. \"locale:za/standard\".","oneOf":[{"type":"string"},{"type":"null"}]},"treatment":{"description":"\"standard\" | \"zeroRated\" | \"exempt\"; blank/unknown means infer.","oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"description":"\"salestax\" | \"levy\" | \"withholding\"; blank means salestax.","oneOf":[{"type":"string"},{"type":"null"}]},"order":{"description":"Stack position (default 0); components apply ascending.","oneOf":[{"type":"number"},{"type":"null"}]},"compound":{"description":"When true, this tax stacks on lower-order taxes' totals (default false).","oneOf":[{"type":"boolean"},{"type":"null"}]},"updates":{"description":"Internal: optimistic-update hints applied alongside the change.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]}},"required":["token","entity","entityid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"entity":{"description":"Entity kind to add the sales tax to, e.g. \"expense\", \"invoice\".","type":"string"},"entityid":{"description":"Id of the entity to add the sales tax to.","type":"string"},"name":{"description":"Display name of the sales tax (e.g. \"VAT\").","type":"string"},"referencenumber":{"description":"Sales tax registration/reference number.","oneOf":[{"type":"string"},{"type":"null"}]},"parentid":{"description":"Id of an existing salestax definition to link, instead of defining one inline.","oneOf":[{"type":"string"},{"type":"null"}]},"recoverable":{"description":"Whether this sales tax is recoverable (claimable as input tax).","oneOf":[{"type":"boolean"},{"type":"null"}]},"exclusive":{"description":"Whether the entity amount excludes this sales tax (tax added on top).","oneOf":[{"type":"boolean"},{"type":"null"}]},"rate":{"description":"Sales tax rate as a DECIMAL FRACTION, e.g. 0.15 = 15% (NOT 15). A rate of 1.0 (100%) or higher is rejected.","oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"description":"Explicit sales tax amount; used instead of the rate when useamount is true.","oneOf":[{"type":"number"},{"type":"null"}]},"useamount":{"description":"When true, use amount as the tax figure instead of computing from the rate.","oneOf":[{"type":"boolean"},{"type":"null"}]},"taxsource":{"description":"Stable locale rate-band identity, e.g. \"locale:za/standard\".","oneOf":[{"type":"string"},{"type":"null"}]},"treatment":{"description":"\"standard\" | \"zeroRated\" | \"exempt\"; blank/unknown means infer.","oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"description":"\"salestax\" | \"levy\" | \"withholding\"; blank means salestax.","oneOf":[{"type":"string"},{"type":"null"}]},"order":{"description":"Stack position (default 0); components apply ascending.","oneOf":[{"type":"number"},{"type":"null"}]},"compound":{"description":"When true, this tax stacks on lower-order taxes' totals (default false).","oneOf":[{"type":"boolean"},{"type":"null"}]},"updates":{"description":"Internal: optimistic-update hints applied alongside the change.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]}},"required":["token","entity","entityid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"entity":{"description":"Entity kind to add the sales tax to, e.g. \"expense\", \"invoice\".","type":"string"},"entityid":{"description":"Id of the entity to add the sales tax to.","type":"string"},"name":{"description":"Display name of the sales tax (e.g. \"VAT\").","type":"string"},"referencenumber":{"description":"Sales tax registration/reference number.","oneOf":[{"type":"string"},{"type":"null"}]},"parentid":{"description":"Id of an existing salestax definition to link, instead of defining one inline.","oneOf":[{"type":"string"},{"type":"null"}]},"recoverable":{"description":"Whether this sales tax is recoverable (claimable as input tax).","oneOf":[{"type":"boolean"},{"type":"null"}]},"exclusive":{"description":"Whether the entity amount excludes this sales tax (tax added on top).","oneOf":[{"type":"boolean"},{"type":"null"}]},"rate":{"description":"Sales tax rate as a DECIMAL FRACTION, e.g. 0.15 = 15% (NOT 15). A rate of 1.0 (100%) or higher is rejected.","oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"description":"Explicit sales tax amount; used instead of the rate when useamount is true.","oneOf":[{"type":"number"},{"type":"null"}]},"useamount":{"description":"When true, use amount as the tax figure instead of computing from the rate.","oneOf":[{"type":"boolean"},{"type":"null"}]},"taxsource":{"description":"Stable locale rate-band identity, e.g. \"locale:za/standard\".","oneOf":[{"type":"string"},{"type":"null"}]},"treatment":{"description":"\"standard\" | \"zeroRated\" | \"exempt\"; blank/unknown means infer.","oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"description":"\"salestax\" | \"levy\" | \"withholding\"; blank means salestax.","oneOf":[{"type":"string"},{"type":"null"}]},"order":{"description":"Stack position (default 0); components apply ascending.","oneOf":[{"type":"number"},{"type":"null"}]},"compound":{"description":"When true, this tax stacks on lower-order taxes' totals (default false).","oneOf":[{"type":"boolean"},{"type":"null"}]},"updates":{"description":"Internal: optimistic-update hints applied alongside the change.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]}},"required":["token","entity","entityid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"entity":{"description":"Entity kind to add the sales tax to, e.g. \"expense\", \"invoice\".","type":"string"},"entityid":{"description":"Id of the entity to add the sales tax to.","type":"string"},"name":{"description":"Display name of the sales tax (e.g. \"VAT\").","type":"string"},"referencenumber":{"description":"Sales tax registration/reference number.","oneOf":[{"type":"string"},{"type":"null"}]},"parentid":{"description":"Id of an existing salestax definition to link, instead of defining one inline.","oneOf":[{"type":"string"},{"type":"null"}]},"recoverable":{"description":"Whether this sales tax is recoverable (claimable as input tax).","oneOf":[{"type":"boolean"},{"type":"null"}]},"exclusive":{"description":"Whether the entity amount excludes this sales tax (tax added on top).","oneOf":[{"type":"boolean"},{"type":"null"}]},"rate":{"description":"Sales tax rate as a DECIMAL FRACTION, e.g. 0.15 = 15% (NOT 15). A rate of 1.0 (100%) or higher is rejected.","oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"description":"Explicit sales tax amount; used instead of the rate when useamount is true.","oneOf":[{"type":"number"},{"type":"null"}]},"useamount":{"description":"When true, use amount as the tax figure instead of computing from the rate.","oneOf":[{"type":"boolean"},{"type":"null"}]},"taxsource":{"description":"Stable locale rate-band identity, e.g. \"locale:za/standard\".","oneOf":[{"type":"string"},{"type":"null"}]},"treatment":{"description":"\"standard\" | \"zeroRated\" | \"exempt\"; blank/unknown means infer.","oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"description":"\"salestax\" | \"levy\" | \"withholding\"; blank means salestax.","oneOf":[{"type":"string"},{"type":"null"}]},"order":{"description":"Stack position (default 0); components apply ascending.","oneOf":[{"type":"number"},{"type":"null"}]},"compound":{"description":"When true, this tax stacks on lower-order taxes' totals (default false).","oneOf":[{"type":"boolean"},{"type":"null"}]},"updates":{"description":"Internal: optimistic-update hints applied alongside the change.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]}},"required":["token","entity","entityid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Add a sales tax to an entity. To add several taxes at once, prefer add_entity_salestaxes.","tags":["entity management"]}},"/api/entity/salestax/update":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the sales tax to update.","type":"string"},"name":{"description":"Display name of the sales tax (e.g. \"VAT\").","type":"string"},"referencenumber":{"description":"Sales tax registration/reference number.","oneOf":[{"type":"string"},{"type":"null"}]},"parentid":{"description":"Id of one of this business's salestax definitions to move the tax to; the record then reports under that tax.","oneOf":[{"type":"string"},{"type":"null"}]},"recoverable":{"description":"Whether this sales tax is recoverable (claimable as input tax).","oneOf":[{"type":"boolean"},{"type":"null"}]},"rate":{"description":"Sales tax rate as a DECIMAL FRACTION, e.g. 0.15 = 15% (NOT 15). A rate of 1.0 (100%) or higher is rejected.","oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"description":"Explicit sales tax amount; used instead of the rate when useamount is true.","oneOf":[{"type":"number"},{"type":"null"}]},"useamount":{"description":"When true, use amount as the tax figure instead of computing from the rate.","oneOf":[{"type":"boolean"},{"type":"null"}]},"exclusive":{"description":"Whether the entity amount excludes this sales tax (tax added on top).","oneOf":[{"type":"boolean"},{"type":"null"}]},"taxsource":{"description":"Stable locale rate-band identity, e.g. \"locale:za/standard\"; \"$delete\" clears it.","oneOf":[{"type":"string"},{"type":"null"}]},"treatment":{"description":"\"standard\" | \"zeroRated\" | \"exempt\"; blank/unknown means infer, \"$delete\" clears it.","oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"description":"\"salestax\" | \"levy\" | \"withholding\"; \"$delete\" clears it.","oneOf":[{"type":"string"},{"type":"null"}]},"order":{"description":"Stack position (default 0); components apply ascending.","oneOf":[{"type":"number"},{"type":"null"}]},"compound":{"description":"When true, this tax stacks on lower-order taxes' totals (default false).","oneOf":[{"type":"boolean"},{"type":"null"}]},"updates":{"description":"Internal: optimistic-update hints applied alongside the change.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the sales tax to update.","type":"string"},"name":{"description":"Display name of the sales tax (e.g. \"VAT\").","type":"string"},"referencenumber":{"description":"Sales tax registration/reference number.","oneOf":[{"type":"string"},{"type":"null"}]},"parentid":{"description":"Id of one of this business's salestax definitions to move the tax to; the record then reports under that tax.","oneOf":[{"type":"string"},{"type":"null"}]},"recoverable":{"description":"Whether this sales tax is recoverable (claimable as input tax).","oneOf":[{"type":"boolean"},{"type":"null"}]},"rate":{"description":"Sales tax rate as a DECIMAL FRACTION, e.g. 0.15 = 15% (NOT 15). A rate of 1.0 (100%) or higher is rejected.","oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"description":"Explicit sales tax amount; used instead of the rate when useamount is true.","oneOf":[{"type":"number"},{"type":"null"}]},"useamount":{"description":"When true, use amount as the tax figure instead of computing from the rate.","oneOf":[{"type":"boolean"},{"type":"null"}]},"exclusive":{"description":"Whether the entity amount excludes this sales tax (tax added on top).","oneOf":[{"type":"boolean"},{"type":"null"}]},"taxsource":{"description":"Stable locale rate-band identity, e.g. \"locale:za/standard\"; \"$delete\" clears it.","oneOf":[{"type":"string"},{"type":"null"}]},"treatment":{"description":"\"standard\" | \"zeroRated\" | \"exempt\"; blank/unknown means infer, \"$delete\" clears it.","oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"description":"\"salestax\" | \"levy\" | \"withholding\"; \"$delete\" clears it.","oneOf":[{"type":"string"},{"type":"null"}]},"order":{"description":"Stack position (default 0); components apply ascending.","oneOf":[{"type":"number"},{"type":"null"}]},"compound":{"description":"When true, this tax stacks on lower-order taxes' totals (default false).","oneOf":[{"type":"boolean"},{"type":"null"}]},"updates":{"description":"Internal: optimistic-update hints applied alongside the change.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the sales tax to update.","type":"string"},"name":{"description":"Display name of the sales tax (e.g. \"VAT\").","type":"string"},"referencenumber":{"description":"Sales tax registration/reference number.","oneOf":[{"type":"string"},{"type":"null"}]},"parentid":{"description":"Id of one of this business's salestax definitions to move the tax to; the record then reports under that tax.","oneOf":[{"type":"string"},{"type":"null"}]},"recoverable":{"description":"Whether this sales tax is recoverable (claimable as input tax).","oneOf":[{"type":"boolean"},{"type":"null"}]},"rate":{"description":"Sales tax rate as a DECIMAL FRACTION, e.g. 0.15 = 15% (NOT 15). A rate of 1.0 (100%) or higher is rejected.","oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"description":"Explicit sales tax amount; used instead of the rate when useamount is true.","oneOf":[{"type":"number"},{"type":"null"}]},"useamount":{"description":"When true, use amount as the tax figure instead of computing from the rate.","oneOf":[{"type":"boolean"},{"type":"null"}]},"exclusive":{"description":"Whether the entity amount excludes this sales tax (tax added on top).","oneOf":[{"type":"boolean"},{"type":"null"}]},"taxsource":{"description":"Stable locale rate-band identity, e.g. \"locale:za/standard\"; \"$delete\" clears it.","oneOf":[{"type":"string"},{"type":"null"}]},"treatment":{"description":"\"standard\" | \"zeroRated\" | \"exempt\"; blank/unknown means infer, \"$delete\" clears it.","oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"description":"\"salestax\" | \"levy\" | \"withholding\"; \"$delete\" clears it.","oneOf":[{"type":"string"},{"type":"null"}]},"order":{"description":"Stack position (default 0); components apply ascending.","oneOf":[{"type":"number"},{"type":"null"}]},"compound":{"description":"When true, this tax stacks on lower-order taxes' totals (default false).","oneOf":[{"type":"boolean"},{"type":"null"}]},"updates":{"description":"Internal: optimistic-update hints applied alongside the change.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the sales tax to update.","type":"string"},"name":{"description":"Display name of the sales tax (e.g. \"VAT\").","type":"string"},"referencenumber":{"description":"Sales tax registration/reference number.","oneOf":[{"type":"string"},{"type":"null"}]},"parentid":{"description":"Id of one of this business's salestax definitions to move the tax to; the record then reports under that tax.","oneOf":[{"type":"string"},{"type":"null"}]},"recoverable":{"description":"Whether this sales tax is recoverable (claimable as input tax).","oneOf":[{"type":"boolean"},{"type":"null"}]},"rate":{"description":"Sales tax rate as a DECIMAL FRACTION, e.g. 0.15 = 15% (NOT 15). A rate of 1.0 (100%) or higher is rejected.","oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"description":"Explicit sales tax amount; used instead of the rate when useamount is true.","oneOf":[{"type":"number"},{"type":"null"}]},"useamount":{"description":"When true, use amount as the tax figure instead of computing from the rate.","oneOf":[{"type":"boolean"},{"type":"null"}]},"exclusive":{"description":"Whether the entity amount excludes this sales tax (tax added on top).","oneOf":[{"type":"boolean"},{"type":"null"}]},"taxsource":{"description":"Stable locale rate-band identity, e.g. \"locale:za/standard\"; \"$delete\" clears it.","oneOf":[{"type":"string"},{"type":"null"}]},"treatment":{"description":"\"standard\" | \"zeroRated\" | \"exempt\"; blank/unknown means infer, \"$delete\" clears it.","oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"description":"\"salestax\" | \"levy\" | \"withholding\"; \"$delete\" clears it.","oneOf":[{"type":"string"},{"type":"null"}]},"order":{"description":"Stack position (default 0); components apply ascending.","oneOf":[{"type":"number"},{"type":"null"}]},"compound":{"description":"When true, this tax stacks on lower-order taxes' totals (default false).","oneOf":[{"type":"boolean"},{"type":"null"}]},"updates":{"description":"Internal: optimistic-update hints applied alongside the change.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Update an existing sales tax already on an entity. To add a new sales tax use add_entity_salestax (one entity), add_entity_salestaxes (several taxes on one entity), or add_salestax_to_entities (one tax across many entities).","tags":["entity management"]}},"/api/entity/salestax/add-many":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"entity":{"description":"Entity kind to add sales taxes to, e.g. \"expense\", \"invoice\".","type":"string"},"entityid":{"description":"Id of the entity to add sales taxes to.","type":"string"},"taxids":{"description":"Ids of existing salestax definitions to attach to the entity.","type":"array","items":{"type":"string"}},"updates":{"description":"Internal: optimistic-update hints applied alongside the change.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]}},"required":["token","entity","entityid","taxids"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"entity":{"description":"Entity kind to add sales taxes to, e.g. \"expense\", \"invoice\".","type":"string"},"entityid":{"description":"Id of the entity to add sales taxes to.","type":"string"},"taxids":{"description":"Ids of existing salestax definitions to attach to the entity.","type":"array","items":{"type":"string"}},"updates":{"description":"Internal: optimistic-update hints applied alongside the change.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]}},"required":["token","entity","entityid","taxids"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"entity":{"description":"Entity kind to add sales taxes to, e.g. \"expense\", \"invoice\".","type":"string"},"entityid":{"description":"Id of the entity to add sales taxes to.","type":"string"},"taxids":{"description":"Ids of existing salestax definitions to attach to the entity.","type":"array","items":{"type":"string"}},"updates":{"description":"Internal: optimistic-update hints applied alongside the change.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]}},"required":["token","entity","entityid","taxids"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"entity":{"description":"Entity kind to add sales taxes to, e.g. \"expense\", \"invoice\".","type":"string"},"entityid":{"description":"Id of the entity to add sales taxes to.","type":"string"},"taxids":{"description":"Ids of existing salestax definitions to attach to the entity.","type":"array","items":{"type":"string"}},"updates":{"description":"Internal: optimistic-update hints applied alongside the change.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]}},"required":["token","entity","entityid","taxids"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Add several sales taxes to one entity by their ids, in a single transaction. Each id is copied onto the entity as a fresh tax instance; the tool does not deduplicate, so passing a tax already present (or the same id twice) adds another copy. If the target entity no longer exists it returns an {:error true} map rather than throwing. To add a single tax to one entity use add_entity_salestax; to apply one existing tax across many entities use add_salestax_to_entities.","tags":["entity management"]}},"/api/entity/salestax/add-entities":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"entity":{"description":"Entity kind to add the sales tax to: \"income\" or \"expense\".","type":"string"},"entityids":{"description":"Ids of the income/expense records to add the sales tax to.","type":"array","items":{"type":"string"}},"parentid":{"description":"Id of the existing salestax definition to apply to every listed entity.","type":"string"},"updates":{"description":"Internal: optimistic-update hints applied alongside the change.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]}},"required":["token","entity","entityids","parentid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"entity":{"description":"Entity kind to add the sales tax to: \"income\" or \"expense\".","type":"string"},"entityids":{"description":"Ids of the income/expense records to add the sales tax to.","type":"array","items":{"type":"string"}},"parentid":{"description":"Id of the existing salestax definition to apply to every listed entity.","type":"string"},"updates":{"description":"Internal: optimistic-update hints applied alongside the change.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]}},"required":["token","entity","entityids","parentid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"entity":{"description":"Entity kind to add the sales tax to: \"income\" or \"expense\".","type":"string"},"entityids":{"description":"Ids of the income/expense records to add the sales tax to.","type":"array","items":{"type":"string"}},"parentid":{"description":"Id of the existing salestax definition to apply to every listed entity.","type":"string"},"updates":{"description":"Internal: optimistic-update hints applied alongside the change.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]}},"required":["token","entity","entityids","parentid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"entity":{"description":"Entity kind to add the sales tax to: \"income\" or \"expense\".","type":"string"},"entityids":{"description":"Ids of the income/expense records to add the sales tax to.","type":"array","items":{"type":"string"}},"parentid":{"description":"Id of the existing salestax definition to apply to every listed entity.","type":"string"},"updates":{"description":"Internal: optimistic-update hints applied alongside the change.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]}},"required":["token","entity","entityids","parentid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Apply one existing sales tax to several income or expense records at once, in a single transaction. Invoices/bills use line-item tax and are not supported here.","tags":["entity management"]}},"/api/entity/salestax/delete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Delete entity sales tax","tags":["entity management"]}},"/api/entity/flagged/update":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"entity":{"description":"Entity kind to flag/unflag, e.g. \"expense\", \"income\", \"transaction\".","type":"string"},"entityid":{"description":"Id of the entity to flag/unflag.","type":"string"},"flagged":{"description":"True to flag (e.g. mark for review), false to unflag.","type":"boolean"},"updates":{"description":"Internal: optimistic-update hints applied alongside the change.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]}},"required":["token","entity","entityid","flagged"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"entity":{"description":"Entity kind to flag/unflag, e.g. \"expense\", \"income\", \"transaction\".","type":"string"},"entityid":{"description":"Id of the entity to flag/unflag.","type":"string"},"flagged":{"description":"True to flag (e.g. mark for review), false to unflag.","type":"boolean"},"updates":{"description":"Internal: optimistic-update hints applied alongside the change.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]}},"required":["token","entity","entityid","flagged"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"entity":{"description":"Entity kind to flag/unflag, e.g. \"expense\", \"income\", \"transaction\".","type":"string"},"entityid":{"description":"Id of the entity to flag/unflag.","type":"string"},"flagged":{"description":"True to flag (e.g. mark for review), false to unflag.","type":"boolean"},"updates":{"description":"Internal: optimistic-update hints applied alongside the change.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]}},"required":["token","entity","entityid","flagged"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"entity":{"description":"Entity kind to flag/unflag, e.g. \"expense\", \"income\", \"transaction\".","type":"string"},"entityid":{"description":"Id of the entity to flag/unflag.","type":"string"},"flagged":{"description":"True to flag (e.g. mark for review), false to unflag.","type":"boolean"},"updates":{"description":"Internal: optimistic-update hints applied alongside the change.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]}},"required":["token","entity","entityid","flagged"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Flag or unflag an entity (e.g. mark for review). For several entities, prefer set_entity_flags_bulk — one call instead of many.","tags":["entity management"]}},"/api/entity/datagroup/update":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"entity":{"type":"string"},"entityid":{"type":"string"},"datagroup":{"oneOf":[{"type":"string"},{"type":"null"}]},"leader":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"updates":{"oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]}},"required":["token","entity","entityid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"entity":{"type":"string"},"entityid":{"type":"string"},"datagroup":{"oneOf":[{"type":"string"},{"type":"null"}]},"leader":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"updates":{"oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]}},"required":["token","entity","entityid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"entity":{"type":"string"},"entityid":{"type":"string"},"datagroup":{"oneOf":[{"type":"string"},{"type":"null"}]},"leader":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"updates":{"oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]}},"required":["token","entity","entityid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"entity":{"type":"string"},"entityid":{"type":"string"},"datagroup":{"oneOf":[{"type":"string"},{"type":"null"}]},"leader":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"updates":{"oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]}},"required":["token","entity","entityid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Set a record's dedup group membership. Send datagroup \"$unique\" to pull it out of any suggested duplicate group and keep it standalone (the backend mints the group hash and marks it leader). Send an existing group's datagroup hash to move it into that group; returns error true if that group does not exist.","tags":["entity management"]}},"/api/entity/flagged/update-many":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"flagged":{"description":"Default flag value applied to items that don't set their own.","type":"boolean"},"items":{"description":"Entities to flag/unflag in one call.","type":"array","items":{"type":"object","properties":{"entity":{"description":"Entity kind, e.g. \"expense\", \"income\", \"invoice\", \"transaction\".","type":"string"},"entityid":{"description":"Id of the entity to flag/unflag.","type":"string"},"flagged":{"description":"True to flag, false to unflag; falls back to the top-level flagged.","type":"boolean"}},"required":["entity","entityid"],"additionalProperties":false}},"updates":{"description":"Internal: optimistic-update hints applied alongside the change.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]}},"required":["token","items"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"flagged":{"description":"Default flag value applied to items that don't set their own.","type":"boolean"},"items":{"description":"Entities to flag/unflag in one call.","type":"array","items":{"type":"object","properties":{"entity":{"description":"Entity kind, e.g. \"expense\", \"income\", \"invoice\", \"transaction\".","type":"string"},"entityid":{"description":"Id of the entity to flag/unflag.","type":"string"},"flagged":{"description":"True to flag, false to unflag; falls back to the top-level flagged.","type":"boolean"}},"required":["entity","entityid"],"additionalProperties":false}},"updates":{"description":"Internal: optimistic-update hints applied alongside the change.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]}},"required":["token","items"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"flagged":{"description":"Default flag value applied to items that don't set their own.","type":"boolean"},"items":{"description":"Entities to flag/unflag in one call.","type":"array","items":{"type":"object","properties":{"entity":{"description":"Entity kind, e.g. \"expense\", \"income\", \"invoice\", \"transaction\".","type":"string"},"entityid":{"description":"Id of the entity to flag/unflag.","type":"string"},"flagged":{"description":"True to flag, false to unflag; falls back to the top-level flagged.","type":"boolean"}},"required":["entity","entityid"],"additionalProperties":false}},"updates":{"description":"Internal: optimistic-update hints applied alongside the change.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]}},"required":["token","items"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"flagged":{"description":"Default flag value applied to items that don't set their own.","type":"boolean"},"items":{"description":"Entities to flag/unflag in one call.","type":"array","items":{"type":"object","properties":{"entity":{"description":"Entity kind, e.g. \"expense\", \"income\", \"invoice\", \"transaction\".","type":"string"},"entityid":{"description":"Id of the entity to flag/unflag.","type":"string"},"flagged":{"description":"True to flag, false to unflag; falls back to the top-level flagged.","type":"boolean"}},"required":["entity","entityid"],"additionalProperties":false}},"updates":{"description":"Internal: optimistic-update hints applied alongside the change.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]}},"required":["token","items"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Flag or unflag many entities at once.","tags":["entity management"]}},"/api/entity/create-many":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"income":{"oneOf":[{"type":"array","items":{"type":"object","properties":{"name":{"description":"Display name / description of the income.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Unit amount before quantity/tax, in the record's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"date":{"description":"Income date (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"client":{"description":"Client id, or an exact client name to resolve (see list_clients).","oneOf":[{"type":"string"},{"type":"null"}]},"product":{"description":"Product id this income is for (see list_products).","oneOf":[{"type":"string"},{"type":"null"}]},"invoiceid":{"description":"Invoice id this income pays toward.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Manual FX rate to the business base currency; omit to use the stored/auto rate.","oneOf":[{"type":"number"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"alert":{"description":"Alert/reminder note to surface on this income.","oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"Chart-of-accounts income category account id, or an exact account name to resolve (see list_accounts). Set to a supplier id (sup-…) to record a refund paid by that supplier: it posts once to Payables, tagged to the supplier, with no VAT, and draws down the credit they owe.","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"description":"Base/control account id override; rarely needed — defaults from the category.","oneOf":[{"type":"string"},{"type":"null"}]},"split":{"description":"Whether this income is one line of a split transaction.","oneOf":[{"type":"boolean"},{"type":"null"}]},"groupid":{"description":"Group id linking split lines of one real-world transaction together.","oneOf":[{"type":"string"},{"type":"null"}]},"transactionid":{"description":"Bank transaction id to reconcile this income against.","oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]},"expenses":{"oneOf":[{"type":"array","items":{"type":"object","properties":{"name":{"description":"Display name / description of the expense.","oneOf":[{"type":"string"},{"type":"null"}]},"supplier":{"description":"Supplier id, or an exact supplier name to resolve (see list_suppliers).","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Unit amount before quantity/tax, in the record's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"description":"Number of units.","oneOf":[{"type":"number"},{"type":"null"}]},"total":{"description":"Total including quantity. Used only when amount is omitted: amount becomes total ÷ quantity, and must come to whole cents. If amount is also sent, amount wins.","oneOf":[{"type":"number"},{"type":"null"}]},"date":{"description":"Expense date (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"paid":{"description":"Whether this expense has been paid.","oneOf":[{"type":"boolean"},{"type":"null"}]},"paiddate":{"description":"Date payment was made (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"showquantity":{"description":"Whether to display the quantity column on the document.","oneOf":[{"type":"boolean"},{"type":"null"}]},"method":{"description":"Payment method as free text (e.g. \"cash\", \"card\", \"eft\") — no fixed set.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Manual FX rate to the business base currency; omit to use the stored/auto rate.","oneOf":[{"type":"number"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"alert":{"description":"Alert/reminder note to surface on this expense.","oneOf":[{"type":"string"},{"type":"null"}]},"bankaccountid":{"description":"Bank account id the money moved through (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"Chart-of-accounts category account id, or an exact account name to resolve (see list_accounts). Set to a bill / purchase order / GRN document id (cont-…) to record this expense as a payment against that document. Set to a customer id (cli-…) to record a refund paid to that customer: it posts once to Receivables, tagged to the customer, with no VAT, and draws down their credit balance.","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"description":"Base/control account id override; rarely needed — defaults from the category.","oneOf":[{"type":"string"},{"type":"null"}]},"split":{"description":"Whether this expense is one line of a split transaction.","oneOf":[{"type":"boolean"},{"type":"null"}]},"groupid":{"description":"Group id linking split lines of one real-world transaction together.","oneOf":[{"type":"string"},{"type":"null"}]},"transactionid":{"description":"Bank transaction id to reconcile this expense against.","oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]},"transactionid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"income":{"oneOf":[{"type":"array","items":{"type":"object","properties":{"name":{"description":"Display name / description of the income.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Unit amount before quantity/tax, in the record's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"date":{"description":"Income date (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"client":{"description":"Client id, or an exact client name to resolve (see list_clients).","oneOf":[{"type":"string"},{"type":"null"}]},"product":{"description":"Product id this income is for (see list_products).","oneOf":[{"type":"string"},{"type":"null"}]},"invoiceid":{"description":"Invoice id this income pays toward.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Manual FX rate to the business base currency; omit to use the stored/auto rate.","oneOf":[{"type":"number"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"alert":{"description":"Alert/reminder note to surface on this income.","oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"Chart-of-accounts income category account id, or an exact account name to resolve (see list_accounts). Set to a supplier id (sup-…) to record a refund paid by that supplier: it posts once to Payables, tagged to the supplier, with no VAT, and draws down the credit they owe.","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"description":"Base/control account id override; rarely needed — defaults from the category.","oneOf":[{"type":"string"},{"type":"null"}]},"split":{"description":"Whether this income is one line of a split transaction.","oneOf":[{"type":"boolean"},{"type":"null"}]},"groupid":{"description":"Group id linking split lines of one real-world transaction together.","oneOf":[{"type":"string"},{"type":"null"}]},"transactionid":{"description":"Bank transaction id to reconcile this income against.","oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]},"expenses":{"oneOf":[{"type":"array","items":{"type":"object","properties":{"name":{"description":"Display name / description of the expense.","oneOf":[{"type":"string"},{"type":"null"}]},"supplier":{"description":"Supplier id, or an exact supplier name to resolve (see list_suppliers).","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Unit amount before quantity/tax, in the record's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"description":"Number of units.","oneOf":[{"type":"number"},{"type":"null"}]},"total":{"description":"Total including quantity. Used only when amount is omitted: amount becomes total ÷ quantity, and must come to whole cents. If amount is also sent, amount wins.","oneOf":[{"type":"number"},{"type":"null"}]},"date":{"description":"Expense date (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"paid":{"description":"Whether this expense has been paid.","oneOf":[{"type":"boolean"},{"type":"null"}]},"paiddate":{"description":"Date payment was made (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"showquantity":{"description":"Whether to display the quantity column on the document.","oneOf":[{"type":"boolean"},{"type":"null"}]},"method":{"description":"Payment method as free text (e.g. \"cash\", \"card\", \"eft\") — no fixed set.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Manual FX rate to the business base currency; omit to use the stored/auto rate.","oneOf":[{"type":"number"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"alert":{"description":"Alert/reminder note to surface on this expense.","oneOf":[{"type":"string"},{"type":"null"}]},"bankaccountid":{"description":"Bank account id the money moved through (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"Chart-of-accounts category account id, or an exact account name to resolve (see list_accounts). Set to a bill / purchase order / GRN document id (cont-…) to record this expense as a payment against that document. Set to a customer id (cli-…) to record a refund paid to that customer: it posts once to Receivables, tagged to the customer, with no VAT, and draws down their credit balance.","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"description":"Base/control account id override; rarely needed — defaults from the category.","oneOf":[{"type":"string"},{"type":"null"}]},"split":{"description":"Whether this expense is one line of a split transaction.","oneOf":[{"type":"boolean"},{"type":"null"}]},"groupid":{"description":"Group id linking split lines of one real-world transaction together.","oneOf":[{"type":"string"},{"type":"null"}]},"transactionid":{"description":"Bank transaction id to reconcile this expense against.","oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]},"transactionid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"income":{"oneOf":[{"type":"array","items":{"type":"object","properties":{"name":{"description":"Display name / description of the income.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Unit amount before quantity/tax, in the record's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"date":{"description":"Income date (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"client":{"description":"Client id, or an exact client name to resolve (see list_clients).","oneOf":[{"type":"string"},{"type":"null"}]},"product":{"description":"Product id this income is for (see list_products).","oneOf":[{"type":"string"},{"type":"null"}]},"invoiceid":{"description":"Invoice id this income pays toward.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Manual FX rate to the business base currency; omit to use the stored/auto rate.","oneOf":[{"type":"number"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"alert":{"description":"Alert/reminder note to surface on this income.","oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"Chart-of-accounts income category account id, or an exact account name to resolve (see list_accounts). Set to a supplier id (sup-…) to record a refund paid by that supplier: it posts once to Payables, tagged to the supplier, with no VAT, and draws down the credit they owe.","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"description":"Base/control account id override; rarely needed — defaults from the category.","oneOf":[{"type":"string"},{"type":"null"}]},"split":{"description":"Whether this income is one line of a split transaction.","oneOf":[{"type":"boolean"},{"type":"null"}]},"groupid":{"description":"Group id linking split lines of one real-world transaction together.","oneOf":[{"type":"string"},{"type":"null"}]},"transactionid":{"description":"Bank transaction id to reconcile this income against.","oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]},"expenses":{"oneOf":[{"type":"array","items":{"type":"object","properties":{"name":{"description":"Display name / description of the expense.","oneOf":[{"type":"string"},{"type":"null"}]},"supplier":{"description":"Supplier id, or an exact supplier name to resolve (see list_suppliers).","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Unit amount before quantity/tax, in the record's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"description":"Number of units.","oneOf":[{"type":"number"},{"type":"null"}]},"total":{"description":"Total including quantity. Used only when amount is omitted: amount becomes total ÷ quantity, and must come to whole cents. If amount is also sent, amount wins.","oneOf":[{"type":"number"},{"type":"null"}]},"date":{"description":"Expense date (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"paid":{"description":"Whether this expense has been paid.","oneOf":[{"type":"boolean"},{"type":"null"}]},"paiddate":{"description":"Date payment was made (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"showquantity":{"description":"Whether to display the quantity column on the document.","oneOf":[{"type":"boolean"},{"type":"null"}]},"method":{"description":"Payment method as free text (e.g. \"cash\", \"card\", \"eft\") — no fixed set.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Manual FX rate to the business base currency; omit to use the stored/auto rate.","oneOf":[{"type":"number"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"alert":{"description":"Alert/reminder note to surface on this expense.","oneOf":[{"type":"string"},{"type":"null"}]},"bankaccountid":{"description":"Bank account id the money moved through (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"Chart-of-accounts category account id, or an exact account name to resolve (see list_accounts). Set to a bill / purchase order / GRN document id (cont-…) to record this expense as a payment against that document. Set to a customer id (cli-…) to record a refund paid to that customer: it posts once to Receivables, tagged to the customer, with no VAT, and draws down their credit balance.","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"description":"Base/control account id override; rarely needed — defaults from the category.","oneOf":[{"type":"string"},{"type":"null"}]},"split":{"description":"Whether this expense is one line of a split transaction.","oneOf":[{"type":"boolean"},{"type":"null"}]},"groupid":{"description":"Group id linking split lines of one real-world transaction together.","oneOf":[{"type":"string"},{"type":"null"}]},"transactionid":{"description":"Bank transaction id to reconcile this expense against.","oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]},"transactionid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"income":{"oneOf":[{"type":"array","items":{"type":"object","properties":{"name":{"description":"Display name / description of the income.","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Unit amount before quantity/tax, in the record's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"date":{"description":"Income date (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"client":{"description":"Client id, or an exact client name to resolve (see list_clients).","oneOf":[{"type":"string"},{"type":"null"}]},"product":{"description":"Product id this income is for (see list_products).","oneOf":[{"type":"string"},{"type":"null"}]},"invoiceid":{"description":"Invoice id this income pays toward.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Manual FX rate to the business base currency; omit to use the stored/auto rate.","oneOf":[{"type":"number"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"alert":{"description":"Alert/reminder note to surface on this income.","oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"Chart-of-accounts income category account id, or an exact account name to resolve (see list_accounts). Set to a supplier id (sup-…) to record a refund paid by that supplier: it posts once to Payables, tagged to the supplier, with no VAT, and draws down the credit they owe.","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"description":"Base/control account id override; rarely needed — defaults from the category.","oneOf":[{"type":"string"},{"type":"null"}]},"split":{"description":"Whether this income is one line of a split transaction.","oneOf":[{"type":"boolean"},{"type":"null"}]},"groupid":{"description":"Group id linking split lines of one real-world transaction together.","oneOf":[{"type":"string"},{"type":"null"}]},"transactionid":{"description":"Bank transaction id to reconcile this income against.","oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]},"expenses":{"oneOf":[{"type":"array","items":{"type":"object","properties":{"name":{"description":"Display name / description of the expense.","oneOf":[{"type":"string"},{"type":"null"}]},"supplier":{"description":"Supplier id, or an exact supplier name to resolve (see list_suppliers).","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Unit amount before quantity/tax, in the record's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"quantity":{"description":"Number of units.","oneOf":[{"type":"number"},{"type":"null"}]},"total":{"description":"Total including quantity. Used only when amount is omitted: amount becomes total ÷ quantity, and must come to whole cents. If amount is also sent, amount wins.","oneOf":[{"type":"number"},{"type":"null"}]},"date":{"description":"Expense date (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"paid":{"description":"Whether this expense has been paid.","oneOf":[{"type":"boolean"},{"type":"null"}]},"paiddate":{"description":"Date payment was made (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"showquantity":{"description":"Whether to display the quantity column on the document.","oneOf":[{"type":"boolean"},{"type":"null"}]},"method":{"description":"Payment method as free text (e.g. \"cash\", \"card\", \"eft\") — no fixed set.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Manual FX rate to the business base currency; omit to use the stored/auto rate.","oneOf":[{"type":"number"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"alert":{"description":"Alert/reminder note to surface on this expense.","oneOf":[{"type":"string"},{"type":"null"}]},"bankaccountid":{"description":"Bank account id the money moved through (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"Chart-of-accounts category account id, or an exact account name to resolve (see list_accounts). Set to a bill / purchase order / GRN document id (cont-…) to record this expense as a payment against that document. Set to a customer id (cli-…) to record a refund paid to that customer: it posts once to Receivables, tagged to the customer, with no VAT, and draws down their credit balance.","oneOf":[{"type":"string"},{"type":"null"}]},"baseaccountid":{"description":"Base/control account id override; rarely needed — defaults from the category.","oneOf":[{"type":"string"},{"type":"null"}]},"split":{"description":"Whether this expense is one line of a split transaction.","oneOf":[{"type":"boolean"},{"type":"null"}]},"groupid":{"description":"Group id linking split lines of one real-world transaction together.","oneOf":[{"type":"string"},{"type":"null"}]},"transactionid":{"description":"Bank transaction id to reconcile this expense against.","oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]},"transactionid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create many income and expense records in one transaction — prefer this over repeated save_income / save_expense calls. Optional top-level transactionid links every record to that bank transaction; a per-item transactionid overrides it. An expense accountid set to a purchase document's id (cont-…) records it as a payment against that bill. All-or-nothing; per-item salestax is not supported (use save_expense). Returns the new ids.","tags":["entity management"]}},"/api/entity/link":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"entity":{"description":"First entity's kind, e.g. \"income\", \"asset\", \"transaction\".","type":"string"},"entityid":{"description":"First entity's id.","type":"string"},"linkedentity":{"description":"Second entity's kind.","type":"string"},"linkedentityid":{"description":"Second entity's id.","type":"string"},"updates":{"description":"Internal: optimistic-update hints applied alongside the change.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]}},"required":["token","entity","entityid","linkedentity","linkedentityid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"entity":{"description":"First entity's kind, e.g. \"income\", \"asset\", \"transaction\".","type":"string"},"entityid":{"description":"First entity's id.","type":"string"},"linkedentity":{"description":"Second entity's kind.","type":"string"},"linkedentityid":{"description":"Second entity's id.","type":"string"},"updates":{"description":"Internal: optimistic-update hints applied alongside the change.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]}},"required":["token","entity","entityid","linkedentity","linkedentityid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"entity":{"description":"First entity's kind, e.g. \"income\", \"asset\", \"transaction\".","type":"string"},"entityid":{"description":"First entity's id.","type":"string"},"linkedentity":{"description":"Second entity's kind.","type":"string"},"linkedentityid":{"description":"Second entity's id.","type":"string"},"updates":{"description":"Internal: optimistic-update hints applied alongside the change.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]}},"required":["token","entity","entityid","linkedentity","linkedentityid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"entity":{"description":"First entity's kind, e.g. \"income\", \"asset\", \"transaction\".","type":"string"},"entityid":{"description":"First entity's id.","type":"string"},"linkedentity":{"description":"Second entity's kind.","type":"string"},"linkedentityid":{"description":"Second entity's id.","type":"string"},"updates":{"description":"Internal: optimistic-update hints applied alongside the change.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]}},"required":["token","entity","entityid","linkedentity","linkedentityid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Link two entities of any supported pair (e.g. income+transaction, income+asset, expense+asset, asset+transaction). Fails cleanly if either record doesn't exist.","tags":["entity management"]}},"/api/entity/unlink":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"entity":{"description":"First entity's kind, e.g. \"income\", \"asset\", \"transaction\".","type":"string"},"entityid":{"description":"First entity's id.","type":"string"},"linkedentity":{"description":"Second entity's kind.","type":"string"},"linkedentityid":{"description":"Second entity's id.","type":"string"},"updates":{"description":"Internal: optimistic-update hints applied alongside the change.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]}},"required":["token","entity","entityid","linkedentity","linkedentityid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"entity":{"description":"First entity's kind, e.g. \"income\", \"asset\", \"transaction\".","type":"string"},"entityid":{"description":"First entity's id.","type":"string"},"linkedentity":{"description":"Second entity's kind.","type":"string"},"linkedentityid":{"description":"Second entity's id.","type":"string"},"updates":{"description":"Internal: optimistic-update hints applied alongside the change.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]}},"required":["token","entity","entityid","linkedentity","linkedentityid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"entity":{"description":"First entity's kind, e.g. \"income\", \"asset\", \"transaction\".","type":"string"},"entityid":{"description":"First entity's id.","type":"string"},"linkedentity":{"description":"Second entity's kind.","type":"string"},"linkedentityid":{"description":"Second entity's id.","type":"string"},"updates":{"description":"Internal: optimistic-update hints applied alongside the change.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]}},"required":["token","entity","entityid","linkedentity","linkedentityid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"entity":{"description":"First entity's kind, e.g. \"income\", \"asset\", \"transaction\".","type":"string"},"entityid":{"description":"First entity's id.","type":"string"},"linkedentity":{"description":"Second entity's kind.","type":"string"},"linkedentityid":{"description":"Second entity's id.","type":"string"},"updates":{"description":"Internal: optimistic-update hints applied alongside the change.","oneOf":[{"type":"array","items":{"type":"object"}},{"type":"null"}]}},"required":["token","entity","entityid","linkedentity","linkedentityid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Unlink two entities of any supported pair. Safe to call even when the link is already broken or one side was deleted without being unlinked first — this is the primitive for clearing a stuck link state without direct database access.","tags":["entity management"]}},"/api/entity/bin/list":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"List binned (soft-deleted) records for the business — expenses, income, documents (invoices, bills, quotes, purchase orders, credit notes), clients, suppliers, bank transactions, products, variants, journal entries, messages and tags — newest deletion first. Payments binned as part of a document deletion are not listed separately; restoring the document brings them back.","tags":["entity management"]}},"/api/entity/bin/restore":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"entity":{"description":"The binned record's kind: \"expense\", \"income\", \"contract\" (any document — invoice, bill, quote, purchase order, credit note; \"document\" is accepted too), \"invoice\" (a legacy-store invoice or quote), \"client\", \"supplier\", \"contact\" (any contact id), \"transaction\", \"product\", \"variant\", \"journal-entry\", \"message\" or \"tag\".","type":"string"},"id":{"description":"The binned record's id.","type":"string"}},"required":["token","entity","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"entity":{"description":"The binned record's kind: \"expense\", \"income\", \"contract\" (any document — invoice, bill, quote, purchase order, credit note; \"document\" is accepted too), \"invoice\" (a legacy-store invoice or quote), \"client\", \"supplier\", \"contact\" (any contact id), \"transaction\", \"product\", \"variant\", \"journal-entry\", \"message\" or \"tag\".","type":"string"},"id":{"description":"The binned record's id.","type":"string"}},"required":["token","entity","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"entity":{"description":"The binned record's kind: \"expense\", \"income\", \"contract\" (any document — invoice, bill, quote, purchase order, credit note; \"document\" is accepted too), \"invoice\" (a legacy-store invoice or quote), \"client\", \"supplier\", \"contact\" (any contact id), \"transaction\", \"product\", \"variant\", \"journal-entry\", \"message\" or \"tag\".","type":"string"},"id":{"description":"The binned record's id.","type":"string"}},"required":["token","entity","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"entity":{"description":"The binned record's kind: \"expense\", \"income\", \"contract\" (any document — invoice, bill, quote, purchase order, credit note; \"document\" is accepted too), \"invoice\" (a legacy-store invoice or quote), \"client\", \"supplier\", \"contact\" (any contact id), \"transaction\", \"product\", \"variant\", \"journal-entry\", \"message\" or \"tag\".","type":"string"},"id":{"description":"The binned record's id.","type":"string"}},"required":["token","entity","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Restore a binned (soft-deleted) record by kind + id, undoing its delete. Restoring a document (invoice, bill, quote, purchase order, credit note) also restores the payments that were binned with it. Idempotent — restoring a record that is not binned changes nothing.","tags":["entity management"]}},"/api/salestax/list":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"List the business's sales taxes (VAT and the like): each tax's name, rate or fixed amount, whether it is added on top or included in the price, whether it can be claimed back, and its reference number.","tags":["salestax management"]}},"/api/salestax/create":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"referencenumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"exclusive":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"recoverable":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"rate":{"oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"useamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"accountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"taxsource":{"oneOf":[{"type":"string"},{"type":"null"}]},"treatment":{"oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"oneOf":[{"type":"string"},{"type":"null"}]},"order":{"oneOf":[{"type":"number"},{"type":"null"}]},"compound":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"referencenumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"exclusive":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"recoverable":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"rate":{"oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"useamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"accountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"taxsource":{"oneOf":[{"type":"string"},{"type":"null"}]},"treatment":{"oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"oneOf":[{"type":"string"},{"type":"null"}]},"order":{"oneOf":[{"type":"number"},{"type":"null"}]},"compound":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"referencenumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"exclusive":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"recoverable":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"rate":{"oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"useamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"accountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"taxsource":{"oneOf":[{"type":"string"},{"type":"null"}]},"treatment":{"oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"oneOf":[{"type":"string"},{"type":"null"}]},"order":{"oneOf":[{"type":"number"},{"type":"null"}]},"compound":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"referencenumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"exclusive":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"recoverable":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"rate":{"oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"useamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"accountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"taxsource":{"oneOf":[{"type":"string"},{"type":"null"}]},"treatment":{"oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"oneOf":[{"type":"string"},{"type":"null"}]},"order":{"oneOf":[{"type":"number"},{"type":"null"}]},"compound":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create new sales tax","tags":["salestax management"]}},"/api/salestax/update":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"referencenumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"exclusive":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"recoverable":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"rate":{"oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"useamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"accountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"taxsource":{"oneOf":[{"type":"string"},{"type":"null"}]},"treatment":{"oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"oneOf":[{"type":"string"},{"type":"null"}]},"order":{"oneOf":[{"type":"number"},{"type":"null"}]},"compound":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"referencenumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"exclusive":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"recoverable":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"rate":{"oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"useamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"accountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"taxsource":{"oneOf":[{"type":"string"},{"type":"null"}]},"treatment":{"oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"oneOf":[{"type":"string"},{"type":"null"}]},"order":{"oneOf":[{"type":"number"},{"type":"null"}]},"compound":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"referencenumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"exclusive":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"recoverable":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"rate":{"oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"useamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"accountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"taxsource":{"oneOf":[{"type":"string"},{"type":"null"}]},"treatment":{"oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"oneOf":[{"type":"string"},{"type":"null"}]},"order":{"oneOf":[{"type":"number"},{"type":"null"}]},"compound":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"referencenumber":{"oneOf":[{"type":"string"},{"type":"null"}]},"exclusive":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"recoverable":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"rate":{"oneOf":[{"type":"number"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"useamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"accountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"taxsource":{"oneOf":[{"type":"string"},{"type":"null"}]},"treatment":{"oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"oneOf":[{"type":"string"},{"type":"null"}]},"order":{"oneOf":[{"type":"number"},{"type":"null"}]},"compound":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Update sales tax data","tags":["salestax management"]}},"/api/salestax/delete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Delete sales tax data","tags":["salestax management"]}},"/api/template/create":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"key":{"oneOf":[{"type":"string"},{"type":"null"}]},"sections":{"oneOf":[{"type":"string"},{"type":"null"}]},"schemaVersion":{"oneOf":[{"type":"integer"},{"type":"null"}]},"source":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"key":{"oneOf":[{"type":"string"},{"type":"null"}]},"sections":{"oneOf":[{"type":"string"},{"type":"null"}]},"schemaVersion":{"oneOf":[{"type":"integer"},{"type":"null"}]},"source":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"key":{"oneOf":[{"type":"string"},{"type":"null"}]},"sections":{"oneOf":[{"type":"string"},{"type":"null"}]},"schemaVersion":{"oneOf":[{"type":"integer"},{"type":"null"}]},"source":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"key":{"oneOf":[{"type":"string"},{"type":"null"}]},"sections":{"oneOf":[{"type":"string"},{"type":"null"}]},"schemaVersion":{"oneOf":[{"type":"integer"},{"type":"null"}]},"source":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create new report template","tags":["template management"]}},"/api/template/update":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"key":{"oneOf":[{"type":"string"},{"type":"null"}]},"sections":{"oneOf":[{"type":"string"},{"type":"null"}]},"schemaVersion":{"oneOf":[{"type":"integer"},{"type":"null"}]},"source":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"key":{"oneOf":[{"type":"string"},{"type":"null"}]},"sections":{"oneOf":[{"type":"string"},{"type":"null"}]},"schemaVersion":{"oneOf":[{"type":"integer"},{"type":"null"}]},"source":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"key":{"oneOf":[{"type":"string"},{"type":"null"}]},"sections":{"oneOf":[{"type":"string"},{"type":"null"}]},"schemaVersion":{"oneOf":[{"type":"integer"},{"type":"null"}]},"source":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"key":{"oneOf":[{"type":"string"},{"type":"null"}]},"sections":{"oneOf":[{"type":"string"},{"type":"null"}]},"schemaVersion":{"oneOf":[{"type":"integer"},{"type":"null"}]},"source":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Update report template","tags":["template management"]}},"/api/template/delete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Delete report template","tags":["template management"]}},"/api/report/create":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"key":{"oneOf":[{"type":"string"},{"type":"null"}]},"templateId":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodStart":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodEnd":{"oneOf":[{"type":"string"},{"type":"null"}]},"dueDate":{"oneOf":[{"type":"string"},{"type":"null"}]},"filedAt":{"oneOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"oneOf":[{"type":"string"},{"type":"null"}]},"payrunid":{"oneOf":[{"type":"string"},{"type":"null"}]},"employeeid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"key":{"oneOf":[{"type":"string"},{"type":"null"}]},"templateId":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodStart":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodEnd":{"oneOf":[{"type":"string"},{"type":"null"}]},"dueDate":{"oneOf":[{"type":"string"},{"type":"null"}]},"filedAt":{"oneOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"oneOf":[{"type":"string"},{"type":"null"}]},"payrunid":{"oneOf":[{"type":"string"},{"type":"null"}]},"employeeid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"key":{"oneOf":[{"type":"string"},{"type":"null"}]},"templateId":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodStart":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodEnd":{"oneOf":[{"type":"string"},{"type":"null"}]},"dueDate":{"oneOf":[{"type":"string"},{"type":"null"}]},"filedAt":{"oneOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"oneOf":[{"type":"string"},{"type":"null"}]},"payrunid":{"oneOf":[{"type":"string"},{"type":"null"}]},"employeeid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"key":{"oneOf":[{"type":"string"},{"type":"null"}]},"templateId":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodStart":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodEnd":{"oneOf":[{"type":"string"},{"type":"null"}]},"dueDate":{"oneOf":[{"type":"string"},{"type":"null"}]},"filedAt":{"oneOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"oneOf":[{"type":"string"},{"type":"null"}]},"payrunid":{"oneOf":[{"type":"string"},{"type":"null"}]},"employeeid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create new report","tags":["report management"]}},"/api/report/update":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"key":{"oneOf":[{"type":"string"},{"type":"null"}]},"templateId":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodStart":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodEnd":{"oneOf":[{"type":"string"},{"type":"null"}]},"dueDate":{"oneOf":[{"type":"string"},{"type":"null"}]},"filedAt":{"oneOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"oneOf":[{"type":"string"},{"type":"null"}]},"payrunid":{"oneOf":[{"type":"string"},{"type":"null"}]},"employeeid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"key":{"oneOf":[{"type":"string"},{"type":"null"}]},"templateId":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodStart":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodEnd":{"oneOf":[{"type":"string"},{"type":"null"}]},"dueDate":{"oneOf":[{"type":"string"},{"type":"null"}]},"filedAt":{"oneOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"oneOf":[{"type":"string"},{"type":"null"}]},"payrunid":{"oneOf":[{"type":"string"},{"type":"null"}]},"employeeid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"key":{"oneOf":[{"type":"string"},{"type":"null"}]},"templateId":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodStart":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodEnd":{"oneOf":[{"type":"string"},{"type":"null"}]},"dueDate":{"oneOf":[{"type":"string"},{"type":"null"}]},"filedAt":{"oneOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"oneOf":[{"type":"string"},{"type":"null"}]},"payrunid":{"oneOf":[{"type":"string"},{"type":"null"}]},"employeeid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"key":{"oneOf":[{"type":"string"},{"type":"null"}]},"templateId":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodStart":{"oneOf":[{"type":"string"},{"type":"null"}]},"periodEnd":{"oneOf":[{"type":"string"},{"type":"null"}]},"dueDate":{"oneOf":[{"type":"string"},{"type":"null"}]},"filedAt":{"oneOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"oneOf":[{"type":"string"},{"type":"null"}]},"payrunid":{"oneOf":[{"type":"string"},{"type":"null"}]},"employeeid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Update report","tags":["report management"]}},"/api/report/delete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Delete report","tags":["report management"]}},"/api/schedule/create":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"key":{"oneOf":[{"type":"string"},{"type":"null"}]},"templateId":{"oneOf":[{"type":"string"},{"type":"null"}]},"cron":{"oneOf":[{"type":"string"},{"type":"null"}]},"enabled":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"period":{"oneOf":[{"type":"string"},{"type":"null"}]},"due":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"key":{"oneOf":[{"type":"string"},{"type":"null"}]},"templateId":{"oneOf":[{"type":"string"},{"type":"null"}]},"cron":{"oneOf":[{"type":"string"},{"type":"null"}]},"enabled":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"period":{"oneOf":[{"type":"string"},{"type":"null"}]},"due":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"key":{"oneOf":[{"type":"string"},{"type":"null"}]},"templateId":{"oneOf":[{"type":"string"},{"type":"null"}]},"cron":{"oneOf":[{"type":"string"},{"type":"null"}]},"enabled":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"period":{"oneOf":[{"type":"string"},{"type":"null"}]},"due":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"key":{"oneOf":[{"type":"string"},{"type":"null"}]},"templateId":{"oneOf":[{"type":"string"},{"type":"null"}]},"cron":{"oneOf":[{"type":"string"},{"type":"null"}]},"enabled":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"period":{"oneOf":[{"type":"string"},{"type":"null"}]},"due":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create new report schedule","tags":["schedule management"]}},"/api/schedule/update":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"key":{"oneOf":[{"type":"string"},{"type":"null"}]},"templateId":{"oneOf":[{"type":"string"},{"type":"null"}]},"cron":{"oneOf":[{"type":"string"},{"type":"null"}]},"enabled":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"period":{"oneOf":[{"type":"string"},{"type":"null"}]},"due":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"key":{"oneOf":[{"type":"string"},{"type":"null"}]},"templateId":{"oneOf":[{"type":"string"},{"type":"null"}]},"cron":{"oneOf":[{"type":"string"},{"type":"null"}]},"enabled":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"period":{"oneOf":[{"type":"string"},{"type":"null"}]},"due":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"key":{"oneOf":[{"type":"string"},{"type":"null"}]},"templateId":{"oneOf":[{"type":"string"},{"type":"null"}]},"cron":{"oneOf":[{"type":"string"},{"type":"null"}]},"enabled":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"period":{"oneOf":[{"type":"string"},{"type":"null"}]},"due":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"key":{"oneOf":[{"type":"string"},{"type":"null"}]},"templateId":{"oneOf":[{"type":"string"},{"type":"null"}]},"cron":{"oneOf":[{"type":"string"},{"type":"null"}]},"enabled":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"period":{"oneOf":[{"type":"string"},{"type":"null"}]},"due":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Update report schedule","tags":["schedule management"]}},"/api/schedule/salestax":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"category":{"type":"string"},"confirm":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","category"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"category":{"type":"string"},"confirm":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","category"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"category":{"type":"string"},"confirm":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","category"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"category":{"type":"string"},"confirm":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","category"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Set this business's VAT period: the months each VAT return covers and when it is drafted. Send category, a VAT category id for the business's country, such as category-b in South Africa. An unknown category is refused with the ids to choose from. When the business already files a different period, the first call changes nothing and answers the current and proposed periods; call again with confirm true after the user approves. Returns already drafted keep their months. The return for the open period appears when the schedule next fires, or the user can create it from the VAT return template. This is the only way to set the VAT period; update_business does not.","tags":["schedule management"]}},"/api/schedule/delete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Delete report schedule","tags":["schedule management"]}},"/api/agentrule/create":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"prompt":{"oneOf":[{"type":"string"},{"type":"null"}]},"cron":{"oneOf":[{"type":"string"},{"type":"null"}]},"enabled":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"prompt":{"oneOf":[{"type":"string"},{"type":"null"}]},"cron":{"oneOf":[{"type":"string"},{"type":"null"}]},"enabled":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"prompt":{"oneOf":[{"type":"string"},{"type":"null"}]},"cron":{"oneOf":[{"type":"string"},{"type":"null"}]},"enabled":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"prompt":{"oneOf":[{"type":"string"},{"type":"null"}]},"cron":{"oneOf":[{"type":"string"},{"type":"null"}]},"enabled":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create an Ask stub rule","tags":["agent rules"]}},"/api/agentrule/update":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"prompt":{"oneOf":[{"type":"string"},{"type":"null"}]},"cron":{"oneOf":[{"type":"string"},{"type":"null"}]},"enabled":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"prompt":{"oneOf":[{"type":"string"},{"type":"null"}]},"cron":{"oneOf":[{"type":"string"},{"type":"null"}]},"enabled":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"prompt":{"oneOf":[{"type":"string"},{"type":"null"}]},"cron":{"oneOf":[{"type":"string"},{"type":"null"}]},"enabled":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"prompt":{"oneOf":[{"type":"string"},{"type":"null"}]},"cron":{"oneOf":[{"type":"string"},{"type":"null"}]},"enabled":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Update an Ask stub rule","tags":["agent rules"]}},"/api/agentrule/delete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Delete an Ask stub rule","tags":["agent rules"]}},"/api/flowschedule/set":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"wfid":{"description":"Which flow to put on a cadence, by its id.","type":"string"},"cron":{"oneOf":[{"type":"string"},{"type":"null"}]},"enabled":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"inputs":{"description":"Values for the flow's params, by name: numbers, choices, and dates as a named period like last-month-start — never a fixed date, which would be wrong on every fire after the first.","oneOf":[{"type":"object","additionalProperties":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"},{"type":"boolean"}]},{"type":"null"}]}},{"type":"null"}]}},"required":["token","wfid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"wfid":{"description":"Which flow to put on a cadence, by its id.","type":"string"},"cron":{"oneOf":[{"type":"string"},{"type":"null"}]},"enabled":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"inputs":{"description":"Values for the flow's params, by name: numbers, choices, and dates as a named period like last-month-start — never a fixed date, which would be wrong on every fire after the first.","oneOf":[{"type":"object","additionalProperties":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"},{"type":"boolean"}]},{"type":"null"}]}},{"type":"null"}]}},"required":["token","wfid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"wfid":{"description":"Which flow to put on a cadence, by its id.","type":"string"},"cron":{"oneOf":[{"type":"string"},{"type":"null"}]},"enabled":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"inputs":{"description":"Values for the flow's params, by name: numbers, choices, and dates as a named period like last-month-start — never a fixed date, which would be wrong on every fire after the first.","oneOf":[{"type":"object","additionalProperties":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"},{"type":"boolean"}]},{"type":"null"}]}},{"type":"null"}]}},"required":["token","wfid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"wfid":{"description":"Which flow to put on a cadence, by its id.","type":"string"},"cron":{"oneOf":[{"type":"string"},{"type":"null"}]},"enabled":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"inputs":{"description":"Values for the flow's params, by name: numbers, choices, and dates as a named period like last-month-start — never a fixed date, which would be wrong on every fire after the first.","oneOf":[{"type":"object","additionalProperties":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"},{"type":"boolean"}]},{"type":"null"}]}},{"type":"null"}]}},"required":["token","wfid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Put a flow on a cadence, or change the cadence it is already on. One schedule per flow: calling this again for the same flow REPLACES the cadence rather than adding a second one. Set enabled false to pause it without forgetting the cadence. Refuses a flow that needs a parameter typed in, a flow that belongs to an installed app, and one that has been archived — in each case it says which.","tags":["flow schedules"]}},"/api/flowschedule/remove":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"wfid":{"description":"Which flow to stop running on a cadence.","type":"string"}},"required":["token","wfid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"wfid":{"description":"Which flow to stop running on a cadence.","type":"string"}},"required":["token","wfid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"wfid":{"description":"Which flow to stop running on a cadence.","type":"string"}},"required":["token","wfid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"wfid":{"description":"Which flow to stop running on a cadence.","type":"string"}},"required":["token","wfid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Stop running a flow on a cadence. The flow itself is untouched and can still be run by hand; only the schedule goes. To pause instead, call schedule_flow with enabled false — that keeps the cadence.","tags":["flow schedules"]}},"/api/flowschedule/list":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Every flow this business runs on a cadence: which flow, how often, whether it is on, when it last ran and when it runs next. A schedule that has paused itself carries the error that paused it.","tags":["flow schedules"]}},"/api/stockentry/create":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the stock entry, required for updates","oneOf":[{"type":"string"},{"type":"null"}]},"variantid":{"description":"ID of the product variant this entry affects","oneOf":[{"type":"string"},{"type":"null"}]},"date":{"description":"Date of the stock entry","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Additional notes about the stock entry","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Name or description of the stock entry","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Monetary value associated with the stock entry","oneOf":[{"type":"number"},{"type":"null"}]},"lines":{"description":"Stock entry lines showing stock movements between locations","oneOf":[{"type":"array","items":{"type":"object","properties":{"locationid":{"description":"Location/warehouse ID","type":"string"},"credit":{"description":"Stock units leaving this location","type":"number"},"debit":{"description":"Stock units entering this location","type":"number"}},"required":["locationid","credit","debit"],"additionalProperties":false}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the stock entry, required for updates","oneOf":[{"type":"string"},{"type":"null"}]},"variantid":{"description":"ID of the product variant this entry affects","oneOf":[{"type":"string"},{"type":"null"}]},"date":{"description":"Date of the stock entry","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Additional notes about the stock entry","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Name or description of the stock entry","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Monetary value associated with the stock entry","oneOf":[{"type":"number"},{"type":"null"}]},"lines":{"description":"Stock entry lines showing stock movements between locations","oneOf":[{"type":"array","items":{"type":"object","properties":{"locationid":{"description":"Location/warehouse ID","type":"string"},"credit":{"description":"Stock units leaving this location","type":"number"},"debit":{"description":"Stock units entering this location","type":"number"}},"required":["locationid","credit","debit"],"additionalProperties":false}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the stock entry, required for updates","oneOf":[{"type":"string"},{"type":"null"}]},"variantid":{"description":"ID of the product variant this entry affects","oneOf":[{"type":"string"},{"type":"null"}]},"date":{"description":"Date of the stock entry","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Additional notes about the stock entry","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Name or description of the stock entry","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Monetary value associated with the stock entry","oneOf":[{"type":"number"},{"type":"null"}]},"lines":{"description":"Stock entry lines showing stock movements between locations","oneOf":[{"type":"array","items":{"type":"object","properties":{"locationid":{"description":"Location/warehouse ID","type":"string"},"credit":{"description":"Stock units leaving this location","type":"number"},"debit":{"description":"Stock units entering this location","type":"number"}},"required":["locationid","credit","debit"],"additionalProperties":false}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the stock entry, required for updates","oneOf":[{"type":"string"},{"type":"null"}]},"variantid":{"description":"ID of the product variant this entry affects","oneOf":[{"type":"string"},{"type":"null"}]},"date":{"description":"Date of the stock entry","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Additional notes about the stock entry","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Name or description of the stock entry","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Monetary value associated with the stock entry","oneOf":[{"type":"number"},{"type":"null"}]},"lines":{"description":"Stock entry lines showing stock movements between locations","oneOf":[{"type":"array","items":{"type":"object","properties":{"locationid":{"description":"Location/warehouse ID","type":"string"},"credit":{"description":"Stock units leaving this location","type":"number"},"debit":{"description":"Stock units entering this location","type":"number"}},"required":["locationid","credit","debit"],"additionalProperties":false}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create new stock entry","tags":["stock entry management"]}},"/api/stockentry/update":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the stock entry, required for updates","oneOf":[{"type":"string"},{"type":"null"}]},"variantid":{"description":"ID of the product variant this entry affects","oneOf":[{"type":"string"},{"type":"null"}]},"date":{"description":"Date of the stock entry","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Additional notes about the stock entry","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Name or description of the stock entry","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Monetary value associated with the stock entry","oneOf":[{"type":"number"},{"type":"null"}]},"lines":{"description":"Stock entry lines showing stock movements between locations","oneOf":[{"type":"array","items":{"type":"object","properties":{"locationid":{"description":"Location/warehouse ID","type":"string"},"credit":{"description":"Stock units leaving this location","type":"number"},"debit":{"description":"Stock units entering this location","type":"number"}},"required":["locationid","credit","debit"],"additionalProperties":false}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the stock entry, required for updates","oneOf":[{"type":"string"},{"type":"null"}]},"variantid":{"description":"ID of the product variant this entry affects","oneOf":[{"type":"string"},{"type":"null"}]},"date":{"description":"Date of the stock entry","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Additional notes about the stock entry","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Name or description of the stock entry","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Monetary value associated with the stock entry","oneOf":[{"type":"number"},{"type":"null"}]},"lines":{"description":"Stock entry lines showing stock movements between locations","oneOf":[{"type":"array","items":{"type":"object","properties":{"locationid":{"description":"Location/warehouse ID","type":"string"},"credit":{"description":"Stock units leaving this location","type":"number"},"debit":{"description":"Stock units entering this location","type":"number"}},"required":["locationid","credit","debit"],"additionalProperties":false}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the stock entry, required for updates","oneOf":[{"type":"string"},{"type":"null"}]},"variantid":{"description":"ID of the product variant this entry affects","oneOf":[{"type":"string"},{"type":"null"}]},"date":{"description":"Date of the stock entry","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Additional notes about the stock entry","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Name or description of the stock entry","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Monetary value associated with the stock entry","oneOf":[{"type":"number"},{"type":"null"}]},"lines":{"description":"Stock entry lines showing stock movements between locations","oneOf":[{"type":"array","items":{"type":"object","properties":{"locationid":{"description":"Location/warehouse ID","type":"string"},"credit":{"description":"Stock units leaving this location","type":"number"},"debit":{"description":"Stock units entering this location","type":"number"}},"required":["locationid","credit","debit"],"additionalProperties":false}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the stock entry, required for updates","oneOf":[{"type":"string"},{"type":"null"}]},"variantid":{"description":"ID of the product variant this entry affects","oneOf":[{"type":"string"},{"type":"null"}]},"date":{"description":"Date of the stock entry","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Additional notes about the stock entry","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Name or description of the stock entry","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Monetary value associated with the stock entry","oneOf":[{"type":"number"},{"type":"null"}]},"lines":{"description":"Stock entry lines showing stock movements between locations","oneOf":[{"type":"array","items":{"type":"object","properties":{"locationid":{"description":"Location/warehouse ID","type":"string"},"credit":{"description":"Stock units leaving this location","type":"number"},"debit":{"description":"Stock units entering this location","type":"number"}},"required":["locationid","credit","debit"],"additionalProperties":false}},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Update stock entry","tags":["stock entry management"]}},"/api/stockentry/delete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the stock entry","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the stock entry","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the stock entry","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the stock entry","type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Delete stock entry","tags":["stock entry management"]}},"/api/stockentry/get-all":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Get all stock entries","tags":["stock entry management"]}},"/api/stockentry/set-quantity":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"productid":{"description":"The product, from list_products.","type":"string"},"variantid":{"description":"The variant, from list_products. Required when the product has variants.","oneOf":[{"type":"string"},{"type":"null"}]},"quantity":{"description":"The counted quantity on hand, zero or more. Fractions are kept.","type":"number"},"stocklocationid":{"description":"The location counted. Omit it for the product's default location.","oneOf":[{"type":"string"},{"type":"null"}]},"date":{"description":"When the count was taken. Omit it for now.","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Why the stock changed, e.g. a stock take.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","productid","quantity"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"productid":{"description":"The product, from list_products.","type":"string"},"variantid":{"description":"The variant, from list_products. Required when the product has variants.","oneOf":[{"type":"string"},{"type":"null"}]},"quantity":{"description":"The counted quantity on hand, zero or more. Fractions are kept.","type":"number"},"stocklocationid":{"description":"The location counted. Omit it for the product's default location.","oneOf":[{"type":"string"},{"type":"null"}]},"date":{"description":"When the count was taken. Omit it for now.","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Why the stock changed, e.g. a stock take.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","productid","quantity"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"productid":{"description":"The product, from list_products.","type":"string"},"variantid":{"description":"The variant, from list_products. Required when the product has variants.","oneOf":[{"type":"string"},{"type":"null"}]},"quantity":{"description":"The counted quantity on hand, zero or more. Fractions are kept.","type":"number"},"stocklocationid":{"description":"The location counted. Omit it for the product's default location.","oneOf":[{"type":"string"},{"type":"null"}]},"date":{"description":"When the count was taken. Omit it for now.","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Why the stock changed, e.g. a stock take.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","productid","quantity"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"productid":{"description":"The product, from list_products.","type":"string"},"variantid":{"description":"The variant, from list_products. Required when the product has variants.","oneOf":[{"type":"string"},{"type":"null"}]},"quantity":{"description":"The counted quantity on hand, zero or more. Fractions are kept.","type":"number"},"stocklocationid":{"description":"The location counted. Omit it for the product's default location.","oneOf":[{"type":"string"},{"type":"null"}]},"date":{"description":"When the count was taken. Omit it for now.","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Why the stock changed, e.g. a stock take.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","productid","quantity"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Set the stock a product (or variant) holds at a location to a counted number. The difference is posted as a stock adjustment, the same one the product page's adjustment form posts; nothing is written when the count already matches. Stock adjustments do not post to the ledger. For the stock a product started with, and its value, use save_opening_stock.","tags":["stock entry management"]}},"/api/stockentry/simple-movement":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"type":{"description":"Type of stock movement: shrink (loss), grow (gain), sale, or purchase","type":"string","enum":["shrink","grow","sale","purchase"]},"variant-id":{"description":"ID of the product variant","type":"string"},"quantity":{"description":"Quantity of units being moved","type":"number"},"locationid":{"description":"Stock location the movement happens at; defaults to the variant's or product's location","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Additional notes about the movement","oneOf":[{"type":"string"},{"type":"null"}]},"date":{"description":"Date of the movement","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Monetary value of the movement","oneOf":[{"type":"number"},{"type":"null"}]}},"required":["token","type","variant-id","quantity"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"type":{"description":"Type of stock movement: shrink (loss), grow (gain), sale, or purchase","type":"string","enum":["shrink","grow","sale","purchase"]},"variant-id":{"description":"ID of the product variant","type":"string"},"quantity":{"description":"Quantity of units being moved","type":"number"},"locationid":{"description":"Stock location the movement happens at; defaults to the variant's or product's location","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Additional notes about the movement","oneOf":[{"type":"string"},{"type":"null"}]},"date":{"description":"Date of the movement","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Monetary value of the movement","oneOf":[{"type":"number"},{"type":"null"}]}},"required":["token","type","variant-id","quantity"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"type":{"description":"Type of stock movement: shrink (loss), grow (gain), sale, or purchase","type":"string","enum":["shrink","grow","sale","purchase"]},"variant-id":{"description":"ID of the product variant","type":"string"},"quantity":{"description":"Quantity of units being moved","type":"number"},"locationid":{"description":"Stock location the movement happens at; defaults to the variant's or product's location","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Additional notes about the movement","oneOf":[{"type":"string"},{"type":"null"}]},"date":{"description":"Date of the movement","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Monetary value of the movement","oneOf":[{"type":"number"},{"type":"null"}]}},"required":["token","type","variant-id","quantity"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"type":{"description":"Type of stock movement: shrink (loss), grow (gain), sale, or purchase","type":"string","enum":["shrink","grow","sale","purchase"]},"variant-id":{"description":"ID of the product variant","type":"string"},"quantity":{"description":"Quantity of units being moved","type":"number"},"locationid":{"description":"Stock location the movement happens at; defaults to the variant's or product's location","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Additional notes about the movement","oneOf":[{"type":"string"},{"type":"null"}]},"date":{"description":"Date of the movement","oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Monetary value of the movement","oneOf":[{"type":"number"},{"type":"null"}]}},"required":["token","type","variant-id","quantity"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create stock entry from simple movement (shrink/grow/sale/purchase)","tags":["stock entry management"]}},"/api/stockentry/line/create":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the stock entry line, required for updates","oneOf":[{"type":"string"},{"type":"null"}]},"stockentryid":{"description":"ID of the parent stock entry","oneOf":[{"type":"string"},{"type":"null"}]},"locationid":{"description":"Location/warehouse ID for this line","oneOf":[{"type":"string"},{"type":"null"}]},"debit":{"description":"Stock units entering this location","oneOf":[{"type":"number"},{"type":"null"}]},"credit":{"description":"Stock units leaving this location","oneOf":[{"type":"number"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the stock entry line, required for updates","oneOf":[{"type":"string"},{"type":"null"}]},"stockentryid":{"description":"ID of the parent stock entry","oneOf":[{"type":"string"},{"type":"null"}]},"locationid":{"description":"Location/warehouse ID for this line","oneOf":[{"type":"string"},{"type":"null"}]},"debit":{"description":"Stock units entering this location","oneOf":[{"type":"number"},{"type":"null"}]},"credit":{"description":"Stock units leaving this location","oneOf":[{"type":"number"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the stock entry line, required for updates","oneOf":[{"type":"string"},{"type":"null"}]},"stockentryid":{"description":"ID of the parent stock entry","oneOf":[{"type":"string"},{"type":"null"}]},"locationid":{"description":"Location/warehouse ID for this line","oneOf":[{"type":"string"},{"type":"null"}]},"debit":{"description":"Stock units entering this location","oneOf":[{"type":"number"},{"type":"null"}]},"credit":{"description":"Stock units leaving this location","oneOf":[{"type":"number"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the stock entry line, required for updates","oneOf":[{"type":"string"},{"type":"null"}]},"stockentryid":{"description":"ID of the parent stock entry","oneOf":[{"type":"string"},{"type":"null"}]},"locationid":{"description":"Location/warehouse ID for this line","oneOf":[{"type":"string"},{"type":"null"}]},"debit":{"description":"Stock units entering this location","oneOf":[{"type":"number"},{"type":"null"}]},"credit":{"description":"Stock units leaving this location","oneOf":[{"type":"number"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Add line to stock entry","tags":["stock entry management"]}},"/api/stockentry/line/update":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the stock entry line, required for updates","oneOf":[{"type":"string"},{"type":"null"}]},"stockentryid":{"description":"ID of the parent stock entry","oneOf":[{"type":"string"},{"type":"null"}]},"locationid":{"description":"Location/warehouse ID for this line","oneOf":[{"type":"string"},{"type":"null"}]},"debit":{"description":"Stock units entering this location","oneOf":[{"type":"number"},{"type":"null"}]},"credit":{"description":"Stock units leaving this location","oneOf":[{"type":"number"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the stock entry line, required for updates","oneOf":[{"type":"string"},{"type":"null"}]},"stockentryid":{"description":"ID of the parent stock entry","oneOf":[{"type":"string"},{"type":"null"}]},"locationid":{"description":"Location/warehouse ID for this line","oneOf":[{"type":"string"},{"type":"null"}]},"debit":{"description":"Stock units entering this location","oneOf":[{"type":"number"},{"type":"null"}]},"credit":{"description":"Stock units leaving this location","oneOf":[{"type":"number"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the stock entry line, required for updates","oneOf":[{"type":"string"},{"type":"null"}]},"stockentryid":{"description":"ID of the parent stock entry","oneOf":[{"type":"string"},{"type":"null"}]},"locationid":{"description":"Location/warehouse ID for this line","oneOf":[{"type":"string"},{"type":"null"}]},"debit":{"description":"Stock units entering this location","oneOf":[{"type":"number"},{"type":"null"}]},"credit":{"description":"Stock units leaving this location","oneOf":[{"type":"number"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the stock entry line, required for updates","oneOf":[{"type":"string"},{"type":"null"}]},"stockentryid":{"description":"ID of the parent stock entry","oneOf":[{"type":"string"},{"type":"null"}]},"locationid":{"description":"Location/warehouse ID for this line","oneOf":[{"type":"string"},{"type":"null"}]},"debit":{"description":"Stock units entering this location","oneOf":[{"type":"number"},{"type":"null"}]},"credit":{"description":"Stock units leaving this location","oneOf":[{"type":"number"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Update line in stock entry","tags":["stock entry management"]}},"/api/stockentry/line/delete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the stock entry line to delete","oneOf":[{"type":"string"},{"type":"null"}]},"_id":{"description":"Alternative internal ID for the line","oneOf":[{"type":"number"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the stock entry line to delete","oneOf":[{"type":"string"},{"type":"null"}]},"_id":{"description":"Alternative internal ID for the line","oneOf":[{"type":"number"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the stock entry line to delete","oneOf":[{"type":"string"},{"type":"null"}]},"_id":{"description":"Alternative internal ID for the line","oneOf":[{"type":"number"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"ID of the stock entry line to delete","oneOf":[{"type":"string"},{"type":"null"}]},"_id":{"description":"Alternative internal ID for the line","oneOf":[{"type":"number"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Delete line from stock entry","tags":["stock entry management"]}},"/api/stocklocation/create":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"name":{"description":"Display name of the location, e.g. \"Warehouse\".","type":"string"},"description":{"description":"Free text such as an address, e.g. \"Unit 4, Montague Gardens\".","oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","name"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"name":{"description":"Display name of the location, e.g. \"Warehouse\".","type":"string"},"description":{"description":"Free text such as an address, e.g. \"Unit 4, Montague Gardens\".","oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","name"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"name":{"description":"Display name of the location, e.g. \"Warehouse\".","type":"string"},"description":{"description":"Free text such as an address, e.g. \"Unit 4, Montague Gardens\".","oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","name"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"name":{"description":"Display name of the location, e.g. \"Warehouse\".","type":"string"},"description":{"description":"Free text such as an address, e.g. \"Unit 4, Montague Gardens\".","oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","name"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create a stock location","tags":["stock location management"]}},"/api/stocklocation/update":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Location id. \"2\" is the built-in main location: it can be renamed only.","type":"string"},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"\"\" or \"$delete\" clears it. Not stored for the main location \"2\".","oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"description":"Archive to stop new stock moving into the location. Refused while it is a product or variant default.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Location id. \"2\" is the built-in main location: it can be renamed only.","type":"string"},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"\"\" or \"$delete\" clears it. Not stored for the main location \"2\".","oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"description":"Archive to stop new stock moving into the location. Refused while it is a product or variant default.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Location id. \"2\" is the built-in main location: it can be renamed only.","type":"string"},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"\"\" or \"$delete\" clears it. Not stored for the main location \"2\".","oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"description":"Archive to stop new stock moving into the location. Refused while it is a product or variant default.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Location id. \"2\" is the built-in main location: it can be renamed only.","type":"string"},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"\"\" or \"$delete\" clears it. Not stored for the main location \"2\".","oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"description":"Archive to stop new stock moving into the location. Refused while it is a product or variant default.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Rename, archive or unarchive a stock location","tags":["stock location management"]}},"/api/stocklocation/delete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Delete a stock location nothing uses yet","tags":["stock location management"]}},"/api/variant/create":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"productid":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"price":{"oneOf":[{"type":"number"},{"type":"null"}]},"cost":{"oneOf":[{"type":"number"},{"type":"null"}]},"image":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"sku":{"oneOf":[{"type":"string"},{"type":"null"}]},"barcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"costcurrency":{"oneOf":[{"type":"string"},{"type":"null"}]},"units":{"oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"salestaxids":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"salestaxexclusive":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"stocklocationid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"productid":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"price":{"oneOf":[{"type":"number"},{"type":"null"}]},"cost":{"oneOf":[{"type":"number"},{"type":"null"}]},"image":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"sku":{"oneOf":[{"type":"string"},{"type":"null"}]},"barcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"costcurrency":{"oneOf":[{"type":"string"},{"type":"null"}]},"units":{"oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"salestaxids":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"salestaxexclusive":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"stocklocationid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"productid":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"price":{"oneOf":[{"type":"number"},{"type":"null"}]},"cost":{"oneOf":[{"type":"number"},{"type":"null"}]},"image":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"sku":{"oneOf":[{"type":"string"},{"type":"null"}]},"barcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"costcurrency":{"oneOf":[{"type":"string"},{"type":"null"}]},"units":{"oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"salestaxids":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"salestaxexclusive":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"stocklocationid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"productid":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"price":{"oneOf":[{"type":"number"},{"type":"null"}]},"cost":{"oneOf":[{"type":"number"},{"type":"null"}]},"image":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"sku":{"oneOf":[{"type":"string"},{"type":"null"}]},"barcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"costcurrency":{"oneOf":[{"type":"string"},{"type":"null"}]},"units":{"oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"salestaxids":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"salestaxexclusive":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"stocklocationid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create new variant","tags":["variant management"]}},"/api/variant/update":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"productid":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"price":{"oneOf":[{"type":"number"},{"type":"null"}]},"cost":{"oneOf":[{"type":"number"},{"type":"null"}]},"image":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"sku":{"oneOf":[{"type":"string"},{"type":"null"}]},"barcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"costcurrency":{"oneOf":[{"type":"string"},{"type":"null"}]},"units":{"oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"salestaxids":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"salestaxexclusive":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"stocklocationid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"productid":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"price":{"oneOf":[{"type":"number"},{"type":"null"}]},"cost":{"oneOf":[{"type":"number"},{"type":"null"}]},"image":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"sku":{"oneOf":[{"type":"string"},{"type":"null"}]},"barcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"costcurrency":{"oneOf":[{"type":"string"},{"type":"null"}]},"units":{"oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"salestaxids":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"salestaxexclusive":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"stocklocationid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"productid":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"price":{"oneOf":[{"type":"number"},{"type":"null"}]},"cost":{"oneOf":[{"type":"number"},{"type":"null"}]},"image":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"sku":{"oneOf":[{"type":"string"},{"type":"null"}]},"barcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"costcurrency":{"oneOf":[{"type":"string"},{"type":"null"}]},"units":{"oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"salestaxids":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"salestaxexclusive":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"stocklocationid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"productid":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"price":{"oneOf":[{"type":"number"},{"type":"null"}]},"cost":{"oneOf":[{"type":"number"},{"type":"null"}]},"image":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"sku":{"oneOf":[{"type":"string"},{"type":"null"}]},"barcode":{"oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"costcurrency":{"oneOf":[{"type":"string"},{"type":"null"}]},"units":{"oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"salestaxids":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"salestaxexclusive":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"stocklocationid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Update variant data","tags":["variant management"]}},"/api/variant/save":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"description":"Business id this variant belongs to; defaults to the authenticated business.","oneOf":[{"type":"string"},{"type":"null"}]},"id":{"description":"Variant id. Present → update that variant; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"productid":{"description":"Parent product id this variant belongs to (see list_products).","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name / description of the variant.","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"Variant description.","oneOf":[{"type":"string"},{"type":"null"}]},"price":{"description":"Selling price per unit, in the record's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"cost":{"description":"Cost price per unit.","oneOf":[{"type":"number"},{"type":"null"}]},"image":{"description":"Variant image URL; pass \"$delete\" to remove the existing image.","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"sku":{"description":"Stock-keeping unit / product code.","oneOf":[{"type":"string"},{"type":"null"}]},"barcode":{"description":"Barcode value for this variant.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"costcurrency":{"description":"ISO 4217 currency code for the cost price.","oneOf":[{"type":"string"},{"type":"null"}]},"units":{"description":"Unit of measure label (e.g. \"each\", \"hour\", \"kg\").","oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"description":"Archive (true) or unarchive (false) the variant. An archived variant is kept with its history and stays in the product's variants; it is not deleted.","oneOf":[{"type":"boolean"},{"type":"null"}]},"salestaxids":{"description":"Sales tax ids to link to this variant.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"salestaxexclusive":{"description":"Whether the price excludes sales tax.","oneOf":[{"type":"boolean"},{"type":"null"}]},"stocklocationid":{"description":"Default stock location id for this variant; empty inherits the product's. Pass \"$delete\" to clear it.","oneOf":[{"type":"string"},{"type":"null"}]},"items":{"description":"Vector of variant objects to create/update in one all-or-nothing batch. Preferred over repeated calls. Each item with an id updates; each without creates.","type":"array","items":{"type":"object","properties":{"businessid":{"description":"Business id this variant belongs to; defaults to the authenticated business.","oneOf":[{"type":"string"},{"type":"null"}]},"id":{"description":"Variant id. Present → update that variant; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"productid":{"description":"Parent product id this variant belongs to (see list_products).","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name / description of the variant.","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"Variant description.","oneOf":[{"type":"string"},{"type":"null"}]},"price":{"description":"Selling price per unit, in the record's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"cost":{"description":"Cost price per unit.","oneOf":[{"type":"number"},{"type":"null"}]},"image":{"description":"Variant image URL; pass \"$delete\" to remove the existing image.","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"sku":{"description":"Stock-keeping unit / product code.","oneOf":[{"type":"string"},{"type":"null"}]},"barcode":{"description":"Barcode value for this variant.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"costcurrency":{"description":"ISO 4217 currency code for the cost price.","oneOf":[{"type":"string"},{"type":"null"}]},"units":{"description":"Unit of measure label (e.g. \"each\", \"hour\", \"kg\").","oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"description":"Archive (true) or unarchive (false) the variant. An archived variant is kept with its history and stays in the product's variants; it is not deleted.","oneOf":[{"type":"boolean"},{"type":"null"}]},"salestaxids":{"description":"Sales tax ids to link to this variant.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"salestaxexclusive":{"description":"Whether the price excludes sales tax.","oneOf":[{"type":"boolean"},{"type":"null"}]},"stocklocationid":{"description":"Default stock location id for this variant; empty inherits the product's. Pass \"$delete\" to clear it.","oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"description":"Business id this variant belongs to; defaults to the authenticated business.","oneOf":[{"type":"string"},{"type":"null"}]},"id":{"description":"Variant id. Present → update that variant; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"productid":{"description":"Parent product id this variant belongs to (see list_products).","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name / description of the variant.","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"Variant description.","oneOf":[{"type":"string"},{"type":"null"}]},"price":{"description":"Selling price per unit, in the record's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"cost":{"description":"Cost price per unit.","oneOf":[{"type":"number"},{"type":"null"}]},"image":{"description":"Variant image URL; pass \"$delete\" to remove the existing image.","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"sku":{"description":"Stock-keeping unit / product code.","oneOf":[{"type":"string"},{"type":"null"}]},"barcode":{"description":"Barcode value for this variant.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"costcurrency":{"description":"ISO 4217 currency code for the cost price.","oneOf":[{"type":"string"},{"type":"null"}]},"units":{"description":"Unit of measure label (e.g. \"each\", \"hour\", \"kg\").","oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"description":"Archive (true) or unarchive (false) the variant. An archived variant is kept with its history and stays in the product's variants; it is not deleted.","oneOf":[{"type":"boolean"},{"type":"null"}]},"salestaxids":{"description":"Sales tax ids to link to this variant.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"salestaxexclusive":{"description":"Whether the price excludes sales tax.","oneOf":[{"type":"boolean"},{"type":"null"}]},"stocklocationid":{"description":"Default stock location id for this variant; empty inherits the product's. Pass \"$delete\" to clear it.","oneOf":[{"type":"string"},{"type":"null"}]},"items":{"description":"Vector of variant objects to create/update in one all-or-nothing batch. Preferred over repeated calls. Each item with an id updates; each without creates.","type":"array","items":{"type":"object","properties":{"businessid":{"description":"Business id this variant belongs to; defaults to the authenticated business.","oneOf":[{"type":"string"},{"type":"null"}]},"id":{"description":"Variant id. Present → update that variant; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"productid":{"description":"Parent product id this variant belongs to (see list_products).","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name / description of the variant.","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"Variant description.","oneOf":[{"type":"string"},{"type":"null"}]},"price":{"description":"Selling price per unit, in the record's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"cost":{"description":"Cost price per unit.","oneOf":[{"type":"number"},{"type":"null"}]},"image":{"description":"Variant image URL; pass \"$delete\" to remove the existing image.","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"sku":{"description":"Stock-keeping unit / product code.","oneOf":[{"type":"string"},{"type":"null"}]},"barcode":{"description":"Barcode value for this variant.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"costcurrency":{"description":"ISO 4217 currency code for the cost price.","oneOf":[{"type":"string"},{"type":"null"}]},"units":{"description":"Unit of measure label (e.g. \"each\", \"hour\", \"kg\").","oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"description":"Archive (true) or unarchive (false) the variant. An archived variant is kept with its history and stays in the product's variants; it is not deleted.","oneOf":[{"type":"boolean"},{"type":"null"}]},"salestaxids":{"description":"Sales tax ids to link to this variant.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"salestaxexclusive":{"description":"Whether the price excludes sales tax.","oneOf":[{"type":"boolean"},{"type":"null"}]},"stocklocationid":{"description":"Default stock location id for this variant; empty inherits the product's. Pass \"$delete\" to clear it.","oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"description":"Business id this variant belongs to; defaults to the authenticated business.","oneOf":[{"type":"string"},{"type":"null"}]},"id":{"description":"Variant id. Present → update that variant; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"productid":{"description":"Parent product id this variant belongs to (see list_products).","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name / description of the variant.","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"Variant description.","oneOf":[{"type":"string"},{"type":"null"}]},"price":{"description":"Selling price per unit, in the record's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"cost":{"description":"Cost price per unit.","oneOf":[{"type":"number"},{"type":"null"}]},"image":{"description":"Variant image URL; pass \"$delete\" to remove the existing image.","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"sku":{"description":"Stock-keeping unit / product code.","oneOf":[{"type":"string"},{"type":"null"}]},"barcode":{"description":"Barcode value for this variant.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"costcurrency":{"description":"ISO 4217 currency code for the cost price.","oneOf":[{"type":"string"},{"type":"null"}]},"units":{"description":"Unit of measure label (e.g. \"each\", \"hour\", \"kg\").","oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"description":"Archive (true) or unarchive (false) the variant. An archived variant is kept with its history and stays in the product's variants; it is not deleted.","oneOf":[{"type":"boolean"},{"type":"null"}]},"salestaxids":{"description":"Sales tax ids to link to this variant.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"salestaxexclusive":{"description":"Whether the price excludes sales tax.","oneOf":[{"type":"boolean"},{"type":"null"}]},"stocklocationid":{"description":"Default stock location id for this variant; empty inherits the product's. Pass \"$delete\" to clear it.","oneOf":[{"type":"string"},{"type":"null"}]},"items":{"description":"Vector of variant objects to create/update in one all-or-nothing batch. Preferred over repeated calls. Each item with an id updates; each without creates.","type":"array","items":{"type":"object","properties":{"businessid":{"description":"Business id this variant belongs to; defaults to the authenticated business.","oneOf":[{"type":"string"},{"type":"null"}]},"id":{"description":"Variant id. Present → update that variant; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"productid":{"description":"Parent product id this variant belongs to (see list_products).","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name / description of the variant.","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"Variant description.","oneOf":[{"type":"string"},{"type":"null"}]},"price":{"description":"Selling price per unit, in the record's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"cost":{"description":"Cost price per unit.","oneOf":[{"type":"number"},{"type":"null"}]},"image":{"description":"Variant image URL; pass \"$delete\" to remove the existing image.","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"sku":{"description":"Stock-keeping unit / product code.","oneOf":[{"type":"string"},{"type":"null"}]},"barcode":{"description":"Barcode value for this variant.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"costcurrency":{"description":"ISO 4217 currency code for the cost price.","oneOf":[{"type":"string"},{"type":"null"}]},"units":{"description":"Unit of measure label (e.g. \"each\", \"hour\", \"kg\").","oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"description":"Archive (true) or unarchive (false) the variant. An archived variant is kept with its history and stays in the product's variants; it is not deleted.","oneOf":[{"type":"boolean"},{"type":"null"}]},"salestaxids":{"description":"Sales tax ids to link to this variant.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"salestaxexclusive":{"description":"Whether the price excludes sales tax.","oneOf":[{"type":"boolean"},{"type":"null"}]},"stocklocationid":{"description":"Default stock location id for this variant; empty inherits the product's. Pass \"$delete\" to clear it.","oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"description":"Business id this variant belongs to; defaults to the authenticated business.","oneOf":[{"type":"string"},{"type":"null"}]},"id":{"description":"Variant id. Present → update that variant; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"productid":{"description":"Parent product id this variant belongs to (see list_products).","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name / description of the variant.","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"Variant description.","oneOf":[{"type":"string"},{"type":"null"}]},"price":{"description":"Selling price per unit, in the record's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"cost":{"description":"Cost price per unit.","oneOf":[{"type":"number"},{"type":"null"}]},"image":{"description":"Variant image URL; pass \"$delete\" to remove the existing image.","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"sku":{"description":"Stock-keeping unit / product code.","oneOf":[{"type":"string"},{"type":"null"}]},"barcode":{"description":"Barcode value for this variant.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"costcurrency":{"description":"ISO 4217 currency code for the cost price.","oneOf":[{"type":"string"},{"type":"null"}]},"units":{"description":"Unit of measure label (e.g. \"each\", \"hour\", \"kg\").","oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"description":"Archive (true) or unarchive (false) the variant. An archived variant is kept with its history and stays in the product's variants; it is not deleted.","oneOf":[{"type":"boolean"},{"type":"null"}]},"salestaxids":{"description":"Sales tax ids to link to this variant.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"salestaxexclusive":{"description":"Whether the price excludes sales tax.","oneOf":[{"type":"boolean"},{"type":"null"}]},"stocklocationid":{"description":"Default stock location id for this variant; empty inherits the product's. Pass \"$delete\" to clear it.","oneOf":[{"type":"string"},{"type":"null"}]},"items":{"description":"Vector of variant objects to create/update in one all-or-nothing batch. Preferred over repeated calls. Each item with an id updates; each without creates.","type":"array","items":{"type":"object","properties":{"businessid":{"description":"Business id this variant belongs to; defaults to the authenticated business.","oneOf":[{"type":"string"},{"type":"null"}]},"id":{"description":"Variant id. Present → update that variant; omit → create a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"productid":{"description":"Parent product id this variant belongs to (see list_products).","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name / description of the variant.","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"Variant description.","oneOf":[{"type":"string"},{"type":"null"}]},"price":{"description":"Selling price per unit, in the record's currency.","oneOf":[{"type":"number"},{"type":"null"}]},"cost":{"description":"Cost price per unit.","oneOf":[{"type":"number"},{"type":"null"}]},"image":{"description":"Variant image URL; pass \"$delete\" to remove the existing image.","oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"sku":{"description":"Stock-keeping unit / product code.","oneOf":[{"type":"string"},{"type":"null"}]},"barcode":{"description":"Barcode value for this variant.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"costcurrency":{"description":"ISO 4217 currency code for the cost price.","oneOf":[{"type":"string"},{"type":"null"}]},"units":{"description":"Unit of measure label (e.g. \"each\", \"hour\", \"kg\").","oneOf":[{"type":"string"},{"type":"null"}]},"archived":{"description":"Archive (true) or unarchive (false) the variant. An archived variant is kept with its history and stays in the product's variants; it is not deleted.","oneOf":[{"type":"boolean"},{"type":"null"}]},"salestaxids":{"description":"Sales tax ids to link to this variant.","oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"salestaxexclusive":{"description":"Whether the price excludes sales tax.","oneOf":[{"type":"boolean"},{"type":"null"}]},"stocklocationid":{"description":"Default stock location id for this variant; empty inherits the product's. Pass \"$delete\" to clear it.","oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create or update an OPTION (size, colour, pack) under an existing product; for the product itself, use save_product. Pass an `id` to update it; omit `id` to create a new one. Returns the new variant id on create. To create/update many at once, send an `items` array — one all-or-nothing transaction with a single ledger recompute; each item with an `id` updates, each without creates.","tags":["variant management"]}},"/api/variant/delete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the variant to delete. Required in practice.","oneOf":[{"type":"string"},{"type":"null"}]},"productid":{"description":"Id of the parent product the variant belongs to (required).","type":"string"}},"required":["token","id","productid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the variant to delete. Required in practice.","oneOf":[{"type":"string"},{"type":"null"}]},"productid":{"description":"Id of the parent product the variant belongs to (required).","type":"string"}},"required":["token","id","productid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the variant to delete. Required in practice.","oneOf":[{"type":"string"},{"type":"null"}]},"productid":{"description":"Id of the parent product the variant belongs to (required).","type":"string"}},"required":["token","id","productid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the variant to delete. Required in practice.","oneOf":[{"type":"string"},{"type":"null"}]},"productid":{"description":"Id of the parent product the variant belongs to (required).","type":"string"}},"required":["token","id","productid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Delete a product variant by id. The variant moves to the bin and restore_deleted brings it back on the same product; to create or edit a variant instead use save_variant.","tags":["variant management"]}},"/api/import/commit/income-and-expenses":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"reference":{"oneOf":[{"type":"string"},{"type":"null"}]},"date":{"oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"included":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"valid":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"baseaccountid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}}},"required":["token","items"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"reference":{"oneOf":[{"type":"string"},{"type":"null"}]},"date":{"oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"included":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"valid":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"baseaccountid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}}},"required":["token","items"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"reference":{"oneOf":[{"type":"string"},{"type":"null"}]},"date":{"oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"included":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"valid":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"baseaccountid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}}},"required":["token","items"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"reference":{"oneOf":[{"type":"string"},{"type":"null"}]},"date":{"oneOf":[{"type":"string"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"included":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"valid":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"baseaccountid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}}},"required":["token","items"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Commit income data","tags":["import helper"]}},"/api/import/commit/products":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"price":{"oneOf":[{"type":"number"},{"type":"null"}]},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"costcurrency":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"sku":{"oneOf":[{"type":"string"},{"type":"null"}]},"salestax":{"oneOf":[{"type":"number"},{"type":"null"}]},"salestaxids":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"salestaxexclusive":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"trackstock":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"quantity":{"oneOf":[{"type":"number"},{"type":"null"}]},"cost":{"oneOf":[{"type":"number"},{"type":"null"}]},"included":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"valid":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"variants":{"oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"price":{"oneOf":[{"type":"number"},{"type":"null"}]},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"costcurrency":{"oneOf":[{"type":"string"},{"type":"null"}]},"sku":{"oneOf":[{"type":"string"},{"type":"null"}]},"salestax":{"oneOf":[{"type":"number"},{"type":"null"}]},"salestaxids":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"salestaxexclusive":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"trackstock":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"quantity":{"oneOf":[{"type":"number"},{"type":"null"}]},"cost":{"oneOf":[{"type":"number"},{"type":"null"}]},"included":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"valid":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]}},"additionalProperties":false}}},"required":["token","items"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"price":{"oneOf":[{"type":"number"},{"type":"null"}]},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"costcurrency":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"sku":{"oneOf":[{"type":"string"},{"type":"null"}]},"salestax":{"oneOf":[{"type":"number"},{"type":"null"}]},"salestaxids":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"salestaxexclusive":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"trackstock":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"quantity":{"oneOf":[{"type":"number"},{"type":"null"}]},"cost":{"oneOf":[{"type":"number"},{"type":"null"}]},"included":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"valid":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"variants":{"oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"price":{"oneOf":[{"type":"number"},{"type":"null"}]},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"costcurrency":{"oneOf":[{"type":"string"},{"type":"null"}]},"sku":{"oneOf":[{"type":"string"},{"type":"null"}]},"salestax":{"oneOf":[{"type":"number"},{"type":"null"}]},"salestaxids":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"salestaxexclusive":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"trackstock":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"quantity":{"oneOf":[{"type":"number"},{"type":"null"}]},"cost":{"oneOf":[{"type":"number"},{"type":"null"}]},"included":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"valid":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]}},"additionalProperties":false}}},"required":["token","items"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"price":{"oneOf":[{"type":"number"},{"type":"null"}]},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"costcurrency":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"sku":{"oneOf":[{"type":"string"},{"type":"null"}]},"salestax":{"oneOf":[{"type":"number"},{"type":"null"}]},"salestaxids":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"salestaxexclusive":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"trackstock":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"quantity":{"oneOf":[{"type":"number"},{"type":"null"}]},"cost":{"oneOf":[{"type":"number"},{"type":"null"}]},"included":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"valid":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"variants":{"oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"price":{"oneOf":[{"type":"number"},{"type":"null"}]},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"costcurrency":{"oneOf":[{"type":"string"},{"type":"null"}]},"sku":{"oneOf":[{"type":"string"},{"type":"null"}]},"salestax":{"oneOf":[{"type":"number"},{"type":"null"}]},"salestaxids":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"salestaxexclusive":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"trackstock":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"quantity":{"oneOf":[{"type":"number"},{"type":"null"}]},"cost":{"oneOf":[{"type":"number"},{"type":"null"}]},"included":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"valid":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]}},"additionalProperties":false}}},"required":["token","items"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"price":{"oneOf":[{"type":"number"},{"type":"null"}]},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"costcurrency":{"oneOf":[{"type":"string"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"sku":{"oneOf":[{"type":"string"},{"type":"null"}]},"salestax":{"oneOf":[{"type":"number"},{"type":"null"}]},"salestaxids":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"salestaxexclusive":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"trackstock":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"quantity":{"oneOf":[{"type":"number"},{"type":"null"}]},"cost":{"oneOf":[{"type":"number"},{"type":"null"}]},"included":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"valid":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"variants":{"oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"price":{"oneOf":[{"type":"number"},{"type":"null"}]},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"costcurrency":{"oneOf":[{"type":"string"},{"type":"null"}]},"sku":{"oneOf":[{"type":"string"},{"type":"null"}]},"salestax":{"oneOf":[{"type":"number"},{"type":"null"}]},"salestaxids":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"salestaxexclusive":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"trackstock":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"quantity":{"oneOf":[{"type":"number"},{"type":"null"}]},"cost":{"oneOf":[{"type":"number"},{"type":"null"}]},"included":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"valid":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]}},"additionalProperties":false}}},"required":["token","items"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Commit imported products and variants","description":"Create products and their variants from prepared import data.","tags":["import helper"]}},"/api/import/commit/document":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"uid":{"type":"string"},"file-id":{"type":"string"},"document-type":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{"type":"object"},{"type":"null"}]},"update-existing-products":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["uid","file-id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"uid":{"type":"string"},"file-id":{"type":"string"},"document-type":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{"type":"object"},{"type":"null"}]},"update-existing-products":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["uid","file-id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"uid":{"type":"string"},"file-id":{"type":"string"},"document-type":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{"type":"object"},{"type":"null"}]},"update-existing-products":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["uid","file-id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"uid":{"type":"string"},"file-id":{"type":"string"},"document-type":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{"type":"object"},{"type":"null"}]},"update-existing-products":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["uid","file-id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Commit extracted document data to create an entity","description":"Takes previously extracted data (from a file in 'extracted' status) and creates the corresponding accounting entity. The frontend can optionally override the document type or send modified data. This is the commit step of the DocuCat prepare/commit flow. update-existing-products is accepted and ignored (PROD-2011): a product row with a SKU always updates the product or variant holding that SKU.","tags":["import helper"]}},"/api/import/documents":{"post":{"requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"token":{"type":"string"},"documents":{"type":"string","format":"binary"},"auto-commit":{"oneOf":[{"type":"string"},{"type":"null"}]},"hint":{"oneOf":[{"type":"string"},{"type":"null"}]},"entity":{"oneOf":[{"type":"string"},{"type":"null"}]},"immediate":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","documents"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Upload documents for automated classification and entity creation","description":"Upload one or more documents (receipts, invoices, trial balances, etc.) as multipart files. Each document is stored in Firebase Storage and queued for asynchronous processing by DocuCat, which classifies the document type and creates the corresponding accounting entity.","tags":["import helper"]}},"/api/migration/session":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"source":{"oneOf":[{"type":"string"},{"type":"null"}]},"sourcesummary":{"oneOf":[{"type":"object"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"source":{"oneOf":[{"type":"string"},{"type":"null"}]},"sourcesummary":{"oneOf":[{"type":"object"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"source":{"oneOf":[{"type":"string"},{"type":"null"}]},"sourcesummary":{"oneOf":[{"type":"object"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"source":{"oneOf":[{"type":"string"},{"type":"null"}]},"sourcesummary":{"oneOf":[{"type":"object"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create a migration staging session","description":"Start a guided-import session for the caller, capturing the per-stage source-summary used by the later Health Check. Does not touch the live ledger.","tags":["migration"]}},"/api/migration/stage":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"session":{"type":"string"},"stage":{"type":"string"},"rows":{"type":"array","items":{"type":"object"}}},"required":["token","session","stage","rows"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"session":{"type":"string"},"stage":{"type":"string"},"rows":{"type":"array","items":{"type":"object"}}},"required":["token","session","stage","rows"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"session":{"type":"string"},"stage":{"type":"string"},"rows":{"type":"array","items":{"type":"object"}}},"required":["token","session","stage","rows"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"session":{"type":"string"},"stage":{"type":"string"},"rows":{"type":"array","items":{"type":"object"}}},"required":["token","session","stage","rows"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Stage rows for a (session, stage)","description":"Write extracted rows into the neutral staging store for a stage. Idempotent (re-staging replaces the stage's prior rows). Live books untouched.","tags":["migration"]}},"/api/migration/preview":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"session":{"type":"string"},"stage":{"type":"string"},"sample-size":{"oneOf":[{"type":"integer"},{"type":"null"}]}},"required":["token","session","stage"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"session":{"type":"string"},"stage":{"type":"string"},"sample-size":{"oneOf":[{"type":"integer"},{"type":"null"}]}},"required":["token","session","stage"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"session":{"type":"string"},"stage":{"type":"string"},"sample-size":{"oneOf":[{"type":"integer"},{"type":"null"}]}},"required":["token","session","stage"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"session":{"type":"string"},"stage":{"type":"string"},"sample-size":{"oneOf":[{"type":"integer"},{"type":"null"}]}},"required":["token","session","stage"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Preview staged rows (Sample Set + Problem Set + Health Check)","description":"Return a random Sample Set, the Problem Set (flagged rows), and the Health Check (staged totals vs the captured source totals) for a staged stage.","tags":["migration"]}},"/api/migration/discard":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"session":{"type":"string"},"stage":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","session"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"session":{"type":"string"},"stage":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","session"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"session":{"type":"string"},"stage":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","session"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"session":{"type":"string"},"stage":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","session"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Discard staged rows (pre-commit panic button)","description":"Soft-delete a session's staged rows (one stage, or all) — clears the draft without affecting live data.","tags":["migration"]}},"/api/migration/commit":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"session":{"type":"string"},"stage":{"type":"string"}},"required":["token","session","stage"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"session":{"type":"string"},"stage":{"type":"string"}},"required":["token","session","stage"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"session":{"type":"string"},"stage":{"type":"string"}},"required":["token","session","stage"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"session":{"type":"string"},"stage":{"type":"string"}},"required":["token","session","stage"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Apply one staged stage to the live books","description":"Commit a verified stage in one transaction. Refused unless every earlier stage is committed, no staged row is flagged, and staged totals match the source totals to the cent.","tags":["migration"]}},"/api/docucat/process":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"uid":{"type":"string"},"file-id":{"type":"string"},"file-name":{"oneOf":[{"type":"string"},{"type":"null"}]},"file-type":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"appid":{"oneOf":[{"type":"string"},{"type":"null"}]},"event":{"oneOf":[{"type":"string"},{"type":"null"}]},"file-hash":{"oneOf":[{"type":"string"},{"type":"null"}]},"idempotency":{"oneOf":[{"type":"string"},{"type":"null"}]},"timestamp":{"oneOf":[{"type":"number"},{"type":"null"}]},"uri":{"oneOf":[{"type":"string"},{"type":"null"}]},"auto-commit":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"hint":{"oneOf":[{"type":"string"},{"type":"null"}]},"entity":{"oneOf":[{"type":"string"},{"type":"null"}]},"system-prompt":{"oneOf":[{"type":"string"},{"type":"null"}]},"output-config":{"oneOf":[{"type":"object"},{"type":"null"}]}},"required":["uid","file-id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"uid":{"type":"string"},"file-id":{"type":"string"},"file-name":{"oneOf":[{"type":"string"},{"type":"null"}]},"file-type":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"appid":{"oneOf":[{"type":"string"},{"type":"null"}]},"event":{"oneOf":[{"type":"string"},{"type":"null"}]},"file-hash":{"oneOf":[{"type":"string"},{"type":"null"}]},"idempotency":{"oneOf":[{"type":"string"},{"type":"null"}]},"timestamp":{"oneOf":[{"type":"number"},{"type":"null"}]},"uri":{"oneOf":[{"type":"string"},{"type":"null"}]},"auto-commit":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"hint":{"oneOf":[{"type":"string"},{"type":"null"}]},"entity":{"oneOf":[{"type":"string"},{"type":"null"}]},"system-prompt":{"oneOf":[{"type":"string"},{"type":"null"}]},"output-config":{"oneOf":[{"type":"object"},{"type":"null"}]}},"required":["uid","file-id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"uid":{"type":"string"},"file-id":{"type":"string"},"file-name":{"oneOf":[{"type":"string"},{"type":"null"}]},"file-type":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"appid":{"oneOf":[{"type":"string"},{"type":"null"}]},"event":{"oneOf":[{"type":"string"},{"type":"null"}]},"file-hash":{"oneOf":[{"type":"string"},{"type":"null"}]},"idempotency":{"oneOf":[{"type":"string"},{"type":"null"}]},"timestamp":{"oneOf":[{"type":"number"},{"type":"null"}]},"uri":{"oneOf":[{"type":"string"},{"type":"null"}]},"auto-commit":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"hint":{"oneOf":[{"type":"string"},{"type":"null"}]},"entity":{"oneOf":[{"type":"string"},{"type":"null"}]},"system-prompt":{"oneOf":[{"type":"string"},{"type":"null"}]},"output-config":{"oneOf":[{"type":"object"},{"type":"null"}]}},"required":["uid","file-id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"uid":{"type":"string"},"file-id":{"type":"string"},"file-name":{"oneOf":[{"type":"string"},{"type":"null"}]},"file-type":{"oneOf":[{"type":"string"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]},"appid":{"oneOf":[{"type":"string"},{"type":"null"}]},"event":{"oneOf":[{"type":"string"},{"type":"null"}]},"file-hash":{"oneOf":[{"type":"string"},{"type":"null"}]},"idempotency":{"oneOf":[{"type":"string"},{"type":"null"}]},"timestamp":{"oneOf":[{"type":"number"},{"type":"null"}]},"uri":{"oneOf":[{"type":"string"},{"type":"null"}]},"auto-commit":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"hint":{"oneOf":[{"type":"string"},{"type":"null"}]},"entity":{"oneOf":[{"type":"string"},{"type":"null"}]},"system-prompt":{"oneOf":[{"type":"string"},{"type":"null"}]},"output-config":{"oneOf":[{"type":"object"},{"type":"null"}]}},"required":["uid","file-id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Process a single document through DocuCat","description":"Classifies an uploaded document, extracts structured data, validates against malli schemas. If auto-commit is true (default), creates the entity immediately. If false, stores extracted data for frontend review. Typically invoked by the SQS event consumer, not directly by clients.","tags":["document processing"]}},"/api/docucat/commit":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"uid":{"type":"string"},"file-id":{"type":"string"},"document-type":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{"type":"object"},{"type":"null"}]},"update-existing-products":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["uid","file-id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"uid":{"type":"string"},"file-id":{"type":"string"},"document-type":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{"type":"object"},{"type":"null"}]},"update-existing-products":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["uid","file-id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"uid":{"type":"string"},"file-id":{"type":"string"},"document-type":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{"type":"object"},{"type":"null"}]},"update-existing-products":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["uid","file-id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"uid":{"type":"string"},"file-id":{"type":"string"},"document-type":{"oneOf":[{"type":"string"},{"type":"null"}]},"data":{"oneOf":[{"type":"object"},{"type":"null"}]},"update-existing-products":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["uid","file-id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Commit extracted document data to create an entity","description":"Takes previously extracted data (from a file in 'extracted' status) and creates the corresponding accounting entity. The frontend can optionally override the document type or send modified data. update-existing-products is accepted and ignored (PROD-2011): a product row with a SKU always updates the product or variant holding that SKU.","tags":["document processing"]}},"/api/docucat/trial-balance/preview":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"file-id":{"type":"string"},"data":{"oneOf":[{"type":"object"},{"type":"null"}]}},"required":["file-id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"file-id":{"type":"string"},"data":{"oneOf":[{"type":"object"},{"type":"null"}]}},"required":["file-id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"file-id":{"type":"string"},"data":{"oneOf":[{"type":"object"},{"type":"null"}]}},"required":["file-id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"file-id":{"type":"string"},"data":{"oneOf":[{"type":"object"},{"type":"null"}]}},"required":["file-id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Preview a trial balance import before committing it","description":"For a file in 'extracted' status holding a trial balance: the accounts each line matches, the accounts the commit would create with their types, the lines waiting on the user's choice, and the debit and credit totals. Sends the stored extraction unless data is given. Writes nothing. Commit with data.decisions to settle the open lines.","tags":["document processing"]}},"/api/contract/create":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"type":{"type":"string","enum":["invoice","quote","credit-note","recurring","purchase-order","bill","debit-note","grn"]},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"contact":{"oneOf":[{"type":"string"},{"type":"null"}]},"supplier":{"oneOf":[{"type":"string"},{"type":"null"}]},"client":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"number":{"oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"date":{"oneOf":[{"type":"string"},{"type":"null"}]},"duedate":{"oneOf":[{"type":"string"},{"type":"null"}]},"message":{"oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Base currency per ONE unit of the document's currency, as booked (20.0480 rand per euro). Omit to stamp the day's rate.","oneOf":[{"type":"number"},{"type":"null"}]},"shipping":{"oneOf":[{"type":"number"},{"type":"null"}]},"showdiscount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showshipping":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showvat":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showdeposit":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"discountamount":{"oneOf":[{"type":"number"},{"type":"null"}]},"discountpercent":{"oneOf":[{"type":"number"},{"type":"null"}]},"discountuseamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"depositamount":{"oneOf":[{"type":"number"},{"type":"null"}]},"depositpercent":{"oneOf":[{"type":"number"},{"type":"null"}]},"deposituseamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"paymentnotes":{"oneOf":[{"type":"string"},{"type":"null"}]},"parent":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountpayment":{"oneOf":[{"type":"number"},{"type":"null"}]},"baseaccountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"showpaymentlink":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showbank":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"invoicebankid":{"description":"PROD-2443. :bankaccount/id of one of the business's own bank accounts to show on this document instead of the default invoice bank. \"$delete\" clears it back to the default; null or omitted leaves it unchanged. An id the business does not own is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"design":{"description":"Id of one of the business's own document designs to print this document with. \"$delete\" clears it back to the business default; null or omitted leaves it unchanged. An unknown, archived or foreign id is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"designpinnedat":{"description":"Pins the document to its design as it stood at this ISO instant, zone included (2026-11-27T09:00:00Z). \"$delete\" unpins. A design change unpins unless the same save pins again.","oneOf":[{"type":"string"},{"type":"null"}]},"blocks":{"description":"The document's own rich-text blocks: a JSON object {blockid: richtext}, or its JSON text, at most 64 KB. \"$delete\" clears them.","oneOf":[{"anyOf":[{"type":"string"},{"type":"object"}]},{"type":"null"}]}},"required":["token","type"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"type":{"type":"string","enum":["invoice","quote","credit-note","recurring","purchase-order","bill","debit-note","grn"]},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"contact":{"oneOf":[{"type":"string"},{"type":"null"}]},"supplier":{"oneOf":[{"type":"string"},{"type":"null"}]},"client":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"number":{"oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"date":{"oneOf":[{"type":"string"},{"type":"null"}]},"duedate":{"oneOf":[{"type":"string"},{"type":"null"}]},"message":{"oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Base currency per ONE unit of the document's currency, as booked (20.0480 rand per euro). Omit to stamp the day's rate.","oneOf":[{"type":"number"},{"type":"null"}]},"shipping":{"oneOf":[{"type":"number"},{"type":"null"}]},"showdiscount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showshipping":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showvat":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showdeposit":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"discountamount":{"oneOf":[{"type":"number"},{"type":"null"}]},"discountpercent":{"oneOf":[{"type":"number"},{"type":"null"}]},"discountuseamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"depositamount":{"oneOf":[{"type":"number"},{"type":"null"}]},"depositpercent":{"oneOf":[{"type":"number"},{"type":"null"}]},"deposituseamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"paymentnotes":{"oneOf":[{"type":"string"},{"type":"null"}]},"parent":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountpayment":{"oneOf":[{"type":"number"},{"type":"null"}]},"baseaccountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"showpaymentlink":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showbank":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"invoicebankid":{"description":"PROD-2443. :bankaccount/id of one of the business's own bank accounts to show on this document instead of the default invoice bank. \"$delete\" clears it back to the default; null or omitted leaves it unchanged. An id the business does not own is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"design":{"description":"Id of one of the business's own document designs to print this document with. \"$delete\" clears it back to the business default; null or omitted leaves it unchanged. An unknown, archived or foreign id is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"designpinnedat":{"description":"Pins the document to its design as it stood at this ISO instant, zone included (2026-11-27T09:00:00Z). \"$delete\" unpins. A design change unpins unless the same save pins again.","oneOf":[{"type":"string"},{"type":"null"}]},"blocks":{"description":"The document's own rich-text blocks: a JSON object {blockid: richtext}, or its JSON text, at most 64 KB. \"$delete\" clears them.","oneOf":[{"anyOf":[{"type":"string"},{"type":"object"}]},{"type":"null"}]}},"required":["token","type"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"type":{"type":"string","enum":["invoice","quote","credit-note","recurring","purchase-order","bill","debit-note","grn"]},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"contact":{"oneOf":[{"type":"string"},{"type":"null"}]},"supplier":{"oneOf":[{"type":"string"},{"type":"null"}]},"client":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"number":{"oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"date":{"oneOf":[{"type":"string"},{"type":"null"}]},"duedate":{"oneOf":[{"type":"string"},{"type":"null"}]},"message":{"oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Base currency per ONE unit of the document's currency, as booked (20.0480 rand per euro). Omit to stamp the day's rate.","oneOf":[{"type":"number"},{"type":"null"}]},"shipping":{"oneOf":[{"type":"number"},{"type":"null"}]},"showdiscount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showshipping":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showvat":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showdeposit":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"discountamount":{"oneOf":[{"type":"number"},{"type":"null"}]},"discountpercent":{"oneOf":[{"type":"number"},{"type":"null"}]},"discountuseamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"depositamount":{"oneOf":[{"type":"number"},{"type":"null"}]},"depositpercent":{"oneOf":[{"type":"number"},{"type":"null"}]},"deposituseamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"paymentnotes":{"oneOf":[{"type":"string"},{"type":"null"}]},"parent":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountpayment":{"oneOf":[{"type":"number"},{"type":"null"}]},"baseaccountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"showpaymentlink":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showbank":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"invoicebankid":{"description":"PROD-2443. :bankaccount/id of one of the business's own bank accounts to show on this document instead of the default invoice bank. \"$delete\" clears it back to the default; null or omitted leaves it unchanged. An id the business does not own is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"design":{"description":"Id of one of the business's own document designs to print this document with. \"$delete\" clears it back to the business default; null or omitted leaves it unchanged. An unknown, archived or foreign id is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"designpinnedat":{"description":"Pins the document to its design as it stood at this ISO instant, zone included (2026-11-27T09:00:00Z). \"$delete\" unpins. A design change unpins unless the same save pins again.","oneOf":[{"type":"string"},{"type":"null"}]},"blocks":{"description":"The document's own rich-text blocks: a JSON object {blockid: richtext}, or its JSON text, at most 64 KB. \"$delete\" clears them.","oneOf":[{"anyOf":[{"type":"string"},{"type":"object"}]},{"type":"null"}]}},"required":["token","type"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"type":{"type":"string","enum":["invoice","quote","credit-note","recurring","purchase-order","bill","debit-note","grn"]},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"contact":{"oneOf":[{"type":"string"},{"type":"null"}]},"supplier":{"oneOf":[{"type":"string"},{"type":"null"}]},"client":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"number":{"oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"date":{"oneOf":[{"type":"string"},{"type":"null"}]},"duedate":{"oneOf":[{"type":"string"},{"type":"null"}]},"message":{"oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Base currency per ONE unit of the document's currency, as booked (20.0480 rand per euro). Omit to stamp the day's rate.","oneOf":[{"type":"number"},{"type":"null"}]},"shipping":{"oneOf":[{"type":"number"},{"type":"null"}]},"showdiscount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showshipping":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showvat":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showdeposit":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"discountamount":{"oneOf":[{"type":"number"},{"type":"null"}]},"discountpercent":{"oneOf":[{"type":"number"},{"type":"null"}]},"discountuseamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"depositamount":{"oneOf":[{"type":"number"},{"type":"null"}]},"depositpercent":{"oneOf":[{"type":"number"},{"type":"null"}]},"deposituseamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"paymentnotes":{"oneOf":[{"type":"string"},{"type":"null"}]},"parent":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountpayment":{"oneOf":[{"type":"number"},{"type":"null"}]},"baseaccountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"showpaymentlink":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showbank":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"invoicebankid":{"description":"PROD-2443. :bankaccount/id of one of the business's own bank accounts to show on this document instead of the default invoice bank. \"$delete\" clears it back to the default; null or omitted leaves it unchanged. An id the business does not own is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"design":{"description":"Id of one of the business's own document designs to print this document with. \"$delete\" clears it back to the business default; null or omitted leaves it unchanged. An unknown, archived or foreign id is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"designpinnedat":{"description":"Pins the document to its design as it stood at this ISO instant, zone included (2026-11-27T09:00:00Z). \"$delete\" unpins. A design change unpins unless the same save pins again.","oneOf":[{"type":"string"},{"type":"null"}]},"blocks":{"description":"The document's own rich-text blocks: a JSON object {blockid: richtext}, or its JSON text, at most 64 KB. \"$delete\" clears them.","oneOf":[{"anyOf":[{"type":"string"},{"type":"object"}]},{"type":"null"}]}},"required":["token","type"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create a document (invoice, quote, credit note, purchase order, bill, etc.) of the given type. Returns the new document id.","tags":["contract management"]}},"/api/contract/get":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Document id.","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Document id.","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Document id.","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Document id.","type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Get one document by id, with totals, status, line items, contact and money direction. Accepts any document id this business owns — including the invoice, quote and credit-note ids returned by list_documents and list_invoices. Find the id yourself with list_documents (query by number or contact); never ask the user for an id. A document's totals are its header $total and $vat; a line's $linetotal is before VAT and before any header discount, and its $salestaxes carry its tax, so never add lines up to quote a document's total or VAT.","tags":["contract management"]}},"/api/contract/view/{uid}/{id}":{"get":{"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"View contract with business details","tags":["contract management"]}},"/api/contract/update":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"contact":{"oneOf":[{"type":"string"},{"type":"null"}]},"supplier":{"oneOf":[{"type":"string"},{"type":"null"}]},"client":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"number":{"oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"date":{"oneOf":[{"type":"string"},{"type":"null"}]},"duedate":{"oneOf":[{"type":"string"},{"type":"null"}]},"message":{"oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Base currency per ONE unit of the document's currency, as booked (20.0480 rand per euro). Omit to stamp the day's rate.","oneOf":[{"type":"number"},{"type":"null"}]},"shipping":{"oneOf":[{"type":"number"},{"type":"null"}]},"showdiscount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showshipping":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showvat":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showdeposit":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"discountamount":{"oneOf":[{"type":"number"},{"type":"null"}]},"discountpercent":{"oneOf":[{"type":"number"},{"type":"null"}]},"discountuseamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"depositamount":{"oneOf":[{"type":"number"},{"type":"null"}]},"depositpercent":{"oneOf":[{"type":"number"},{"type":"null"}]},"deposituseamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"paymentnotes":{"oneOf":[{"type":"string"},{"type":"null"}]},"sent":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"accepted":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"accepteddate":{"oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"settled":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"locked":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"accountpayment":{"oneOf":[{"type":"number"},{"type":"null"}]},"baseaccountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"showpaymentlink":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showbank":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"invoicebankid":{"description":"PROD-2443. :bankaccount/id of one of the business's own bank accounts to show on this document instead of the default invoice bank. \"$delete\" clears it back to the default; null or omitted leaves it unchanged. An id the business does not own is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"design":{"description":"Id of one of the business's own document designs to print this document with. \"$delete\" clears it back to the business default; null or omitted leaves it unchanged. An unknown, archived or foreign id is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"designpinnedat":{"description":"Pins the document to its design as it stood at this ISO instant, zone included (2026-11-27T09:00:00Z). \"$delete\" unpins. A design change unpins unless the same save pins again.","oneOf":[{"type":"string"},{"type":"null"}]},"blocks":{"description":"The document's own rich-text blocks: a JSON object {blockid: richtext}, or its JSON text, at most 64 KB. \"$delete\" clears them.","oneOf":[{"anyOf":[{"type":"string"},{"type":"object"}]},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"contact":{"oneOf":[{"type":"string"},{"type":"null"}]},"supplier":{"oneOf":[{"type":"string"},{"type":"null"}]},"client":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"number":{"oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"date":{"oneOf":[{"type":"string"},{"type":"null"}]},"duedate":{"oneOf":[{"type":"string"},{"type":"null"}]},"message":{"oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Base currency per ONE unit of the document's currency, as booked (20.0480 rand per euro). Omit to stamp the day's rate.","oneOf":[{"type":"number"},{"type":"null"}]},"shipping":{"oneOf":[{"type":"number"},{"type":"null"}]},"showdiscount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showshipping":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showvat":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showdeposit":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"discountamount":{"oneOf":[{"type":"number"},{"type":"null"}]},"discountpercent":{"oneOf":[{"type":"number"},{"type":"null"}]},"discountuseamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"depositamount":{"oneOf":[{"type":"number"},{"type":"null"}]},"depositpercent":{"oneOf":[{"type":"number"},{"type":"null"}]},"deposituseamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"paymentnotes":{"oneOf":[{"type":"string"},{"type":"null"}]},"sent":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"accepted":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"accepteddate":{"oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"settled":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"locked":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"accountpayment":{"oneOf":[{"type":"number"},{"type":"null"}]},"baseaccountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"showpaymentlink":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showbank":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"invoicebankid":{"description":"PROD-2443. :bankaccount/id of one of the business's own bank accounts to show on this document instead of the default invoice bank. \"$delete\" clears it back to the default; null or omitted leaves it unchanged. An id the business does not own is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"design":{"description":"Id of one of the business's own document designs to print this document with. \"$delete\" clears it back to the business default; null or omitted leaves it unchanged. An unknown, archived or foreign id is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"designpinnedat":{"description":"Pins the document to its design as it stood at this ISO instant, zone included (2026-11-27T09:00:00Z). \"$delete\" unpins. A design change unpins unless the same save pins again.","oneOf":[{"type":"string"},{"type":"null"}]},"blocks":{"description":"The document's own rich-text blocks: a JSON object {blockid: richtext}, or its JSON text, at most 64 KB. \"$delete\" clears them.","oneOf":[{"anyOf":[{"type":"string"},{"type":"object"}]},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"contact":{"oneOf":[{"type":"string"},{"type":"null"}]},"supplier":{"oneOf":[{"type":"string"},{"type":"null"}]},"client":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"number":{"oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"date":{"oneOf":[{"type":"string"},{"type":"null"}]},"duedate":{"oneOf":[{"type":"string"},{"type":"null"}]},"message":{"oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Base currency per ONE unit of the document's currency, as booked (20.0480 rand per euro). Omit to stamp the day's rate.","oneOf":[{"type":"number"},{"type":"null"}]},"shipping":{"oneOf":[{"type":"number"},{"type":"null"}]},"showdiscount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showshipping":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showvat":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showdeposit":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"discountamount":{"oneOf":[{"type":"number"},{"type":"null"}]},"discountpercent":{"oneOf":[{"type":"number"},{"type":"null"}]},"discountuseamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"depositamount":{"oneOf":[{"type":"number"},{"type":"null"}]},"depositpercent":{"oneOf":[{"type":"number"},{"type":"null"}]},"deposituseamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"paymentnotes":{"oneOf":[{"type":"string"},{"type":"null"}]},"sent":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"accepted":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"accepteddate":{"oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"settled":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"locked":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"accountpayment":{"oneOf":[{"type":"number"},{"type":"null"}]},"baseaccountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"showpaymentlink":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showbank":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"invoicebankid":{"description":"PROD-2443. :bankaccount/id of one of the business's own bank accounts to show on this document instead of the default invoice bank. \"$delete\" clears it back to the default; null or omitted leaves it unchanged. An id the business does not own is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"design":{"description":"Id of one of the business's own document designs to print this document with. \"$delete\" clears it back to the business default; null or omitted leaves it unchanged. An unknown, archived or foreign id is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"designpinnedat":{"description":"Pins the document to its design as it stood at this ISO instant, zone included (2026-11-27T09:00:00Z). \"$delete\" unpins. A design change unpins unless the same save pins again.","oneOf":[{"type":"string"},{"type":"null"}]},"blocks":{"description":"The document's own rich-text blocks: a JSON object {blockid: richtext}, or its JSON text, at most 64 KB. \"$delete\" clears them.","oneOf":[{"anyOf":[{"type":"string"},{"type":"object"}]},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"contact":{"oneOf":[{"type":"string"},{"type":"null"}]},"supplier":{"oneOf":[{"type":"string"},{"type":"null"}]},"client":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]},"number":{"oneOf":[{"type":"string"},{"type":"null"}]},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"date":{"oneOf":[{"type":"string"},{"type":"null"}]},"duedate":{"oneOf":[{"type":"string"},{"type":"null"}]},"message":{"oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Base currency per ONE unit of the document's currency, as booked (20.0480 rand per euro). Omit to stamp the day's rate.","oneOf":[{"type":"number"},{"type":"null"}]},"shipping":{"oneOf":[{"type":"number"},{"type":"null"}]},"showdiscount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showshipping":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showvat":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showdeposit":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"discountamount":{"oneOf":[{"type":"number"},{"type":"null"}]},"discountpercent":{"oneOf":[{"type":"number"},{"type":"null"}]},"discountuseamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"depositamount":{"oneOf":[{"type":"number"},{"type":"null"}]},"depositpercent":{"oneOf":[{"type":"number"},{"type":"null"}]},"deposituseamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]},"paymentnotes":{"oneOf":[{"type":"string"},{"type":"null"}]},"sent":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"accepted":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"accepteddate":{"oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"settled":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"locked":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"accountpayment":{"oneOf":[{"type":"number"},{"type":"null"}]},"baseaccountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"oneOf":[{"type":"string"},{"type":"null"}]},"showpaymentlink":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"showbank":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"invoicebankid":{"description":"PROD-2443. :bankaccount/id of one of the business's own bank accounts to show on this document instead of the default invoice bank. \"$delete\" clears it back to the default; null or omitted leaves it unchanged. An id the business does not own is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"design":{"description":"Id of one of the business's own document designs to print this document with. \"$delete\" clears it back to the business default; null or omitted leaves it unchanged. An unknown, archived or foreign id is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"designpinnedat":{"description":"Pins the document to its design as it stood at this ISO instant, zone included (2026-11-27T09:00:00Z). \"$delete\" unpins. A design change unpins unless the same save pins again.","oneOf":[{"type":"string"},{"type":"null"}]},"blocks":{"description":"The document's own rich-text blocks: a JSON object {blockid: richtext}, or its JSON text, at most 64 KB. \"$delete\" clears them.","oneOf":[{"anyOf":[{"type":"string"},{"type":"object"}]},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Update an existing document by id (dates, contact, totals, sent/settled flags, etc.). Returns the updated document.","tags":["contract management"]}},"/api/contract/save":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Document id. Present → update that document; omit → create a new one (must include type).","oneOf":[{"type":"string"},{"type":"null"}]},"type":{"oneOf":[{"type":"string","enum":["invoice","quote","credit-note","recurring","purchase-order","bill","debit-note","grn"]},{"type":"null"}]},"contact":{"description":"Contact id, or an exact client/supplier name to resolve (client for money-in document types, supplier for money-out; see list_clients / list_suppliers).","oneOf":[{"type":"string"},{"type":"null"}]},"supplier":{"description":"Supplier id, or an exact supplier name to resolve (see list_suppliers).","oneOf":[{"type":"string"},{"type":"null"}]},"client":{"description":"Client id, or an exact client name to resolve (see list_clients).","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name / title of the document.","oneOf":[{"type":"string"},{"type":"null"}]},"number":{"description":"Document number; auto-generated if omitted.","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"Free-text description of the document.","oneOf":[{"type":"string"},{"type":"null"}]},"date":{"description":"Document date (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"duedate":{"description":"Payment due date (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"message":{"description":"Message shown to the recipient on the document.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Base currency per ONE unit of the document's currency, as booked (20.0480 rand per euro). Omit to stamp the day's rate.","oneOf":[{"type":"number"},{"type":"null"}]},"shipping":{"description":"Shipping amount added to the document total.","oneOf":[{"type":"number"},{"type":"null"}]},"showdiscount":{"description":"Whether to display the discount line on the document.","oneOf":[{"type":"boolean"},{"type":"null"}]},"showshipping":{"description":"Whether to display the shipping line on the document.","oneOf":[{"type":"boolean"},{"type":"null"}]},"showvat":{"description":"Whether to display the VAT/sales-tax line on the document.","oneOf":[{"type":"boolean"},{"type":"null"}]},"showdeposit":{"description":"Whether to display the deposit line on the document.","oneOf":[{"type":"boolean"},{"type":"null"}]},"discountamount":{"description":"Explicit discount amount; used instead of the percentage when discountuseamount is true.","oneOf":[{"type":"number"},{"type":"null"}]},"discountpercent":{"description":"Discount as a percentage of the subtotal.","oneOf":[{"type":"number"},{"type":"null"}]},"discountuseamount":{"description":"When true, use discountamount instead of the percentage.","oneOf":[{"type":"boolean"},{"type":"null"}]},"depositamount":{"description":"Explicit deposit amount; used instead of the percentage when deposituseamount is true.","oneOf":[{"type":"number"},{"type":"null"}]},"depositpercent":{"description":"Deposit as a percentage of the total.","oneOf":[{"type":"number"},{"type":"null"}]},"deposituseamount":{"description":"When true, use depositamount instead of the percentage.","oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"paymentnotes":{"description":"Free-text payment instructions shown on the document.","oneOf":[{"type":"string"},{"type":"null"}]},"parent":{"description":"Id of the parent document this one derives from (e.g. the invoice a credit note relates to).","oneOf":[{"type":"string"},{"type":"null"}]},"sent":{"description":"Whether the document has been sent to the recipient.","oneOf":[{"type":"boolean"},{"type":"null"}]},"accepted":{"description":"Whether the recipient has accepted the document (e.g. a quote).","oneOf":[{"type":"boolean"},{"type":"null"}]},"accepteddate":{"description":"Date the document was accepted (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"settled":{"description":"Set true to settle: closes the balance left after the recorded payments and marks the document settled. Only for a small gap once the payment is recorded: an exchange-rate difference, a bank fee or rounding (the FX difference itself, or a few percent of the total at most); the gap posts to Settlements, or to Foreign Exchange for an FX difference. Before you set it, state the gap amount and where it posts, and ask the user to confirm, even when they already said 'settle it' or 'mark it paid'. No payment recorded yet: use record_document_payment first. Refused while an AI-matched payment is unconfirmed. Not a write-off: a large short payment, or any part the customer will not pay, is never settled; bad debt is written off with write_off_document, which also reverses the VAT.","oneOf":[{"type":"boolean"},{"type":"null"}]},"settledaccountid":{"description":"Where the settle gap posts, when settling an existing document: a Chart of Accounts account name or id (see list_accounts). Omit to post to Settlements, or to Foreign Exchange for a foreign-currency document.","oneOf":[{"type":"string"},{"type":"null"}]},"settleddate":{"description":"Date the settle entry posts, when settling an existing document (ISO 8601, YYYY-MM-DD). Omit for the default date.","oneOf":[{"type":"string"},{"type":"null"}]},"locked":{"description":"Whether the document is locked against further edits.","oneOf":[{"type":"boolean"},{"type":"null"}]},"accountpayment":{"description":"Amount paid against the document at save time.","oneOf":[{"type":"number"},{"type":"null"}]},"baseaccountid":{"description":"Base/control account id override; rarely needed — defaults from the category.","oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"Bank/ledger account id the payment moved through (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"showpaymentlink":{"description":"Whether to include an online payment link on the document.","oneOf":[{"type":"boolean"},{"type":"null"}]},"showbank":{"description":"Whether to display the business's banking details on the document. Defaults to true on create; only shown to recipients on money-in documents (invoices, quotes).","oneOf":[{"type":"boolean"},{"type":"null"}]},"invoicebankid":{"description":"PROD-2443. :bankaccount/id of one of the business's own bank accounts to show on this document instead of the default invoice bank. \"$delete\" clears it back to the default; null or omitted leaves it unchanged. An id the business does not own is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"design":{"description":"Id of one of the business's own document designs to print this document with. \"$delete\" clears it back to the business default; null or omitted leaves it unchanged. An unknown, archived or foreign id is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"designpinnedat":{"description":"Pins the document to its design as it stood at this ISO instant, zone included (2026-11-27T09:00:00Z). \"$delete\" unpins. A design change unpins unless the same save pins again.","oneOf":[{"type":"string"},{"type":"null"}]},"blocks":{"description":"The document's own rich-text blocks: a JSON object {blockid: richtext}, or its JSON text, at most 64 KB. \"$delete\" clears them.","oneOf":[{"anyOf":[{"type":"string"},{"type":"object"}]},{"type":"null"}]},"items":{"description":"Vector of document objects to create/update in one all-or-nothing batch. Preferred over repeated calls. Each item with an id updates; each without creates and must include type.","type":"array","items":{"type":"object","properties":{"id":{"description":"Document id. Present → update that document; omit → create a new one (must include type).","oneOf":[{"type":"string"},{"type":"null"}]},"type":{"oneOf":[{"type":"string","enum":["invoice","quote","credit-note","recurring","purchase-order","bill","debit-note","grn"]},{"type":"null"}]},"contact":{"description":"Contact id, or an exact client/supplier name to resolve (client for money-in document types, supplier for money-out; see list_clients / list_suppliers).","oneOf":[{"type":"string"},{"type":"null"}]},"supplier":{"description":"Supplier id, or an exact supplier name to resolve (see list_suppliers).","oneOf":[{"type":"string"},{"type":"null"}]},"client":{"description":"Client id, or an exact client name to resolve (see list_clients).","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name / title of the document.","oneOf":[{"type":"string"},{"type":"null"}]},"number":{"description":"Document number; auto-generated if omitted.","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"Free-text description of the document.","oneOf":[{"type":"string"},{"type":"null"}]},"date":{"description":"Document date (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"duedate":{"description":"Payment due date (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"message":{"description":"Message shown to the recipient on the document.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Base currency per ONE unit of the document's currency, as booked (20.0480 rand per euro). Omit to stamp the day's rate.","oneOf":[{"type":"number"},{"type":"null"}]},"shipping":{"description":"Shipping amount added to the document total.","oneOf":[{"type":"number"},{"type":"null"}]},"showdiscount":{"description":"Whether to display the discount line on the document.","oneOf":[{"type":"boolean"},{"type":"null"}]},"showshipping":{"description":"Whether to display the shipping line on the document.","oneOf":[{"type":"boolean"},{"type":"null"}]},"showvat":{"description":"Whether to display the VAT/sales-tax line on the document.","oneOf":[{"type":"boolean"},{"type":"null"}]},"showdeposit":{"description":"Whether to display the deposit line on the document.","oneOf":[{"type":"boolean"},{"type":"null"}]},"discountamount":{"description":"Explicit discount amount; used instead of the percentage when discountuseamount is true.","oneOf":[{"type":"number"},{"type":"null"}]},"discountpercent":{"description":"Discount as a percentage of the subtotal.","oneOf":[{"type":"number"},{"type":"null"}]},"discountuseamount":{"description":"When true, use discountamount instead of the percentage.","oneOf":[{"type":"boolean"},{"type":"null"}]},"depositamount":{"description":"Explicit deposit amount; used instead of the percentage when deposituseamount is true.","oneOf":[{"type":"number"},{"type":"null"}]},"depositpercent":{"description":"Deposit as a percentage of the total.","oneOf":[{"type":"number"},{"type":"null"}]},"deposituseamount":{"description":"When true, use depositamount instead of the percentage.","oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"paymentnotes":{"description":"Free-text payment instructions shown on the document.","oneOf":[{"type":"string"},{"type":"null"}]},"parent":{"description":"Id of the parent document this one derives from (e.g. the invoice a credit note relates to).","oneOf":[{"type":"string"},{"type":"null"}]},"sent":{"description":"Whether the document has been sent to the recipient.","oneOf":[{"type":"boolean"},{"type":"null"}]},"accepted":{"description":"Whether the recipient has accepted the document (e.g. a quote).","oneOf":[{"type":"boolean"},{"type":"null"}]},"accepteddate":{"description":"Date the document was accepted (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"settled":{"description":"Set true to settle: closes the balance left after the recorded payments and marks the document settled. Only for a small gap once the payment is recorded: an exchange-rate difference, a bank fee or rounding (the FX difference itself, or a few percent of the total at most); the gap posts to Settlements, or to Foreign Exchange for an FX difference. Before you set it, state the gap amount and where it posts, and ask the user to confirm, even when they already said 'settle it' or 'mark it paid'. No payment recorded yet: use record_document_payment first. Refused while an AI-matched payment is unconfirmed. Not a write-off: a large short payment, or any part the customer will not pay, is never settled; bad debt is written off with write_off_document, which also reverses the VAT.","oneOf":[{"type":"boolean"},{"type":"null"}]},"settledaccountid":{"description":"Where the settle gap posts, when settling an existing document: a Chart of Accounts account name or id (see list_accounts). Omit to post to Settlements, or to Foreign Exchange for a foreign-currency document.","oneOf":[{"type":"string"},{"type":"null"}]},"settleddate":{"description":"Date the settle entry posts, when settling an existing document (ISO 8601, YYYY-MM-DD). Omit for the default date.","oneOf":[{"type":"string"},{"type":"null"}]},"locked":{"description":"Whether the document is locked against further edits.","oneOf":[{"type":"boolean"},{"type":"null"}]},"accountpayment":{"description":"Amount paid against the document at save time.","oneOf":[{"type":"number"},{"type":"null"}]},"baseaccountid":{"description":"Base/control account id override; rarely needed — defaults from the category.","oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"Bank/ledger account id the payment moved through (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"showpaymentlink":{"description":"Whether to include an online payment link on the document.","oneOf":[{"type":"boolean"},{"type":"null"}]},"showbank":{"description":"Whether to display the business's banking details on the document. Defaults to true on create; only shown to recipients on money-in documents (invoices, quotes).","oneOf":[{"type":"boolean"},{"type":"null"}]},"invoicebankid":{"description":"PROD-2443. :bankaccount/id of one of the business's own bank accounts to show on this document instead of the default invoice bank. \"$delete\" clears it back to the default; null or omitted leaves it unchanged. An id the business does not own is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"design":{"description":"Id of one of the business's own document designs to print this document with. \"$delete\" clears it back to the business default; null or omitted leaves it unchanged. An unknown, archived or foreign id is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"designpinnedat":{"description":"Pins the document to its design as it stood at this ISO instant, zone included (2026-11-27T09:00:00Z). \"$delete\" unpins. A design change unpins unless the same save pins again.","oneOf":[{"type":"string"},{"type":"null"}]},"blocks":{"description":"The document's own rich-text blocks: a JSON object {blockid: richtext}, or its JSON text, at most 64 KB. \"$delete\" clears them.","oneOf":[{"anyOf":[{"type":"string"},{"type":"object"}]},{"type":"null"}]}},"additionalProperties":false}}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Document id. Present → update that document; omit → create a new one (must include type).","oneOf":[{"type":"string"},{"type":"null"}]},"type":{"oneOf":[{"type":"string","enum":["invoice","quote","credit-note","recurring","purchase-order","bill","debit-note","grn"]},{"type":"null"}]},"contact":{"description":"Contact id, or an exact client/supplier name to resolve (client for money-in document types, supplier for money-out; see list_clients / list_suppliers).","oneOf":[{"type":"string"},{"type":"null"}]},"supplier":{"description":"Supplier id, or an exact supplier name to resolve (see list_suppliers).","oneOf":[{"type":"string"},{"type":"null"}]},"client":{"description":"Client id, or an exact client name to resolve (see list_clients).","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name / title of the document.","oneOf":[{"type":"string"},{"type":"null"}]},"number":{"description":"Document number; auto-generated if omitted.","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"Free-text description of the document.","oneOf":[{"type":"string"},{"type":"null"}]},"date":{"description":"Document date (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"duedate":{"description":"Payment due date (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"message":{"description":"Message shown to the recipient on the document.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Base currency per ONE unit of the document's currency, as booked (20.0480 rand per euro). Omit to stamp the day's rate.","oneOf":[{"type":"number"},{"type":"null"}]},"shipping":{"description":"Shipping amount added to the document total.","oneOf":[{"type":"number"},{"type":"null"}]},"showdiscount":{"description":"Whether to display the discount line on the document.","oneOf":[{"type":"boolean"},{"type":"null"}]},"showshipping":{"description":"Whether to display the shipping line on the document.","oneOf":[{"type":"boolean"},{"type":"null"}]},"showvat":{"description":"Whether to display the VAT/sales-tax line on the document.","oneOf":[{"type":"boolean"},{"type":"null"}]},"showdeposit":{"description":"Whether to display the deposit line on the document.","oneOf":[{"type":"boolean"},{"type":"null"}]},"discountamount":{"description":"Explicit discount amount; used instead of the percentage when discountuseamount is true.","oneOf":[{"type":"number"},{"type":"null"}]},"discountpercent":{"description":"Discount as a percentage of the subtotal.","oneOf":[{"type":"number"},{"type":"null"}]},"discountuseamount":{"description":"When true, use discountamount instead of the percentage.","oneOf":[{"type":"boolean"},{"type":"null"}]},"depositamount":{"description":"Explicit deposit amount; used instead of the percentage when deposituseamount is true.","oneOf":[{"type":"number"},{"type":"null"}]},"depositpercent":{"description":"Deposit as a percentage of the total.","oneOf":[{"type":"number"},{"type":"null"}]},"deposituseamount":{"description":"When true, use depositamount instead of the percentage.","oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"paymentnotes":{"description":"Free-text payment instructions shown on the document.","oneOf":[{"type":"string"},{"type":"null"}]},"parent":{"description":"Id of the parent document this one derives from (e.g. the invoice a credit note relates to).","oneOf":[{"type":"string"},{"type":"null"}]},"sent":{"description":"Whether the document has been sent to the recipient.","oneOf":[{"type":"boolean"},{"type":"null"}]},"accepted":{"description":"Whether the recipient has accepted the document (e.g. a quote).","oneOf":[{"type":"boolean"},{"type":"null"}]},"accepteddate":{"description":"Date the document was accepted (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"settled":{"description":"Set true to settle: closes the balance left after the recorded payments and marks the document settled. Only for a small gap once the payment is recorded: an exchange-rate difference, a bank fee or rounding (the FX difference itself, or a few percent of the total at most); the gap posts to Settlements, or to Foreign Exchange for an FX difference. Before you set it, state the gap amount and where it posts, and ask the user to confirm, even when they already said 'settle it' or 'mark it paid'. No payment recorded yet: use record_document_payment first. Refused while an AI-matched payment is unconfirmed. Not a write-off: a large short payment, or any part the customer will not pay, is never settled; bad debt is written off with write_off_document, which also reverses the VAT.","oneOf":[{"type":"boolean"},{"type":"null"}]},"settledaccountid":{"description":"Where the settle gap posts, when settling an existing document: a Chart of Accounts account name or id (see list_accounts). Omit to post to Settlements, or to Foreign Exchange for a foreign-currency document.","oneOf":[{"type":"string"},{"type":"null"}]},"settleddate":{"description":"Date the settle entry posts, when settling an existing document (ISO 8601, YYYY-MM-DD). Omit for the default date.","oneOf":[{"type":"string"},{"type":"null"}]},"locked":{"description":"Whether the document is locked against further edits.","oneOf":[{"type":"boolean"},{"type":"null"}]},"accountpayment":{"description":"Amount paid against the document at save time.","oneOf":[{"type":"number"},{"type":"null"}]},"baseaccountid":{"description":"Base/control account id override; rarely needed — defaults from the category.","oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"Bank/ledger account id the payment moved through (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"showpaymentlink":{"description":"Whether to include an online payment link on the document.","oneOf":[{"type":"boolean"},{"type":"null"}]},"showbank":{"description":"Whether to display the business's banking details on the document. Defaults to true on create; only shown to recipients on money-in documents (invoices, quotes).","oneOf":[{"type":"boolean"},{"type":"null"}]},"invoicebankid":{"description":"PROD-2443. :bankaccount/id of one of the business's own bank accounts to show on this document instead of the default invoice bank. \"$delete\" clears it back to the default; null or omitted leaves it unchanged. An id the business does not own is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"design":{"description":"Id of one of the business's own document designs to print this document with. \"$delete\" clears it back to the business default; null or omitted leaves it unchanged. An unknown, archived or foreign id is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"designpinnedat":{"description":"Pins the document to its design as it stood at this ISO instant, zone included (2026-11-27T09:00:00Z). \"$delete\" unpins. A design change unpins unless the same save pins again.","oneOf":[{"type":"string"},{"type":"null"}]},"blocks":{"description":"The document's own rich-text blocks: a JSON object {blockid: richtext}, or its JSON text, at most 64 KB. \"$delete\" clears them.","oneOf":[{"anyOf":[{"type":"string"},{"type":"object"}]},{"type":"null"}]},"items":{"description":"Vector of document objects to create/update in one all-or-nothing batch. Preferred over repeated calls. Each item with an id updates; each without creates and must include type.","type":"array","items":{"type":"object","properties":{"id":{"description":"Document id. Present → update that document; omit → create a new one (must include type).","oneOf":[{"type":"string"},{"type":"null"}]},"type":{"oneOf":[{"type":"string","enum":["invoice","quote","credit-note","recurring","purchase-order","bill","debit-note","grn"]},{"type":"null"}]},"contact":{"description":"Contact id, or an exact client/supplier name to resolve (client for money-in document types, supplier for money-out; see list_clients / list_suppliers).","oneOf":[{"type":"string"},{"type":"null"}]},"supplier":{"description":"Supplier id, or an exact supplier name to resolve (see list_suppliers).","oneOf":[{"type":"string"},{"type":"null"}]},"client":{"description":"Client id, or an exact client name to resolve (see list_clients).","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name / title of the document.","oneOf":[{"type":"string"},{"type":"null"}]},"number":{"description":"Document number; auto-generated if omitted.","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"Free-text description of the document.","oneOf":[{"type":"string"},{"type":"null"}]},"date":{"description":"Document date (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"duedate":{"description":"Payment due date (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"message":{"description":"Message shown to the recipient on the document.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Base currency per ONE unit of the document's currency, as booked (20.0480 rand per euro). Omit to stamp the day's rate.","oneOf":[{"type":"number"},{"type":"null"}]},"shipping":{"description":"Shipping amount added to the document total.","oneOf":[{"type":"number"},{"type":"null"}]},"showdiscount":{"description":"Whether to display the discount line on the document.","oneOf":[{"type":"boolean"},{"type":"null"}]},"showshipping":{"description":"Whether to display the shipping line on the document.","oneOf":[{"type":"boolean"},{"type":"null"}]},"showvat":{"description":"Whether to display the VAT/sales-tax line on the document.","oneOf":[{"type":"boolean"},{"type":"null"}]},"showdeposit":{"description":"Whether to display the deposit line on the document.","oneOf":[{"type":"boolean"},{"type":"null"}]},"discountamount":{"description":"Explicit discount amount; used instead of the percentage when discountuseamount is true.","oneOf":[{"type":"number"},{"type":"null"}]},"discountpercent":{"description":"Discount as a percentage of the subtotal.","oneOf":[{"type":"number"},{"type":"null"}]},"discountuseamount":{"description":"When true, use discountamount instead of the percentage.","oneOf":[{"type":"boolean"},{"type":"null"}]},"depositamount":{"description":"Explicit deposit amount; used instead of the percentage when deposituseamount is true.","oneOf":[{"type":"number"},{"type":"null"}]},"depositpercent":{"description":"Deposit as a percentage of the total.","oneOf":[{"type":"number"},{"type":"null"}]},"deposituseamount":{"description":"When true, use depositamount instead of the percentage.","oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"paymentnotes":{"description":"Free-text payment instructions shown on the document.","oneOf":[{"type":"string"},{"type":"null"}]},"parent":{"description":"Id of the parent document this one derives from (e.g. the invoice a credit note relates to).","oneOf":[{"type":"string"},{"type":"null"}]},"sent":{"description":"Whether the document has been sent to the recipient.","oneOf":[{"type":"boolean"},{"type":"null"}]},"accepted":{"description":"Whether the recipient has accepted the document (e.g. a quote).","oneOf":[{"type":"boolean"},{"type":"null"}]},"accepteddate":{"description":"Date the document was accepted (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"settled":{"description":"Set true to settle: closes the balance left after the recorded payments and marks the document settled. Only for a small gap once the payment is recorded: an exchange-rate difference, a bank fee or rounding (the FX difference itself, or a few percent of the total at most); the gap posts to Settlements, or to Foreign Exchange for an FX difference. Before you set it, state the gap amount and where it posts, and ask the user to confirm, even when they already said 'settle it' or 'mark it paid'. No payment recorded yet: use record_document_payment first. Refused while an AI-matched payment is unconfirmed. Not a write-off: a large short payment, or any part the customer will not pay, is never settled; bad debt is written off with write_off_document, which also reverses the VAT.","oneOf":[{"type":"boolean"},{"type":"null"}]},"settledaccountid":{"description":"Where the settle gap posts, when settling an existing document: a Chart of Accounts account name or id (see list_accounts). Omit to post to Settlements, or to Foreign Exchange for a foreign-currency document.","oneOf":[{"type":"string"},{"type":"null"}]},"settleddate":{"description":"Date the settle entry posts, when settling an existing document (ISO 8601, YYYY-MM-DD). Omit for the default date.","oneOf":[{"type":"string"},{"type":"null"}]},"locked":{"description":"Whether the document is locked against further edits.","oneOf":[{"type":"boolean"},{"type":"null"}]},"accountpayment":{"description":"Amount paid against the document at save time.","oneOf":[{"type":"number"},{"type":"null"}]},"baseaccountid":{"description":"Base/control account id override; rarely needed — defaults from the category.","oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"Bank/ledger account id the payment moved through (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"showpaymentlink":{"description":"Whether to include an online payment link on the document.","oneOf":[{"type":"boolean"},{"type":"null"}]},"showbank":{"description":"Whether to display the business's banking details on the document. Defaults to true on create; only shown to recipients on money-in documents (invoices, quotes).","oneOf":[{"type":"boolean"},{"type":"null"}]},"invoicebankid":{"description":"PROD-2443. :bankaccount/id of one of the business's own bank accounts to show on this document instead of the default invoice bank. \"$delete\" clears it back to the default; null or omitted leaves it unchanged. An id the business does not own is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"design":{"description":"Id of one of the business's own document designs to print this document with. \"$delete\" clears it back to the business default; null or omitted leaves it unchanged. An unknown, archived or foreign id is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"designpinnedat":{"description":"Pins the document to its design as it stood at this ISO instant, zone included (2026-11-27T09:00:00Z). \"$delete\" unpins. A design change unpins unless the same save pins again.","oneOf":[{"type":"string"},{"type":"null"}]},"blocks":{"description":"The document's own rich-text blocks: a JSON object {blockid: richtext}, or its JSON text, at most 64 KB. \"$delete\" clears them.","oneOf":[{"anyOf":[{"type":"string"},{"type":"object"}]},{"type":"null"}]}},"additionalProperties":false}}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Document id. Present → update that document; omit → create a new one (must include type).","oneOf":[{"type":"string"},{"type":"null"}]},"type":{"oneOf":[{"type":"string","enum":["invoice","quote","credit-note","recurring","purchase-order","bill","debit-note","grn"]},{"type":"null"}]},"contact":{"description":"Contact id, or an exact client/supplier name to resolve (client for money-in document types, supplier for money-out; see list_clients / list_suppliers).","oneOf":[{"type":"string"},{"type":"null"}]},"supplier":{"description":"Supplier id, or an exact supplier name to resolve (see list_suppliers).","oneOf":[{"type":"string"},{"type":"null"}]},"client":{"description":"Client id, or an exact client name to resolve (see list_clients).","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name / title of the document.","oneOf":[{"type":"string"},{"type":"null"}]},"number":{"description":"Document number; auto-generated if omitted.","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"Free-text description of the document.","oneOf":[{"type":"string"},{"type":"null"}]},"date":{"description":"Document date (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"duedate":{"description":"Payment due date (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"message":{"description":"Message shown to the recipient on the document.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Base currency per ONE unit of the document's currency, as booked (20.0480 rand per euro). Omit to stamp the day's rate.","oneOf":[{"type":"number"},{"type":"null"}]},"shipping":{"description":"Shipping amount added to the document total.","oneOf":[{"type":"number"},{"type":"null"}]},"showdiscount":{"description":"Whether to display the discount line on the document.","oneOf":[{"type":"boolean"},{"type":"null"}]},"showshipping":{"description":"Whether to display the shipping line on the document.","oneOf":[{"type":"boolean"},{"type":"null"}]},"showvat":{"description":"Whether to display the VAT/sales-tax line on the document.","oneOf":[{"type":"boolean"},{"type":"null"}]},"showdeposit":{"description":"Whether to display the deposit line on the document.","oneOf":[{"type":"boolean"},{"type":"null"}]},"discountamount":{"description":"Explicit discount amount; used instead of the percentage when discountuseamount is true.","oneOf":[{"type":"number"},{"type":"null"}]},"discountpercent":{"description":"Discount as a percentage of the subtotal.","oneOf":[{"type":"number"},{"type":"null"}]},"discountuseamount":{"description":"When true, use discountamount instead of the percentage.","oneOf":[{"type":"boolean"},{"type":"null"}]},"depositamount":{"description":"Explicit deposit amount; used instead of the percentage when deposituseamount is true.","oneOf":[{"type":"number"},{"type":"null"}]},"depositpercent":{"description":"Deposit as a percentage of the total.","oneOf":[{"type":"number"},{"type":"null"}]},"deposituseamount":{"description":"When true, use depositamount instead of the percentage.","oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"paymentnotes":{"description":"Free-text payment instructions shown on the document.","oneOf":[{"type":"string"},{"type":"null"}]},"parent":{"description":"Id of the parent document this one derives from (e.g. the invoice a credit note relates to).","oneOf":[{"type":"string"},{"type":"null"}]},"sent":{"description":"Whether the document has been sent to the recipient.","oneOf":[{"type":"boolean"},{"type":"null"}]},"accepted":{"description":"Whether the recipient has accepted the document (e.g. a quote).","oneOf":[{"type":"boolean"},{"type":"null"}]},"accepteddate":{"description":"Date the document was accepted (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"settled":{"description":"Set true to settle: closes the balance left after the recorded payments and marks the document settled. Only for a small gap once the payment is recorded: an exchange-rate difference, a bank fee or rounding (the FX difference itself, or a few percent of the total at most); the gap posts to Settlements, or to Foreign Exchange for an FX difference. Before you set it, state the gap amount and where it posts, and ask the user to confirm, even when they already said 'settle it' or 'mark it paid'. No payment recorded yet: use record_document_payment first. Refused while an AI-matched payment is unconfirmed. Not a write-off: a large short payment, or any part the customer will not pay, is never settled; bad debt is written off with write_off_document, which also reverses the VAT.","oneOf":[{"type":"boolean"},{"type":"null"}]},"settledaccountid":{"description":"Where the settle gap posts, when settling an existing document: a Chart of Accounts account name or id (see list_accounts). Omit to post to Settlements, or to Foreign Exchange for a foreign-currency document.","oneOf":[{"type":"string"},{"type":"null"}]},"settleddate":{"description":"Date the settle entry posts, when settling an existing document (ISO 8601, YYYY-MM-DD). Omit for the default date.","oneOf":[{"type":"string"},{"type":"null"}]},"locked":{"description":"Whether the document is locked against further edits.","oneOf":[{"type":"boolean"},{"type":"null"}]},"accountpayment":{"description":"Amount paid against the document at save time.","oneOf":[{"type":"number"},{"type":"null"}]},"baseaccountid":{"description":"Base/control account id override; rarely needed — defaults from the category.","oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"Bank/ledger account id the payment moved through (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"showpaymentlink":{"description":"Whether to include an online payment link on the document.","oneOf":[{"type":"boolean"},{"type":"null"}]},"showbank":{"description":"Whether to display the business's banking details on the document. Defaults to true on create; only shown to recipients on money-in documents (invoices, quotes).","oneOf":[{"type":"boolean"},{"type":"null"}]},"invoicebankid":{"description":"PROD-2443. :bankaccount/id of one of the business's own bank accounts to show on this document instead of the default invoice bank. \"$delete\" clears it back to the default; null or omitted leaves it unchanged. An id the business does not own is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"design":{"description":"Id of one of the business's own document designs to print this document with. \"$delete\" clears it back to the business default; null or omitted leaves it unchanged. An unknown, archived or foreign id is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"designpinnedat":{"description":"Pins the document to its design as it stood at this ISO instant, zone included (2026-11-27T09:00:00Z). \"$delete\" unpins. A design change unpins unless the same save pins again.","oneOf":[{"type":"string"},{"type":"null"}]},"blocks":{"description":"The document's own rich-text blocks: a JSON object {blockid: richtext}, or its JSON text, at most 64 KB. \"$delete\" clears them.","oneOf":[{"anyOf":[{"type":"string"},{"type":"object"}]},{"type":"null"}]},"items":{"description":"Vector of document objects to create/update in one all-or-nothing batch. Preferred over repeated calls. Each item with an id updates; each without creates and must include type.","type":"array","items":{"type":"object","properties":{"id":{"description":"Document id. Present → update that document; omit → create a new one (must include type).","oneOf":[{"type":"string"},{"type":"null"}]},"type":{"oneOf":[{"type":"string","enum":["invoice","quote","credit-note","recurring","purchase-order","bill","debit-note","grn"]},{"type":"null"}]},"contact":{"description":"Contact id, or an exact client/supplier name to resolve (client for money-in document types, supplier for money-out; see list_clients / list_suppliers).","oneOf":[{"type":"string"},{"type":"null"}]},"supplier":{"description":"Supplier id, or an exact supplier name to resolve (see list_suppliers).","oneOf":[{"type":"string"},{"type":"null"}]},"client":{"description":"Client id, or an exact client name to resolve (see list_clients).","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name / title of the document.","oneOf":[{"type":"string"},{"type":"null"}]},"number":{"description":"Document number; auto-generated if omitted.","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"Free-text description of the document.","oneOf":[{"type":"string"},{"type":"null"}]},"date":{"description":"Document date (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"duedate":{"description":"Payment due date (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"message":{"description":"Message shown to the recipient on the document.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Base currency per ONE unit of the document's currency, as booked (20.0480 rand per euro). Omit to stamp the day's rate.","oneOf":[{"type":"number"},{"type":"null"}]},"shipping":{"description":"Shipping amount added to the document total.","oneOf":[{"type":"number"},{"type":"null"}]},"showdiscount":{"description":"Whether to display the discount line on the document.","oneOf":[{"type":"boolean"},{"type":"null"}]},"showshipping":{"description":"Whether to display the shipping line on the document.","oneOf":[{"type":"boolean"},{"type":"null"}]},"showvat":{"description":"Whether to display the VAT/sales-tax line on the document.","oneOf":[{"type":"boolean"},{"type":"null"}]},"showdeposit":{"description":"Whether to display the deposit line on the document.","oneOf":[{"type":"boolean"},{"type":"null"}]},"discountamount":{"description":"Explicit discount amount; used instead of the percentage when discountuseamount is true.","oneOf":[{"type":"number"},{"type":"null"}]},"discountpercent":{"description":"Discount as a percentage of the subtotal.","oneOf":[{"type":"number"},{"type":"null"}]},"discountuseamount":{"description":"When true, use discountamount instead of the percentage.","oneOf":[{"type":"boolean"},{"type":"null"}]},"depositamount":{"description":"Explicit deposit amount; used instead of the percentage when deposituseamount is true.","oneOf":[{"type":"number"},{"type":"null"}]},"depositpercent":{"description":"Deposit as a percentage of the total.","oneOf":[{"type":"number"},{"type":"null"}]},"deposituseamount":{"description":"When true, use depositamount instead of the percentage.","oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"paymentnotes":{"description":"Free-text payment instructions shown on the document.","oneOf":[{"type":"string"},{"type":"null"}]},"parent":{"description":"Id of the parent document this one derives from (e.g. the invoice a credit note relates to).","oneOf":[{"type":"string"},{"type":"null"}]},"sent":{"description":"Whether the document has been sent to the recipient.","oneOf":[{"type":"boolean"},{"type":"null"}]},"accepted":{"description":"Whether the recipient has accepted the document (e.g. a quote).","oneOf":[{"type":"boolean"},{"type":"null"}]},"accepteddate":{"description":"Date the document was accepted (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"settled":{"description":"Set true to settle: closes the balance left after the recorded payments and marks the document settled. Only for a small gap once the payment is recorded: an exchange-rate difference, a bank fee or rounding (the FX difference itself, or a few percent of the total at most); the gap posts to Settlements, or to Foreign Exchange for an FX difference. Before you set it, state the gap amount and where it posts, and ask the user to confirm, even when they already said 'settle it' or 'mark it paid'. No payment recorded yet: use record_document_payment first. Refused while an AI-matched payment is unconfirmed. Not a write-off: a large short payment, or any part the customer will not pay, is never settled; bad debt is written off with write_off_document, which also reverses the VAT.","oneOf":[{"type":"boolean"},{"type":"null"}]},"settledaccountid":{"description":"Where the settle gap posts, when settling an existing document: a Chart of Accounts account name or id (see list_accounts). Omit to post to Settlements, or to Foreign Exchange for a foreign-currency document.","oneOf":[{"type":"string"},{"type":"null"}]},"settleddate":{"description":"Date the settle entry posts, when settling an existing document (ISO 8601, YYYY-MM-DD). Omit for the default date.","oneOf":[{"type":"string"},{"type":"null"}]},"locked":{"description":"Whether the document is locked against further edits.","oneOf":[{"type":"boolean"},{"type":"null"}]},"accountpayment":{"description":"Amount paid against the document at save time.","oneOf":[{"type":"number"},{"type":"null"}]},"baseaccountid":{"description":"Base/control account id override; rarely needed — defaults from the category.","oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"Bank/ledger account id the payment moved through (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"showpaymentlink":{"description":"Whether to include an online payment link on the document.","oneOf":[{"type":"boolean"},{"type":"null"}]},"showbank":{"description":"Whether to display the business's banking details on the document. Defaults to true on create; only shown to recipients on money-in documents (invoices, quotes).","oneOf":[{"type":"boolean"},{"type":"null"}]},"invoicebankid":{"description":"PROD-2443. :bankaccount/id of one of the business's own bank accounts to show on this document instead of the default invoice bank. \"$delete\" clears it back to the default; null or omitted leaves it unchanged. An id the business does not own is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"design":{"description":"Id of one of the business's own document designs to print this document with. \"$delete\" clears it back to the business default; null or omitted leaves it unchanged. An unknown, archived or foreign id is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"designpinnedat":{"description":"Pins the document to its design as it stood at this ISO instant, zone included (2026-11-27T09:00:00Z). \"$delete\" unpins. A design change unpins unless the same save pins again.","oneOf":[{"type":"string"},{"type":"null"}]},"blocks":{"description":"The document's own rich-text blocks: a JSON object {blockid: richtext}, or its JSON text, at most 64 KB. \"$delete\" clears them.","oneOf":[{"anyOf":[{"type":"string"},{"type":"object"}]},{"type":"null"}]}},"additionalProperties":false}}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Document id. Present → update that document; omit → create a new one (must include type).","oneOf":[{"type":"string"},{"type":"null"}]},"type":{"oneOf":[{"type":"string","enum":["invoice","quote","credit-note","recurring","purchase-order","bill","debit-note","grn"]},{"type":"null"}]},"contact":{"description":"Contact id, or an exact client/supplier name to resolve (client for money-in document types, supplier for money-out; see list_clients / list_suppliers).","oneOf":[{"type":"string"},{"type":"null"}]},"supplier":{"description":"Supplier id, or an exact supplier name to resolve (see list_suppliers).","oneOf":[{"type":"string"},{"type":"null"}]},"client":{"description":"Client id, or an exact client name to resolve (see list_clients).","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name / title of the document.","oneOf":[{"type":"string"},{"type":"null"}]},"number":{"description":"Document number; auto-generated if omitted.","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"Free-text description of the document.","oneOf":[{"type":"string"},{"type":"null"}]},"date":{"description":"Document date (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"duedate":{"description":"Payment due date (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"message":{"description":"Message shown to the recipient on the document.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Base currency per ONE unit of the document's currency, as booked (20.0480 rand per euro). Omit to stamp the day's rate.","oneOf":[{"type":"number"},{"type":"null"}]},"shipping":{"description":"Shipping amount added to the document total.","oneOf":[{"type":"number"},{"type":"null"}]},"showdiscount":{"description":"Whether to display the discount line on the document.","oneOf":[{"type":"boolean"},{"type":"null"}]},"showshipping":{"description":"Whether to display the shipping line on the document.","oneOf":[{"type":"boolean"},{"type":"null"}]},"showvat":{"description":"Whether to display the VAT/sales-tax line on the document.","oneOf":[{"type":"boolean"},{"type":"null"}]},"showdeposit":{"description":"Whether to display the deposit line on the document.","oneOf":[{"type":"boolean"},{"type":"null"}]},"discountamount":{"description":"Explicit discount amount; used instead of the percentage when discountuseamount is true.","oneOf":[{"type":"number"},{"type":"null"}]},"discountpercent":{"description":"Discount as a percentage of the subtotal.","oneOf":[{"type":"number"},{"type":"null"}]},"discountuseamount":{"description":"When true, use discountamount instead of the percentage.","oneOf":[{"type":"boolean"},{"type":"null"}]},"depositamount":{"description":"Explicit deposit amount; used instead of the percentage when deposituseamount is true.","oneOf":[{"type":"number"},{"type":"null"}]},"depositpercent":{"description":"Deposit as a percentage of the total.","oneOf":[{"type":"number"},{"type":"null"}]},"deposituseamount":{"description":"When true, use depositamount instead of the percentage.","oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"paymentnotes":{"description":"Free-text payment instructions shown on the document.","oneOf":[{"type":"string"},{"type":"null"}]},"parent":{"description":"Id of the parent document this one derives from (e.g. the invoice a credit note relates to).","oneOf":[{"type":"string"},{"type":"null"}]},"sent":{"description":"Whether the document has been sent to the recipient.","oneOf":[{"type":"boolean"},{"type":"null"}]},"accepted":{"description":"Whether the recipient has accepted the document (e.g. a quote).","oneOf":[{"type":"boolean"},{"type":"null"}]},"accepteddate":{"description":"Date the document was accepted (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"settled":{"description":"Set true to settle: closes the balance left after the recorded payments and marks the document settled. Only for a small gap once the payment is recorded: an exchange-rate difference, a bank fee or rounding (the FX difference itself, or a few percent of the total at most); the gap posts to Settlements, or to Foreign Exchange for an FX difference. Before you set it, state the gap amount and where it posts, and ask the user to confirm, even when they already said 'settle it' or 'mark it paid'. No payment recorded yet: use record_document_payment first. Refused while an AI-matched payment is unconfirmed. Not a write-off: a large short payment, or any part the customer will not pay, is never settled; bad debt is written off with write_off_document, which also reverses the VAT.","oneOf":[{"type":"boolean"},{"type":"null"}]},"settledaccountid":{"description":"Where the settle gap posts, when settling an existing document: a Chart of Accounts account name or id (see list_accounts). Omit to post to Settlements, or to Foreign Exchange for a foreign-currency document.","oneOf":[{"type":"string"},{"type":"null"}]},"settleddate":{"description":"Date the settle entry posts, when settling an existing document (ISO 8601, YYYY-MM-DD). Omit for the default date.","oneOf":[{"type":"string"},{"type":"null"}]},"locked":{"description":"Whether the document is locked against further edits.","oneOf":[{"type":"boolean"},{"type":"null"}]},"accountpayment":{"description":"Amount paid against the document at save time.","oneOf":[{"type":"number"},{"type":"null"}]},"baseaccountid":{"description":"Base/control account id override; rarely needed — defaults from the category.","oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"Bank/ledger account id the payment moved through (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"showpaymentlink":{"description":"Whether to include an online payment link on the document.","oneOf":[{"type":"boolean"},{"type":"null"}]},"showbank":{"description":"Whether to display the business's banking details on the document. Defaults to true on create; only shown to recipients on money-in documents (invoices, quotes).","oneOf":[{"type":"boolean"},{"type":"null"}]},"invoicebankid":{"description":"PROD-2443. :bankaccount/id of one of the business's own bank accounts to show on this document instead of the default invoice bank. \"$delete\" clears it back to the default; null or omitted leaves it unchanged. An id the business does not own is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"design":{"description":"Id of one of the business's own document designs to print this document with. \"$delete\" clears it back to the business default; null or omitted leaves it unchanged. An unknown, archived or foreign id is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"designpinnedat":{"description":"Pins the document to its design as it stood at this ISO instant, zone included (2026-11-27T09:00:00Z). \"$delete\" unpins. A design change unpins unless the same save pins again.","oneOf":[{"type":"string"},{"type":"null"}]},"blocks":{"description":"The document's own rich-text blocks: a JSON object {blockid: richtext}, or its JSON text, at most 64 KB. \"$delete\" clears them.","oneOf":[{"anyOf":[{"type":"string"},{"type":"object"}]},{"type":"null"}]},"items":{"description":"Vector of document objects to create/update in one all-or-nothing batch. Preferred over repeated calls. Each item with an id updates; each without creates and must include type.","type":"array","items":{"type":"object","properties":{"id":{"description":"Document id. Present → update that document; omit → create a new one (must include type).","oneOf":[{"type":"string"},{"type":"null"}]},"type":{"oneOf":[{"type":"string","enum":["invoice","quote","credit-note","recurring","purchase-order","bill","debit-note","grn"]},{"type":"null"}]},"contact":{"description":"Contact id, or an exact client/supplier name to resolve (client for money-in document types, supplier for money-out; see list_clients / list_suppliers).","oneOf":[{"type":"string"},{"type":"null"}]},"supplier":{"description":"Supplier id, or an exact supplier name to resolve (see list_suppliers).","oneOf":[{"type":"string"},{"type":"null"}]},"client":{"description":"Client id, or an exact client name to resolve (see list_clients).","oneOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Display name / title of the document.","oneOf":[{"type":"string"},{"type":"null"}]},"number":{"description":"Document number; auto-generated if omitted.","oneOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"Free-text description of the document.","oneOf":[{"type":"string"},{"type":"null"}]},"date":{"description":"Document date (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"duedate":{"description":"Payment due date (ISO 8601).","oneOf":[{"type":"string"},{"type":"null"}]},"message":{"description":"Message shown to the recipient on the document.","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency code (e.g. \"ZAR\", \"USD\"). Defaults to the business currency.","oneOf":[{"type":"string"},{"type":"null"}]},"exchangerate":{"description":"Base currency per ONE unit of the document's currency, as booked (20.0480 rand per euro). Omit to stamp the day's rate.","oneOf":[{"type":"number"},{"type":"null"}]},"shipping":{"description":"Shipping amount added to the document total.","oneOf":[{"type":"number"},{"type":"null"}]},"showdiscount":{"description":"Whether to display the discount line on the document.","oneOf":[{"type":"boolean"},{"type":"null"}]},"showshipping":{"description":"Whether to display the shipping line on the document.","oneOf":[{"type":"boolean"},{"type":"null"}]},"showvat":{"description":"Whether to display the VAT/sales-tax line on the document.","oneOf":[{"type":"boolean"},{"type":"null"}]},"showdeposit":{"description":"Whether to display the deposit line on the document.","oneOf":[{"type":"boolean"},{"type":"null"}]},"discountamount":{"description":"Explicit discount amount; used instead of the percentage when discountuseamount is true.","oneOf":[{"type":"number"},{"type":"null"}]},"discountpercent":{"description":"Discount as a percentage of the subtotal.","oneOf":[{"type":"number"},{"type":"null"}]},"discountuseamount":{"description":"When true, use discountamount instead of the percentage.","oneOf":[{"type":"boolean"},{"type":"null"}]},"depositamount":{"description":"Explicit deposit amount; used instead of the percentage when deposituseamount is true.","oneOf":[{"type":"number"},{"type":"null"}]},"depositpercent":{"description":"Deposit as a percentage of the total.","oneOf":[{"type":"number"},{"type":"null"}]},"deposituseamount":{"description":"When true, use depositamount instead of the percentage.","oneOf":[{"type":"boolean"},{"type":"null"}]},"notes":{"description":"Free-text notes.","oneOf":[{"type":"string"},{"type":"null"}]},"paymentnotes":{"description":"Free-text payment instructions shown on the document.","oneOf":[{"type":"string"},{"type":"null"}]},"parent":{"description":"Id of the parent document this one derives from (e.g. the invoice a credit note relates to).","oneOf":[{"type":"string"},{"type":"null"}]},"sent":{"description":"Whether the document has been sent to the recipient.","oneOf":[{"type":"boolean"},{"type":"null"}]},"accepted":{"description":"Whether the recipient has accepted the document (e.g. a quote).","oneOf":[{"type":"boolean"},{"type":"null"}]},"accepteddate":{"description":"Date the document was accepted (ISO 8601).","oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"settled":{"description":"Set true to settle: closes the balance left after the recorded payments and marks the document settled. Only for a small gap once the payment is recorded: an exchange-rate difference, a bank fee or rounding (the FX difference itself, or a few percent of the total at most); the gap posts to Settlements, or to Foreign Exchange for an FX difference. Before you set it, state the gap amount and where it posts, and ask the user to confirm, even when they already said 'settle it' or 'mark it paid'. No payment recorded yet: use record_document_payment first. Refused while an AI-matched payment is unconfirmed. Not a write-off: a large short payment, or any part the customer will not pay, is never settled; bad debt is written off with write_off_document, which also reverses the VAT.","oneOf":[{"type":"boolean"},{"type":"null"}]},"settledaccountid":{"description":"Where the settle gap posts, when settling an existing document: a Chart of Accounts account name or id (see list_accounts). Omit to post to Settlements, or to Foreign Exchange for a foreign-currency document.","oneOf":[{"type":"string"},{"type":"null"}]},"settleddate":{"description":"Date the settle entry posts, when settling an existing document (ISO 8601, YYYY-MM-DD). Omit for the default date.","oneOf":[{"type":"string"},{"type":"null"}]},"locked":{"description":"Whether the document is locked against further edits.","oneOf":[{"type":"boolean"},{"type":"null"}]},"accountpayment":{"description":"Amount paid against the document at save time.","oneOf":[{"type":"number"},{"type":"null"}]},"baseaccountid":{"description":"Base/control account id override; rarely needed — defaults from the category.","oneOf":[{"type":"string"},{"type":"null"}]},"accountid":{"description":"Bank/ledger account id the payment moved through (see list_accounts).","oneOf":[{"type":"string"},{"type":"null"}]},"showpaymentlink":{"description":"Whether to include an online payment link on the document.","oneOf":[{"type":"boolean"},{"type":"null"}]},"showbank":{"description":"Whether to display the business's banking details on the document. Defaults to true on create; only shown to recipients on money-in documents (invoices, quotes).","oneOf":[{"type":"boolean"},{"type":"null"}]},"invoicebankid":{"description":"PROD-2443. :bankaccount/id of one of the business's own bank accounts to show on this document instead of the default invoice bank. \"$delete\" clears it back to the default; null or omitted leaves it unchanged. An id the business does not own is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"design":{"description":"Id of one of the business's own document designs to print this document with. \"$delete\" clears it back to the business default; null or omitted leaves it unchanged. An unknown, archived or foreign id is refused.","oneOf":[{"type":"string"},{"type":"null"}]},"designpinnedat":{"description":"Pins the document to its design as it stood at this ISO instant, zone included (2026-11-27T09:00:00Z). \"$delete\" unpins. A design change unpins unless the same save pins again.","oneOf":[{"type":"string"},{"type":"null"}]},"blocks":{"description":"The document's own rich-text blocks: a JSON object {blockid: richtext}, or its JSON text, at most 64 KB. \"$delete\" clears them.","oneOf":[{"anyOf":[{"type":"string"},{"type":"object"}]},{"type":"null"}]}},"additionalProperties":false}}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create or update a WHOLE document and its header (contact, dates, type, parent); to change lines on an existing document without resending it use update_document_item, and to add one line use add_document_line. Works for documents of ANY kind — all eight document types are supported here, not just invoices: invoice, quote, recurring, debit_note, credit_note, purchase_order, bill, grn (the `type` enum below documents what each one is for). Credit notes and debit notes are raised through this same tool — pass the matching `type` and, where it relates to an existing document, its id as `parent`. For one document, send its fields inline (pass an `id` to update, omit + include `type` to create). To create/update many at once, send an `items` array — preferred over repeated calls: the whole batch is one all-or-nothing transaction with a single ledger recompute. Each item with an `id` updates; each without creates and must include `type`. This manages the document as a whole; to edit individual line items on an existing document use update_document_item (or update_document_items_bulk).","tags":["contract management"]}},"/api/contract/update-many":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"type":{"oneOf":[{"type":"string","enum":["invoice","quote","credit-note","recurring","purchase-order","bill","debit-note","grn"]},{"type":"null"}]},"direction":{"description":"Filter by money direction: \"in\" for money-in documents (invoices, quotes, credit notes), \"out\" for money-out documents (bills, purchase orders, debit notes).","oneOf":[{"type":"string","enum":["in","out"]},{"type":"null"}]},"contact":{"description":"Filter to documents for this contact id (a client or supplier).","oneOf":[{"type":"string"},{"type":"null"}]},"query":{"description":"Case-insensitive substring match over the document's text (reference/number, name, notes, purchase order, contact and line items). Combine with type to jump straight to one document by its reference number, e.g. type=bill, query=\"4B66E86E-0286\".","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"Filter to documents in this currency (ISO 4217 code, e.g. \"USD\", \"ZAR\"). Documents with no stored currency are excluded when set.","oneOf":[{"type":"string"},{"type":"null"}]},"status":{"description":"Filter to documents whose computed status matches (case-insensitive), e.g. \"overdue\", \"due\", \"paid\", \"partiallypaid\", \"sent\", \"draft\". Combine with type=bill for overdue-bill analysis.","oneOf":[{"type":"string"},{"type":"null"}]},"from":{"description":"Only documents with a due date on/after this date (inclusive, ISO 8601, e.g. \"2026-01-01\"). Documents with no due date are kept.","oneOf":[{"type":"string"},{"type":"null"}]},"to":{"description":"Only documents with a due date on/before this date (inclusive, ISO 8601; e.g. today to isolate bills due by now). Documents with no due date are kept.","oneOf":[{"type":"string"},{"type":"null"}]},"unpaid":{"description":"When true, return only documents with an outstanding balance (excludes fully paid / zero-outstanding rows).","oneOf":[{"type":"boolean"},{"type":"null"}]},"min_outstanding":{"description":"Only documents whose outstanding balance is at least this amount (inclusive).","oneOf":[{"type":"number"},{"type":"null"}]},"repeating":{"description":"When true, return only the documents whose repeat schedule is on: each live series' template. Generated copies and stopped series are left out. Pass a row's id to set_recurring_invoice to stop or change that series.","oneOf":[{"type":"boolean"},{"type":"null"}]},"ids":{"description":"Only these document ids (up to 250). Combine with the filters to narrow further.","oneOf":[{"type":"array","items":{"type":"string"},"maxItems":250},{"type":"null"}]},"duedate":{"description":"Set every matched document's due date to this date (ISO 8601, e.g. \"2026-11-30\"). Send this or due_days.","oneOf":[{"type":"string"},{"type":"null"}]},"due_days":{"description":"Set each matched document's due date to its own document date plus this many days, e.g. 30. Send this or duedate.","oneOf":[{"type":"integer"},{"type":"null"}]},"dry_run":{"description":"When true, change nothing: return how many documents would change and which. Call with dry_run first, tell the user the count, and apply once they confirm.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"type":{"oneOf":[{"type":"string","enum":["invoice","quote","credit-note","recurring","purchase-order","bill","debit-note","grn"]},{"type":"null"}]},"direction":{"description":"Filter by money direction: \"in\" for money-in documents (invoices, quotes, credit notes), \"out\" for money-out documents (bills, purchase orders, debit notes).","oneOf":[{"type":"string","enum":["in","out"]},{"type":"null"}]},"contact":{"description":"Filter to documents for this contact id (a client or supplier).","oneOf":[{"type":"string"},{"type":"null"}]},"query":{"description":"Case-insensitive substring match over the document's text (reference/number, name, notes, purchase order, contact and line items). Combine with type to jump straight to one document by its reference number, e.g. type=bill, query=\"4B66E86E-0286\".","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"Filter to documents in this currency (ISO 4217 code, e.g. \"USD\", \"ZAR\"). Documents with no stored currency are excluded when set.","oneOf":[{"type":"string"},{"type":"null"}]},"status":{"description":"Filter to documents whose computed status matches (case-insensitive), e.g. \"overdue\", \"due\", \"paid\", \"partiallypaid\", \"sent\", \"draft\". Combine with type=bill for overdue-bill analysis.","oneOf":[{"type":"string"},{"type":"null"}]},"from":{"description":"Only documents with a due date on/after this date (inclusive, ISO 8601, e.g. \"2026-01-01\"). Documents with no due date are kept.","oneOf":[{"type":"string"},{"type":"null"}]},"to":{"description":"Only documents with a due date on/before this date (inclusive, ISO 8601; e.g. today to isolate bills due by now). Documents with no due date are kept.","oneOf":[{"type":"string"},{"type":"null"}]},"unpaid":{"description":"When true, return only documents with an outstanding balance (excludes fully paid / zero-outstanding rows).","oneOf":[{"type":"boolean"},{"type":"null"}]},"min_outstanding":{"description":"Only documents whose outstanding balance is at least this amount (inclusive).","oneOf":[{"type":"number"},{"type":"null"}]},"repeating":{"description":"When true, return only the documents whose repeat schedule is on: each live series' template. Generated copies and stopped series are left out. Pass a row's id to set_recurring_invoice to stop or change that series.","oneOf":[{"type":"boolean"},{"type":"null"}]},"ids":{"description":"Only these document ids (up to 250). Combine with the filters to narrow further.","oneOf":[{"type":"array","items":{"type":"string"},"maxItems":250},{"type":"null"}]},"duedate":{"description":"Set every matched document's due date to this date (ISO 8601, e.g. \"2026-11-30\"). Send this or due_days.","oneOf":[{"type":"string"},{"type":"null"}]},"due_days":{"description":"Set each matched document's due date to its own document date plus this many days, e.g. 30. Send this or duedate.","oneOf":[{"type":"integer"},{"type":"null"}]},"dry_run":{"description":"When true, change nothing: return how many documents would change and which. Call with dry_run first, tell the user the count, and apply once they confirm.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"type":{"oneOf":[{"type":"string","enum":["invoice","quote","credit-note","recurring","purchase-order","bill","debit-note","grn"]},{"type":"null"}]},"direction":{"description":"Filter by money direction: \"in\" for money-in documents (invoices, quotes, credit notes), \"out\" for money-out documents (bills, purchase orders, debit notes).","oneOf":[{"type":"string","enum":["in","out"]},{"type":"null"}]},"contact":{"description":"Filter to documents for this contact id (a client or supplier).","oneOf":[{"type":"string"},{"type":"null"}]},"query":{"description":"Case-insensitive substring match over the document's text (reference/number, name, notes, purchase order, contact and line items). Combine with type to jump straight to one document by its reference number, e.g. type=bill, query=\"4B66E86E-0286\".","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"Filter to documents in this currency (ISO 4217 code, e.g. \"USD\", \"ZAR\"). Documents with no stored currency are excluded when set.","oneOf":[{"type":"string"},{"type":"null"}]},"status":{"description":"Filter to documents whose computed status matches (case-insensitive), e.g. \"overdue\", \"due\", \"paid\", \"partiallypaid\", \"sent\", \"draft\". Combine with type=bill for overdue-bill analysis.","oneOf":[{"type":"string"},{"type":"null"}]},"from":{"description":"Only documents with a due date on/after this date (inclusive, ISO 8601, e.g. \"2026-01-01\"). Documents with no due date are kept.","oneOf":[{"type":"string"},{"type":"null"}]},"to":{"description":"Only documents with a due date on/before this date (inclusive, ISO 8601; e.g. today to isolate bills due by now). Documents with no due date are kept.","oneOf":[{"type":"string"},{"type":"null"}]},"unpaid":{"description":"When true, return only documents with an outstanding balance (excludes fully paid / zero-outstanding rows).","oneOf":[{"type":"boolean"},{"type":"null"}]},"min_outstanding":{"description":"Only documents whose outstanding balance is at least this amount (inclusive).","oneOf":[{"type":"number"},{"type":"null"}]},"repeating":{"description":"When true, return only the documents whose repeat schedule is on: each live series' template. Generated copies and stopped series are left out. Pass a row's id to set_recurring_invoice to stop or change that series.","oneOf":[{"type":"boolean"},{"type":"null"}]},"ids":{"description":"Only these document ids (up to 250). Combine with the filters to narrow further.","oneOf":[{"type":"array","items":{"type":"string"},"maxItems":250},{"type":"null"}]},"duedate":{"description":"Set every matched document's due date to this date (ISO 8601, e.g. \"2026-11-30\"). Send this or due_days.","oneOf":[{"type":"string"},{"type":"null"}]},"due_days":{"description":"Set each matched document's due date to its own document date plus this many days, e.g. 30. Send this or duedate.","oneOf":[{"type":"integer"},{"type":"null"}]},"dry_run":{"description":"When true, change nothing: return how many documents would change and which. Call with dry_run first, tell the user the count, and apply once they confirm.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"type":{"oneOf":[{"type":"string","enum":["invoice","quote","credit-note","recurring","purchase-order","bill","debit-note","grn"]},{"type":"null"}]},"direction":{"description":"Filter by money direction: \"in\" for money-in documents (invoices, quotes, credit notes), \"out\" for money-out documents (bills, purchase orders, debit notes).","oneOf":[{"type":"string","enum":["in","out"]},{"type":"null"}]},"contact":{"description":"Filter to documents for this contact id (a client or supplier).","oneOf":[{"type":"string"},{"type":"null"}]},"query":{"description":"Case-insensitive substring match over the document's text (reference/number, name, notes, purchase order, contact and line items). Combine with type to jump straight to one document by its reference number, e.g. type=bill, query=\"4B66E86E-0286\".","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"Filter to documents in this currency (ISO 4217 code, e.g. \"USD\", \"ZAR\"). Documents with no stored currency are excluded when set.","oneOf":[{"type":"string"},{"type":"null"}]},"status":{"description":"Filter to documents whose computed status matches (case-insensitive), e.g. \"overdue\", \"due\", \"paid\", \"partiallypaid\", \"sent\", \"draft\". Combine with type=bill for overdue-bill analysis.","oneOf":[{"type":"string"},{"type":"null"}]},"from":{"description":"Only documents with a due date on/after this date (inclusive, ISO 8601, e.g. \"2026-01-01\"). Documents with no due date are kept.","oneOf":[{"type":"string"},{"type":"null"}]},"to":{"description":"Only documents with a due date on/before this date (inclusive, ISO 8601; e.g. today to isolate bills due by now). Documents with no due date are kept.","oneOf":[{"type":"string"},{"type":"null"}]},"unpaid":{"description":"When true, return only documents with an outstanding balance (excludes fully paid / zero-outstanding rows).","oneOf":[{"type":"boolean"},{"type":"null"}]},"min_outstanding":{"description":"Only documents whose outstanding balance is at least this amount (inclusive).","oneOf":[{"type":"number"},{"type":"null"}]},"repeating":{"description":"When true, return only the documents whose repeat schedule is on: each live series' template. Generated copies and stopped series are left out. Pass a row's id to set_recurring_invoice to stop or change that series.","oneOf":[{"type":"boolean"},{"type":"null"}]},"ids":{"description":"Only these document ids (up to 250). Combine with the filters to narrow further.","oneOf":[{"type":"array","items":{"type":"string"},"maxItems":250},{"type":"null"}]},"duedate":{"description":"Set every matched document's due date to this date (ISO 8601, e.g. \"2026-11-30\"). Send this or due_days.","oneOf":[{"type":"string"},{"type":"null"}]},"due_days":{"description":"Set each matched document's due date to its own document date plus this many days, e.g. 30. Send this or duedate.","oneOf":[{"type":"integer"},{"type":"null"}]},"dry_run":{"description":"When true, change nothing: return how many documents would change and which. Call with dry_run first, tell the user the count, and apply once they confirm.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Change the due date on many documents in one call: every document a filter matches (the list_documents filters, and/or ids), up to 250. Use this, never save_document one by one, when the user asks to change due dates on several documents. Send duedate for a fixed date, or due_days for each document's own date plus N days. Call with dry_run=true first, tell the user how many documents would change, and apply once they confirm. Partial success: returns updated, skipped (already due on that date) and errors.","tags":["contract management"]}},"/api/contract/delete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Document id.","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Document id.","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Document id.","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Document id.","type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Delete contract","tags":["contract management"]}},"/api/contract/list":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"type":{"oneOf":[{"type":"string","enum":["invoice","quote","credit-note","recurring","purchase-order","bill","debit-note","grn"]},{"type":"null"}]},"direction":{"description":"Filter by money direction: \"in\" for money-in documents (invoices, quotes, credit notes), \"out\" for money-out documents (bills, purchase orders, debit notes).","oneOf":[{"type":"string","enum":["in","out"]},{"type":"null"}]},"contact":{"description":"Filter to documents for this contact id (a client or supplier).","oneOf":[{"type":"string"},{"type":"null"}]},"query":{"description":"Case-insensitive substring match over the document's text (reference/number, name, notes, purchase order, contact and line items). Combine with type to jump straight to one document by its reference number, e.g. type=bill, query=\"4B66E86E-0286\".","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"Filter to documents in this currency (ISO 4217 code, e.g. \"USD\", \"ZAR\"). Documents with no stored currency are excluded when set.","oneOf":[{"type":"string"},{"type":"null"}]},"status":{"description":"Filter to documents whose computed status matches (case-insensitive), e.g. \"overdue\", \"due\", \"paid\", \"partiallypaid\", \"sent\", \"draft\". Combine with type=bill for overdue-bill analysis.","oneOf":[{"type":"string"},{"type":"null"}]},"from":{"description":"Only documents with a due date on/after this date (inclusive, ISO 8601, e.g. \"2026-01-01\"). Documents with no due date are kept.","oneOf":[{"type":"string"},{"type":"null"}]},"to":{"description":"Only documents with a due date on/before this date (inclusive, ISO 8601; e.g. today to isolate bills due by now). Documents with no due date are kept.","oneOf":[{"type":"string"},{"type":"null"}]},"unpaid":{"description":"When true, return only documents with an outstanding balance (excludes fully paid / zero-outstanding rows).","oneOf":[{"type":"boolean"},{"type":"null"}]},"min_outstanding":{"description":"Only documents whose outstanding balance is at least this amount (inclusive).","oneOf":[{"type":"number"},{"type":"null"}]},"repeating":{"description":"When true, return only the documents whose repeat schedule is on: each live series' template. Generated copies and stopped series are left out. Pass a row's id to set_recurring_invoice to stop or change that series.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"type":{"oneOf":[{"type":"string","enum":["invoice","quote","credit-note","recurring","purchase-order","bill","debit-note","grn"]},{"type":"null"}]},"direction":{"description":"Filter by money direction: \"in\" for money-in documents (invoices, quotes, credit notes), \"out\" for money-out documents (bills, purchase orders, debit notes).","oneOf":[{"type":"string","enum":["in","out"]},{"type":"null"}]},"contact":{"description":"Filter to documents for this contact id (a client or supplier).","oneOf":[{"type":"string"},{"type":"null"}]},"query":{"description":"Case-insensitive substring match over the document's text (reference/number, name, notes, purchase order, contact and line items). Combine with type to jump straight to one document by its reference number, e.g. type=bill, query=\"4B66E86E-0286\".","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"Filter to documents in this currency (ISO 4217 code, e.g. \"USD\", \"ZAR\"). Documents with no stored currency are excluded when set.","oneOf":[{"type":"string"},{"type":"null"}]},"status":{"description":"Filter to documents whose computed status matches (case-insensitive), e.g. \"overdue\", \"due\", \"paid\", \"partiallypaid\", \"sent\", \"draft\". Combine with type=bill for overdue-bill analysis.","oneOf":[{"type":"string"},{"type":"null"}]},"from":{"description":"Only documents with a due date on/after this date (inclusive, ISO 8601, e.g. \"2026-01-01\"). Documents with no due date are kept.","oneOf":[{"type":"string"},{"type":"null"}]},"to":{"description":"Only documents with a due date on/before this date (inclusive, ISO 8601; e.g. today to isolate bills due by now). Documents with no due date are kept.","oneOf":[{"type":"string"},{"type":"null"}]},"unpaid":{"description":"When true, return only documents with an outstanding balance (excludes fully paid / zero-outstanding rows).","oneOf":[{"type":"boolean"},{"type":"null"}]},"min_outstanding":{"description":"Only documents whose outstanding balance is at least this amount (inclusive).","oneOf":[{"type":"number"},{"type":"null"}]},"repeating":{"description":"When true, return only the documents whose repeat schedule is on: each live series' template. Generated copies and stopped series are left out. Pass a row's id to set_recurring_invoice to stop or change that series.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"type":{"oneOf":[{"type":"string","enum":["invoice","quote","credit-note","recurring","purchase-order","bill","debit-note","grn"]},{"type":"null"}]},"direction":{"description":"Filter by money direction: \"in\" for money-in documents (invoices, quotes, credit notes), \"out\" for money-out documents (bills, purchase orders, debit notes).","oneOf":[{"type":"string","enum":["in","out"]},{"type":"null"}]},"contact":{"description":"Filter to documents for this contact id (a client or supplier).","oneOf":[{"type":"string"},{"type":"null"}]},"query":{"description":"Case-insensitive substring match over the document's text (reference/number, name, notes, purchase order, contact and line items). Combine with type to jump straight to one document by its reference number, e.g. type=bill, query=\"4B66E86E-0286\".","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"Filter to documents in this currency (ISO 4217 code, e.g. \"USD\", \"ZAR\"). Documents with no stored currency are excluded when set.","oneOf":[{"type":"string"},{"type":"null"}]},"status":{"description":"Filter to documents whose computed status matches (case-insensitive), e.g. \"overdue\", \"due\", \"paid\", \"partiallypaid\", \"sent\", \"draft\". Combine with type=bill for overdue-bill analysis.","oneOf":[{"type":"string"},{"type":"null"}]},"from":{"description":"Only documents with a due date on/after this date (inclusive, ISO 8601, e.g. \"2026-01-01\"). Documents with no due date are kept.","oneOf":[{"type":"string"},{"type":"null"}]},"to":{"description":"Only documents with a due date on/before this date (inclusive, ISO 8601; e.g. today to isolate bills due by now). Documents with no due date are kept.","oneOf":[{"type":"string"},{"type":"null"}]},"unpaid":{"description":"When true, return only documents with an outstanding balance (excludes fully paid / zero-outstanding rows).","oneOf":[{"type":"boolean"},{"type":"null"}]},"min_outstanding":{"description":"Only documents whose outstanding balance is at least this amount (inclusive).","oneOf":[{"type":"number"},{"type":"null"}]},"repeating":{"description":"When true, return only the documents whose repeat schedule is on: each live series' template. Generated copies and stopped series are left out. Pass a row's id to set_recurring_invoice to stop or change that series.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"type":{"oneOf":[{"type":"string","enum":["invoice","quote","credit-note","recurring","purchase-order","bill","debit-note","grn"]},{"type":"null"}]},"direction":{"description":"Filter by money direction: \"in\" for money-in documents (invoices, quotes, credit notes), \"out\" for money-out documents (bills, purchase orders, debit notes).","oneOf":[{"type":"string","enum":["in","out"]},{"type":"null"}]},"contact":{"description":"Filter to documents for this contact id (a client or supplier).","oneOf":[{"type":"string"},{"type":"null"}]},"query":{"description":"Case-insensitive substring match over the document's text (reference/number, name, notes, purchase order, contact and line items). Combine with type to jump straight to one document by its reference number, e.g. type=bill, query=\"4B66E86E-0286\".","oneOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"Filter to documents in this currency (ISO 4217 code, e.g. \"USD\", \"ZAR\"). Documents with no stored currency are excluded when set.","oneOf":[{"type":"string"},{"type":"null"}]},"status":{"description":"Filter to documents whose computed status matches (case-insensitive), e.g. \"overdue\", \"due\", \"paid\", \"partiallypaid\", \"sent\", \"draft\". Combine with type=bill for overdue-bill analysis.","oneOf":[{"type":"string"},{"type":"null"}]},"from":{"description":"Only documents with a due date on/after this date (inclusive, ISO 8601, e.g. \"2026-01-01\"). Documents with no due date are kept.","oneOf":[{"type":"string"},{"type":"null"}]},"to":{"description":"Only documents with a due date on/before this date (inclusive, ISO 8601; e.g. today to isolate bills due by now). Documents with no due date are kept.","oneOf":[{"type":"string"},{"type":"null"}]},"unpaid":{"description":"When true, return only documents with an outstanding balance (excludes fully paid / zero-outstanding rows).","oneOf":[{"type":"boolean"},{"type":"null"}]},"min_outstanding":{"description":"Only documents whose outstanding balance is at least this amount (inclusive).","oneOf":[{"type":"number"},{"type":"null"}]},"repeating":{"description":"When true, return only the documents whose repeat schedule is on: each live series' template. Generated copies and stopped series are left out. Pass a row's id to set_recurring_invoice to stop or change that series.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"List the business's documents — invoices, quotes, credit notes, recurring invoices, bills, purchase orders, debit notes and goods received notes. This is the complete, authoritative document surface: it reads both document stores. Rows are paginated (50 per page, 200 max), so a count or total is only safe when taken from `meta.total` or from every page — never by summing one page's rows while `meta.truncated` is true. Rows come newest first. Optionally filter by `type` (invoice, quote, bill, …), `direction` (in/out), `status` (e.g. overdue, due, paid, partiallypaid), a `query` substring (reference/number, name, notes — jump straight to one document by its reference), `currency` (ISO 4217, e.g. USD), a due-date range (`from`/`to` filter on the DUE date, not the document date: for a sales report or invoices by invoice date use list_invoices with from/to), `unpaid` (only rows with an outstanding balance), `min_outstanding` (minimum outstanding amount) and/or `repeating` (only live repeat series) — combine e.g. type=bill + unpaid + status=overdue to pull only overdue bills in one call, or type=invoice + query=<ref> to fetch a specific invoice. To find what repeats, or before stopping a repeat, use repeating=true (with contact for one customer): type=recurring is a document type, not whether a series is running. Each row carries totals, outstanding, status, type, type_label and contact. Use get_document for one document's full detail.","tags":["contract management"]}},"/api/contract/add-contract-link":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"invoiceid":{"type":"string"},"linkedid":{"type":"string"},"useamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]}},"required":["token","invoiceid","linkedid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"invoiceid":{"type":"string"},"linkedid":{"type":"string"},"useamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]}},"required":["token","invoiceid","linkedid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"invoiceid":{"type":"string"},"linkedid":{"type":"string"},"useamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]}},"required":["token","invoiceid","linkedid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"invoiceid":{"type":"string"},"linkedid":{"type":"string"},"useamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]}},"required":["token","invoiceid","linkedid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Link two contracts (e.g. credit note to invoice)","tags":["contract management"]}},"/api/contract/update-contract-link":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"useamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"useamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"useamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"useamount":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"amount":{"oneOf":[{"type":"number"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Update a contract link amount","tags":["contract management"]}},"/api/contract/remove-contract-link":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Remove a contract link","tags":["contract management"]}},"/api/crm/note/create":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string"},"type":{"oneOf":[{"type":"string","enum":["call","general","cancellation"]},{"type":"null"}]},"notes":{"type":"string"},"creator":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","businessid","notes"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string"},"type":{"oneOf":[{"type":"string","enum":["call","general","cancellation"]},{"type":"null"}]},"notes":{"type":"string"},"creator":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","businessid","notes"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string"},"type":{"oneOf":[{"type":"string","enum":["call","general","cancellation"]},{"type":"null"}]},"notes":{"type":"string"},"creator":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","businessid","notes"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string"},"type":{"oneOf":[{"type":"string","enum":["call","general","cancellation"]},{"type":"null"}]},"notes":{"type":"string"},"creator":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","businessid","notes"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create new CRM internal note","tags":["CRM management"]}},"/api/crm/note/update":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string"},"id":{"type":"string"},"type":{"oneOf":[{"type":"string","enum":["call","general","cancellation"]},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","businessid","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string"},"id":{"type":"string"},"type":{"oneOf":[{"type":"string","enum":["call","general","cancellation"]},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","businessid","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string"},"id":{"type":"string"},"type":{"oneOf":[{"type":"string","enum":["call","general","cancellation"]},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","businessid","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string"},"id":{"type":"string"},"type":{"oneOf":[{"type":"string","enum":["call","general","cancellation"]},{"type":"null"}]},"notes":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","businessid","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Update CRM internal note","tags":["CRM management"]}},"/api/crm/note/delete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string"},"id":{"type":"string"}},"required":["token","businessid","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string"},"id":{"type":"string"}},"required":["token","businessid","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string"},"id":{"type":"string"}},"required":["token","businessid","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string"},"id":{"type":"string"}},"required":["token","businessid","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Delete CRM internal note","tags":["CRM management"]}},"/api/crm/cortex/{businessid}":{"get":{"parameters":[{"in":"path","name":"businessid","required":true,"schema":{"type":"string"}},{"in":"query","name":"token","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Get Cortex profile for a business","tags":["CRM management"]}},"/api/message/notifications":{"get":{"parameters":[{"in":"query","name":"token","required":false,"schema":{"type":"string"}},{"in":"query","name":"limit","required":false,"schema":{"description":"Max notifications to return (default 50, newest first).","oneOf":[{"type":"integer"},{"type":"null"}]},"description":"Max notifications to return (default 50, newest first)."}],"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Get the business's notification feed (notification messages, newest first, with per-user read/alerted state). Read-only; soft-deleted notifications are excluded.","tags":["Message management"]},"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"limit":{"description":"Max notifications to return (default 50, newest first).","oneOf":[{"type":"integer"},{"type":"null"}]}},"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"limit":{"description":"Max notifications to return (default 50, newest first).","oneOf":[{"type":"integer"},{"type":"null"}]}},"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"limit":{"description":"Max notifications to return (default 50, newest first).","oneOf":[{"type":"integer"},{"type":"null"}]}},"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"limit":{"description":"Max notifications to return (default 50, newest first).","oneOf":[{"type":"integer"},{"type":"null"}]}},"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"List the business's notifications, newest first, with the caller's read state. Read-only; deleted notifications are left out.","tags":["Message management"]}},"/api/message/contextual":{"get":{"parameters":[{"in":"query","name":"token","required":false,"schema":{"type":"string"}},{"in":"query","name":"contextid","required":true,"schema":{"description":"Id of the record whose message/audit history to return (e.g. an expense/invoice/file id).","type":"string"},"description":"Id of the record whose message/audit history to return (e.g. an expense/invoice/file id)."}],"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Get the message/audit history for a single record (its contextual-history panel) — every message linked to the given contextid, newest first, capped at 50. Read-only; soft-deleted messages excluded.","tags":["Message management"]},"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"contextid":{"description":"Id of the record whose message/audit history to return (e.g. an expense/invoice/file id).","type":"string"}},"required":["contextid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"contextid":{"description":"Id of the record whose message/audit history to return (e.g. an expense/invoice/file id).","type":"string"}},"required":["contextid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"contextid":{"description":"Id of the record whose message/audit history to return (e.g. an expense/invoice/file id).","type":"string"}},"required":["contextid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"contextid":{"description":"Id of the record whose message/audit history to return (e.g. an expense/invoice/file id).","type":"string"}},"required":["contextid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Read one record's history: the messages linked to it and, on plans with the audit trail, who changed which of its fields and when. Newest first, at most 50 messages. A change names the field, never its old or new value. Read-only.","tags":["Message management"]}},"/api/message/audit-group":{"get":{"parameters":[{"in":"query","name":"token","required":false,"schema":{"type":"string"}},{"in":"query","name":"group","required":true,"schema":{"description":"The bulk operation's audit group id — the :audit/group UUID shared by every audit event of one logical bulk op.","type":"string"},"description":"The bulk operation's audit group id — the :audit/group UUID shared by every audit event of one logical bulk op."}],"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Get the summary of one bulk operation's audit group — how many audit events share the group id, the action they share, and their [earliest latest] timespan as epoch millis — so a bulk edit reads as one row (\"200 expenses added\") rather than N. Read-only, derived on read; scoped to the authed business, and a group it does not own reads the same as one that does not exist (empty :summary).","tags":["Message management"]}},"/api/message/actor-history":{"get":{"parameters":[{"in":"query","name":"token","required":false,"schema":{"type":"string"}},{"in":"query","name":"actor","required":true,"schema":{"description":"Profile uid of the team member whose actions to list.","type":"string"},"description":"Profile uid of the team member whose actions to list."},{"in":"query","name":"from","required":false,"schema":{"description":"Window start, epoch millis (inclusive). Defaults to 30 days before `to`.","type":"integer"},"description":"Window start, epoch millis (inclusive). Defaults to 30 days before `to`."},{"in":"query","name":"to","required":false,"schema":{"description":"Window end, epoch millis (inclusive). Defaults to now. The window may not exceed 366 days.","type":"integer"},"description":"Window end, epoch millis (inclusive). Defaults to now. The window may not exceed 366 days."},{"in":"query","name":"limit","required":false,"schema":{"description":"Rows per page (default 50, clamped to 1..200).","type":"integer"},"description":"Rows per page (default 50, clamped to 1..200)."},{"in":"query","name":"before","required":false,"schema":{"description":"The `next` cursor from the previous page.","type":"string"},"description":"The `next` cursor from the previous page."}],"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Get what one team member did in this business — their audit events, newest first, over a date window (default the last 30 days, at most 366), paged by an opaque `before` cursor. Each row carries the action, time, the diffs to this business's records only, and the records touched as {id, type}. Read-only. Owners, administrators and editors only, on plans that include the audit trail.","tags":["Message management"]}},"/api/message/create":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"text":{"description":"The message/notification body text shown to the user.","type":"string"},"contextid":{"description":"Id of the entity this message relates to (e.g. an expense/invoice/file id).","oneOf":[{"type":"string"},{"type":"null"}]},"contexttype":{"description":"Kind of entity `contextid` refers to (e.g. \"expense\", \"invoice\", \"file\").","oneOf":[{"type":"string"},{"type":"null"}]},"notification":{"description":"Whether this surfaces as a notification (vs a passive message).","oneOf":[{"type":"boolean"},{"type":"null"}]},"alert":{"description":"Alert level/label to emphasise the message (e.g. \"warning\").","oneOf":[{"type":"string"},{"type":"null"}]},"date":{"description":"Message timestamp as epoch millis; defaults to now.","oneOf":[{"type":"integer"},{"type":"null"}]},"type":{"description":"Message type/category label.","oneOf":[{"type":"string"},{"type":"null"}]},"link":{"description":"URL the message links to when clicked.","oneOf":[{"type":"string"},{"type":"null"}]},"newtab":{"description":"Whether the link opens in a new tab.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","text"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"text":{"description":"The message/notification body text shown to the user.","type":"string"},"contextid":{"description":"Id of the entity this message relates to (e.g. an expense/invoice/file id).","oneOf":[{"type":"string"},{"type":"null"}]},"contexttype":{"description":"Kind of entity `contextid` refers to (e.g. \"expense\", \"invoice\", \"file\").","oneOf":[{"type":"string"},{"type":"null"}]},"notification":{"description":"Whether this surfaces as a notification (vs a passive message).","oneOf":[{"type":"boolean"},{"type":"null"}]},"alert":{"description":"Alert level/label to emphasise the message (e.g. \"warning\").","oneOf":[{"type":"string"},{"type":"null"}]},"date":{"description":"Message timestamp as epoch millis; defaults to now.","oneOf":[{"type":"integer"},{"type":"null"}]},"type":{"description":"Message type/category label.","oneOf":[{"type":"string"},{"type":"null"}]},"link":{"description":"URL the message links to when clicked.","oneOf":[{"type":"string"},{"type":"null"}]},"newtab":{"description":"Whether the link opens in a new tab.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","text"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"text":{"description":"The message/notification body text shown to the user.","type":"string"},"contextid":{"description":"Id of the entity this message relates to (e.g. an expense/invoice/file id).","oneOf":[{"type":"string"},{"type":"null"}]},"contexttype":{"description":"Kind of entity `contextid` refers to (e.g. \"expense\", \"invoice\", \"file\").","oneOf":[{"type":"string"},{"type":"null"}]},"notification":{"description":"Whether this surfaces as a notification (vs a passive message).","oneOf":[{"type":"boolean"},{"type":"null"}]},"alert":{"description":"Alert level/label to emphasise the message (e.g. \"warning\").","oneOf":[{"type":"string"},{"type":"null"}]},"date":{"description":"Message timestamp as epoch millis; defaults to now.","oneOf":[{"type":"integer"},{"type":"null"}]},"type":{"description":"Message type/category label.","oneOf":[{"type":"string"},{"type":"null"}]},"link":{"description":"URL the message links to when clicked.","oneOf":[{"type":"string"},{"type":"null"}]},"newtab":{"description":"Whether the link opens in a new tab.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","text"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"text":{"description":"The message/notification body text shown to the user.","type":"string"},"contextid":{"description":"Id of the entity this message relates to (e.g. an expense/invoice/file id).","oneOf":[{"type":"string"},{"type":"null"}]},"contexttype":{"description":"Kind of entity `contextid` refers to (e.g. \"expense\", \"invoice\", \"file\").","oneOf":[{"type":"string"},{"type":"null"}]},"notification":{"description":"Whether this surfaces as a notification (vs a passive message).","oneOf":[{"type":"boolean"},{"type":"null"}]},"alert":{"description":"Alert level/label to emphasise the message (e.g. \"warning\").","oneOf":[{"type":"string"},{"type":"null"}]},"date":{"description":"Message timestamp as epoch millis; defaults to now.","oneOf":[{"type":"integer"},{"type":"null"}]},"type":{"description":"Message type/category label.","oneOf":[{"type":"string"},{"type":"null"}]},"link":{"description":"URL the message links to when clicked.","oneOf":[{"type":"string"},{"type":"null"}]},"newtab":{"description":"Whether the link opens in a new tab.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","text"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create an in-app message / notification for the business's users (optionally linked to an entity and/or a URL).","tags":["Message management"]}},"/api/message/update":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the message to update.","type":"string"},"text":{"description":"New message body text.","oneOf":[{"type":"string"},{"type":"null"}]},"contextid":{"description":"Id of the related entity (e.g. an expense/invoice/file id).","oneOf":[{"type":"string"},{"type":"null"}]},"contexttype":{"description":"Kind of entity `contextid` refers to.","oneOf":[{"type":"string"},{"type":"null"}]},"notification":{"description":"Whether this surfaces as a notification.","oneOf":[{"type":"boolean"},{"type":"null"}]},"alert":{"description":"Alert level/label.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the message to update.","type":"string"},"text":{"description":"New message body text.","oneOf":[{"type":"string"},{"type":"null"}]},"contextid":{"description":"Id of the related entity (e.g. an expense/invoice/file id).","oneOf":[{"type":"string"},{"type":"null"}]},"contexttype":{"description":"Kind of entity `contextid` refers to.","oneOf":[{"type":"string"},{"type":"null"}]},"notification":{"description":"Whether this surfaces as a notification.","oneOf":[{"type":"boolean"},{"type":"null"}]},"alert":{"description":"Alert level/label.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the message to update.","type":"string"},"text":{"description":"New message body text.","oneOf":[{"type":"string"},{"type":"null"}]},"contextid":{"description":"Id of the related entity (e.g. an expense/invoice/file id).","oneOf":[{"type":"string"},{"type":"null"}]},"contexttype":{"description":"Kind of entity `contextid` refers to.","oneOf":[{"type":"string"},{"type":"null"}]},"notification":{"description":"Whether this surfaces as a notification.","oneOf":[{"type":"boolean"},{"type":"null"}]},"alert":{"description":"Alert level/label.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the message to update.","type":"string"},"text":{"description":"New message body text.","oneOf":[{"type":"string"},{"type":"null"}]},"contextid":{"description":"Id of the related entity (e.g. an expense/invoice/file id).","oneOf":[{"type":"string"},{"type":"null"}]},"contexttype":{"description":"Kind of entity `contextid` refers to.","oneOf":[{"type":"string"},{"type":"null"}]},"notification":{"description":"Whether this surfaces as a notification.","oneOf":[{"type":"boolean"},{"type":"null"}]},"alert":{"description":"Alert level/label.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Change an existing message's text, context, notification flag or alert level by id; to mark it read use mark_message_read, and to hide it for a while use snooze_message.","tags":["Message management"]}},"/api/message/read":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"One message id to mark read.","type":"string"},"ids":{"description":"Up to 1000 message ids to mark read in one transaction. Partial success: ids this business does not own are skipped and listed in errors.","type":"array","items":{"type":"string"},"minItems":1,"maxItems":1000}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"One message id to mark read.","type":"string"},"ids":{"description":"Up to 1000 message ids to mark read in one transaction. Partial success: ids this business does not own are skipped and listed in errors.","type":"array","items":{"type":"string"},"minItems":1,"maxItems":1000}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"One message id to mark read.","type":"string"},"ids":{"description":"Up to 1000 message ids to mark read in one transaction. Partial success: ids this business does not own are skipped and listed in errors.","type":"array","items":{"type":"string"},"minItems":1,"maxItems":1000}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"One message id to mark read.","type":"string"},"ids":{"description":"Up to 1000 message ids to mark read in one transaction. Partial success: ids this business does not own are skipped and listed in errors.","type":"array","items":{"type":"string"},"minItems":1,"maxItems":1000}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Mark one message or many as read by the current user. Send `id` for one message, which returns {error}. Or send `ids` (up to 1000) to mark many in one transaction, which returns {error, read: [id ...], errors: [{id, message} ...]}. That is partial success: ids this business does not own are skipped and listed in errors, and error is true only when nothing was marked.","tags":["Message management"]}},"/api/message/read-many":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"messages":{"description":"The messages to mark read — each item is {id}.","type":"array","items":{"type":"object","properties":{"id":{"description":"Message id.","type":"string"}},"required":["id"],"additionalProperties":false}}},"required":["token","messages"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"messages":{"description":"The messages to mark read — each item is {id}.","type":"array","items":{"type":"object","properties":{"id":{"description":"Message id.","type":"string"}},"required":["id"],"additionalProperties":false}}},"required":["token","messages"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"messages":{"description":"The messages to mark read — each item is {id}.","type":"array","items":{"type":"object","properties":{"id":{"description":"Message id.","type":"string"}},"required":["id"],"additionalProperties":false}}},"required":["token","messages"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"messages":{"description":"The messages to mark read — each item is {id}.","type":"array","items":{"type":"object","properties":{"id":{"description":"Message id.","type":"string"}},"required":["id"],"additionalProperties":false}}},"required":["token","messages"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Mark multiple messages as read by current user (stub-web; agents use mark_message_read with ids)","tags":["Message management"]}},"/api/message/alerted":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the message.","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the message.","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the message.","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the message.","type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Mark a message as having been alerted (shown as an alert) to the current user.","tags":["Message management"]}},"/api/message/snooze":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the message/notification to snooze.","type":"string"},"time":{"description":"Snooze duration hint in minutes; omit to snooze until tomorrow 08:00 SAST.","oneOf":[{"type":"integer"},{"type":"null"}]},"snooze-until":{"description":"Explicit ISO 8601 timestamp to resurface the message at; overrides `time`.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the message/notification to snooze.","type":"string"},"time":{"description":"Snooze duration hint in minutes; omit to snooze until tomorrow 08:00 SAST.","oneOf":[{"type":"integer"},{"type":"null"}]},"snooze-until":{"description":"Explicit ISO 8601 timestamp to resurface the message at; overrides `time`.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the message/notification to snooze.","type":"string"},"time":{"description":"Snooze duration hint in minutes; omit to snooze until tomorrow 08:00 SAST.","oneOf":[{"type":"integer"},{"type":"null"}]},"snooze-until":{"description":"Explicit ISO 8601 timestamp to resurface the message at; overrides `time`.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the message/notification to snooze.","type":"string"},"time":{"description":"Snooze duration hint in minutes; omit to snooze until tomorrow 08:00 SAST.","oneOf":[{"type":"integer"},{"type":"null"}]},"snooze-until":{"description":"Explicit ISO 8601 timestamp to resurface the message at; overrides `time`.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Snooze a notification — resurfaces tomorrow at 08:00 SAST","tags":["Message management"]}},"/api/message/action":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the message whose action to trigger.","type":"string"},"action":{"description":"The action key to invoke — must be one the message actually offers (its primary-CTA action).","type":"string"}},"required":["token","id","action"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the message whose action to trigger.","type":"string"},"action":{"description":"The action key to invoke — must be one the message actually offers (its primary-CTA action).","type":"string"}},"required":["token","id","action"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the message whose action to trigger.","type":"string"},"action":{"description":"The action key to invoke — must be one the message actually offers (its primary-CTA action).","type":"string"}},"required":["token","id","action"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the message whose action to trigger.","type":"string"},"action":{"description":"The action key to invoke — must be one the message actually offers (its primary-CTA action).","type":"string"}},"required":["token","id","action"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Trigger the primary-CTA action on a message","tags":["Message management"]}},"/api/message/dismiss":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the message.","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the message.","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the message.","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the message.","type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Permanently delete an in-app message / notification by id. Removes it for every user of the business (it is retracted, not just marked read — for that use mark_message_read). Immediate and irreversible — confirm with the user before deleting.","tags":["Message management"]}},"/api/message/archive":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"The message to archive or restore.","type":"string"},"archived":{"description":"false restores it (the Undo). Default true.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"The message to archive or restore.","type":"string"},"archived":{"description":"false restores it (the Undo). Default true.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"The message to archive or restore.","type":"string"},"archived":{"description":"false restores it (the Undo). Default true.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"The message to archive or restore.","type":"string"},"archived":{"description":"false restores it (the Undo). Default true.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Archive a notification for the calling member only, or restore it with archived false (the Undo). Other members' trays are untouched.","tags":["Message management"]}},"/api/message/unread":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"The message to mark unread for the caller.","type":"string"}},"required":["id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"The message to mark unread for the caller.","type":"string"}},"required":["id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"The message to mark unread for the caller.","type":"string"}},"required":["id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"The message to mark unread for the caller.","type":"string"}},"required":["id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Mark a notification unread for the calling member only.","tags":["Message management"]}},"/api/message/business-history":{"get":{"parameters":[{"in":"query","name":"token","required":false,"schema":{"type":"string"}},{"in":"query","name":"actor","required":false,"schema":{"description":"Narrow to one actor uid.","type":"string"},"description":"Narrow to one actor uid."},{"in":"query","name":"actortype","required":false,"schema":{"description":"team-member, connected-app, scheduled or stub.","type":"string"},"description":"team-member, connected-app, scheduled or stub."},{"in":"query","name":"category","required":false,"schema":{"description":"A notification category key, e.g. money-in or payroll.","type":"string"},"description":"A notification category key, e.g. money-in or payroll."},{"in":"query","name":"group","required":false,"schema":{"description":"One :audit/group — every event of one operation.","type":"string"},"description":"One :audit/group — every event of one operation."},{"in":"query","name":"from","required":false,"schema":{"description":"Window start, epoch millis (inclusive). Defaults to 30 days before `to`.","type":"integer"},"description":"Window start, epoch millis (inclusive). Defaults to 30 days before `to`."},{"in":"query","name":"to","required":false,"schema":{"description":"Window end, epoch millis (inclusive). Defaults to now; at most 366 days.","type":"integer"},"description":"Window end, epoch millis (inclusive). Defaults to now; at most 366 days."},{"in":"query","name":"limit","required":false,"schema":{"description":"Rows per page (default 50, clamped to 1..200).","type":"integer"},"description":"Rows per page (default 50, clamped to 1..200)."},{"in":"query","name":"before","required":false,"schema":{"description":"The `next` cursor from the previous page.","type":"string"},"description":"The `next` cursor from the previous page."}],"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Get the whole business's audit history, newest first, over a date window (default the last 30 days, at most 366), paged by an opaque `before` cursor. Narrow by actor, actortype, notification category or one audit group. Rows are in the actor-history shape. Owners, administrators and editors only, on plans that include the audit trail.","tags":["Message management"]},"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"actor":{"description":"Narrow to one actor uid.","type":"string"},"actortype":{"description":"team-member, connected-app, scheduled or stub.","type":"string"},"category":{"description":"A notification category key, e.g. money-in or payroll.","type":"string"},"group":{"description":"One :audit/group — every event of one operation.","type":"string"},"from":{"description":"Window start, epoch millis (inclusive). Defaults to 30 days before `to`.","type":"integer"},"to":{"description":"Window end, epoch millis (inclusive). Defaults to now; at most 366 days.","type":"integer"},"limit":{"description":"Rows per page (default 50, clamped to 1..200).","type":"integer"},"before":{"description":"The `next` cursor from the previous page.","type":"string"}},"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"actor":{"description":"Narrow to one actor uid.","type":"string"},"actortype":{"description":"team-member, connected-app, scheduled or stub.","type":"string"},"category":{"description":"A notification category key, e.g. money-in or payroll.","type":"string"},"group":{"description":"One :audit/group — every event of one operation.","type":"string"},"from":{"description":"Window start, epoch millis (inclusive). Defaults to 30 days before `to`.","type":"integer"},"to":{"description":"Window end, epoch millis (inclusive). Defaults to now; at most 366 days.","type":"integer"},"limit":{"description":"Rows per page (default 50, clamped to 1..200).","type":"integer"},"before":{"description":"The `next` cursor from the previous page.","type":"string"}},"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"actor":{"description":"Narrow to one actor uid.","type":"string"},"actortype":{"description":"team-member, connected-app, scheduled or stub.","type":"string"},"category":{"description":"A notification category key, e.g. money-in or payroll.","type":"string"},"group":{"description":"One :audit/group — every event of one operation.","type":"string"},"from":{"description":"Window start, epoch millis (inclusive). Defaults to 30 days before `to`.","type":"integer"},"to":{"description":"Window end, epoch millis (inclusive). Defaults to now; at most 366 days.","type":"integer"},"limit":{"description":"Rows per page (default 50, clamped to 1..200).","type":"integer"},"before":{"description":"The `next` cursor from the previous page.","type":"string"}},"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"actor":{"description":"Narrow to one actor uid.","type":"string"},"actortype":{"description":"team-member, connected-app, scheduled or stub.","type":"string"},"category":{"description":"A notification category key, e.g. money-in or payroll.","type":"string"},"group":{"description":"One :audit/group — every event of one operation.","type":"string"},"from":{"description":"Window start, epoch millis (inclusive). Defaults to 30 days before `to`.","type":"integer"},"to":{"description":"Window end, epoch millis (inclusive). Defaults to now; at most 366 days.","type":"integer"},"limit":{"description":"Rows per page (default 50, clamped to 1..200).","type":"integer"},"before":{"description":"The `next` cursor from the previous page.","type":"string"}},"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"List who did what across the business, newest first, over a date window (default the last 30 days, at most 366), paged by the `before` cursor this returns as `next`. Narrow by one team member (actor), actortype, notification category or one audit group. A change names the field, never its old or new value. Owners, administrators and editors only, on plans that include the audit trail.","tags":["Message management"]}},"/api/notification/catalogue":{"get":{"parameters":[{"in":"query","name":"token","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Get the notification kinds the caller's role can receive, localised, with their defaults and an example, plus the categories.","tags":["Notifications"]}},"/api/notification/preferences":{"get":{"parameters":[{"in":"query","name":"token","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Get the calling member's own notification preferences — only what they set; the client fills the defaults.","tags":["Notifications"]},"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"kinds":{"description":"{kind {inapp bool, email instant|digest|off}}. Mandatory and unknown kinds are ignored.","oneOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]},"digest":{"description":"daily, weekly or off.","oneOf":[{"type":"string"},{"type":"null"}]},"digesthour":{"description":"Hour of the day, 0 to 23.","oneOf":[{"type":"integer"},{"type":"null"}]},"popups":{"description":"false stops in-app pop-ups.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"kinds":{"description":"{kind {inapp bool, email instant|digest|off}}. Mandatory and unknown kinds are ignored.","oneOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]},"digest":{"description":"daily, weekly or off.","oneOf":[{"type":"string"},{"type":"null"}]},"digesthour":{"description":"Hour of the day, 0 to 23.","oneOf":[{"type":"integer"},{"type":"null"}]},"popups":{"description":"false stops in-app pop-ups.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"kinds":{"description":"{kind {inapp bool, email instant|digest|off}}. Mandatory and unknown kinds are ignored.","oneOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]},"digest":{"description":"daily, weekly or off.","oneOf":[{"type":"string"},{"type":"null"}]},"digesthour":{"description":"Hour of the day, 0 to 23.","oneOf":[{"type":"integer"},{"type":"null"}]},"popups":{"description":"false stops in-app pop-ups.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"kinds":{"description":"{kind {inapp bool, email instant|digest|off}}. Mandatory and unknown kinds are ignored.","oneOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]},"digest":{"description":"daily, weekly or off.","oneOf":[{"type":"string"},{"type":"null"}]},"digesthour":{"description":"Hour of the day, 0 to 23.","oneOf":[{"type":"integer"},{"type":"null"}]},"popups":{"description":"false stops in-app pop-ups.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Replace the calling member's own notification preferences. Every role may, viewers included. Overrides of mandatory kinds are ignored.","tags":["Notifications"]}},"/api/trail/append":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"description":"The business the member is working in.","type":"string"},"events":{"description":"Up to 200 trail events. Invalid events and unknown keys are dropped; the batch still succeeds.","type":"array","items":{},"maxItems":200}},"required":["businessid","events"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"description":"The business the member is working in.","type":"string"},"events":{"description":"Up to 200 trail events. Invalid events and unknown keys are dropped; the batch still succeeds.","type":"array","items":{},"maxItems":200}},"required":["businessid","events"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"description":"The business the member is working in.","type":"string"},"events":{"description":"Up to 200 trail events. Invalid events and unknown keys are dropped; the batch still succeeds.","type":"array","items":{},"maxItems":200}},"required":["businessid","events"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"description":"The business the member is working in.","type":"string"},"events":{"description":"Up to 200 trail events. Invalid events and unknown keys are dropped; the batch still succeeds.","type":"array","items":{},"maxItems":200}},"required":["businessid","events"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Append a batch of the calling member's UI trail events (names, never values). Every role may, viewers included. Kept 14 days.","tags":["UI trail"]}},"/api/email/list":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"status":{"description":"Only emails in this delivery state: sent | delivered | bounced | complained | rejected | delayed | failed.","oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"description":"Only emails of this kind (e.g. \"invoice\", \"reminder\", \"quote-accepted\", \"order-received\").","oneOf":[{"type":"string"},{"type":"null"}]},"contextid":{"description":"Only emails about this entity — e.g. an invoice id, to see that invoice's send history.","oneOf":[{"type":"string"},{"type":"null"}]},"days":{"description":"How far back to look, in days. Defaults to 30; pass 0 to read the whole history (slower).","oneOf":[{"type":"integer"},{"type":"null"}]},"from-date":{"description":"Only emails sent at or after this epoch-millis timestamp. Overrides `days`.","oneOf":[{"type":"integer"},{"type":"null"}]},"to-date":{"description":"Only emails sent at or before this epoch-millis timestamp.","oneOf":[{"type":"integer"},{"type":"null"}]},"query":{"description":"Case-insensitive substring match on the subject line.","oneOf":[{"type":"string"},{"type":"null"}]},"limit":{"description":"Page size; defaults to 50, capped at 250.","oneOf":[{"type":"integer"},{"type":"null"}]},"cursor":{"description":"Offset from the previous response's `cursor`; omit for the first page.","oneOf":[{"type":"integer"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"status":{"description":"Only emails in this delivery state: sent | delivered | bounced | complained | rejected | delayed | failed.","oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"description":"Only emails of this kind (e.g. \"invoice\", \"reminder\", \"quote-accepted\", \"order-received\").","oneOf":[{"type":"string"},{"type":"null"}]},"contextid":{"description":"Only emails about this entity — e.g. an invoice id, to see that invoice's send history.","oneOf":[{"type":"string"},{"type":"null"}]},"days":{"description":"How far back to look, in days. Defaults to 30; pass 0 to read the whole history (slower).","oneOf":[{"type":"integer"},{"type":"null"}]},"from-date":{"description":"Only emails sent at or after this epoch-millis timestamp. Overrides `days`.","oneOf":[{"type":"integer"},{"type":"null"}]},"to-date":{"description":"Only emails sent at or before this epoch-millis timestamp.","oneOf":[{"type":"integer"},{"type":"null"}]},"query":{"description":"Case-insensitive substring match on the subject line.","oneOf":[{"type":"string"},{"type":"null"}]},"limit":{"description":"Page size; defaults to 50, capped at 250.","oneOf":[{"type":"integer"},{"type":"null"}]},"cursor":{"description":"Offset from the previous response's `cursor`; omit for the first page.","oneOf":[{"type":"integer"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"status":{"description":"Only emails in this delivery state: sent | delivered | bounced | complained | rejected | delayed | failed.","oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"description":"Only emails of this kind (e.g. \"invoice\", \"reminder\", \"quote-accepted\", \"order-received\").","oneOf":[{"type":"string"},{"type":"null"}]},"contextid":{"description":"Only emails about this entity — e.g. an invoice id, to see that invoice's send history.","oneOf":[{"type":"string"},{"type":"null"}]},"days":{"description":"How far back to look, in days. Defaults to 30; pass 0 to read the whole history (slower).","oneOf":[{"type":"integer"},{"type":"null"}]},"from-date":{"description":"Only emails sent at or after this epoch-millis timestamp. Overrides `days`.","oneOf":[{"type":"integer"},{"type":"null"}]},"to-date":{"description":"Only emails sent at or before this epoch-millis timestamp.","oneOf":[{"type":"integer"},{"type":"null"}]},"query":{"description":"Case-insensitive substring match on the subject line.","oneOf":[{"type":"string"},{"type":"null"}]},"limit":{"description":"Page size; defaults to 50, capped at 250.","oneOf":[{"type":"integer"},{"type":"null"}]},"cursor":{"description":"Offset from the previous response's `cursor`; omit for the first page.","oneOf":[{"type":"integer"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"status":{"description":"Only emails in this delivery state: sent | delivered | bounced | complained | rejected | delayed | failed.","oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"description":"Only emails of this kind (e.g. \"invoice\", \"reminder\", \"quote-accepted\", \"order-received\").","oneOf":[{"type":"string"},{"type":"null"}]},"contextid":{"description":"Only emails about this entity — e.g. an invoice id, to see that invoice's send history.","oneOf":[{"type":"string"},{"type":"null"}]},"days":{"description":"How far back to look, in days. Defaults to 30; pass 0 to read the whole history (slower).","oneOf":[{"type":"integer"},{"type":"null"}]},"from-date":{"description":"Only emails sent at or after this epoch-millis timestamp. Overrides `days`.","oneOf":[{"type":"integer"},{"type":"null"}]},"to-date":{"description":"Only emails sent at or before this epoch-millis timestamp.","oneOf":[{"type":"integer"},{"type":"null"}]},"query":{"description":"Case-insensitive substring match on the subject line.","oneOf":[{"type":"string"},{"type":"null"}]},"limit":{"description":"Page size; defaults to 50, capped at 250.","oneOf":[{"type":"integer"},{"type":"null"}]},"cursor":{"description":"Offset from the previous response's `cursor`; omit for the first page.","oneOf":[{"type":"integer"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"List emails the business has sent, newest first, with their delivery state and times. Covers the last 30 days unless `days`/`from-date` say otherwise. Filter by status, kind or related entity, and page with `cursor`.","tags":["Email history"]}},"/api/email/get":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the email history record.","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the email history record.","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the email history record.","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the email history record.","type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Get one sent email's history record by id — subject, recipients, time sent, time received and why it failed if it did.","tags":["Email history"]}},"/api/email/preview/document":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the document, payslip or contact the email is about.","oneOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Override recipient, as the send takes it.","oneOf":[{"type":"string"},{"type":"null"}]},"message":{"description":"The note the send would carry.","oneOf":[{"type":"string"},{"type":"null"}]},"contactkind":{"description":"Statement only: customer | supplier.","oneOf":[{"type":"string"},{"type":"null"}]},"attachrebilled":{"description":"Invoice only: as api/invoice/send takes it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"attachpdf":{"description":"Invoice only: as api/invoice/send takes it. Names the PDF; never draws it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"attachmentfileids":{"description":"As api/invoice/send or api/statement/send takes it. At most 20.","oneOf":[{"type":"array","items":{"type":"string"},"maxItems":20},{"type":"null"}]},"name":{"description":"Invite only: the invitee's name.","oneOf":[{"type":"string"},{"type":"null"}]},"role":{"description":"Invite only: the role offered.","oneOf":[{"type":"string"},{"type":"null"}]},"makeowner":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"cc":{"description":"Extra addresses to CC on this send, shown to every recipient. Each entry may hold one address or several split by , or ;. At most 10 addresses.","oneOf":[{"type":"array","items":{"type":"string"},"maxItems":10},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the document, payslip or contact the email is about.","oneOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Override recipient, as the send takes it.","oneOf":[{"type":"string"},{"type":"null"}]},"message":{"description":"The note the send would carry.","oneOf":[{"type":"string"},{"type":"null"}]},"contactkind":{"description":"Statement only: customer | supplier.","oneOf":[{"type":"string"},{"type":"null"}]},"attachrebilled":{"description":"Invoice only: as api/invoice/send takes it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"attachpdf":{"description":"Invoice only: as api/invoice/send takes it. Names the PDF; never draws it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"attachmentfileids":{"description":"As api/invoice/send or api/statement/send takes it. At most 20.","oneOf":[{"type":"array","items":{"type":"string"},"maxItems":20},{"type":"null"}]},"name":{"description":"Invite only: the invitee's name.","oneOf":[{"type":"string"},{"type":"null"}]},"role":{"description":"Invite only: the role offered.","oneOf":[{"type":"string"},{"type":"null"}]},"makeowner":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"cc":{"description":"Extra addresses to CC on this send, shown to every recipient. Each entry may hold one address or several split by , or ;. At most 10 addresses.","oneOf":[{"type":"array","items":{"type":"string"},"maxItems":10},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the document, payslip or contact the email is about.","oneOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Override recipient, as the send takes it.","oneOf":[{"type":"string"},{"type":"null"}]},"message":{"description":"The note the send would carry.","oneOf":[{"type":"string"},{"type":"null"}]},"contactkind":{"description":"Statement only: customer | supplier.","oneOf":[{"type":"string"},{"type":"null"}]},"attachrebilled":{"description":"Invoice only: as api/invoice/send takes it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"attachpdf":{"description":"Invoice only: as api/invoice/send takes it. Names the PDF; never draws it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"attachmentfileids":{"description":"As api/invoice/send or api/statement/send takes it. At most 20.","oneOf":[{"type":"array","items":{"type":"string"},"maxItems":20},{"type":"null"}]},"name":{"description":"Invite only: the invitee's name.","oneOf":[{"type":"string"},{"type":"null"}]},"role":{"description":"Invite only: the role offered.","oneOf":[{"type":"string"},{"type":"null"}]},"makeowner":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"cc":{"description":"Extra addresses to CC on this send, shown to every recipient. Each entry may hold one address or several split by , or ;. At most 10 addresses.","oneOf":[{"type":"array","items":{"type":"string"},"maxItems":10},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the document, payslip or contact the email is about.","oneOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Override recipient, as the send takes it.","oneOf":[{"type":"string"},{"type":"null"}]},"message":{"description":"The note the send would carry.","oneOf":[{"type":"string"},{"type":"null"}]},"contactkind":{"description":"Statement only: customer | supplier.","oneOf":[{"type":"string"},{"type":"null"}]},"attachrebilled":{"description":"Invoice only: as api/invoice/send takes it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"attachpdf":{"description":"Invoice only: as api/invoice/send takes it. Names the PDF; never draws it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"attachmentfileids":{"description":"As api/invoice/send or api/statement/send takes it. At most 20.","oneOf":[{"type":"array","items":{"type":"string"},"maxItems":20},{"type":"null"}]},"name":{"description":"Invite only: the invitee's name.","oneOf":[{"type":"string"},{"type":"null"}]},"role":{"description":"Invite only: the role offered.","oneOf":[{"type":"string"},{"type":"null"}]},"makeowner":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"cc":{"description":"Extra addresses to CC on this send, shown to every recipient. Each entry may hold one address or several split by , or ;. At most 10 addresses.","oneOf":[{"type":"array","items":{"type":"string"},"maxItems":10},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Render the document email the matching send would deliver, without sending it.","tags":["Email history"]}},"/api/email/preview/reminder":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the document, payslip or contact the email is about.","oneOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Override recipient, as the send takes it.","oneOf":[{"type":"string"},{"type":"null"}]},"message":{"description":"The note the send would carry.","oneOf":[{"type":"string"},{"type":"null"}]},"contactkind":{"description":"Statement only: customer | supplier.","oneOf":[{"type":"string"},{"type":"null"}]},"attachrebilled":{"description":"Invoice only: as api/invoice/send takes it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"attachpdf":{"description":"Invoice only: as api/invoice/send takes it. Names the PDF; never draws it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"attachmentfileids":{"description":"As api/invoice/send or api/statement/send takes it. At most 20.","oneOf":[{"type":"array","items":{"type":"string"},"maxItems":20},{"type":"null"}]},"name":{"description":"Invite only: the invitee's name.","oneOf":[{"type":"string"},{"type":"null"}]},"role":{"description":"Invite only: the role offered.","oneOf":[{"type":"string"},{"type":"null"}]},"makeowner":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"cc":{"description":"Extra addresses to CC on this send, shown to every recipient. Each entry may hold one address or several split by , or ;. At most 10 addresses.","oneOf":[{"type":"array","items":{"type":"string"},"maxItems":10},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the document, payslip or contact the email is about.","oneOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Override recipient, as the send takes it.","oneOf":[{"type":"string"},{"type":"null"}]},"message":{"description":"The note the send would carry.","oneOf":[{"type":"string"},{"type":"null"}]},"contactkind":{"description":"Statement only: customer | supplier.","oneOf":[{"type":"string"},{"type":"null"}]},"attachrebilled":{"description":"Invoice only: as api/invoice/send takes it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"attachpdf":{"description":"Invoice only: as api/invoice/send takes it. Names the PDF; never draws it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"attachmentfileids":{"description":"As api/invoice/send or api/statement/send takes it. At most 20.","oneOf":[{"type":"array","items":{"type":"string"},"maxItems":20},{"type":"null"}]},"name":{"description":"Invite only: the invitee's name.","oneOf":[{"type":"string"},{"type":"null"}]},"role":{"description":"Invite only: the role offered.","oneOf":[{"type":"string"},{"type":"null"}]},"makeowner":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"cc":{"description":"Extra addresses to CC on this send, shown to every recipient. Each entry may hold one address or several split by , or ;. At most 10 addresses.","oneOf":[{"type":"array","items":{"type":"string"},"maxItems":10},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the document, payslip or contact the email is about.","oneOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Override recipient, as the send takes it.","oneOf":[{"type":"string"},{"type":"null"}]},"message":{"description":"The note the send would carry.","oneOf":[{"type":"string"},{"type":"null"}]},"contactkind":{"description":"Statement only: customer | supplier.","oneOf":[{"type":"string"},{"type":"null"}]},"attachrebilled":{"description":"Invoice only: as api/invoice/send takes it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"attachpdf":{"description":"Invoice only: as api/invoice/send takes it. Names the PDF; never draws it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"attachmentfileids":{"description":"As api/invoice/send or api/statement/send takes it. At most 20.","oneOf":[{"type":"array","items":{"type":"string"},"maxItems":20},{"type":"null"}]},"name":{"description":"Invite only: the invitee's name.","oneOf":[{"type":"string"},{"type":"null"}]},"role":{"description":"Invite only: the role offered.","oneOf":[{"type":"string"},{"type":"null"}]},"makeowner":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"cc":{"description":"Extra addresses to CC on this send, shown to every recipient. Each entry may hold one address or several split by , or ;. At most 10 addresses.","oneOf":[{"type":"array","items":{"type":"string"},"maxItems":10},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the document, payslip or contact the email is about.","oneOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Override recipient, as the send takes it.","oneOf":[{"type":"string"},{"type":"null"}]},"message":{"description":"The note the send would carry.","oneOf":[{"type":"string"},{"type":"null"}]},"contactkind":{"description":"Statement only: customer | supplier.","oneOf":[{"type":"string"},{"type":"null"}]},"attachrebilled":{"description":"Invoice only: as api/invoice/send takes it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"attachpdf":{"description":"Invoice only: as api/invoice/send takes it. Names the PDF; never draws it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"attachmentfileids":{"description":"As api/invoice/send or api/statement/send takes it. At most 20.","oneOf":[{"type":"array","items":{"type":"string"},"maxItems":20},{"type":"null"}]},"name":{"description":"Invite only: the invitee's name.","oneOf":[{"type":"string"},{"type":"null"}]},"role":{"description":"Invite only: the role offered.","oneOf":[{"type":"string"},{"type":"null"}]},"makeowner":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"cc":{"description":"Extra addresses to CC on this send, shown to every recipient. Each entry may hold one address or several split by , or ;. At most 10 addresses.","oneOf":[{"type":"array","items":{"type":"string"},"maxItems":10},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Render the reminder email the matching send would deliver, without sending it.","tags":["Email history"]}},"/api/email/preview/statement":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the document, payslip or contact the email is about.","oneOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Override recipient, as the send takes it.","oneOf":[{"type":"string"},{"type":"null"}]},"message":{"description":"The note the send would carry.","oneOf":[{"type":"string"},{"type":"null"}]},"contactkind":{"description":"Statement only: customer | supplier.","oneOf":[{"type":"string"},{"type":"null"}]},"attachrebilled":{"description":"Invoice only: as api/invoice/send takes it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"attachpdf":{"description":"Invoice only: as api/invoice/send takes it. Names the PDF; never draws it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"attachmentfileids":{"description":"As api/invoice/send or api/statement/send takes it. At most 20.","oneOf":[{"type":"array","items":{"type":"string"},"maxItems":20},{"type":"null"}]},"name":{"description":"Invite only: the invitee's name.","oneOf":[{"type":"string"},{"type":"null"}]},"role":{"description":"Invite only: the role offered.","oneOf":[{"type":"string"},{"type":"null"}]},"makeowner":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"cc":{"description":"Extra addresses to CC on this send, shown to every recipient. Each entry may hold one address or several split by , or ;. At most 10 addresses.","oneOf":[{"type":"array","items":{"type":"string"},"maxItems":10},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the document, payslip or contact the email is about.","oneOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Override recipient, as the send takes it.","oneOf":[{"type":"string"},{"type":"null"}]},"message":{"description":"The note the send would carry.","oneOf":[{"type":"string"},{"type":"null"}]},"contactkind":{"description":"Statement only: customer | supplier.","oneOf":[{"type":"string"},{"type":"null"}]},"attachrebilled":{"description":"Invoice only: as api/invoice/send takes it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"attachpdf":{"description":"Invoice only: as api/invoice/send takes it. Names the PDF; never draws it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"attachmentfileids":{"description":"As api/invoice/send or api/statement/send takes it. At most 20.","oneOf":[{"type":"array","items":{"type":"string"},"maxItems":20},{"type":"null"}]},"name":{"description":"Invite only: the invitee's name.","oneOf":[{"type":"string"},{"type":"null"}]},"role":{"description":"Invite only: the role offered.","oneOf":[{"type":"string"},{"type":"null"}]},"makeowner":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"cc":{"description":"Extra addresses to CC on this send, shown to every recipient. Each entry may hold one address or several split by , or ;. At most 10 addresses.","oneOf":[{"type":"array","items":{"type":"string"},"maxItems":10},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the document, payslip or contact the email is about.","oneOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Override recipient, as the send takes it.","oneOf":[{"type":"string"},{"type":"null"}]},"message":{"description":"The note the send would carry.","oneOf":[{"type":"string"},{"type":"null"}]},"contactkind":{"description":"Statement only: customer | supplier.","oneOf":[{"type":"string"},{"type":"null"}]},"attachrebilled":{"description":"Invoice only: as api/invoice/send takes it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"attachpdf":{"description":"Invoice only: as api/invoice/send takes it. Names the PDF; never draws it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"attachmentfileids":{"description":"As api/invoice/send or api/statement/send takes it. At most 20.","oneOf":[{"type":"array","items":{"type":"string"},"maxItems":20},{"type":"null"}]},"name":{"description":"Invite only: the invitee's name.","oneOf":[{"type":"string"},{"type":"null"}]},"role":{"description":"Invite only: the role offered.","oneOf":[{"type":"string"},{"type":"null"}]},"makeowner":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"cc":{"description":"Extra addresses to CC on this send, shown to every recipient. Each entry may hold one address or several split by , or ;. At most 10 addresses.","oneOf":[{"type":"array","items":{"type":"string"},"maxItems":10},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the document, payslip or contact the email is about.","oneOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Override recipient, as the send takes it.","oneOf":[{"type":"string"},{"type":"null"}]},"message":{"description":"The note the send would carry.","oneOf":[{"type":"string"},{"type":"null"}]},"contactkind":{"description":"Statement only: customer | supplier.","oneOf":[{"type":"string"},{"type":"null"}]},"attachrebilled":{"description":"Invoice only: as api/invoice/send takes it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"attachpdf":{"description":"Invoice only: as api/invoice/send takes it. Names the PDF; never draws it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"attachmentfileids":{"description":"As api/invoice/send or api/statement/send takes it. At most 20.","oneOf":[{"type":"array","items":{"type":"string"},"maxItems":20},{"type":"null"}]},"name":{"description":"Invite only: the invitee's name.","oneOf":[{"type":"string"},{"type":"null"}]},"role":{"description":"Invite only: the role offered.","oneOf":[{"type":"string"},{"type":"null"}]},"makeowner":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"cc":{"description":"Extra addresses to CC on this send, shown to every recipient. Each entry may hold one address or several split by , or ;. At most 10 addresses.","oneOf":[{"type":"array","items":{"type":"string"},"maxItems":10},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Render the statement email the matching send would deliver, without sending it.","tags":["Email history"]}},"/api/email/preview/payslip":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the document, payslip or contact the email is about.","oneOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Override recipient, as the send takes it.","oneOf":[{"type":"string"},{"type":"null"}]},"message":{"description":"The note the send would carry.","oneOf":[{"type":"string"},{"type":"null"}]},"contactkind":{"description":"Statement only: customer | supplier.","oneOf":[{"type":"string"},{"type":"null"}]},"attachrebilled":{"description":"Invoice only: as api/invoice/send takes it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"attachpdf":{"description":"Invoice only: as api/invoice/send takes it. Names the PDF; never draws it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"attachmentfileids":{"description":"As api/invoice/send or api/statement/send takes it. At most 20.","oneOf":[{"type":"array","items":{"type":"string"},"maxItems":20},{"type":"null"}]},"name":{"description":"Invite only: the invitee's name.","oneOf":[{"type":"string"},{"type":"null"}]},"role":{"description":"Invite only: the role offered.","oneOf":[{"type":"string"},{"type":"null"}]},"makeowner":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"cc":{"description":"Extra addresses to CC on this send, shown to every recipient. Each entry may hold one address or several split by , or ;. At most 10 addresses.","oneOf":[{"type":"array","items":{"type":"string"},"maxItems":10},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the document, payslip or contact the email is about.","oneOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Override recipient, as the send takes it.","oneOf":[{"type":"string"},{"type":"null"}]},"message":{"description":"The note the send would carry.","oneOf":[{"type":"string"},{"type":"null"}]},"contactkind":{"description":"Statement only: customer | supplier.","oneOf":[{"type":"string"},{"type":"null"}]},"attachrebilled":{"description":"Invoice only: as api/invoice/send takes it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"attachpdf":{"description":"Invoice only: as api/invoice/send takes it. Names the PDF; never draws it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"attachmentfileids":{"description":"As api/invoice/send or api/statement/send takes it. At most 20.","oneOf":[{"type":"array","items":{"type":"string"},"maxItems":20},{"type":"null"}]},"name":{"description":"Invite only: the invitee's name.","oneOf":[{"type":"string"},{"type":"null"}]},"role":{"description":"Invite only: the role offered.","oneOf":[{"type":"string"},{"type":"null"}]},"makeowner":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"cc":{"description":"Extra addresses to CC on this send, shown to every recipient. Each entry may hold one address or several split by , or ;. At most 10 addresses.","oneOf":[{"type":"array","items":{"type":"string"},"maxItems":10},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the document, payslip or contact the email is about.","oneOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Override recipient, as the send takes it.","oneOf":[{"type":"string"},{"type":"null"}]},"message":{"description":"The note the send would carry.","oneOf":[{"type":"string"},{"type":"null"}]},"contactkind":{"description":"Statement only: customer | supplier.","oneOf":[{"type":"string"},{"type":"null"}]},"attachrebilled":{"description":"Invoice only: as api/invoice/send takes it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"attachpdf":{"description":"Invoice only: as api/invoice/send takes it. Names the PDF; never draws it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"attachmentfileids":{"description":"As api/invoice/send or api/statement/send takes it. At most 20.","oneOf":[{"type":"array","items":{"type":"string"},"maxItems":20},{"type":"null"}]},"name":{"description":"Invite only: the invitee's name.","oneOf":[{"type":"string"},{"type":"null"}]},"role":{"description":"Invite only: the role offered.","oneOf":[{"type":"string"},{"type":"null"}]},"makeowner":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"cc":{"description":"Extra addresses to CC on this send, shown to every recipient. Each entry may hold one address or several split by , or ;. At most 10 addresses.","oneOf":[{"type":"array","items":{"type":"string"},"maxItems":10},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the document, payslip or contact the email is about.","oneOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Override recipient, as the send takes it.","oneOf":[{"type":"string"},{"type":"null"}]},"message":{"description":"The note the send would carry.","oneOf":[{"type":"string"},{"type":"null"}]},"contactkind":{"description":"Statement only: customer | supplier.","oneOf":[{"type":"string"},{"type":"null"}]},"attachrebilled":{"description":"Invoice only: as api/invoice/send takes it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"attachpdf":{"description":"Invoice only: as api/invoice/send takes it. Names the PDF; never draws it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"attachmentfileids":{"description":"As api/invoice/send or api/statement/send takes it. At most 20.","oneOf":[{"type":"array","items":{"type":"string"},"maxItems":20},{"type":"null"}]},"name":{"description":"Invite only: the invitee's name.","oneOf":[{"type":"string"},{"type":"null"}]},"role":{"description":"Invite only: the role offered.","oneOf":[{"type":"string"},{"type":"null"}]},"makeowner":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"cc":{"description":"Extra addresses to CC on this send, shown to every recipient. Each entry may hold one address or several split by , or ;. At most 10 addresses.","oneOf":[{"type":"array","items":{"type":"string"},"maxItems":10},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Render the payslip email the matching send would deliver, without sending it.","tags":["Email history"]}},"/api/email/preview/invite":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the document, payslip or contact the email is about.","oneOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Override recipient, as the send takes it.","oneOf":[{"type":"string"},{"type":"null"}]},"message":{"description":"The note the send would carry.","oneOf":[{"type":"string"},{"type":"null"}]},"contactkind":{"description":"Statement only: customer | supplier.","oneOf":[{"type":"string"},{"type":"null"}]},"attachrebilled":{"description":"Invoice only: as api/invoice/send takes it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"attachpdf":{"description":"Invoice only: as api/invoice/send takes it. Names the PDF; never draws it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"attachmentfileids":{"description":"As api/invoice/send or api/statement/send takes it. At most 20.","oneOf":[{"type":"array","items":{"type":"string"},"maxItems":20},{"type":"null"}]},"name":{"description":"Invite only: the invitee's name.","oneOf":[{"type":"string"},{"type":"null"}]},"role":{"description":"Invite only: the role offered.","oneOf":[{"type":"string"},{"type":"null"}]},"makeowner":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"cc":{"description":"Extra addresses to CC on this send, shown to every recipient. Each entry may hold one address or several split by , or ;. At most 10 addresses.","oneOf":[{"type":"array","items":{"type":"string"},"maxItems":10},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the document, payslip or contact the email is about.","oneOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Override recipient, as the send takes it.","oneOf":[{"type":"string"},{"type":"null"}]},"message":{"description":"The note the send would carry.","oneOf":[{"type":"string"},{"type":"null"}]},"contactkind":{"description":"Statement only: customer | supplier.","oneOf":[{"type":"string"},{"type":"null"}]},"attachrebilled":{"description":"Invoice only: as api/invoice/send takes it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"attachpdf":{"description":"Invoice only: as api/invoice/send takes it. Names the PDF; never draws it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"attachmentfileids":{"description":"As api/invoice/send or api/statement/send takes it. At most 20.","oneOf":[{"type":"array","items":{"type":"string"},"maxItems":20},{"type":"null"}]},"name":{"description":"Invite only: the invitee's name.","oneOf":[{"type":"string"},{"type":"null"}]},"role":{"description":"Invite only: the role offered.","oneOf":[{"type":"string"},{"type":"null"}]},"makeowner":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"cc":{"description":"Extra addresses to CC on this send, shown to every recipient. Each entry may hold one address or several split by , or ;. At most 10 addresses.","oneOf":[{"type":"array","items":{"type":"string"},"maxItems":10},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the document, payslip or contact the email is about.","oneOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Override recipient, as the send takes it.","oneOf":[{"type":"string"},{"type":"null"}]},"message":{"description":"The note the send would carry.","oneOf":[{"type":"string"},{"type":"null"}]},"contactkind":{"description":"Statement only: customer | supplier.","oneOf":[{"type":"string"},{"type":"null"}]},"attachrebilled":{"description":"Invoice only: as api/invoice/send takes it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"attachpdf":{"description":"Invoice only: as api/invoice/send takes it. Names the PDF; never draws it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"attachmentfileids":{"description":"As api/invoice/send or api/statement/send takes it. At most 20.","oneOf":[{"type":"array","items":{"type":"string"},"maxItems":20},{"type":"null"}]},"name":{"description":"Invite only: the invitee's name.","oneOf":[{"type":"string"},{"type":"null"}]},"role":{"description":"Invite only: the role offered.","oneOf":[{"type":"string"},{"type":"null"}]},"makeowner":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"cc":{"description":"Extra addresses to CC on this send, shown to every recipient. Each entry may hold one address or several split by , or ;. At most 10 addresses.","oneOf":[{"type":"array","items":{"type":"string"},"maxItems":10},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"Id of the document, payslip or contact the email is about.","oneOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Override recipient, as the send takes it.","oneOf":[{"type":"string"},{"type":"null"}]},"message":{"description":"The note the send would carry.","oneOf":[{"type":"string"},{"type":"null"}]},"contactkind":{"description":"Statement only: customer | supplier.","oneOf":[{"type":"string"},{"type":"null"}]},"attachrebilled":{"description":"Invoice only: as api/invoice/send takes it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"attachpdf":{"description":"Invoice only: as api/invoice/send takes it. Names the PDF; never draws it.","oneOf":[{"type":"boolean"},{"type":"null"}]},"attachmentfileids":{"description":"As api/invoice/send or api/statement/send takes it. At most 20.","oneOf":[{"type":"array","items":{"type":"string"},"maxItems":20},{"type":"null"}]},"name":{"description":"Invite only: the invitee's name.","oneOf":[{"type":"string"},{"type":"null"}]},"role":{"description":"Invite only: the role offered.","oneOf":[{"type":"string"},{"type":"null"}]},"makeowner":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"cc":{"description":"Extra addresses to CC on this send, shown to every recipient. Each entry may hold one address or several split by , or ;. At most 10 addresses.","oneOf":[{"type":"array","items":{"type":"string"},"maxItems":10},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Render the invite email the matching send would deliver, without sending it.","tags":["Email history"]}},"/api/cortex/nudge/active":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Get active nudges for the business","tags":["Cortex nudge engine"]}},"/api/cortex/nudge/dismiss":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"nudgeid":{"type":"string"}},"required":["token","nudgeid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"nudgeid":{"type":"string"}},"required":["token","nudgeid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"nudgeid":{"type":"string"}},"required":["token","nudgeid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"nudgeid":{"type":"string"}},"required":["token","nudgeid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Dismiss a nudge","tags":["Cortex nudge engine"]}},"/api/cortex/nudge/acted":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"nudgeid":{"type":"string"}},"required":["token","nudgeid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"nudgeid":{"type":"string"}},"required":["token","nudgeid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"nudgeid":{"type":"string"}},"required":["token","nudgeid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"nudgeid":{"type":"string"}},"required":["token","nudgeid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Mark a nudge as acted on","tags":["Cortex nudge engine"]}},"/api/cortex/ask":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"query":{"type":"string"},"k":{"oneOf":[{"type":"integer"},{"type":"null"}]}},"required":["token","query"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"query":{"type":"string"},"k":{"oneOf":[{"type":"integer"},{"type":"null"}]}},"required":["token","query"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"query":{"type":"string"},"k":{"oneOf":[{"type":"integer"},{"type":"null"}]}},"required":["token","query"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"query":{"type":"string"},"k":{"oneOf":[{"type":"integer"},{"type":"null"}]}},"required":["token","query"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Ask Cortex a question using semantic memory search","tags":["Cortex nudge engine"]}},"/api/cortex/experiment":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"stratum":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"stratum":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"stratum":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"stratum":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Get (or make) this business's arm in a Cortex experiment","tags":["Cortex nudge engine"]}},"/api/cortex/remember":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"kind":{"type":"string"},"memory":{"type":"string"},"domain":{"oneOf":[{"type":"string"},{"type":"null"}]},"condition":{"oneOf":[{"type":"string"},{"type":"null"}]},"expires_in_days":{"oneOf":[{"type":"integer"},{"type":"null"}]},"key":{"description":"For kind profile: a short name for the fact, e.g. accountant. Reuse one cortex_profile lists before naming a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"new_key":{"description":"For kind profile: true when the key looks like an existing one but is a different fact.","oneOf":[{"type":"boolean"},{"type":"null"}]},"seen_in":{"description":"For kind profile: where you saw the value, e.g. \"the letterhead on INV1682\".","oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"description":"The chat to put the proposal in front of the entrepreneur in.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","kind","memory"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"kind":{"type":"string"},"memory":{"type":"string"},"domain":{"oneOf":[{"type":"string"},{"type":"null"}]},"condition":{"oneOf":[{"type":"string"},{"type":"null"}]},"expires_in_days":{"oneOf":[{"type":"integer"},{"type":"null"}]},"key":{"description":"For kind profile: a short name for the fact, e.g. accountant. Reuse one cortex_profile lists before naming a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"new_key":{"description":"For kind profile: true when the key looks like an existing one but is a different fact.","oneOf":[{"type":"boolean"},{"type":"null"}]},"seen_in":{"description":"For kind profile: where you saw the value, e.g. \"the letterhead on INV1682\".","oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"description":"The chat to put the proposal in front of the entrepreneur in.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","kind","memory"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"kind":{"type":"string"},"memory":{"type":"string"},"domain":{"oneOf":[{"type":"string"},{"type":"null"}]},"condition":{"oneOf":[{"type":"string"},{"type":"null"}]},"expires_in_days":{"oneOf":[{"type":"integer"},{"type":"null"}]},"key":{"description":"For kind profile: a short name for the fact, e.g. accountant. Reuse one cortex_profile lists before naming a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"new_key":{"description":"For kind profile: true when the key looks like an existing one but is a different fact.","oneOf":[{"type":"boolean"},{"type":"null"}]},"seen_in":{"description":"For kind profile: where you saw the value, e.g. \"the letterhead on INV1682\".","oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"description":"The chat to put the proposal in front of the entrepreneur in.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","kind","memory"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"kind":{"type":"string"},"memory":{"type":"string"},"domain":{"oneOf":[{"type":"string"},{"type":"null"}]},"condition":{"oneOf":[{"type":"string"},{"type":"null"}]},"expires_in_days":{"oneOf":[{"type":"integer"},{"type":"null"}]},"key":{"description":"For kind profile: a short name for the fact, e.g. accountant. Reuse one cortex_profile lists before naming a new one.","oneOf":[{"type":"string"},{"type":"null"}]},"new_key":{"description":"For kind profile: true when the key looks like an existing one but is a different fact.","oneOf":[{"type":"boolean"},{"type":"null"}]},"seen_in":{"description":"For kind profile: where you saw the value, e.g. \"the letterhead on INV1682\".","oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"description":"The chat to put the proposal in front of the entrepreneur in.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","kind","memory"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Propose something Cortex should remember about this business — a standing rule, a fact, or an observation. This is a PROPOSAL: it has no effect until the founder confirms it. When the founder states something durable (\"those drafts are my quotes\"), pass their own words and the chatid: they see it on a card, their answer arrives as a NEW message, and then you call save_memories. When you only infer something they never said, leave out the chatid: it is kept unconfirmed and read by nothing, until you ask them and they tick it. Never for one-off instructions that only apply to this conversation, and never twice for the same thing. kind is one of rule (a binding instruction, e.g. \"never chase Mr Dlamini for payment\"), fact (a stable truth about the business), or observation (a pattern worth keeping). Keep memory to the durable essence, under 500 characters. kind profile files one concrete value about the business under a short key you name, such as accountant or lease-expiry: pass the key, the value as memory, and seen_in, where you saw it. Reuse a key cortex_profile lists before naming a new one. Never for anything stub already holds, such as the VAT or registration number.","tags":["Cortex nudge engine"]}},"/api/cortex/profile":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Read the business's profile: concrete facts stub has no other field for, such as their accountant, B-BBEE level, CSD number or when their lease ends, each confirmed by the owner. Also lists every key the business uses, so you reuse one rather than name a new one, and common keys still empty. The VAT, registration and payroll numbers are not here: read them with get_business_profile.","tags":["Cortex nudge engine"]}},"/api/cortex/remember/save":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Store what the entrepreneur ticked on a card from cortex_remember, in their name, so every later answer reads it. ONLY call this after their answer has come back: anything they did not tick stays unconfirmed, and a call before they answered stores nothing.","tags":["Cortex nudge engine"]}},"/api/cortex/memory/confirm":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"accept":{"type":"boolean"}},"required":["token","id","accept"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"accept":{"type":"boolean"}},"required":["token","id","accept"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"accept":{"type":"boolean"}},"required":["token","id","accept"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"},"accept":{"type":"boolean"}},"required":["token","id","accept"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Confirm or reject a pending Cortex proposal (founder only)","tags":["Cortex nudge engine"]}},"/api/push/cortex-bootstrap":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"SQS: Bootstrap memories for a business"}},"/api/push/cortex-collect":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"SQS: Collect habits + BI sync for a business"}},"/api/push/cortex-process":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"appid":{"type":"string","minLength":1},"uid":{"type":"string"},"apikey":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["appid","uid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"SQS: Full Cortex processing (AI) for a business"}},"/api/agent/run":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"prompt":{"type":"string"},"chatid":{"oneOf":[{"type":"string"},{"type":"null"}]},"retryof":{"oneOf":[{"type":"string"},{"type":"null"}]},"attachments":{"oneOf":[{"type":"array","items":{"type":"object","properties":{"data":{"type":"string"},"content-type":{"type":"string"},"name":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["data","content-type"],"additionalProperties":false}},{"type":"null"}]},"confirm":{"oneOf":[{"type":"object","properties":{"confirmid":{"description":"Id of the confirm card being answered.","type":"string"},"selected":{"description":"Ids of the ticked items. Empty means the user confirmed none of them.","type":"array","items":{"type":"string"}}},"required":["confirmid","selected"],"additionalProperties":false},{"type":"null"}]}},"required":["token","prompt"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"prompt":{"type":"string"},"chatid":{"oneOf":[{"type":"string"},{"type":"null"}]},"retryof":{"oneOf":[{"type":"string"},{"type":"null"}]},"attachments":{"oneOf":[{"type":"array","items":{"type":"object","properties":{"data":{"type":"string"},"content-type":{"type":"string"},"name":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["data","content-type"],"additionalProperties":false}},{"type":"null"}]},"confirm":{"oneOf":[{"type":"object","properties":{"confirmid":{"description":"Id of the confirm card being answered.","type":"string"},"selected":{"description":"Ids of the ticked items. Empty means the user confirmed none of them.","type":"array","items":{"type":"string"}}},"required":["confirmid","selected"],"additionalProperties":false},{"type":"null"}]}},"required":["token","prompt"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"prompt":{"type":"string"},"chatid":{"oneOf":[{"type":"string"},{"type":"null"}]},"retryof":{"oneOf":[{"type":"string"},{"type":"null"}]},"attachments":{"oneOf":[{"type":"array","items":{"type":"object","properties":{"data":{"type":"string"},"content-type":{"type":"string"},"name":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["data","content-type"],"additionalProperties":false}},{"type":"null"}]},"confirm":{"oneOf":[{"type":"object","properties":{"confirmid":{"description":"Id of the confirm card being answered.","type":"string"},"selected":{"description":"Ids of the ticked items. Empty means the user confirmed none of them.","type":"array","items":{"type":"string"}}},"required":["confirmid","selected"],"additionalProperties":false},{"type":"null"}]}},"required":["token","prompt"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"prompt":{"type":"string"},"chatid":{"oneOf":[{"type":"string"},{"type":"null"}]},"retryof":{"oneOf":[{"type":"string"},{"type":"null"}]},"attachments":{"oneOf":[{"type":"array","items":{"type":"object","properties":{"data":{"type":"string"},"content-type":{"type":"string"},"name":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["data","content-type"],"additionalProperties":false}},{"type":"null"}]},"confirm":{"oneOf":[{"type":"object","properties":{"confirmid":{"description":"Id of the confirm card being answered.","type":"string"},"selected":{"description":"Ids of the ticked items. Empty means the user confirmed none of them.","type":"array","items":{"type":"string"}}},"required":["confirmid","selected"],"additionalProperties":false},{"type":"null"}]}},"required":["token","prompt"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Start an async agent job to action a business","tags":["agent"]}},"/api/agent/status":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"jobid":{"type":"string"}},"required":["token","jobid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"jobid":{"type":"string"}},"required":["token","jobid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"jobid":{"type":"string"}},"required":["token","jobid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"jobid":{"type":"string"}},"required":["token","jobid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Check the status of an agent job","tags":["agent"]}},"/api/agent/status-by-chat":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"type":"string"}},"required":["token","chatid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"type":"string"}},"required":["token","chatid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"type":"string"}},"required":["token","chatid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"type":"string"}},"required":["token","chatid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Resolve the latest running agent job for a chat — lets a session that came back rehydrate a run whose job id it lost, and see (via started) how long it's been running.","tags":["agent"]}},"/api/agent/undo":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"jobid":{"type":"string"}},"required":["token","jobid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"jobid":{"type":"string"}},"required":["token","jobid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"jobid":{"type":"string"}},"required":["token","jobid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"jobid":{"type":"string"}},"required":["token","jobid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Undo a bulk agent run by its job id — reverses every change that run made, skipping anything you've since edited by hand.","tags":["agent"]}},"/api/agent/stop":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"jobid":{"type":"string"},"chatid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","jobid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"jobid":{"type":"string"},"chatid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","jobid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"jobid":{"type":"string"},"chatid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","jobid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"jobid":{"type":"string"},"chatid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","jobid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Stop a running agent job (PROD-1106). The Ask-stub workbench Stop button POSTs {chatid, jobid} here. Delegates to the same cooperative cancel flag the run loop observes between tool iterations, landing the run as cancelled and keeping any committed work.","tags":["agent"]}},"/api/agent/voice-token":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Get a short-lived Deepgram API key for voice input","tags":["agent"]}},"/api/agent/chats":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"List all chats for the business","tags":["agent"]}},"/api/agent/memory":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Whether this business reads its memories the new way","tags":["agent"]}},"/api/agent/memory/enrol":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"on":{"type":"boolean"}},"required":["token","on"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"on":{"type":"boolean"}},"required":["token","on"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"on":{"type":"boolean"}},"required":["token","on"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"on":{"type":"boolean"}},"required":["token","on"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Turn the new memory reading on or off for this business","tags":["agent"]}},"/api/agent/chat":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"type":"string"}},"required":["token","chatid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"type":"string"}},"required":["token","chatid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"type":"string"}},"required":["token","chatid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"type":"string"}},"required":["token","chatid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Get a specific chat's messages","tags":["agent"]}},"/api/agent/chat/prewarm":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Warm this business's Ask-stub context prefix","tags":["agent"]}},"/api/agent/chat/delete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"type":"string"}},"required":["token","chatid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"type":"string"}},"required":["token","chatid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"type":"string"}},"required":["token","chatid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"type":"string"}},"required":["token","chatid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Delete a chat","tags":["agent"]}},"/api/agent/todos":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"description":"Id of the chat whose todo checklist to replace.","type":"string"},"todos":{"description":"The FULL checklist (replaces the stored list, not merged).","type":"array","items":{"type":"object","properties":{"text":{"description":"What the todo item says.","type":"string"},"status":{"description":"Item status: \"pending\", \"in_progress\", or \"done\".","oneOf":[{"type":"string"},{"type":"null"}]},"id":{"description":"Stable id for the item; omit to let the server assign one.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["text"],"additionalProperties":false}}},"required":["token","chatid","todos"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"description":"Id of the chat whose todo checklist to replace.","type":"string"},"todos":{"description":"The FULL checklist (replaces the stored list, not merged).","type":"array","items":{"type":"object","properties":{"text":{"description":"What the todo item says.","type":"string"},"status":{"description":"Item status: \"pending\", \"in_progress\", or \"done\".","oneOf":[{"type":"string"},{"type":"null"}]},"id":{"description":"Stable id for the item; omit to let the server assign one.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["text"],"additionalProperties":false}}},"required":["token","chatid","todos"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"description":"Id of the chat whose todo checklist to replace.","type":"string"},"todos":{"description":"The FULL checklist (replaces the stored list, not merged).","type":"array","items":{"type":"object","properties":{"text":{"description":"What the todo item says.","type":"string"},"status":{"description":"Item status: \"pending\", \"in_progress\", or \"done\".","oneOf":[{"type":"string"},{"type":"null"}]},"id":{"description":"Stable id for the item; omit to let the server assign one.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["text"],"additionalProperties":false}}},"required":["token","chatid","todos"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"description":"Id of the chat whose todo checklist to replace.","type":"string"},"todos":{"description":"The FULL checklist (replaces the stored list, not merged).","type":"array","items":{"type":"object","properties":{"text":{"description":"What the todo item says.","type":"string"},"status":{"description":"Item status: \"pending\", \"in_progress\", or \"done\".","oneOf":[{"type":"string"},{"type":"null"}]},"id":{"description":"Stable id for the item; omit to let the server assign one.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["text"],"additionalProperties":false}}},"required":["token","chatid","todos"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create or replace the todo checklist for the current chat. Pass the FULL list of items every time (the stored list is replaced, not merged). Each item has `text` and a `status` of \"pending\", \"in_progress\", or \"done\". Use this to plan and track multi-step work — mark an item \"in_progress\" before starting it and \"done\" when finished — so progress is visible to the user and survives across sessions. Requires a `chatid` from an ACTIVE Ask-stub chat session — the id cannot be minted via MCP, so this tool applies only when operating inside a chat. Never include ids; name records by number, name, amount or date.","tags":["agent"]}},"/api/agent/confirm":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"description":"Id of the chat to show the list in.","type":"string"},"title":{"description":"One short line saying what the entrepreneur is confirming. No ids.","type":"string"},"items":{"description":"The full list to show. Every item gets its own tick box.","type":"array","items":{"type":"object","properties":{"label":{"description":"What this item says, in plain language. No ids.","type":"string"},"id":{"description":"Stable id for the item; omit to let the server assign one.","oneOf":[{"type":"string"},{"type":"null"}]},"ticked":{"description":"Whether the box starts ticked. Defaults to false.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["label"],"additionalProperties":false}}},"required":["token","chatid","title","items"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"description":"Id of the chat to show the list in.","type":"string"},"title":{"description":"One short line saying what the entrepreneur is confirming. No ids.","type":"string"},"items":{"description":"The full list to show. Every item gets its own tick box.","type":"array","items":{"type":"object","properties":{"label":{"description":"What this item says, in plain language. No ids.","type":"string"},"id":{"description":"Stable id for the item; omit to let the server assign one.","oneOf":[{"type":"string"},{"type":"null"}]},"ticked":{"description":"Whether the box starts ticked. Defaults to false.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["label"],"additionalProperties":false}}},"required":["token","chatid","title","items"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"description":"Id of the chat to show the list in.","type":"string"},"title":{"description":"One short line saying what the entrepreneur is confirming. No ids.","type":"string"},"items":{"description":"The full list to show. Every item gets its own tick box.","type":"array","items":{"type":"object","properties":{"label":{"description":"What this item says, in plain language. No ids.","type":"string"},"id":{"description":"Stable id for the item; omit to let the server assign one.","oneOf":[{"type":"string"},{"type":"null"}]},"ticked":{"description":"Whether the box starts ticked. Defaults to false.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["label"],"additionalProperties":false}}},"required":["token","chatid","title","items"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"description":"Id of the chat to show the list in.","type":"string"},"title":{"description":"One short line saying what the entrepreneur is confirming. No ids.","type":"string"},"items":{"description":"The full list to show. Every item gets its own tick box.","type":"array","items":{"type":"object","properties":{"label":{"description":"What this item says, in plain language. No ids.","type":"string"},"id":{"description":"Stable id for the item; omit to let the server assign one.","oneOf":[{"type":"string"},{"type":"null"}]},"ticked":{"description":"Whether the box starts ticked. Defaults to false.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["label"],"additionalProperties":false}}},"required":["token","chatid","title","items"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Show the entrepreneur a list of items with tick boxes and WAIT for their answer. Use this instead of asking them to reply with numbers whenever you need them to pick from, approve, or check off a set of things. Pass the FULL list every time; each item needs a `label` and may start `ticked`. Their answer does NOT come back from this call — it arrives later as a NEW message. Call this, tell them briefly what you have put in front of them, and then STOP: do not assume what they picked, do not act on any of the items, and do not call this tool again in the same turn. Requires a `chatid` from an ACTIVE Ask-stub chat session — the id cannot be minted via MCP, so this tool applies only when operating inside a chat. Never include ids; name records by number, name, amount or date.","tags":["agent"]}},"/api/agent/noactivity/propose":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"description":"Id of the chat to show the list in.","type":"string"},"periods":{"description":"The months with no entries, each as yyyy-MM (e.g. \"2025-09\"). Only the\n      months your answer actually covers.","type":"array","items":{"type":"string"}}},"required":["token","chatid","periods"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"description":"Id of the chat to show the list in.","type":"string"},"periods":{"description":"The months with no entries, each as yyyy-MM (e.g. \"2025-09\"). Only the\n      months your answer actually covers.","type":"array","items":{"type":"string"}}},"required":["token","chatid","periods"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"description":"Id of the chat to show the list in.","type":"string"},"periods":{"description":"The months with no entries, each as yyyy-MM (e.g. \"2025-09\"). Only the\n      months your answer actually covers.","type":"array","items":{"type":"string"}}},"required":["token","chatid","periods"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"description":"Id of the chat to show the list in.","type":"string"},"periods":{"description":"The months with no entries, each as yyyy-MM (e.g. \"2025-09\"). Only the\n      months your answer actually covers.","type":"array","items":{"type":"string"}}},"required":["token","chatid","periods"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Ask the entrepreneur to confirm that specific months had NO trading activity, when your answer ran into months with no entries and you cannot tell a real zero from missing books. Pass the months as yyyy-MM; the wording they see is written by stub, not by you. Their answer does NOT come back from this call — it arrives later as a NEW message. Call this, say briefly what you have put in front of them, and then STOP. Use this only for \"the business was paused/closed\"; if the books are missing because statements or a bank feed never arrived, help them connect or upload instead — this tool would record a wrong zero.","tags":["agent"]}},"/api/agent/noactivity/mark":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"oneOf":[{"type":"string"},{"type":"null"}]},"periods":{"description":"The months to record, each as yyyy-MM. Only months the entrepreneur\n      ticked are recorded; anything else is ignored.","type":"array","items":{"type":"string"}}},"required":["token","periods"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"oneOf":[{"type":"string"},{"type":"null"}]},"periods":{"description":"The months to record, each as yyyy-MM. Only months the entrepreneur\n      ticked are recorded; anything else is ignored.","type":"array","items":{"type":"string"}}},"required":["token","periods"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"oneOf":[{"type":"string"},{"type":"null"}]},"periods":{"description":"The months to record, each as yyyy-MM. Only months the entrepreneur\n      ticked are recorded; anything else is ignored.","type":"array","items":{"type":"string"}}},"required":["token","periods"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"oneOf":[{"type":"string"},{"type":"null"}]},"periods":{"description":"The months to record, each as yyyy-MM. Only months the entrepreneur\n      ticked are recorded; anything else is ignored.","type":"array","items":{"type":"string"}}},"required":["token","periods"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Record months as genuinely having no trading activity, so they read as a real zero instead of a gap and stub stops asking about them. ONLY call this after the entrepreneur has ticked those months on a card from propose_no_activity_periods and their answer has come back. The months are checked against what they actually ticked: anything they did not tick is ignored, and a call made before they answered records nothing at all. Do not use it to paper over missing statements or a bank feed that never synced.","tags":["agent"]}},"/api/agent/rules/propose":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"description":"Id of the chat to show the card in.","type":"string"},"rules":{"description":"Each rule as one short instruction in the entrepreneur's own words,\n      under 280 characters — e.g. \"Payments from ACME PTY are always\n      consulting income\".","type":"array","items":{"type":"string"}}},"required":["token","chatid","rules"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"description":"Id of the chat to show the card in.","type":"string"},"rules":{"description":"Each rule as one short instruction in the entrepreneur's own words,\n      under 280 characters — e.g. \"Payments from ACME PTY are always\n      consulting income\".","type":"array","items":{"type":"string"}}},"required":["token","chatid","rules"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"description":"Id of the chat to show the card in.","type":"string"},"rules":{"description":"Each rule as one short instruction in the entrepreneur's own words,\n      under 280 characters — e.g. \"Payments from ACME PTY are always\n      consulting income\".","type":"array","items":{"type":"string"}}},"required":["token","chatid","rules"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"description":"Id of the chat to show the card in.","type":"string"},"rules":{"description":"Each rule as one short instruction in the entrepreneur's own words,\n      under 280 characters — e.g. \"Payments from ACME PTY are always\n      consulting income\".","type":"array","items":{"type":"string"}}},"required":["token","chatid","rules"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"When the entrepreneur corrects you with something that should hold from now on (\"ACME is always consulting income\", \"never count the loan account as revenue\"), offer to remember it as a standing rule. Pass the rule as one short instruction in their own words. They see it word for word and tick it; their answer does NOT come back from this call — it arrives later as a NEW message. Call this, say briefly what you have put in front of them, and then STOP. Never offer a rule they did not state or clearly imply. Never include ids; name records by number, name, amount or date.","tags":["agent"]}},"/api/agent/rules/save":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"oneOf":[{"type":"string"},{"type":"null"}]},"rules":{"description":"The rules to store, word for word as they were shown. Only rules the\n      entrepreneur ticked are stored; anything else is ignored.","type":"array","items":{"type":"string"}},"correction":{"description":"The entrepreneur's message that prompted the rule, as provenance.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","rules"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"oneOf":[{"type":"string"},{"type":"null"}]},"rules":{"description":"The rules to store, word for word as they were shown. Only rules the\n      entrepreneur ticked are stored; anything else is ignored.","type":"array","items":{"type":"string"}},"correction":{"description":"The entrepreneur's message that prompted the rule, as provenance.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","rules"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"oneOf":[{"type":"string"},{"type":"null"}]},"rules":{"description":"The rules to store, word for word as they were shown. Only rules the\n      entrepreneur ticked are stored; anything else is ignored.","type":"array","items":{"type":"string"}},"correction":{"description":"The entrepreneur's message that prompted the rule, as provenance.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","rules"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"oneOf":[{"type":"string"},{"type":"null"}]},"rules":{"description":"The rules to store, word for word as they were shown. Only rules the\n      entrepreneur ticked are stored; anything else is ignored.","type":"array","items":{"type":"string"}},"correction":{"description":"The entrepreneur's message that prompted the rule, as provenance.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","rules"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Store standing rules the entrepreneur has confirmed, so every later answer follows them. ONLY call this after they ticked the rule on a card from propose_rule and their answer has come back. Pass the rules word for word as shown: anything they did not tick is ignored, and a call made before they answered stores nothing.","tags":["agent"]}},"/api/agent/rules/list":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"List the standing rules this business has asked stub to follow, oldest first, each with its id. Use it when the entrepreneur asks what stub remembers, or before deleting one.","tags":["agent"]}},"/api/agent/rules/delete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"id":{"description":"The rule id, from list_rules.","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"id":{"description":"The rule id, from list_rules.","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"id":{"description":"The rule id, from list_rules.","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"id":{"description":"The rule id, from list_rules.","type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Delete one standing rule when the entrepreneur asks stub to forget it. Pass the id from list_rules. Only delete a rule they asked you to remove.","tags":["agent"]}},"/api/agent/hq/find-business":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"query":{"type":"string"}},"required":["token","query"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"query":{"type":"string"}},"required":["token","query"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"query":{"type":"string"}},"required":["token","query"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"query":{"type":"string"}},"required":["token","query"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Find a business by free-text query (name, email, id, industry, or fuzzy/semantic). Returns up to 50 candidates with id, name, email, industry, city, status.","tags":["agent"]}},"/api/agent/hq/read-ui-trail":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string"},"reason":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"uid":{"oneOf":[{"type":"string"},{"type":"null"}]},"since":{"oneOf":[{"anyOf":[{"type":"integer"},{"type":"string"}]},{"type":"null"}]},"until":{"oneOf":[{"anyOf":[{"type":"integer"},{"type":"string"}]},{"type":"null"}]},"limit":{"oneOf":[{"type":"integer"},{"type":"null"}]}},"required":["token","businessid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string"},"reason":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"uid":{"oneOf":[{"type":"string"},{"type":"null"}]},"since":{"oneOf":[{"anyOf":[{"type":"integer"},{"type":"string"}]},{"type":"null"}]},"until":{"oneOf":[{"anyOf":[{"type":"integer"},{"type":"string"}]},{"type":"null"}]},"limit":{"oneOf":[{"type":"integer"},{"type":"null"}]}},"required":["token","businessid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string"},"reason":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"uid":{"oneOf":[{"type":"string"},{"type":"null"}]},"since":{"oneOf":[{"anyOf":[{"type":"integer"},{"type":"string"}]},{"type":"null"}]},"until":{"oneOf":[{"anyOf":[{"type":"integer"},{"type":"string"}]},{"type":"null"}]},"limit":{"oneOf":[{"type":"integer"},{"type":"null"}]}},"required":["token","businessid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"type":"string"},"reason":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"uid":{"oneOf":[{"type":"string"},{"type":"null"}]},"since":{"oneOf":[{"anyOf":[{"type":"integer"},{"type":"string"}]},{"type":"null"}]},"until":{"oneOf":[{"anyOf":[{"type":"integer"},{"type":"string"}]},{"type":"null"}]},"limit":{"oneOf":[{"type":"integer"},{"type":"null"}]}},"required":["token","businessid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Read a founder's UI trail on one business: what they pressed, saw, and which requests and toasts they hit, as text lines in the business's time zone plus the raw events. Names, never values. `email` or `uid` picks one member (omitted: all members); `since`/`until` are epoch millis or ISO instants (default the last 60 minutes); `limit` is at most 500 (default 200). `reason` is required, e.g. the Intercom conversation id; it is recorded on the staff-access row.","tags":["agent"]}},"/api/agent/barb/access":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"uid":{"type":"string"}},"required":["uid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"uid":{"type":"string"}},"required":["uid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"uid":{"type":"string"}},"required":["uid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"uid":{"type":"string"}},"required":["uid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"List the businesses a user can access — owner or invited member (customer-path tenant boundary)","tags":["agent"]}},"/api/agent/barb/context":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"uid":{"type":"string"},"businessid":{"type":"string"}},"required":["uid","businessid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"uid":{"type":"string"},"businessid":{"type":"string"}},"required":["uid","businessid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"uid":{"type":"string"},"businessid":{"type":"string"}},"required":["uid","businessid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"uid":{"type":"string"},"businessid":{"type":"string"}},"required":["uid","businessid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Business context for the customer path — 403 unless the user has access to the business","tags":["agent"]}},"/api/agent/barb/grant":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"businessid":{"type":"string"}},"required":["businessid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"businessid":{"type":"string"}},"required":["businessid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"businessid":{"type":"string"}},"required":["businessid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"businessid":{"type":"string"}},"required":["businessid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Exchange the agent root token for a business-scoped MCP grant (1 hour): read-only if authenticated with STUB_AGENT_READ, full read+write with STUB_AGENT_WRITE. 403 for a business flagged sensitive.","tags":["agent"]}},"/api/agent/barb/find-business":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string"}},"required":["query"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"query":{"type":"string"}},"required":["query"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"query":{"type":"string"}},"required":["query"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"query":{"type":"string"}},"required":["query"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Find a business by free-text query (name, email, id). Returns safe summary fields only — pass an id to /grant to read its data.","tags":["agent"]}},"/api/agent/barb/outcome":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"conversation_id":{"anyOf":[{"type":"string"},{"type":"integer"}]},"started_at":{"anyOf":[{"type":"integer"},{"type":"string"}]},"business_id":{"oneOf":[{"type":"string"},{"type":"null"}]},"uid":{"oneOf":[{"type":"string"},{"type":"null"}]},"channel":{"oneOf":[{"type":"string"},{"type":"null"}]},"topic":{"oneOf":[{"type":"string"},{"type":"null"}]},"title":{"oneOf":[{"type":"string"},{"type":"null"}]},"tickets":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"closed_by":{"oneOf":[{"anyOf":[{"type":"string"},{"type":"integer"}]},{"type":"null"}]},"teammate_replied":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"closed_at":{"oneOf":[{"anyOf":[{"type":"integer"},{"type":"string"}]},{"type":"null"}]},"reopened_at":{"oneOf":[{"anyOf":[{"type":"integer"},{"type":"string"}]},{"type":"null"}]},"count_reopens":{"oneOf":[{"type":"integer"},{"type":"null"}]},"fix_delivered":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"customer_confirmed":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"finished_by":{"oneOf":[{"anyOf":[{"type":"string"},{"type":"integer"}]},{"type":"null"}]}},"required":["conversation_id","started_at"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"conversation_id":{"anyOf":[{"type":"string"},{"type":"integer"}]},"started_at":{"anyOf":[{"type":"integer"},{"type":"string"}]},"business_id":{"oneOf":[{"type":"string"},{"type":"null"}]},"uid":{"oneOf":[{"type":"string"},{"type":"null"}]},"channel":{"oneOf":[{"type":"string"},{"type":"null"}]},"topic":{"oneOf":[{"type":"string"},{"type":"null"}]},"title":{"oneOf":[{"type":"string"},{"type":"null"}]},"tickets":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"closed_by":{"oneOf":[{"anyOf":[{"type":"string"},{"type":"integer"}]},{"type":"null"}]},"teammate_replied":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"closed_at":{"oneOf":[{"anyOf":[{"type":"integer"},{"type":"string"}]},{"type":"null"}]},"reopened_at":{"oneOf":[{"anyOf":[{"type":"integer"},{"type":"string"}]},{"type":"null"}]},"count_reopens":{"oneOf":[{"type":"integer"},{"type":"null"}]},"fix_delivered":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"customer_confirmed":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"finished_by":{"oneOf":[{"anyOf":[{"type":"string"},{"type":"integer"}]},{"type":"null"}]}},"required":["conversation_id","started_at"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"conversation_id":{"anyOf":[{"type":"string"},{"type":"integer"}]},"started_at":{"anyOf":[{"type":"integer"},{"type":"string"}]},"business_id":{"oneOf":[{"type":"string"},{"type":"null"}]},"uid":{"oneOf":[{"type":"string"},{"type":"null"}]},"channel":{"oneOf":[{"type":"string"},{"type":"null"}]},"topic":{"oneOf":[{"type":"string"},{"type":"null"}]},"title":{"oneOf":[{"type":"string"},{"type":"null"}]},"tickets":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"closed_by":{"oneOf":[{"anyOf":[{"type":"string"},{"type":"integer"}]},{"type":"null"}]},"teammate_replied":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"closed_at":{"oneOf":[{"anyOf":[{"type":"integer"},{"type":"string"}]},{"type":"null"}]},"reopened_at":{"oneOf":[{"anyOf":[{"type":"integer"},{"type":"string"}]},{"type":"null"}]},"count_reopens":{"oneOf":[{"type":"integer"},{"type":"null"}]},"fix_delivered":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"customer_confirmed":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"finished_by":{"oneOf":[{"anyOf":[{"type":"string"},{"type":"integer"}]},{"type":"null"}]}},"required":["conversation_id","started_at"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"conversation_id":{"anyOf":[{"type":"string"},{"type":"integer"}]},"started_at":{"anyOf":[{"type":"integer"},{"type":"string"}]},"business_id":{"oneOf":[{"type":"string"},{"type":"null"}]},"uid":{"oneOf":[{"type":"string"},{"type":"null"}]},"channel":{"oneOf":[{"type":"string"},{"type":"null"}]},"topic":{"oneOf":[{"type":"string"},{"type":"null"}]},"title":{"oneOf":[{"type":"string"},{"type":"null"}]},"tickets":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"closed_by":{"oneOf":[{"anyOf":[{"type":"string"},{"type":"integer"}]},{"type":"null"}]},"teammate_replied":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"closed_at":{"oneOf":[{"anyOf":[{"type":"integer"},{"type":"string"}]},{"type":"null"}]},"reopened_at":{"oneOf":[{"anyOf":[{"type":"integer"},{"type":"string"}]},{"type":"null"}]},"count_reopens":{"oneOf":[{"type":"integer"},{"type":"null"}]},"fix_delivered":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"customer_confirmed":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"finished_by":{"oneOf":[{"anyOf":[{"type":"string"},{"type":"integer"}]},{"type":"null"}]}},"required":["conversation_id","started_at"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Barb records how one Intercom conversation went (write token only). Idempotent per conversation_id; count_reopens is Intercom's absolute count.","tags":["agent"]}},"/api/agent/barb/cost":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"conversation_id":{"anyOf":[{"type":"string"},{"type":"integer"}]},"turn_id":{"type":"string"},"step_index":{"type":"integer"},"at":{"anyOf":[{"type":"integer"},{"type":"string"}]},"message_id":{"oneOf":[{"type":"string"},{"type":"null"}]},"surface":{"oneOf":[{"type":"string"},{"type":"null"}]},"shadow":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"model":{"oneOf":[{"type":"string"},{"type":"null"}]},"input_tokens":{"oneOf":[{"type":"integer"},{"type":"null"}]},"cache_read_tokens":{"oneOf":[{"type":"integer"},{"type":"null"}]},"cache_write_tokens":{"oneOf":[{"type":"integer"},{"type":"null"}]},"output_tokens":{"oneOf":[{"type":"integer"},{"type":"null"}]},"cost_usd":{"oneOf":[{"type":"number"},{"type":"null"}]}},"required":["conversation_id","turn_id","step_index","at"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"conversation_id":{"anyOf":[{"type":"string"},{"type":"integer"}]},"turn_id":{"type":"string"},"step_index":{"type":"integer"},"at":{"anyOf":[{"type":"integer"},{"type":"string"}]},"message_id":{"oneOf":[{"type":"string"},{"type":"null"}]},"surface":{"oneOf":[{"type":"string"},{"type":"null"}]},"shadow":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"model":{"oneOf":[{"type":"string"},{"type":"null"}]},"input_tokens":{"oneOf":[{"type":"integer"},{"type":"null"}]},"cache_read_tokens":{"oneOf":[{"type":"integer"},{"type":"null"}]},"cache_write_tokens":{"oneOf":[{"type":"integer"},{"type":"null"}]},"output_tokens":{"oneOf":[{"type":"integer"},{"type":"null"}]},"cost_usd":{"oneOf":[{"type":"number"},{"type":"null"}]}},"required":["conversation_id","turn_id","step_index","at"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"conversation_id":{"anyOf":[{"type":"string"},{"type":"integer"}]},"turn_id":{"type":"string"},"step_index":{"type":"integer"},"at":{"anyOf":[{"type":"integer"},{"type":"string"}]},"message_id":{"oneOf":[{"type":"string"},{"type":"null"}]},"surface":{"oneOf":[{"type":"string"},{"type":"null"}]},"shadow":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"model":{"oneOf":[{"type":"string"},{"type":"null"}]},"input_tokens":{"oneOf":[{"type":"integer"},{"type":"null"}]},"cache_read_tokens":{"oneOf":[{"type":"integer"},{"type":"null"}]},"cache_write_tokens":{"oneOf":[{"type":"integer"},{"type":"null"}]},"output_tokens":{"oneOf":[{"type":"integer"},{"type":"null"}]},"cost_usd":{"oneOf":[{"type":"number"},{"type":"null"}]}},"required":["conversation_id","turn_id","step_index","at"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"conversation_id":{"anyOf":[{"type":"string"},{"type":"integer"}]},"turn_id":{"type":"string"},"step_index":{"type":"integer"},"at":{"anyOf":[{"type":"integer"},{"type":"string"}]},"message_id":{"oneOf":[{"type":"string"},{"type":"null"}]},"surface":{"oneOf":[{"type":"string"},{"type":"null"}]},"shadow":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"model":{"oneOf":[{"type":"string"},{"type":"null"}]},"input_tokens":{"oneOf":[{"type":"integer"},{"type":"null"}]},"cache_read_tokens":{"oneOf":[{"type":"integer"},{"type":"null"}]},"cache_write_tokens":{"oneOf":[{"type":"integer"},{"type":"null"}]},"output_tokens":{"oneOf":[{"type":"integer"},{"type":"null"}]},"cost_usd":{"oneOf":[{"type":"number"},{"type":"null"}]}},"required":["conversation_id","turn_id","step_index","at"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Barb records what one model call on an Intercom conversation cost (write token only). Idempotent per (conversation_id, turn_id, step_index).","tags":["agent"]}},"/api/agent/rules/category/propose":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"description":"Id of the chat to show the card in.","type":"string"},"type":{"description":"\"expense\" for money out, \"income\" for money in.","type":"string"},"match":{"description":"A short piece of the line's description to match, e.g. \"FNB fee\". At least 4 characters.","type":"string"},"how":{"description":"\"contains\" (the default) or \"starts-with\".","oneOf":[{"type":"string"},{"type":"null"}]},"account":{"description":"The account's exact name in their chart, e.g. \"Bank Charges\".","type":"string"},"bankaccount":{"description":"Only lines on this bank account: its name, bank or last four digits. Leave out for every account.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","chatid","type","match","account"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"description":"Id of the chat to show the card in.","type":"string"},"type":{"description":"\"expense\" for money out, \"income\" for money in.","type":"string"},"match":{"description":"A short piece of the line's description to match, e.g. \"FNB fee\". At least 4 characters.","type":"string"},"how":{"description":"\"contains\" (the default) or \"starts-with\".","oneOf":[{"type":"string"},{"type":"null"}]},"account":{"description":"The account's exact name in their chart, e.g. \"Bank Charges\".","type":"string"},"bankaccount":{"description":"Only lines on this bank account: its name, bank or last four digits. Leave out for every account.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","chatid","type","match","account"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"description":"Id of the chat to show the card in.","type":"string"},"type":{"description":"\"expense\" for money out, \"income\" for money in.","type":"string"},"match":{"description":"A short piece of the line's description to match, e.g. \"FNB fee\". At least 4 characters.","type":"string"},"how":{"description":"\"contains\" (the default) or \"starts-with\".","oneOf":[{"type":"string"},{"type":"null"}]},"account":{"description":"The account's exact name in their chart, e.g. \"Bank Charges\".","type":"string"},"bankaccount":{"description":"Only lines on this bank account: its name, bank or last four digits. Leave out for every account.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","chatid","type","match","account"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"description":"Id of the chat to show the card in.","type":"string"},"type":{"description":"\"expense\" for money out, \"income\" for money in.","type":"string"},"match":{"description":"A short piece of the line's description to match, e.g. \"FNB fee\". At least 4 characters.","type":"string"},"how":{"description":"\"contains\" (the default) or \"starts-with\".","oneOf":[{"type":"string"},{"type":"null"}]},"account":{"description":"The account's exact name in their chart, e.g. \"Bank Charges\".","type":"string"},"bankaccount":{"description":"Only lines on this bank account: its name, bank or last four digits. Leave out for every account.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","chatid","type","match","account"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"When they ask for lines to always go to one account (\"every FNB fee goes to Bank Charges\", \"Uber is always travel\"), offer it as a categorisation rule. Pass the description text to match, money in or out, and the account's exact name; add a bank account only if they named one. For several rules, call once per rule: they share one card. They see the rule in plain words and tick it; their answer arrives later as a NEW message. Call this, say what you put in front of them, then STOP. A rule about how you answer goes to propose_rule instead.","tags":["agent"]}},"/api/agent/rules/category/save":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"oneOf":[{"type":"string"},{"type":"null"}]},"correction":{"description":"The message that asked for the rule, as provenance.","oneOf":[{"type":"string"},{"type":"null"}]},"type":{"description":"\"expense\" for money out, \"income\" for money in.","type":"string"},"match":{"description":"A short piece of the line's description to match, e.g. \"FNB fee\". At least 4 characters.","type":"string"},"how":{"description":"\"contains\" (the default) or \"starts-with\".","oneOf":[{"type":"string"},{"type":"null"}]},"account":{"description":"The account's exact name in their chart, e.g. \"Bank Charges\".","type":"string"},"bankaccount":{"description":"Only lines on this bank account: its name, bank or last four digits. Leave out for every account.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","type","match","account"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"oneOf":[{"type":"string"},{"type":"null"}]},"correction":{"description":"The message that asked for the rule, as provenance.","oneOf":[{"type":"string"},{"type":"null"}]},"type":{"description":"\"expense\" for money out, \"income\" for money in.","type":"string"},"match":{"description":"A short piece of the line's description to match, e.g. \"FNB fee\". At least 4 characters.","type":"string"},"how":{"description":"\"contains\" (the default) or \"starts-with\".","oneOf":[{"type":"string"},{"type":"null"}]},"account":{"description":"The account's exact name in their chart, e.g. \"Bank Charges\".","type":"string"},"bankaccount":{"description":"Only lines on this bank account: its name, bank or last four digits. Leave out for every account.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","type","match","account"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"oneOf":[{"type":"string"},{"type":"null"}]},"correction":{"description":"The message that asked for the rule, as provenance.","oneOf":[{"type":"string"},{"type":"null"}]},"type":{"description":"\"expense\" for money out, \"income\" for money in.","type":"string"},"match":{"description":"A short piece of the line's description to match, e.g. \"FNB fee\". At least 4 characters.","type":"string"},"how":{"description":"\"contains\" (the default) or \"starts-with\".","oneOf":[{"type":"string"},{"type":"null"}]},"account":{"description":"The account's exact name in their chart, e.g. \"Bank Charges\".","type":"string"},"bankaccount":{"description":"Only lines on this bank account: its name, bank or last four digits. Leave out for every account.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","type","match","account"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"oneOf":[{"type":"string"},{"type":"null"}]},"correction":{"description":"The message that asked for the rule, as provenance.","oneOf":[{"type":"string"},{"type":"null"}]},"type":{"description":"\"expense\" for money out, \"income\" for money in.","type":"string"},"match":{"description":"A short piece of the line's description to match, e.g. \"FNB fee\". At least 4 characters.","type":"string"},"how":{"description":"\"contains\" (the default) or \"starts-with\".","oneOf":[{"type":"string"},{"type":"null"}]},"account":{"description":"The account's exact name in their chart, e.g. \"Bank Charges\".","type":"string"},"bankaccount":{"description":"Only lines on this bank account: its name, bank or last four digits. Leave out for every account.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","type","match","account"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Store a categorisation rule they ticked on a propose_category_rule card, so new lines that match go to that account. ONLY call this after their answer came back. Pass the same type, match, how, account and bankaccount you proposed: a rule they did not tick stores nothing. It does not change lines already in the books.","tags":["agent"]}},"/api/agent/rules/category/fix/propose":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"description":"Id of the chat to show the card in.","type":"string"},"page":{"description":"Which 50 lines to show, from 1 (the default).","oneOf":[{"type":"integer"},{"type":"null"}]},"type":{"description":"\"expense\" for money out, \"income\" for money in.","type":"string"},"match":{"description":"A short piece of the line's description to match, e.g. \"FNB fee\". At least 4 characters.","type":"string"},"how":{"description":"\"contains\" (the default) or \"starts-with\".","oneOf":[{"type":"string"},{"type":"null"}]},"account":{"description":"The account's exact name in their chart, e.g. \"Bank Charges\".","type":"string"},"bankaccount":{"description":"Only lines on this bank account: its name, bank or last four digits. Leave out for every account.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","chatid","type","match","account"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"description":"Id of the chat to show the card in.","type":"string"},"page":{"description":"Which 50 lines to show, from 1 (the default).","oneOf":[{"type":"integer"},{"type":"null"}]},"type":{"description":"\"expense\" for money out, \"income\" for money in.","type":"string"},"match":{"description":"A short piece of the line's description to match, e.g. \"FNB fee\". At least 4 characters.","type":"string"},"how":{"description":"\"contains\" (the default) or \"starts-with\".","oneOf":[{"type":"string"},{"type":"null"}]},"account":{"description":"The account's exact name in their chart, e.g. \"Bank Charges\".","type":"string"},"bankaccount":{"description":"Only lines on this bank account: its name, bank or last four digits. Leave out for every account.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","chatid","type","match","account"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"description":"Id of the chat to show the card in.","type":"string"},"page":{"description":"Which 50 lines to show, from 1 (the default).","oneOf":[{"type":"integer"},{"type":"null"}]},"type":{"description":"\"expense\" for money out, \"income\" for money in.","type":"string"},"match":{"description":"A short piece of the line's description to match, e.g. \"FNB fee\". At least 4 characters.","type":"string"},"how":{"description":"\"contains\" (the default) or \"starts-with\".","oneOf":[{"type":"string"},{"type":"null"}]},"account":{"description":"The account's exact name in their chart, e.g. \"Bank Charges\".","type":"string"},"bankaccount":{"description":"Only lines on this bank account: its name, bank or last four digits. Leave out for every account.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","chatid","type","match","account"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"description":"Id of the chat to show the card in.","type":"string"},"page":{"description":"Which 50 lines to show, from 1 (the default).","oneOf":[{"type":"integer"},{"type":"null"}]},"type":{"description":"\"expense\" for money out, \"income\" for money in.","type":"string"},"match":{"description":"A short piece of the line's description to match, e.g. \"FNB fee\". At least 4 characters.","type":"string"},"how":{"description":"\"contains\" (the default) or \"starts-with\".","oneOf":[{"type":"string"},{"type":"null"}]},"account":{"description":"The account's exact name in their chart, e.g. \"Bank Charges\".","type":"string"},"bankaccount":{"description":"Only lines on this bank account: its name, bank or last four digits. Leave out for every account.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","chatid","type","match","account"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Right after save_category_rule stored a rule, offer to move the PAST lines it matches. Pass the same type, match, how, account and bankaccount. They see each line with the account it is in now and tick the ones to move; their answer arrives later as a NEW message. Lines in a locked period are left out. A card shows 50 lines; :more counts the rest. Moved lines leave the list, so after an apply call again with page 1 for the next ones; page 2 and on show the lines they left. Lines for several rules share one card. Call this, say what you put in front of them, then STOP.","tags":["agent"]}},"/api/agent/rules/category/fix/apply":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"oneOf":[{"type":"string"},{"type":"null"}]},"type":{"description":"\"expense\" for money out, \"income\" for money in.","type":"string"},"match":{"description":"A short piece of the line's description to match, e.g. \"FNB fee\". At least 4 characters.","type":"string"},"how":{"description":"\"contains\" (the default) or \"starts-with\".","oneOf":[{"type":"string"},{"type":"null"}]},"account":{"description":"The account's exact name in their chart, e.g. \"Bank Charges\".","type":"string"},"bankaccount":{"description":"Only lines on this bank account: its name, bank or last four digits. Leave out for every account.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","type","match","account"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"oneOf":[{"type":"string"},{"type":"null"}]},"type":{"description":"\"expense\" for money out, \"income\" for money in.","type":"string"},"match":{"description":"A short piece of the line's description to match, e.g. \"FNB fee\". At least 4 characters.","type":"string"},"how":{"description":"\"contains\" (the default) or \"starts-with\".","oneOf":[{"type":"string"},{"type":"null"}]},"account":{"description":"The account's exact name in their chart, e.g. \"Bank Charges\".","type":"string"},"bankaccount":{"description":"Only lines on this bank account: its name, bank or last four digits. Leave out for every account.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","type","match","account"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"oneOf":[{"type":"string"},{"type":"null"}]},"type":{"description":"\"expense\" for money out, \"income\" for money in.","type":"string"},"match":{"description":"A short piece of the line's description to match, e.g. \"FNB fee\". At least 4 characters.","type":"string"},"how":{"description":"\"contains\" (the default) or \"starts-with\".","oneOf":[{"type":"string"},{"type":"null"}]},"account":{"description":"The account's exact name in their chart, e.g. \"Bank Charges\".","type":"string"},"bankaccount":{"description":"Only lines on this bank account: its name, bank or last four digits. Leave out for every account.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","type","match","account"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"chatid":{"oneOf":[{"type":"string"},{"type":"null"}]},"type":{"description":"\"expense\" for money out, \"income\" for money in.","type":"string"},"match":{"description":"A short piece of the line's description to match, e.g. \"FNB fee\". At least 4 characters.","type":"string"},"how":{"description":"\"contains\" (the default) or \"starts-with\".","oneOf":[{"type":"string"},{"type":"null"}]},"account":{"description":"The account's exact name in their chart, e.g. \"Bank Charges\".","type":"string"},"bankaccount":{"description":"Only lines on this bank account: its name, bank or last four digits. Leave out for every account.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","type","match","account"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Move the past lines they ticked on a propose_category_fix card to the rule's account. ONLY call this after their answer came back. Pass the same type, match, how, account and bankaccount. Only ticked lines move; a line that changed or got locked since the card stays put. Undoing the turn puts them back.","tags":["agent"]}},"/api/agent/memory/list":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"The rules and facts stub remembers about this business","tags":["Agent memory"]}},"/api/agent/memory/edit":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"The memory's id, from the list.","type":"string"},"text":{"description":"The new words, as the owner wants them kept.","type":"string"}},"required":["token","id","text"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"The memory's id, from the list.","type":"string"},"text":{"description":"The new words, as the owner wants them kept.","type":"string"}},"required":["token","id","text"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"The memory's id, from the list.","type":"string"},"text":{"description":"The new words, as the owner wants them kept.","type":"string"}},"required":["token","id","text"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"The memory's id, from the list.","type":"string"},"text":{"description":"The new words, as the owner wants them kept.","type":"string"}},"required":["token","id","text"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Replace a rule or fact with new words; the old one is kept as replaced","tags":["Agent memory"]}},"/api/agent/memory/withdraw":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"The memory's id, from the list.","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"The memory's id, from the list.","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"The memory's id, from the list.","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"The memory's id, from the list.","type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Take a rule or fact out of every answer; the history keeps it","tags":["Agent memory"]}},"/api/agent/memory/profile":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Every profile key, its value, and any value an agent proposed","tags":["Agent memory"]}},"/api/agent/memory/profile/set":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"key":{"description":"A profile key, from the list.","type":"string"},"value":{"description":"The value, as the owner wants it kept.","type":"string"}},"required":["token","key","value"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"key":{"description":"A profile key, from the list.","type":"string"},"value":{"description":"The value, as the owner wants it kept.","type":"string"}},"required":["token","key","value"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"key":{"description":"A profile key, from the list.","type":"string"},"value":{"description":"The value, as the owner wants it kept.","type":"string"}},"required":["token","key","value"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"key":{"description":"A profile key, from the list.","type":"string"},"value":{"description":"The value, as the owner wants it kept.","type":"string"}},"required":["token","key","value"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Set a profile value in the owner's name; the old one is kept as replaced","tags":["Agent memory"]}},"/api/agent/memory/profile/confirm":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"The proposal's id, from the list.","type":"string"},"accept":{"description":"true keeps it in the owner's name; false turns it down.","type":"boolean"}},"required":["token","id","accept"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"The proposal's id, from the list.","type":"string"},"accept":{"description":"true keeps it in the owner's name; false turns it down.","type":"boolean"}},"required":["token","id","accept"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"The proposal's id, from the list.","type":"string"},"accept":{"description":"true keeps it in the owner's name; false turns it down.","type":"boolean"}},"required":["token","id","accept"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"The proposal's id, from the list.","type":"string"},"accept":{"description":"true keeps it in the owner's name; false turns it down.","type":"boolean"}},"required":["token","id","accept"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Keep or turn down a profile value an agent proposed","tags":["Agent memory"]}},"/api/agent/memory/profile/withdraw":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"The memory's id, from the list.","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"The memory's id, from the list.","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"The memory's id, from the list.","type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"description":"The memory's id, from the list.","type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Take a profile value out of every answer; the history keeps it","tags":["Agent memory"]}},"/agent/cortex/recall":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"scope":{"oneOf":[{"type":"string","enum":["system","business"]},{"type":"null"}]},"domain":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"uid":{"oneOf":[{"type":"string"},{"type":"null"}]},"max":{"oneOf":[{"type":"integer"},{"type":"null"}]}},"required":["domain"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"scope":{"oneOf":[{"type":"string","enum":["system","business"]},{"type":"null"}]},"domain":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"uid":{"oneOf":[{"type":"string"},{"type":"null"}]},"max":{"oneOf":[{"type":"integer"},{"type":"null"}]}},"required":["domain"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"scope":{"oneOf":[{"type":"string","enum":["system","business"]},{"type":"null"}]},"domain":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"uid":{"oneOf":[{"type":"string"},{"type":"null"}]},"max":{"oneOf":[{"type":"integer"},{"type":"null"}]}},"required":["domain"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"scope":{"oneOf":[{"type":"string","enum":["system","business"]},{"type":"null"}]},"domain":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"uid":{"oneOf":[{"type":"string"},{"type":"null"}]},"max":{"oneOf":[{"type":"integer"},{"type":"null"}]}},"required":["domain"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"An agent reads an allow-listed Cortex domain (system or business scope)","tags":["Agent — Cortex access"]}},"/agent/cortex/remember":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"scope":{"oneOf":[{"type":"string","enum":["system","business"]},{"type":"null"}]},"domain":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"uid":{"oneOf":[{"type":"string"},{"type":"null"}]},"memory":{"type":"string"},"inputsummary":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["domain","memory"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"scope":{"oneOf":[{"type":"string","enum":["system","business"]},{"type":"null"}]},"domain":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"uid":{"oneOf":[{"type":"string"},{"type":"null"}]},"memory":{"type":"string"},"inputsummary":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["domain","memory"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"scope":{"oneOf":[{"type":"string","enum":["system","business"]},{"type":"null"}]},"domain":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"uid":{"oneOf":[{"type":"string"},{"type":"null"}]},"memory":{"type":"string"},"inputsummary":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["domain","memory"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"scope":{"oneOf":[{"type":"string","enum":["system","business"]},{"type":"null"}]},"domain":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"uid":{"oneOf":[{"type":"string"},{"type":"null"}]},"memory":{"type":"string"},"inputsummary":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["domain","memory"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"An agent writes a learning to an allow-listed Cortex domain (write-capable agents only)","tags":["Agent — Cortex access"]}},"/api/search/text":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"description":"Auth token for the request.","type":"string"},"businessid":{"description":"Business id to search within; defaults to the caller's business.","oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"description":"Which collection to search. One of: \"all\" (every collection), \"expenses\", \"income\", \"transactions\", \"clients\", \"suppliers\", \"products\", \"invoices\".","type":"string","enum":["all","expenses","income","transactions","clients","suppliers","products","invoices"]},"query":{"description":"Free-text search query (case-insensitive substring match across all text fields).","type":"string"},"from":{"description":"Lower bound of the date range to match (ISO 8601, YYYY-MM-DD).","oneOf":[{"type":"string"},{"type":"null"}]},"to":{"description":"Upper bound of the date range to match (ISO 8601, YYYY-MM-DD).","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","kind","query"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"description":"Auth token for the request.","type":"string"},"businessid":{"description":"Business id to search within; defaults to the caller's business.","oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"description":"Which collection to search. One of: \"all\" (every collection), \"expenses\", \"income\", \"transactions\", \"clients\", \"suppliers\", \"products\", \"invoices\".","type":"string","enum":["all","expenses","income","transactions","clients","suppliers","products","invoices"]},"query":{"description":"Free-text search query (case-insensitive substring match across all text fields).","type":"string"},"from":{"description":"Lower bound of the date range to match (ISO 8601, YYYY-MM-DD).","oneOf":[{"type":"string"},{"type":"null"}]},"to":{"description":"Upper bound of the date range to match (ISO 8601, YYYY-MM-DD).","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","kind","query"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"description":"Auth token for the request.","type":"string"},"businessid":{"description":"Business id to search within; defaults to the caller's business.","oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"description":"Which collection to search. One of: \"all\" (every collection), \"expenses\", \"income\", \"transactions\", \"clients\", \"suppliers\", \"products\", \"invoices\".","type":"string","enum":["all","expenses","income","transactions","clients","suppliers","products","invoices"]},"query":{"description":"Free-text search query (case-insensitive substring match across all text fields).","type":"string"},"from":{"description":"Lower bound of the date range to match (ISO 8601, YYYY-MM-DD).","oneOf":[{"type":"string"},{"type":"null"}]},"to":{"description":"Upper bound of the date range to match (ISO 8601, YYYY-MM-DD).","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","kind","query"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"description":"Auth token for the request.","type":"string"},"businessid":{"description":"Business id to search within; defaults to the caller's business.","oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"description":"Which collection to search. One of: \"all\" (every collection), \"expenses\", \"income\", \"transactions\", \"clients\", \"suppliers\", \"products\", \"invoices\".","type":"string","enum":["all","expenses","income","transactions","clients","suppliers","products","invoices"]},"query":{"description":"Free-text search query (case-insensitive substring match across all text fields).","type":"string"},"from":{"description":"Lower bound of the date range to match (ISO 8601, YYYY-MM-DD).","oneOf":[{"type":"string"},{"type":"null"}]},"to":{"description":"Upper bound of the date range to match (ISO 8601, YYYY-MM-DD).","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","kind","query"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Search business data by text. Searches ALL text fields on each item — names, descriptions, notes, references, supplier/client names, categories, and more. Set 'kind' to: all, expenses, income, transactions, clients, suppliers, products, or invoices. Use 'all' when you're not sure where something lives — it searches the whole business. Set 'query' to the search term (case-insensitive substring match). Optionally filter by date range with 'from' and 'to' in YYYY-MM-DD format. Returns ALL matches (sorted by date descending), paginated — use limit/cursor to page through the full result set; narrow with 'query'/date if there are more than you need. For an amount range instead of text, use search_amount; to match on text AND amount together, use search_combined.","tags":["search"]}},"/api/search/number":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"description":"Auth token for the request.","type":"string"},"businessid":{"description":"Business id to search within; defaults to the caller's business.","oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"description":"Which collection to search. One of: \"all\" (every collection), \"expenses\", \"income\", \"transactions\", \"clients\", \"suppliers\", \"products\", \"invoices\".","type":"string","enum":["all","expenses","income","transactions","clients","suppliers","products","invoices"]},"min":{"description":"Lower bound of the amount range to match (matched on the kind's primary amount field, absolute value).","oneOf":[{"type":"number"},{"type":"null"}]},"max":{"description":"Upper bound of the amount range to match (matched on the kind's primary amount field, absolute value).","oneOf":[{"type":"number"},{"type":"null"}]},"from":{"description":"Lower bound of the date range to match (ISO 8601, YYYY-MM-DD).","oneOf":[{"type":"string"},{"type":"null"}]},"to":{"description":"Upper bound of the date range to match (ISO 8601, YYYY-MM-DD).","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","kind"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"description":"Auth token for the request.","type":"string"},"businessid":{"description":"Business id to search within; defaults to the caller's business.","oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"description":"Which collection to search. One of: \"all\" (every collection), \"expenses\", \"income\", \"transactions\", \"clients\", \"suppliers\", \"products\", \"invoices\".","type":"string","enum":["all","expenses","income","transactions","clients","suppliers","products","invoices"]},"min":{"description":"Lower bound of the amount range to match (matched on the kind's primary amount field, absolute value).","oneOf":[{"type":"number"},{"type":"null"}]},"max":{"description":"Upper bound of the amount range to match (matched on the kind's primary amount field, absolute value).","oneOf":[{"type":"number"},{"type":"null"}]},"from":{"description":"Lower bound of the date range to match (ISO 8601, YYYY-MM-DD).","oneOf":[{"type":"string"},{"type":"null"}]},"to":{"description":"Upper bound of the date range to match (ISO 8601, YYYY-MM-DD).","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","kind"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"description":"Auth token for the request.","type":"string"},"businessid":{"description":"Business id to search within; defaults to the caller's business.","oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"description":"Which collection to search. One of: \"all\" (every collection), \"expenses\", \"income\", \"transactions\", \"clients\", \"suppliers\", \"products\", \"invoices\".","type":"string","enum":["all","expenses","income","transactions","clients","suppliers","products","invoices"]},"min":{"description":"Lower bound of the amount range to match (matched on the kind's primary amount field, absolute value).","oneOf":[{"type":"number"},{"type":"null"}]},"max":{"description":"Upper bound of the amount range to match (matched on the kind's primary amount field, absolute value).","oneOf":[{"type":"number"},{"type":"null"}]},"from":{"description":"Lower bound of the date range to match (ISO 8601, YYYY-MM-DD).","oneOf":[{"type":"string"},{"type":"null"}]},"to":{"description":"Upper bound of the date range to match (ISO 8601, YYYY-MM-DD).","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","kind"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"description":"Auth token for the request.","type":"string"},"businessid":{"description":"Business id to search within; defaults to the caller's business.","oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"description":"Which collection to search. One of: \"all\" (every collection), \"expenses\", \"income\", \"transactions\", \"clients\", \"suppliers\", \"products\", \"invoices\".","type":"string","enum":["all","expenses","income","transactions","clients","suppliers","products","invoices"]},"min":{"description":"Lower bound of the amount range to match (matched on the kind's primary amount field, absolute value).","oneOf":[{"type":"number"},{"type":"null"}]},"max":{"description":"Upper bound of the amount range to match (matched on the kind's primary amount field, absolute value).","oneOf":[{"type":"number"},{"type":"null"}]},"from":{"description":"Lower bound of the date range to match (ISO 8601, YYYY-MM-DD).","oneOf":[{"type":"string"},{"type":"null"}]},"to":{"description":"Upper bound of the date range to match (ISO 8601, YYYY-MM-DD).","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token","kind"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Search business data by amount range. Filters on the primary amount field: 'total' for expenses and invoices, 'amount' for income and products, 'value' for transactions. Set 'kind' to: all, expenses, income, transactions, products, or invoices. Use 'all' to search amounts across everything. Set 'min' and/or 'max' for the amount range (both optional, uses absolute values). Optionally filter by date range with 'from' and 'to' in YYYY-MM-DD format. Returns ALL matches (sorted by amount descending), paginated — use limit/cursor to page through the full result set; narrow the range/date if there are more than you need. For free-text matching use search_text; to combine text with an amount range use search_combined.","tags":["search"]}},"/api/search/combined":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"description":"Auth token for the request.","type":"string"},"businessid":{"description":"Business id to search within; defaults to the caller's business.","oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"description":"Which collection to search. One of: \"all\" (every collection), \"expenses\", \"income\", \"transactions\", \"clients\", \"suppliers\", \"products\", \"invoices\".","type":"string","enum":["all","expenses","income","transactions","clients","suppliers","products","invoices"]},"query":{"description":"Free-text search query (case-insensitive substring match across all text fields).","oneOf":[{"type":"string"},{"type":"null"}]},"min":{"description":"Lower bound of the amount range to match (matched on the kind's primary amount field, absolute value).","oneOf":[{"type":"number"},{"type":"null"}]},"max":{"description":"Upper bound of the amount range to match (matched on the kind's primary amount field, absolute value).","oneOf":[{"type":"number"},{"type":"null"}]},"from":{"description":"Lower bound of the date range to match (ISO 8601, YYYY-MM-DD).","oneOf":[{"type":"string"},{"type":"null"}]},"to":{"description":"Upper bound of the date range to match (ISO 8601, YYYY-MM-DD).","oneOf":[{"type":"string"},{"type":"null"}]},"sort":{"description":"Result ordering. \"amount\" (default) sorts by the kind's primary amount field descending; \"date\" sorts by date descending — use \"date\" for clients/suppliers (which have no amount) or whenever recency matters more than size.","oneOf":[{"type":"string","enum":["amount","date"]},{"type":"null"}]}},"required":["token","kind"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"description":"Auth token for the request.","type":"string"},"businessid":{"description":"Business id to search within; defaults to the caller's business.","oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"description":"Which collection to search. One of: \"all\" (every collection), \"expenses\", \"income\", \"transactions\", \"clients\", \"suppliers\", \"products\", \"invoices\".","type":"string","enum":["all","expenses","income","transactions","clients","suppliers","products","invoices"]},"query":{"description":"Free-text search query (case-insensitive substring match across all text fields).","oneOf":[{"type":"string"},{"type":"null"}]},"min":{"description":"Lower bound of the amount range to match (matched on the kind's primary amount field, absolute value).","oneOf":[{"type":"number"},{"type":"null"}]},"max":{"description":"Upper bound of the amount range to match (matched on the kind's primary amount field, absolute value).","oneOf":[{"type":"number"},{"type":"null"}]},"from":{"description":"Lower bound of the date range to match (ISO 8601, YYYY-MM-DD).","oneOf":[{"type":"string"},{"type":"null"}]},"to":{"description":"Upper bound of the date range to match (ISO 8601, YYYY-MM-DD).","oneOf":[{"type":"string"},{"type":"null"}]},"sort":{"description":"Result ordering. \"amount\" (default) sorts by the kind's primary amount field descending; \"date\" sorts by date descending — use \"date\" for clients/suppliers (which have no amount) or whenever recency matters more than size.","oneOf":[{"type":"string","enum":["amount","date"]},{"type":"null"}]}},"required":["token","kind"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"description":"Auth token for the request.","type":"string"},"businessid":{"description":"Business id to search within; defaults to the caller's business.","oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"description":"Which collection to search. One of: \"all\" (every collection), \"expenses\", \"income\", \"transactions\", \"clients\", \"suppliers\", \"products\", \"invoices\".","type":"string","enum":["all","expenses","income","transactions","clients","suppliers","products","invoices"]},"query":{"description":"Free-text search query (case-insensitive substring match across all text fields).","oneOf":[{"type":"string"},{"type":"null"}]},"min":{"description":"Lower bound of the amount range to match (matched on the kind's primary amount field, absolute value).","oneOf":[{"type":"number"},{"type":"null"}]},"max":{"description":"Upper bound of the amount range to match (matched on the kind's primary amount field, absolute value).","oneOf":[{"type":"number"},{"type":"null"}]},"from":{"description":"Lower bound of the date range to match (ISO 8601, YYYY-MM-DD).","oneOf":[{"type":"string"},{"type":"null"}]},"to":{"description":"Upper bound of the date range to match (ISO 8601, YYYY-MM-DD).","oneOf":[{"type":"string"},{"type":"null"}]},"sort":{"description":"Result ordering. \"amount\" (default) sorts by the kind's primary amount field descending; \"date\" sorts by date descending — use \"date\" for clients/suppliers (which have no amount) or whenever recency matters more than size.","oneOf":[{"type":"string","enum":["amount","date"]},{"type":"null"}]}},"required":["token","kind"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"description":"Auth token for the request.","type":"string"},"businessid":{"description":"Business id to search within; defaults to the caller's business.","oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"description":"Which collection to search. One of: \"all\" (every collection), \"expenses\", \"income\", \"transactions\", \"clients\", \"suppliers\", \"products\", \"invoices\".","type":"string","enum":["all","expenses","income","transactions","clients","suppliers","products","invoices"]},"query":{"description":"Free-text search query (case-insensitive substring match across all text fields).","oneOf":[{"type":"string"},{"type":"null"}]},"min":{"description":"Lower bound of the amount range to match (matched on the kind's primary amount field, absolute value).","oneOf":[{"type":"number"},{"type":"null"}]},"max":{"description":"Upper bound of the amount range to match (matched on the kind's primary amount field, absolute value).","oneOf":[{"type":"number"},{"type":"null"}]},"from":{"description":"Lower bound of the date range to match (ISO 8601, YYYY-MM-DD).","oneOf":[{"type":"string"},{"type":"null"}]},"to":{"description":"Upper bound of the date range to match (ISO 8601, YYYY-MM-DD).","oneOf":[{"type":"string"},{"type":"null"}]},"sort":{"description":"Result ordering. \"amount\" (default) sorts by the kind's primary amount field descending; \"date\" sorts by date descending — use \"date\" for clients/suppliers (which have no amount) or whenever recency matters more than size.","oneOf":[{"type":"string","enum":["amount","date"]},{"type":"null"}]}},"required":["token","kind"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"The unified search over business data — combine free text and/or an amount range in one call. Set 'kind' to: all, expenses, income, transactions, clients, suppliers, products, or invoices (use 'all' to search the whole business). Set 'query' for text search (case-insensitive substring match across names, descriptions, notes, references, supplier/client names, categories) and/or 'min'/'max' for an amount range on the kind's primary amount field — both are optional, so omit the amount range for a pure text search (e.g. over clients or suppliers) or omit 'query' for a pure amount search. Optionally filter by date range with 'from' and 'to' in YYYY-MM-DD format. Set 'sort' to 'amount' (default — descending by amount) or 'date' (descending by date; best for clients/suppliers, which have no amount, or when recency matters more than size). Returns ALL matches, paginated — use limit/cursor to page through the full result set; narrow query/range/date if there are more than you need.","tags":["search"]}},"/api/search/peek":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"description":"Auth token for the request.","type":"string"},"businessid":{"description":"Business id to peek into; defaults to the caller's business.","oneOf":[{"type":"string"},{"type":"null"}]},"keys":{"description":"Business-view keys to return. For array-valued keys only the first item is returned as a sample. Available: details, expenses, income, transactions, clients, suppliers, products, invoices, bankaccounts, entries, tags, insights, analytics, meta, accounts, salestaxes.","type":"array","items":{"type":"string"}}},"required":["token","keys"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"description":"Auth token for the request.","type":"string"},"businessid":{"description":"Business id to peek into; defaults to the caller's business.","oneOf":[{"type":"string"},{"type":"null"}]},"keys":{"description":"Business-view keys to return. For array-valued keys only the first item is returned as a sample. Available: details, expenses, income, transactions, clients, suppliers, products, invoices, bankaccounts, entries, tags, insights, analytics, meta, accounts, salestaxes.","type":"array","items":{"type":"string"}}},"required":["token","keys"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"description":"Auth token for the request.","type":"string"},"businessid":{"description":"Business id to peek into; defaults to the caller's business.","oneOf":[{"type":"string"},{"type":"null"}]},"keys":{"description":"Business-view keys to return. For array-valued keys only the first item is returned as a sample. Available: details, expenses, income, transactions, clients, suppliers, products, invoices, bankaccounts, entries, tags, insights, analytics, meta, accounts, salestaxes.","type":"array","items":{"type":"string"}}},"required":["token","keys"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"description":"Auth token for the request.","type":"string"},"businessid":{"description":"Business id to peek into; defaults to the caller's business.","oneOf":[{"type":"string"},{"type":"null"}]},"keys":{"description":"Business-view keys to return. For array-valued keys only the first item is returned as a sample. Available: details, expenses, income, transactions, clients, suppliers, products, invoices, bankaccounts, entries, tags, insights, analytics, meta, accounts, salestaxes.","type":"array","items":{"type":"string"}}},"required":["token","keys"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Peek at business data properties. Returns the requested keys from the business. For collections (arrays), returns only the first item so you can see the shape/schema without loading everything. Available keys: details, expenses, income, transactions, clients, suppliers, products, invoices, bankaccounts, entries, tags, insights, analytics, meta, accounts, salestaxes. Use this to understand the data structure before searching.","tags":["search"]}},"/api/automation/business/toggle":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"type":"string"},"enabled":{"type":"boolean"}},"required":["kind","enabled"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"type":"string"},"enabled":{"type":"boolean"}},"required":["kind","enabled"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"type":"string"},"enabled":{"type":"boolean"}},"required":["kind","enabled"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"kind":{"type":"string"},"enabled":{"type":"boolean"}},"required":["kind","enabled"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Enable or disable a business automation (kill switch)","tags":["automations"]}},"/api/automation/invoice/reminder":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"id":{"type":"string"},"enabled":{"type":"boolean"},"cron":{"oneOf":[{"type":"string"},{"type":"null"}]},"max-runs":{"oneOf":[{"type":"number"},{"type":"null"}]}},"required":["id","enabled"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"id":{"type":"string"},"enabled":{"type":"boolean"},"cron":{"oneOf":[{"type":"string"},{"type":"null"}]},"max-runs":{"oneOf":[{"type":"number"},{"type":"null"}]}},"required":["id","enabled"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"id":{"type":"string"},"enabled":{"type":"boolean"},"cron":{"oneOf":[{"type":"string"},{"type":"null"}]},"max-runs":{"oneOf":[{"type":"number"},{"type":"null"}]}},"required":["id","enabled"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"id":{"type":"string"},"enabled":{"type":"boolean"},"cron":{"oneOf":[{"type":"string"},{"type":"null"}]},"max-runs":{"oneOf":[{"type":"number"},{"type":"null"}]}},"required":["id","enabled"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Set up, update, or disable a payment reminder on an invoice","tags":["automations"]}},"/api/automation/invoice/reminder/send":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"id":{"type":"string"}},"required":["id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"id":{"type":"string"}},"required":["id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"id":{"type":"string"}},"required":["id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Send a payment reminder to the client for an outstanding invoice. Pass the invoice 'id' to send the reminder immediately. Only use when the entrepreneur asks you to chase or remind a client about an unpaid invoice.","tags":["automations"]}},"/api/automation/invoice/reminders/send":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"ids":{"description":"Invoice or document ids to remind about. Find them yourself with list_documents; never ask the user for an id.","type":"array","items":{"type":"string"},"minItems":1,"maxItems":10},"chatid":{"description":"Id of the chat to show the card in.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["ids"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"ids":{"description":"Invoice or document ids to remind about. Find them yourself with list_documents; never ask the user for an id.","type":"array","items":{"type":"string"},"minItems":1,"maxItems":10},"chatid":{"description":"Id of the chat to show the card in.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["ids"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"ids":{"description":"Invoice or document ids to remind about. Find them yourself with list_documents; never ask the user for an id.","type":"array","items":{"type":"string"},"minItems":1,"maxItems":10},"chatid":{"description":"Id of the chat to show the card in.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["ids"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"ids":{"description":"Invoice or document ids to remind about. Find them yourself with list_documents; never ask the user for an id.","type":"array","items":{"type":"string"},"minItems":1,"maxItems":10},"chatid":{"description":"Id of the chat to show the card in.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["ids"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Email a payment reminder now for each document named in ids (at most 10). Every id must be this business's document, not void, with something outstanding, a contact email and no bank payment waiting on the owner's confirm, or the whole batch sends nothing. The first call sends nothing: it puts a card on the chat with each document, amount and address, and answers status awaiting-user. Stop and wait; if the user ticks Send it, call again with the same ids. A tick sends once. The answer lists sent and failed ids; retrying the failed ones is a new batch and needs a new card. Runs only inside an Ask stub chat.","tags":["automations"]}},"/api/automation/invoice/recurring":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"id":{"type":"string"},"enabled":{"type":"boolean"},"cron":{"oneOf":[{"type":"string"},{"type":"null"}]},"autosend":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"max-runs":{"oneOf":[{"type":"number"},{"type":"null"}]}},"required":["id","enabled"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"id":{"type":"string"},"enabled":{"type":"boolean"},"cron":{"oneOf":[{"type":"string"},{"type":"null"}]},"autosend":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"max-runs":{"oneOf":[{"type":"number"},{"type":"null"}]}},"required":["id","enabled"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"id":{"type":"string"},"enabled":{"type":"boolean"},"cron":{"oneOf":[{"type":"string"},{"type":"null"}]},"autosend":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"max-runs":{"oneOf":[{"type":"number"},{"type":"null"}]}},"required":["id","enabled"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"id":{"type":"string"},"enabled":{"type":"boolean"},"cron":{"oneOf":[{"type":"string"},{"type":"null"}]},"autosend":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"max-runs":{"oneOf":[{"type":"number"},{"type":"null"}]}},"required":["id","enabled"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Set up, update, or disable a recurring schedule on an invoice so it repeats automatically. Pass the invoice id (find it yourself with list_documents by number; never ask the user for an id), enabled true/false, and a frequency (with day_of_month or weekday). Set autosend true to email each generated invoice to the client automatically.","tags":["automations"]}},"/api/automation/contract/recurring":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"id":{"type":"string"},"enabled":{"type":"boolean"},"cron":{"oneOf":[{"type":"string"},{"type":"null"}]},"autosend":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"max-runs":{"oneOf":[{"type":"number"},{"type":"null"}]}},"required":["id","enabled"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"id":{"type":"string"},"enabled":{"type":"boolean"},"cron":{"oneOf":[{"type":"string"},{"type":"null"}]},"autosend":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"max-runs":{"oneOf":[{"type":"number"},{"type":"null"}]}},"required":["id","enabled"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"id":{"type":"string"},"enabled":{"type":"boolean"},"cron":{"oneOf":[{"type":"string"},{"type":"null"}]},"autosend":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"max-runs":{"oneOf":[{"type":"number"},{"type":"null"}]}},"required":["id","enabled"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"id":{"type":"string"},"enabled":{"type":"boolean"},"cron":{"oneOf":[{"type":"string"},{"type":"null"}]},"autosend":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"max-runs":{"oneOf":[{"type":"number"},{"type":"null"}]}},"required":["id","enabled"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Set up, update, or disable a recurring schedule on a document (bill, purchase order, etc.) so it repeats automatically. Pass the document id, enabled true/false, and a frequency (with day_of_month or weekday). Set autosend true to send each generated document automatically.","tags":["automations"]}},"/api/automation/invoice/recurring/trigger":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"entity-ids":{"type":"array","items":{"type":"string"}},"entity-type":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["entity-ids"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"entity-ids":{"type":"array","items":{"type":"string"}},"entity-type":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["entity-ids"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"entity-ids":{"type":"array","items":{"type":"string"}},"entity-type":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["entity-ids"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"entity-ids":{"type":"array","items":{"type":"string"}},"entity-type":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["entity-ids"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Generate the next copies of recurring invoice templates right now, without waiting for the schedule. Pass entity_ids (the recurring invoice template ids).","tags":["automations"]}},"/api/automation/contract/recurring/trigger":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"entity-ids":{"type":"array","items":{"type":"string"}},"entity-type":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["entity-ids"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"entity-ids":{"type":"array","items":{"type":"string"}},"entity-type":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["entity-ids"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"entity-ids":{"type":"array","items":{"type":"string"}},"entity-type":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["entity-ids"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"entity-ids":{"type":"array","items":{"type":"string"}},"entity-type":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["entity-ids"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Generate the next copies of recurring document templates (bills, purchase orders, etc.) right now, without waiting for the schedule. Pass entity_ids (the recurring document template ids).","tags":["automations"]}},"/api/automation/invoice/recurring/source":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"id":{"type":"string"}},"required":["id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"id":{"type":"string"}},"required":["id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"id":{"type":"string"}},"required":["id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"The document the next copy of recurring invoice template 'id' takes its lines and content from: the latest live one in the series (PROD-2333).","tags":["automations"]}},"/api/automation/recurring/series":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"clientid":{"description":"Only this customer's repeat series. Find the id yourself with list_clients.","oneOf":[{"type":"string"},{"type":"null"}]},"id":{"description":"A repeating invoice or any copy it made: shows the one series behind it, even when stopped.","oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"clientid":{"description":"Only this customer's repeat series. Find the id yourself with list_clients.","oneOf":[{"type":"string"},{"type":"null"}]},"id":{"description":"A repeating invoice or any copy it made: shows the one series behind it, even when stopped.","oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"clientid":{"description":"Only this customer's repeat series. Find the id yourself with list_clients.","oneOf":[{"type":"string"},{"type":"null"}]},"id":{"description":"A repeating invoice or any copy it made: shows the one series behind it, even when stopped.","oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"clientid":{"description":"Only this customer's repeat series. Find the id yourself with list_clients.","oneOf":[{"type":"string"},{"type":"null"}]},"id":{"description":"A repeating invoice or any copy it made: shows the one series behind it, even when stopped.","oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"List repeat-invoice series: each one's customer, frequency, the invoice whose payment term sets the next due date (due_from), next copy, copies made so far and whether it is on. Pass clientid for one customer's series, or id (an invoice or any copy) for the series behind it.","tags":["automations"]}},"/api/automation/recurring/series/stop":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"ids":{"description":"Repeating invoices, or copies they made, whose series to stop. Get them from list_recurring_schedules.","type":"array","items":{"type":"string"},"minItems":1,"maxItems":50}},"required":["ids"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"ids":{"description":"Repeating invoices, or copies they made, whose series to stop. Get them from list_recurring_schedules.","type":"array","items":{"type":"string"},"minItems":1,"maxItems":50}},"required":["ids"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"ids":{"description":"Repeating invoices, or copies they made, whose series to stop. Get them from list_recurring_schedules.","type":"array","items":{"type":"string"},"minItems":1,"maxItems":50}},"required":["ids"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"ids":{"description":"Repeating invoices, or copies they made, whose series to stop. Get them from list_recurring_schedules.","type":"array","items":{"type":"string"},"minItems":1,"maxItems":50}},"required":["ids"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Stop repeat series so they make no more copies. Pass ids of the repeating invoices or any of their copies; copies of one series stop it once. Each result says whether the series was found off after the stop. Report from those results.","tags":["automations"]}},"/api/automation/invoice/reminders/list":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"List the invoices that have a payment reminder, on or off: number, customer, whether it is on, and its next send date. business_reminders_on false means no reminder sends at all until the business switch is back on.","tags":["automations"]}},"/api/automation/invoice/reminders/set":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"ids":{"description":"Invoices whose payment reminders to change. Get them from list_payment_reminders; never ask the user for an id.","type":"array","items":{"type":"string"},"minItems":1,"maxItems":50},"enabled":{"description":"false stops the reminders, true turns them back on.","type":"boolean"},"confirm":{"description":"true only after the user agreed to this change.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["ids","enabled"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"ids":{"description":"Invoices whose payment reminders to change. Get them from list_payment_reminders; never ask the user for an id.","type":"array","items":{"type":"string"},"minItems":1,"maxItems":50},"enabled":{"description":"false stops the reminders, true turns them back on.","type":"boolean"},"confirm":{"description":"true only after the user agreed to this change.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["ids","enabled"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"ids":{"description":"Invoices whose payment reminders to change. Get them from list_payment_reminders; never ask the user for an id.","type":"array","items":{"type":"string"},"minItems":1,"maxItems":50},"enabled":{"description":"false stops the reminders, true turns them back on.","type":"boolean"},"confirm":{"description":"true only after the user agreed to this change.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["ids","enabled"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"ids":{"description":"Invoices whose payment reminders to change. Get them from list_payment_reminders; never ask the user for an id.","type":"array","items":{"type":"string"},"minItems":1,"maxItems":50},"enabled":{"description":"false stops the reminders, true turns them back on.","type":"boolean"},"confirm":{"description":"true only after the user agreed to this change.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["ids","enabled"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Stop (enabled false) or resume (enabled true) the payment reminders on invoices, by id. Without confirm true it changes nothing and says what it would do: ask the user, then call again with confirm true. Resume keeps each invoice's own schedule and never adds a reminder to an invoice that had none. Each result says whether the reminder was found on or off afterwards. Report from those results.","tags":["automations"]}},"/api/automation/business/payment-reminders":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"enabled":{"description":"false stops every payment reminder of the business, true turns them back on.","type":"boolean"},"confirm":{"description":"true only after the user agreed to this change.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["enabled"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"enabled":{"description":"false stops every payment reminder of the business, true turns them back on.","type":"boolean"},"confirm":{"description":"true only after the user agreed to this change.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["enabled"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"enabled":{"description":"false stops every payment reminder of the business, true turns them back on.","type":"boolean"},"confirm":{"description":"true only after the user agreed to this change.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["enabled"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"enabled":{"description":"false stops every payment reminder of the business, true turns them back on.","type":"boolean"},"confirm":{"description":"true only after the user agreed to this change.","oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["enabled"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Stop (enabled false) or resume (enabled true) every payment reminder of the business at once. The invoices keep their own reminder settings. Without confirm true it changes nothing: ask the user, then call again with confirm true.","tags":["automations"]}},"/api/automation/contract/recurring/source":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"id":{"type":"string"}},"required":["id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"id":{"type":"string"}},"required":["id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"id":{"type":"string"}},"required":["id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"The document the next copy of recurring document template 'id' takes its lines and content from: the latest live one in the series (PROD-2333).","tags":["automations"]}},"/api/automation/payrun/trigger":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"schedule":{"description":"The id of one pay run schedule to run (list_payrun_schedules). Omit it to run every enabled schedule.","oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"schedule":{"description":"The id of one pay run schedule to run (list_payrun_schedules). Omit it to run every enabled schedule.","oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"schedule":{"description":"The id of one pay run schedule to run (list_payrun_schedules). Omit it to run every enabled schedule.","oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"schedule":{"description":"The id of one pay run schedule to run (list_payrun_schedules). Omit it to run every enabled schedule.","oneOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Open the next pay run for each enabled pay run schedule right now, without waiting for its date. Send schedule to run only that one; an id that is not one of the business's enabled schedules is refused and opens nothing.","tags":["automations"]}},"/api/agent/marketing/outcomes":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["from","to"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["from","to"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["from","to"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["from","to"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Paid-media outcomes per utm_id, aggregated (Edna)","tags":["agent"]}},"/api/agent/marketing/businesses":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"utm_id":{"oneOf":[{"type":"string","pattern":"^[A-Za-z0-9_.:-]{1,64}$"},{"type":"null"}]},"limit":{"oneOf":[{"type":"integer","minimum":1,"maximum":200},{"type":"null"}]},"filter_on":{"oneOf":[{"type":"string","enum":["signup_date","cancelled_at"]},{"type":"null"}]},"include_never_paid":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["from","to"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"utm_id":{"oneOf":[{"type":"string","pattern":"^[A-Za-z0-9_.:-]{1,64}$"},{"type":"null"}]},"limit":{"oneOf":[{"type":"integer","minimum":1,"maximum":200},{"type":"null"}]},"filter_on":{"oneOf":[{"type":"string","enum":["signup_date","cancelled_at"]},{"type":"null"}]},"include_never_paid":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["from","to"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"utm_id":{"oneOf":[{"type":"string","pattern":"^[A-Za-z0-9_.:-]{1,64}$"},{"type":"null"}]},"limit":{"oneOf":[{"type":"integer","minimum":1,"maximum":200},{"type":"null"}]},"filter_on":{"oneOf":[{"type":"string","enum":["signup_date","cancelled_at"]},{"type":"null"}]},"include_never_paid":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["from","to"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"utm_id":{"oneOf":[{"type":"string","pattern":"^[A-Za-z0-9_.:-]{1,64}$"},{"type":"null"}]},"limit":{"oneOf":[{"type":"integer","minimum":1,"maximum":200},{"type":"null"}]},"filter_on":{"oneOf":[{"type":"string","enum":["signup_date","cancelled_at"]},{"type":"null"}]},"include_never_paid":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["from","to"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Tagged businesses, most active first — name and email, for a human's screen (Edna)","tags":["agent"]}},"/api/agent/marketing/events":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"window_days":{"oneOf":[{"type":"integer","minimum":1,"maximum":366},{"type":"null"}]},"require":{"oneOf":[{"type":"array","items":{"type":"string","minLength":1,"maxLength":64}},{"type":"null"}]},"group_by":{"oneOf":[{"type":"array","items":{"type":"string","minLength":1,"maxLength":64}},{"type":"null"}]}},"required":["from","to"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"window_days":{"oneOf":[{"type":"integer","minimum":1,"maximum":366},{"type":"null"}]},"require":{"oneOf":[{"type":"array","items":{"type":"string","minLength":1,"maxLength":64}},{"type":"null"}]},"group_by":{"oneOf":[{"type":"array","items":{"type":"string","minLength":1,"maxLength":64}},{"type":"null"}]}},"required":["from","to"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"window_days":{"oneOf":[{"type":"integer","minimum":1,"maximum":366},{"type":"null"}]},"require":{"oneOf":[{"type":"array","items":{"type":"string","minLength":1,"maxLength":64}},{"type":"null"}]},"group_by":{"oneOf":[{"type":"array","items":{"type":"string","minLength":1,"maxLength":64}},{"type":"null"}]}},"required":["from","to"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"window_days":{"oneOf":[{"type":"integer","minimum":1,"maximum":366},{"type":"null"}]},"require":{"oneOf":[{"type":"array","items":{"type":"string","minLength":1,"maxLength":64}},{"type":"null"}]},"group_by":{"oneOf":[{"type":"array","items":{"type":"string","minLength":1,"maxLength":64}},{"type":"null"}]}},"required":["from","to"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Aggregate event counts per group, intersected server-side (Edna)","tags":["agent"]}},"/api/agent/marketing/growth":{"post":{"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"The growth record, aggregated — dashboard, tabs and partner portal numbers in one document (Edna)","tags":["agent"]}},"/api/agent/marketing/spend":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"platform":{"type":"string"},"spend_zar":{"type":"number"}},"required":["date","platform","spend_zar"],"additionalProperties":false},"minItems":1,"maxItems":50}},"required":["rows"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"platform":{"type":"string"},"spend_zar":{"type":"number"}},"required":["date","platform","spend_zar"],"additionalProperties":false},"minItems":1,"maxItems":50}},"required":["rows"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"platform":{"type":"string"},"spend_zar":{"type":"number"}},"required":["date","platform","spend_zar"],"additionalProperties":false},"minItems":1,"maxItems":50}},"required":["rows"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"platform":{"type":"string"},"spend_zar":{"type":"number"}},"required":["date","platform","spend_zar"],"additionalProperties":false},"minItems":1,"maxItems":50}},"required":["rows"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"A day's paid media spend per platform; a re-post of a date and platform replaces it (Edna)","tags":["agent"]}},"/api/agent/metrics":{"post":{"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"MRR, ARR, growth, bridge, retention, engagement, unit economics — the fund-raise set (Edna)","tags":["agent"]}},"/api/agent/revenue":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"from":{"oneOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"to":{"oneOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"from":{"oneOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"to":{"oneOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"from":{"oneOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"to":{"oneOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"from":{"oneOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"to":{"oneOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"stub's own revenue — subscription payments only, gross, in SAST (Edna)","tags":["agent"]}},"/api/agent/memory/remember":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string","minLength":1,"maxLength":64},"memory":{"type":"string","minLength":1,"maxLength":20000},"inputsummary":{"oneOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"creator":{"oneOf":[{"type":"string","maxLength":128},{"type":"null"}]}},"required":["domain","memory"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"domain":{"type":"string","minLength":1,"maxLength":64},"memory":{"type":"string","minLength":1,"maxLength":20000},"inputsummary":{"oneOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"creator":{"oneOf":[{"type":"string","maxLength":128},{"type":"null"}]}},"required":["domain","memory"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"domain":{"type":"string","minLength":1,"maxLength":64},"memory":{"type":"string","minLength":1,"maxLength":20000},"inputsummary":{"oneOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"creator":{"oneOf":[{"type":"string","maxLength":128},{"type":"null"}]}},"required":["domain","memory"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"domain":{"type":"string","minLength":1,"maxLength":64},"memory":{"type":"string","minLength":1,"maxLength":20000},"inputsummary":{"oneOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"creator":{"oneOf":[{"type":"string","maxLength":128},{"type":"null"}]}},"required":["domain","memory"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Store one memory in Edna's own Cortex partition (Edna)","tags":["agent"]}},"/api/agent/memory/recall":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"oneOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"query":{"oneOf":[{"type":"string","minLength":1,"maxLength":1000},{"type":"null"}]},"maxentries":{"oneOf":[{"type":"integer","minimum":1,"maximum":100},{"type":"null"}]}},"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"domain":{"oneOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"query":{"oneOf":[{"type":"string","minLength":1,"maxLength":1000},{"type":"null"}]},"maxentries":{"oneOf":[{"type":"integer","minimum":1,"maximum":100},{"type":"null"}]}},"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"domain":{"oneOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"query":{"oneOf":[{"type":"string","minLength":1,"maxLength":1000},{"type":"null"}]},"maxentries":{"oneOf":[{"type":"integer","minimum":1,"maximum":100},{"type":"null"}]}},"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"domain":{"oneOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"query":{"oneOf":[{"type":"string","minLength":1,"maxLength":1000},{"type":"null"}]},"maxentries":{"oneOf":[{"type":"integer","minimum":1,"maximum":100},{"type":"null"}]}},"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Recall Edna's memories by domain, or semantically by query (Edna)","tags":["agent"]}},"/api/attribution":{"get":{"parameters":[{"in":"query","name":"token","required":false,"schema":{"oneOf":[{"type":"string"},{"type":"null"}]}},{"in":"query","name":"from","required":false,"schema":{"oneOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},{"in":"query","name":"to","required":false,"schema":{"oneOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},{"in":"query","name":"detail","required":false,"schema":{"oneOf":[{"type":"string","enum":["totals","full"]},{"type":"null"}]}},{"in":"query","name":"limit","required":false,"schema":{"oneOf":[{"type":"integer","minimum":1,"maximum":500},{"type":"null"}]}},{"in":"query","name":"sort","required":false,"schema":{"oneOf":[{"type":"string","enum":["signups","customers","gross"]},{"type":"null"}]}}],"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Top referrers, ranked — secret or core staff","tags":["attribution"]}},"/api/attribution/username":{"get":{"parameters":[{"in":"query","name":"token","required":false,"schema":{"oneOf":[{"type":"string"},{"type":"null"}]}}],"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"The caller's referral handle and what they have released","tags":["attribution"]},"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"username":{"type":"string","minLength":1,"maxLength":40},"owner":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["username"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"username":{"type":"string","minLength":1,"maxLength":40},"owner":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["username"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"username":{"type":"string","minLength":1,"maxLength":40},"owner":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["username"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"oneOf":[{"type":"string"},{"type":"null"}]},"username":{"type":"string","minLength":1,"maxLength":40},"owner":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["username"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Claim or change a referral handle (staff may pass owner)","tags":["attribution"]}},"/api/attribution/username/@{handle}/available":{"get":{"parameters":[{"in":"query","name":"token","required":false,"schema":{"oneOf":[{"type":"string"},{"type":"null"}]}},{"in":"path","name":"handle","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Is this handle claimable by the caller?","tags":["attribution"]}},"/api/attribution/resolve/@{handle}":{"get":{"parameters":[{"in":"path","name":"handle","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Public: name and logo behind a handle, nothing else","tags":["attribution"]}},"/api/attribution/backfill-payer":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"dry_run":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"dry_run":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"dry_run":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"dry_run":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Stamp :subscription/payer on history from the id scheme (staff)","tags":["attribution"]}},"/api/attribution/{id}":{"get":{"parameters":[{"in":"query","name":"token","required":false,"schema":{"oneOf":[{"type":"string"},{"type":"null"}]}},{"in":"query","name":"from","required":false,"schema":{"oneOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},{"in":"query","name":"to","required":false,"schema":{"oneOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},{"in":"query","name":"detail","required":false,"schema":{"oneOf":[{"type":"string","enum":["totals","full"]},{"type":"null"}]}},{"in":"query","name":"limit","required":false,"schema":{"oneOf":[{"type":"integer","minimum":1,"maximum":500},{"type":"null"}]}},{"in":"query","name":"sort","required":false,"schema":{"oneOf":[{"type":"string","enum":["signups","customers","gross"]},{"type":"null"}]}},{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Signups, customers and payments attributed to a referrer","tags":["attribution"]}},"/api/page/visit":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"page":{"type":"string"}},"required":["token","page"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"page":{"type":"string"}},"required":["token","page"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"page":{"type":"string"}},"required":["token","page"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"businessid":{"oneOf":[{"type":"string"},{"type":"null"}]},"page":{"type":"string"}},"required":["token","page"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Record that a signed-in user opened a tracked page","tags":["pagevisit"]}},"/api/supercat/enrich":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"uid":{"type":"string"}},"required":["token","uid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"uid":{"type":"string"}},"required":["token","uid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"uid":{"type":"string"}},"required":["token","uid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"uid":{"type":"string"}},"required":["token","uid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Backfill Supercat indexes from a business's existing data","tags":["Supercat predictor"]}},"/api/supercat/predict":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"uid":{"type":"string"},"key":{"type":"string"},"want":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token","uid","key"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"uid":{"type":"string"},"key":{"type":"string"},"want":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token","uid","key"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"uid":{"type":"string"},"key":{"type":"string"},"want":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token","uid","key"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"uid":{"type":"string"},"key":{"type":"string"},"want":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token","uid","key"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Predict :want fields for a key under a business's scopes","tags":["Supercat predictor"]}},"/api/workflow/archive":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"wfid":{"description":"Which of this business's flows to remove, by its id.","type":"string"}},"required":["token","wfid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"wfid":{"description":"Which of this business's flows to remove, by its id.","type":"string"}},"required":["token","wfid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"wfid":{"description":"Which of this business's flows to remove, by its id.","type":"string"}},"required":["token","wfid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"wfid":{"description":"Which of this business's flows to remove, by its id.","type":"string"}},"required":["token","wfid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Remove one of this business's own flows. It stops appearing and can no longer be run. Its history is kept, so a run it already did stays undoable — and creating a flow with the same id again brings it back. Stub's own flows run for every business and cannot be removed.","tags":["workflows"]}},"/api/workflow/validate":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"definition":{"description":"The flow definition as an EDN string — the same thing create_flow takes. Nothing is saved; you get the validation report back.","type":"string","maxLength":65536}},"required":["token","definition"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"definition":{"description":"The flow definition as an EDN string — the same thing create_flow takes. Nothing is saved; you get the validation report back.","type":"string","maxLength":65536}},"required":["token","definition"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"definition":{"description":"The flow definition as an EDN string — the same thing create_flow takes. Nothing is saved; you get the validation report back.","type":"string","maxLength":65536}},"required":["token","definition"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"definition":{"description":"The flow definition as an EDN string — the same thing create_flow takes. Nothing is saved; you get the validation report back.","type":"string","maxLength":65536}},"required":["token","definition"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Check a flow definition WITHOUT saving it. Returns the same report create_flow would, so you can get a definition right before it becomes a stored version. Runs the schema and the static checks: every @step.field reference resolves to a field the tool actually returns, every tool exists, every :llm prompt exists, and the effects-scope holds. Call this after read_flow_grammar and before create_flow; call it again after every edit.","tags":["workflows"]}},"/api/workflow/blocks":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"definition":{"description":"The flow being built, as an EDN string, so each block says whether it may go at `at`.","type":"string","maxLength":65536},"at":{"description":"Where the owner wants to put a block.","type":"object","properties":{"parent":{"description":"The step it goes inside. Leave out for the top of the flow.","type":"string"},"branch":{"description":"Which part of that step: body or then. Leave out for the usual one.","type":"string"},"index":{"description":"Where among that step's steps. Leave out for the end.","type":"integer","minimum":0}},"additionalProperties":false}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"definition":{"description":"The flow being built, as an EDN string, so each block says whether it may go at `at`.","type":"string","maxLength":65536},"at":{"description":"Where the owner wants to put a block.","type":"object","properties":{"parent":{"description":"The step it goes inside. Leave out for the top of the flow.","type":"string"},"branch":{"description":"Which part of that step: body or then. Leave out for the usual one.","type":"string"},"index":{"description":"Where among that step's steps. Leave out for the end.","type":"integer","minimum":0}},"additionalProperties":false}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"definition":{"description":"The flow being built, as an EDN string, so each block says whether it may go at `at`.","type":"string","maxLength":65536},"at":{"description":"Where the owner wants to put a block.","type":"object","properties":{"parent":{"description":"The step it goes inside. Leave out for the top of the flow.","type":"string"},"branch":{"description":"Which part of that step: body or then. Leave out for the usual one.","type":"string"},"index":{"description":"Where among that step's steps. Leave out for the end.","type":"integer","minimum":0}},"additionalProperties":false}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"definition":{"description":"The flow being built, as an EDN string, so each block says whether it may go at `at`.","type":"string","maxLength":65536},"at":{"description":"Where the owner wants to put a block.","type":"object","properties":{"parent":{"description":"The step it goes inside. Leave out for the top of the flow.","type":"string"},"branch":{"description":"Which part of that step: body or then. Leave out for the usual one.","type":"string"},"index":{"description":"Where among that step's steps. Leave out for the end.","type":"integer","minimum":0}},"additionalProperties":false}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"The building blocks an owner puts together into a flow, each in plain words with what it changes, and ready-made starters. Send the flow and a place to learn which blocks may go there.","tags":["workflows"]}},"/api/workflow/preview":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"definition":{"description":"A flow definition as an EDN string. Leave out to name a flow by wfid.","type":"string","maxLength":65536},"wfid":{"description":"A flow by its id: one of stub's (values only) or one of yours.","type":"string"},"ops":{"type":"array","items":{"type":"object","properties":{"op":{"description":"set, set-default, remove, rename, reset or insert. move is not available yet.","type":"string"},"block":{"description":"For insert: the block's id, as /blocks gives it.","type":"string"},"at":{"description":"For insert: where the block goes.","type":"object","properties":{"parent":{"description":"The step it goes inside. Leave out for the top of the flow.","type":"string"},"branch":{"description":"Which part of that step: body or then. Leave out for the usual one.","type":"string"},"index":{"description":"Where among that step's steps. Leave out for the end.","type":"integer","minimum":0}},"additionalProperties":false},"values":{"description":"For insert: the block's values by knob name; any left out take the block's default.","type":"object","additionalProperties":{}},"knob":{"description":"For set and reset: the knob's id, as the recipe gives it.","type":"string"},"value":{"description":"For set and set-default: the new value, as the owner sees it (90 for 90%)."},"param":{"description":"For set-default: the parameter's name.","type":"string"},"step":{"description":"For remove: the step's id.","type":"string"},"title":{"type":"string"},"summary":{"type":"string"}},"required":["op"],"additionalProperties":false}}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"definition":{"description":"A flow definition as an EDN string. Leave out to name a flow by wfid.","type":"string","maxLength":65536},"wfid":{"description":"A flow by its id: one of stub's (values only) or one of yours.","type":"string"},"ops":{"type":"array","items":{"type":"object","properties":{"op":{"description":"set, set-default, remove, rename, reset or insert. move is not available yet.","type":"string"},"block":{"description":"For insert: the block's id, as /blocks gives it.","type":"string"},"at":{"description":"For insert: where the block goes.","type":"object","properties":{"parent":{"description":"The step it goes inside. Leave out for the top of the flow.","type":"string"},"branch":{"description":"Which part of that step: body or then. Leave out for the usual one.","type":"string"},"index":{"description":"Where among that step's steps. Leave out for the end.","type":"integer","minimum":0}},"additionalProperties":false},"values":{"description":"For insert: the block's values by knob name; any left out take the block's default.","type":"object","additionalProperties":{}},"knob":{"description":"For set and reset: the knob's id, as the recipe gives it.","type":"string"},"value":{"description":"For set and set-default: the new value, as the owner sees it (90 for 90%)."},"param":{"description":"For set-default: the parameter's name.","type":"string"},"step":{"description":"For remove: the step's id.","type":"string"},"title":{"type":"string"},"summary":{"type":"string"}},"required":["op"],"additionalProperties":false}}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"definition":{"description":"A flow definition as an EDN string. Leave out to name a flow by wfid.","type":"string","maxLength":65536},"wfid":{"description":"A flow by its id: one of stub's (values only) or one of yours.","type":"string"},"ops":{"type":"array","items":{"type":"object","properties":{"op":{"description":"set, set-default, remove, rename, reset or insert. move is not available yet.","type":"string"},"block":{"description":"For insert: the block's id, as /blocks gives it.","type":"string"},"at":{"description":"For insert: where the block goes.","type":"object","properties":{"parent":{"description":"The step it goes inside. Leave out for the top of the flow.","type":"string"},"branch":{"description":"Which part of that step: body or then. Leave out for the usual one.","type":"string"},"index":{"description":"Where among that step's steps. Leave out for the end.","type":"integer","minimum":0}},"additionalProperties":false},"values":{"description":"For insert: the block's values by knob name; any left out take the block's default.","type":"object","additionalProperties":{}},"knob":{"description":"For set and reset: the knob's id, as the recipe gives it.","type":"string"},"value":{"description":"For set and set-default: the new value, as the owner sees it (90 for 90%)."},"param":{"description":"For set-default: the parameter's name.","type":"string"},"step":{"description":"For remove: the step's id.","type":"string"},"title":{"type":"string"},"summary":{"type":"string"}},"required":["op"],"additionalProperties":false}}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"definition":{"description":"A flow definition as an EDN string. Leave out to name a flow by wfid.","type":"string","maxLength":65536},"wfid":{"description":"A flow by its id: one of stub's (values only) or one of yours.","type":"string"},"ops":{"type":"array","items":{"type":"object","properties":{"op":{"description":"set, set-default, remove, rename, reset or insert. move is not available yet.","type":"string"},"block":{"description":"For insert: the block's id, as /blocks gives it.","type":"string"},"at":{"description":"For insert: where the block goes.","type":"object","properties":{"parent":{"description":"The step it goes inside. Leave out for the top of the flow.","type":"string"},"branch":{"description":"Which part of that step: body or then. Leave out for the usual one.","type":"string"},"index":{"description":"Where among that step's steps. Leave out for the end.","type":"integer","minimum":0}},"additionalProperties":false},"values":{"description":"For insert: the block's values by knob name; any left out take the block's default.","type":"object","additionalProperties":{}},"knob":{"description":"For set and reset: the knob's id, as the recipe gives it.","type":"string"},"value":{"description":"For set and set-default: the new value, as the owner sees it (90 for 90%)."},"param":{"description":"For set-default: the parameter's name.","type":"string"},"step":{"description":"For remove: the step's id.","type":"string"},"title":{"type":"string"},"summary":{"type":"string"}},"required":["op"],"additionalProperties":false}}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Try changes to a flow without saving anything: set a value, set a default, remove a step, rename it. Returns the flow as it would read, what changed, and anything the change would break.","tags":["workflows"]}},"/api/workflow/create":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"title":{"description":"The new flow's name, up to 80 characters.","type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"title":{"description":"The new flow's name, up to 80 characters.","type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"title":{"description":"The new flow's name, up to 80 characters.","type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"title":{"description":"The new flow's name, up to 80 characters.","type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Make a new flow from a name alone. It is saved straight away with no steps; add blocks to it to give it something to do.","tags":["workflows"]}},"/api/workflow/draft":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"instruction":{"description":"What the flow should do, or how to change it, in the owner's words. Up to 1,000 characters.","type":"string"},"definition":{"description":"The flow being changed, as an EDN string. Leave out to draft a new one.","type":"string","maxLength":65536}},"required":["token","instruction"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"instruction":{"description":"What the flow should do, or how to change it, in the owner's words. Up to 1,000 characters.","type":"string"},"definition":{"description":"The flow being changed, as an EDN string. Leave out to draft a new one.","type":"string","maxLength":65536}},"required":["token","instruction"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"instruction":{"description":"What the flow should do, or how to change it, in the owner's words. Up to 1,000 characters.","type":"string"},"definition":{"description":"The flow being changed, as an EDN string. Leave out to draft a new one.","type":"string","maxLength":65536}},"required":["token","instruction"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"instruction":{"description":"What the flow should do, or how to change it, in the owner's words. Up to 1,000 characters.","type":"string"},"definition":{"description":"The flow being changed, as an EDN string. Leave out to draft a new one.","type":"string","maxLength":65536}},"required":["token","instruction"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Draft a flow from a sentence, or change the one sent. Nothing is saved; the answer reads like /preview's, or points to a feature stub already has. Each draft uses one action.","tags":["workflows"]}},"/api/workflow/values":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"wfid":{"description":"Which of stub's flows these values are for.","type":"string"},"ops":{"type":"array","items":{"type":"object","properties":{"op":{"description":"set, set-default, remove, rename, reset or insert. move is not available yet.","type":"string"},"block":{"description":"For insert: the block's id, as /blocks gives it.","type":"string"},"at":{"description":"For insert: where the block goes.","type":"object","properties":{"parent":{"description":"The step it goes inside. Leave out for the top of the flow.","type":"string"},"branch":{"description":"Which part of that step: body or then. Leave out for the usual one.","type":"string"},"index":{"description":"Where among that step's steps. Leave out for the end.","type":"integer","minimum":0}},"additionalProperties":false},"values":{"description":"For insert: the block's values by knob name; any left out take the block's default.","type":"object","additionalProperties":{}},"knob":{"description":"For set and reset: the knob's id, as the recipe gives it.","type":"string"},"value":{"description":"For set and set-default: the new value, as the owner sees it (90 for 90%)."},"param":{"description":"For set-default: the parameter's name.","type":"string"},"step":{"description":"For remove: the step's id.","type":"string"},"title":{"type":"string"},"summary":{"type":"string"}},"required":["op"],"additionalProperties":false}}},"required":["token","wfid","ops"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"wfid":{"description":"Which of stub's flows these values are for.","type":"string"},"ops":{"type":"array","items":{"type":"object","properties":{"op":{"description":"set, set-default, remove, rename, reset or insert. move is not available yet.","type":"string"},"block":{"description":"For insert: the block's id, as /blocks gives it.","type":"string"},"at":{"description":"For insert: where the block goes.","type":"object","properties":{"parent":{"description":"The step it goes inside. Leave out for the top of the flow.","type":"string"},"branch":{"description":"Which part of that step: body or then. Leave out for the usual one.","type":"string"},"index":{"description":"Where among that step's steps. Leave out for the end.","type":"integer","minimum":0}},"additionalProperties":false},"values":{"description":"For insert: the block's values by knob name; any left out take the block's default.","type":"object","additionalProperties":{}},"knob":{"description":"For set and reset: the knob's id, as the recipe gives it.","type":"string"},"value":{"description":"For set and set-default: the new value, as the owner sees it (90 for 90%)."},"param":{"description":"For set-default: the parameter's name.","type":"string"},"step":{"description":"For remove: the step's id.","type":"string"},"title":{"type":"string"},"summary":{"type":"string"}},"required":["op"],"additionalProperties":false}}},"required":["token","wfid","ops"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"wfid":{"description":"Which of stub's flows these values are for.","type":"string"},"ops":{"type":"array","items":{"type":"object","properties":{"op":{"description":"set, set-default, remove, rename, reset or insert. move is not available yet.","type":"string"},"block":{"description":"For insert: the block's id, as /blocks gives it.","type":"string"},"at":{"description":"For insert: where the block goes.","type":"object","properties":{"parent":{"description":"The step it goes inside. Leave out for the top of the flow.","type":"string"},"branch":{"description":"Which part of that step: body or then. Leave out for the usual one.","type":"string"},"index":{"description":"Where among that step's steps. Leave out for the end.","type":"integer","minimum":0}},"additionalProperties":false},"values":{"description":"For insert: the block's values by knob name; any left out take the block's default.","type":"object","additionalProperties":{}},"knob":{"description":"For set and reset: the knob's id, as the recipe gives it.","type":"string"},"value":{"description":"For set and set-default: the new value, as the owner sees it (90 for 90%)."},"param":{"description":"For set-default: the parameter's name.","type":"string"},"step":{"description":"For remove: the step's id.","type":"string"},"title":{"type":"string"},"summary":{"type":"string"}},"required":["op"],"additionalProperties":false}}},"required":["token","wfid","ops"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"wfid":{"description":"Which of stub's flows these values are for.","type":"string"},"ops":{"type":"array","items":{"type":"object","properties":{"op":{"description":"set, set-default, remove, rename, reset or insert. move is not available yet.","type":"string"},"block":{"description":"For insert: the block's id, as /blocks gives it.","type":"string"},"at":{"description":"For insert: where the block goes.","type":"object","properties":{"parent":{"description":"The step it goes inside. Leave out for the top of the flow.","type":"string"},"branch":{"description":"Which part of that step: body or then. Leave out for the usual one.","type":"string"},"index":{"description":"Where among that step's steps. Leave out for the end.","type":"integer","minimum":0}},"additionalProperties":false},"values":{"description":"For insert: the block's values by knob name; any left out take the block's default.","type":"object","additionalProperties":{}},"knob":{"description":"For set and reset: the knob's id, as the recipe gives it.","type":"string"},"value":{"description":"For set and set-default: the new value, as the owner sees it (90 for 90%)."},"param":{"description":"For set-default: the parameter's name.","type":"string"},"step":{"description":"For remove: the step's id.","type":"string"},"title":{"type":"string"},"summary":{"type":"string"}},"required":["op"],"additionalProperties":false}}},"required":["token","wfid","ops"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Keep your own values on one of stub's flows — how sure it must be, what it does when unsure. Every run of that flow for this business uses them; reset puts stub's value back.","tags":["workflows"]}},"/api/workflow/try":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"definition":{"description":"A flow definition as an EDN string. Leave out to name a flow by wfid.","type":"string","maxLength":65536},"wfid":{"description":"A flow by its id: one of stub's (values only) or one of yours.","type":"string"},"ops":{"type":"array","items":{"type":"object","properties":{"op":{"description":"set, set-default, remove, rename, reset or insert. move is not available yet.","type":"string"},"block":{"description":"For insert: the block's id, as /blocks gives it.","type":"string"},"at":{"description":"For insert: where the block goes.","type":"object","properties":{"parent":{"description":"The step it goes inside. Leave out for the top of the flow.","type":"string"},"branch":{"description":"Which part of that step: body or then. Leave out for the usual one.","type":"string"},"index":{"description":"Where among that step's steps. Leave out for the end.","type":"integer","minimum":0}},"additionalProperties":false},"values":{"description":"For insert: the block's values by knob name; any left out take the block's default.","type":"object","additionalProperties":{}},"knob":{"description":"For set and reset: the knob's id, as the recipe gives it.","type":"string"},"value":{"description":"For set and set-default: the new value, as the owner sees it (90 for 90%)."},"param":{"description":"For set-default: the parameter's name.","type":"string"},"step":{"description":"For remove: the step's id.","type":"string"},"title":{"type":"string"},"summary":{"type":"string"}},"required":["op"],"additionalProperties":false}},"inputs":{"description":"The values the flow asks for, by name.","type":"object","additionalProperties":{}}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"definition":{"description":"A flow definition as an EDN string. Leave out to name a flow by wfid.","type":"string","maxLength":65536},"wfid":{"description":"A flow by its id: one of stub's (values only) or one of yours.","type":"string"},"ops":{"type":"array","items":{"type":"object","properties":{"op":{"description":"set, set-default, remove, rename, reset or insert. move is not available yet.","type":"string"},"block":{"description":"For insert: the block's id, as /blocks gives it.","type":"string"},"at":{"description":"For insert: where the block goes.","type":"object","properties":{"parent":{"description":"The step it goes inside. Leave out for the top of the flow.","type":"string"},"branch":{"description":"Which part of that step: body or then. Leave out for the usual one.","type":"string"},"index":{"description":"Where among that step's steps. Leave out for the end.","type":"integer","minimum":0}},"additionalProperties":false},"values":{"description":"For insert: the block's values by knob name; any left out take the block's default.","type":"object","additionalProperties":{}},"knob":{"description":"For set and reset: the knob's id, as the recipe gives it.","type":"string"},"value":{"description":"For set and set-default: the new value, as the owner sees it (90 for 90%)."},"param":{"description":"For set-default: the parameter's name.","type":"string"},"step":{"description":"For remove: the step's id.","type":"string"},"title":{"type":"string"},"summary":{"type":"string"}},"required":["op"],"additionalProperties":false}},"inputs":{"description":"The values the flow asks for, by name.","type":"object","additionalProperties":{}}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"definition":{"description":"A flow definition as an EDN string. Leave out to name a flow by wfid.","type":"string","maxLength":65536},"wfid":{"description":"A flow by its id: one of stub's (values only) or one of yours.","type":"string"},"ops":{"type":"array","items":{"type":"object","properties":{"op":{"description":"set, set-default, remove, rename, reset or insert. move is not available yet.","type":"string"},"block":{"description":"For insert: the block's id, as /blocks gives it.","type":"string"},"at":{"description":"For insert: where the block goes.","type":"object","properties":{"parent":{"description":"The step it goes inside. Leave out for the top of the flow.","type":"string"},"branch":{"description":"Which part of that step: body or then. Leave out for the usual one.","type":"string"},"index":{"description":"Where among that step's steps. Leave out for the end.","type":"integer","minimum":0}},"additionalProperties":false},"values":{"description":"For insert: the block's values by knob name; any left out take the block's default.","type":"object","additionalProperties":{}},"knob":{"description":"For set and reset: the knob's id, as the recipe gives it.","type":"string"},"value":{"description":"For set and set-default: the new value, as the owner sees it (90 for 90%)."},"param":{"description":"For set-default: the parameter's name.","type":"string"},"step":{"description":"For remove: the step's id.","type":"string"},"title":{"type":"string"},"summary":{"type":"string"}},"required":["op"],"additionalProperties":false}},"inputs":{"description":"The values the flow asks for, by name.","type":"object","additionalProperties":{}}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"definition":{"description":"A flow definition as an EDN string. Leave out to name a flow by wfid.","type":"string","maxLength":65536},"wfid":{"description":"A flow by its id: one of stub's (values only) or one of yours.","type":"string"},"ops":{"type":"array","items":{"type":"object","properties":{"op":{"description":"set, set-default, remove, rename, reset or insert. move is not available yet.","type":"string"},"block":{"description":"For insert: the block's id, as /blocks gives it.","type":"string"},"at":{"description":"For insert: where the block goes.","type":"object","properties":{"parent":{"description":"The step it goes inside. Leave out for the top of the flow.","type":"string"},"branch":{"description":"Which part of that step: body or then. Leave out for the usual one.","type":"string"},"index":{"description":"Where among that step's steps. Leave out for the end.","type":"integer","minimum":0}},"additionalProperties":false},"values":{"description":"For insert: the block's values by knob name; any left out take the block's default.","type":"object","additionalProperties":{}},"knob":{"description":"For set and reset: the knob's id, as the recipe gives it.","type":"string"},"value":{"description":"For set and set-default: the new value, as the owner sees it (90 for 90%)."},"param":{"description":"For set-default: the parameter's name.","type":"string"},"step":{"description":"For remove: the step's id.","type":"string"},"title":{"type":"string"},"summary":{"type":"string"}},"required":["op"],"additionalProperties":false}},"inputs":{"description":"The values the flow asks for, by name.","type":"object","additionalProperties":{}}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Try a flow on your own books without changing anything. It reads what is there, works out what it would change and who it would tell, and keeps none of it. Answers with a tryid; read the answer with /try-result.","tags":["workflows"]}},"/api/workflow/try-result":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"tryid":{"description":"The id /try answered with.","type":"string"}},"required":["token","tryid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"tryid":{"description":"The id /try answered with.","type":"string"}},"required":["token","tryid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"tryid":{"description":"The id /try answered with.","type":"string"}},"required":["token","tryid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"tryid":{"description":"The id /try answered with.","type":"string"}},"required":["token","tryid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Where a try of a flow is, and once it is done what it found, what it would change, who it would tell and what it would leave for you. Answers are kept for an hour.","tags":["workflows"]}},"/api/workflow/triggers":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"The events a flow can run on, and what each one gives it.","tags":["workflows"]}},"/api/workflow/when":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"wfid":{"description":"Which flow, by its id.","type":"string"},"event":{"description":"What sets it going, from /triggers. null removes it.","oneOf":[{"type":"string"},{"type":"null"}]},"enabled":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","wfid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"wfid":{"description":"Which flow, by its id.","type":"string"},"event":{"description":"What sets it going, from /triggers. null removes it.","oneOf":[{"type":"string"},{"type":"null"}]},"enabled":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","wfid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"wfid":{"description":"Which flow, by its id.","type":"string"},"event":{"description":"What sets it going, from /triggers. null removes it.","oneOf":[{"type":"string"},{"type":"null"}]},"enabled":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","wfid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"wfid":{"description":"Which flow, by its id.","type":"string"},"event":{"description":"What sets it going, from /triggers. null removes it.","oneOf":[{"type":"string"},{"type":"null"}]},"enabled":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"required":["token","wfid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Run a flow when something happens, instead of on a cadence. A flow has one When: setting an event takes it off its schedule. An event of null removes it.","tags":["workflows"]}},"/api/workflow/submit":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"definition":{"description":"The workflow definition as an EDN string. A map with :id (keyword) :version :description :author :signature :steps, and optional :invariants and :effects-scope. Steps are either deterministic :tool calls or sharp :llm judgment points; data flows between steps via @step.field references. It is validated before being saved.","type":"string","maxLength":65536}},"required":["token","definition"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"definition":{"description":"The workflow definition as an EDN string. A map with :id (keyword) :version :description :author :signature :steps, and optional :invariants and :effects-scope. Steps are either deterministic :tool calls or sharp :llm judgment points; data flows between steps via @step.field references. It is validated before being saved.","type":"string","maxLength":65536}},"required":["token","definition"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"definition":{"description":"The workflow definition as an EDN string. A map with :id (keyword) :version :description :author :signature :steps, and optional :invariants and :effects-scope. Steps are either deterministic :tool calls or sharp :llm judgment points; data flows between steps via @step.field references. It is validated before being saved.","type":"string","maxLength":65536}},"required":["token","definition"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"definition":{"description":"The workflow definition as an EDN string. A map with :id (keyword) :version :description :author :signature :steps, and optional :invariants and :effects-scope. Steps are either deterministic :tool calls or sharp :llm judgment points; data flows between steps via @step.field references. It is validated before being saved.","type":"string","maxLength":65536}},"required":["token","definition"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create a flow for this business from a definition (EDN) — also called a workflow, a rule or an automation. It is validated before being saved: schema + static checks always run, and when sandbox fixtures are available the full replay-gate runs too. Returns whether it was accepted plus the validation report. A flow describes WHAT to do, never when: there is no cadence in the grammar. To make it repeat, create it first and then call schedule_flow.","tags":["workflows"]}},"/api/workflow/stamp-handle":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"entity":{"description":"Which kind of entity is being claimed — \"contract\" for an invoice/quote/bill, \"expense\", \"income\", \"client\", and so on.","type":"string"},"entityid":{"description":"Id of the entity to claim.","type":"string"},"key":{"description":"The workflow's own name for this thing — anything it can rebuild on a later run, e.g. a period, a client id, or both. Opaque to stub.","type":"string"}},"required":["token","entity","entityid","key"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"entity":{"description":"Which kind of entity is being claimed — \"contract\" for an invoice/quote/bill, \"expense\", \"income\", \"client\", and so on.","type":"string"},"entityid":{"description":"Id of the entity to claim.","type":"string"},"key":{"description":"The workflow's own name for this thing — anything it can rebuild on a later run, e.g. a period, a client id, or both. Opaque to stub.","type":"string"}},"required":["token","entity","entityid","key"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"entity":{"description":"Which kind of entity is being claimed — \"contract\" for an invoice/quote/bill, \"expense\", \"income\", \"client\", and so on.","type":"string"},"entityid":{"description":"Id of the entity to claim.","type":"string"},"key":{"description":"The workflow's own name for this thing — anything it can rebuild on a later run, e.g. a period, a client id, or both. Opaque to stub.","type":"string"}},"required":["token","entity","entityid","key"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"entity":{"description":"Which kind of entity is being claimed — \"contract\" for an invoice/quote/bill, \"expense\", \"income\", \"client\", and so on.","type":"string"},"entityid":{"description":"Id of the entity to claim.","type":"string"},"key":{"description":"The workflow's own name for this thing — anything it can rebuild on a later run, e.g. a period, a client id, or both. Opaque to stub.","type":"string"}},"required":["token","entity","entityid","key"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Claim an entity for the running workflow under a key of its own choosing, so a later run can find it again with one indexed lookup instead of scanning. Stamps :workflowhandle = [workflow, business, key]. Re-stamping the same entity with the same key changes nothing. Only callable inside a workflow run.","tags":["workflows"]}},"/api/workflow/kv-write":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"group":{"description":"The ledger this row is a line of — a name the workflow chooses, e.g. \"webhook.runs/cli-acme\". Rows go in, nothing edits a line, and the balance is a fold over the lines.","type":"string"},"key":{"description":"The row's key within the group. A fixed key makes a note (the new value replaces the last); the event's own identifier makes a reading (a retry lands on the row it wrote before, so counts hold under retries).","type":"string"},"value":{"description":"What the row records. A number is what sum/max/min/avg fold over; anything else is stored as-is and read back by first/last. Omit to record only that the thing happened."},"ttldays":{"description":"Days to keep the row. Omit to keep it forever — anything a billed quantity rests on must outlive the invoice, so the billing path never sets this.","oneOf":[{"type":"integer","minimum":1},{"type":"null"}]}},"required":["token","group","key"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"group":{"description":"The ledger this row is a line of — a name the workflow chooses, e.g. \"webhook.runs/cli-acme\". Rows go in, nothing edits a line, and the balance is a fold over the lines.","type":"string"},"key":{"description":"The row's key within the group. A fixed key makes a note (the new value replaces the last); the event's own identifier makes a reading (a retry lands on the row it wrote before, so counts hold under retries).","type":"string"},"value":{"description":"What the row records. A number is what sum/max/min/avg fold over; anything else is stored as-is and read back by first/last. Omit to record only that the thing happened."},"ttldays":{"description":"Days to keep the row. Omit to keep it forever — anything a billed quantity rests on must outlive the invoice, so the billing path never sets this.","oneOf":[{"type":"integer","minimum":1},{"type":"null"}]}},"required":["token","group","key"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"group":{"description":"The ledger this row is a line of — a name the workflow chooses, e.g. \"webhook.runs/cli-acme\". Rows go in, nothing edits a line, and the balance is a fold over the lines.","type":"string"},"key":{"description":"The row's key within the group. A fixed key makes a note (the new value replaces the last); the event's own identifier makes a reading (a retry lands on the row it wrote before, so counts hold under retries).","type":"string"},"value":{"description":"What the row records. A number is what sum/max/min/avg fold over; anything else is stored as-is and read back by first/last. Omit to record only that the thing happened."},"ttldays":{"description":"Days to keep the row. Omit to keep it forever — anything a billed quantity rests on must outlive the invoice, so the billing path never sets this.","oneOf":[{"type":"integer","minimum":1},{"type":"null"}]}},"required":["token","group","key"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"group":{"description":"The ledger this row is a line of — a name the workflow chooses, e.g. \"webhook.runs/cli-acme\". Rows go in, nothing edits a line, and the balance is a fold over the lines.","type":"string"},"key":{"description":"The row's key within the group. A fixed key makes a note (the new value replaces the last); the event's own identifier makes a reading (a retry lands on the row it wrote before, so counts hold under retries).","type":"string"},"value":{"description":"What the row records. A number is what sum/max/min/avg fold over; anything else is stored as-is and read back by first/last. Omit to record only that the thing happened."},"ttldays":{"description":"Days to keep the row. Omit to keep it forever — anything a billed quantity rests on must outlive the invoice, so the billing path never sets this.","oneOf":[{"type":"integer","minimum":1},{"type":"null"}]}},"required":["token","group","key"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Write one row into the running workflow's own memory — a note (fixed key, last value wins) or a reading (the key is the event's identifier, so retries are idempotent). Rows live in a group scoped to this workflow and this business; nothing can read or write across either. Only callable inside a workflow run.","tags":["workflows"]}},"/api/workflow/kv-read":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"group":{"description":"The group to ask about.","type":"string"},"fold":{"description":"One of: count | sum | max | min | first | last | avg. The list is closed. An empty group answers only count and sum (a blank is not a zero), and sum/max/min/avg refuse a group where any row lacks a number rather than folding a smaller total.","type":"string"}},"required":["token","group","fold"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"group":{"description":"The group to ask about.","type":"string"},"fold":{"description":"One of: count | sum | max | min | first | last | avg. The list is closed. An empty group answers only count and sum (a blank is not a zero), and sum/max/min/avg refuse a group where any row lacks a number rather than folding a smaller total.","type":"string"}},"required":["token","group","fold"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"group":{"description":"The group to ask about.","type":"string"},"fold":{"description":"One of: count | sum | max | min | first | last | avg. The list is closed. An empty group answers only count and sum (a blank is not a zero), and sum/max/min/avg refuse a group where any row lacks a number rather than folding a smaller total.","type":"string"}},"required":["token","group","fold"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"group":{"description":"The group to ask about.","type":"string"},"fold":{"description":"One of: count | sum | max | min | first | last | avg. The list is closed. An empty group answers only count and sum (a blank is not a zero), and sum/max/min/avg refuse a group where any row lacks a number rather than folding a smaller total.","type":"string"}},"required":["token","group","fold"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Ask one question of a group in the running workflow's memory: count, sum, max, min, first, last or avg — a fold over the rows at the moment of asking, nothing stored. Reading consumes nothing. Only callable inside a workflow run.","tags":["workflows"]}},"/api/workflow/runs":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"wfid":{"description":"Which flow's runs to list, by its id.","type":"string"},"jobid":{"description":"One run in full — what it left, changed and sent.","type":"string"}},"required":["token","wfid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"wfid":{"description":"Which flow's runs to list, by its id.","type":"string"},"jobid":{"description":"One run in full — what it left, changed and sent.","type":"string"}},"required":["token","wfid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"wfid":{"description":"Which flow's runs to list, by its id.","type":"string"},"jobid":{"description":"One run in full — what it left, changed and sent.","type":"string"}},"required":["token","wfid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"wfid":{"description":"Which flow's runs to list, by its id.","type":"string"},"jobid":{"description":"One run in full — what it left, changed and sent.","type":"string"}},"required":["token","wfid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"This flow's recent runs, newest first — when each ran, how it went, and what it reported.","tags":["workflows"]}},"/api/workflow/run-status":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"wfid":{"description":"Which flow's runs to list, by its id.","type":"string"},"jobid":{"description":"One run in full — what it left, changed and sent.","type":"string"}},"required":["token","wfid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"wfid":{"description":"Which flow's runs to list, by its id.","type":"string"},"jobid":{"description":"One run in full — what it left, changed and sent.","type":"string"}},"required":["token","wfid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"wfid":{"description":"Which flow's runs to list, by its id.","type":"string"},"jobid":{"description":"One run in full — what it left, changed and sent.","type":"string"}},"required":["token","wfid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"wfid":{"description":"Which flow's runs to list, by its id.","type":"string"},"jobid":{"description":"One run in full — what it left, changed and sent.","type":"string"}},"required":["token","wfid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"How far this flow's current run has got — the step it is working on now, and which pass of a repeat it is on. Empty when nothing is running.","tags":["workflows"]}},"/api/workflow/standard":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"The flows stub runs for every business — the checked-in workflows, each rendered as a recipe: what it touches, where it decides something, and what it checks before calling itself done.","tags":["workflows"]}},"/api/workflow/grammar":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"The flow grammar — how a flow definition is written, the predicate names it may use, and the judgment prompts an :llm step may reference. Read this before writing a flow.","tags":["workflows"]}},"/api/workflow/get":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"wfid":{"description":"Which flow to read, by its id.","type":"string"},"version":{"description":"Which saved version to read. The latest when left out.","type":"integer","minimum":1}},"required":["token","wfid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"wfid":{"description":"Which flow to read, by its id.","type":"string"},"version":{"description":"Which saved version to read. The latest when left out.","type":"integer","minimum":1}},"required":["token","wfid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"wfid":{"description":"Which flow to read, by its id.","type":"string"},"version":{"description":"Which saved version to read. The latest when left out.","type":"integer","minimum":1}},"required":["token","wfid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"wfid":{"description":"Which flow to read, by its id.","type":"string"},"version":{"description":"Which saved version to read. The latest when left out.","type":"integer","minimum":1}},"required":["token","wfid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Read one flow's full definition back — stub's own, or one this business saved. Returns the definition as an EDN string, the same form create_flow accepts, so a saved flow can be inspected and resubmitted as a new version.","tags":["workflows"]}},"/api/workflow/trigger":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"wfid":{"description":"Which of this business's own flows to run, by its id.","type":"string"},"inputs":{"description":"Values for the flow's required signature params, by name. Only needed for a flow that declares some; most do not.","type":"object","additionalProperties":{}}},"required":["token","wfid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"wfid":{"description":"Which of this business's own flows to run, by its id.","type":"string"},"inputs":{"description":"Values for the flow's required signature params, by name. Only needed for a flow that declares some; most do not.","type":"object","additionalProperties":{}}},"required":["token","wfid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"wfid":{"description":"Which of this business's own flows to run, by its id.","type":"string"},"inputs":{"description":"Values for the flow's required signature params, by name. Only needed for a flow that declares some; most do not.","type":"object","additionalProperties":{}}},"required":["token","wfid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"wfid":{"description":"Which of this business's own flows to run, by its id.","type":"string"},"inputs":{"description":"Values for the flow's required signature params, by name. Only needed for a flow that declares some; most do not.","type":"object","additionalProperties":{}}},"required":["token","wfid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Run one of this business's own flows now — the flow you just created or edited. Returns as soon as the run is queued; a run takes minutes, and every write it makes is reversible. Use this to TEST a flow you built with create_flow. Stub's own flows are not run from here: each is a tool of its own, and this says which to call.","tags":["workflows"]}},"/api/workflow/run":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"wfid":{"description":"Which flow to run, by its id (e.g. \"books-integrity\").","type":"string"},"inputs":{"description":"Values for the flow's params, by name: numbers, choices, and dates as YYYY-MM-DD or a named period like last-month-start.","type":"object","additionalProperties":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"},{"type":"boolean"}]},{"type":"null"}]}}},"required":["token","wfid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"wfid":{"description":"Which flow to run, by its id (e.g. \"books-integrity\").","type":"string"},"inputs":{"description":"Values for the flow's params, by name: numbers, choices, and dates as YYYY-MM-DD or a named period like last-month-start.","type":"object","additionalProperties":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"},{"type":"boolean"}]},{"type":"null"}]}}},"required":["token","wfid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"wfid":{"description":"Which flow to run, by its id (e.g. \"books-integrity\").","type":"string"},"inputs":{"description":"Values for the flow's params, by name: numbers, choices, and dates as YYYY-MM-DD or a named period like last-month-start.","type":"object","additionalProperties":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"},{"type":"boolean"}]},{"type":"null"}]}}},"required":["token","wfid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"wfid":{"description":"Which flow to run, by its id (e.g. \"books-integrity\").","type":"string"},"inputs":{"description":"Values for the flow's params, by name: numbers, choices, and dates as YYYY-MM-DD or a named period like last-month-start.","type":"object","additionalProperties":{"oneOf":[{"anyOf":[{"type":"number"},{"type":"string"},{"type":"boolean"}]},{"type":"null"}]}}},"required":["token","wfid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Run one of stub's flows now, against this business's books. Returns as soon as the run is queued — it takes minutes, and every write it makes is reversible.","tags":["workflows"]}},"/api/workflow/list":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"status":{"description":"Optional filter: candidate | validated | rejected | archived","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"status":{"description":"Optional filter: candidate | validated | rejected | archived","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"status":{"description":"Optional filter: candidate | validated | rejected | archived","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"status":{"description":"Optional filter: candidate | validated | rejected | archived","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"List workflows saved for this business (summaries only).","tags":["workflows"]}},"/api/workflow/restore":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"wfid":{"description":"Which of this business's flows to restore.","type":"string"},"version":{"description":"The saved version to make the newest again.","type":"integer","minimum":1}},"required":["token","wfid","version"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"wfid":{"description":"Which of this business's flows to restore.","type":"string"},"version":{"description":"The saved version to make the newest again.","type":"integer","minimum":1}},"required":["token","wfid","version"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"wfid":{"description":"Which of this business's flows to restore.","type":"string"},"version":{"description":"The saved version to make the newest again.","type":"integer","minimum":1}},"required":["token","wfid","version"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"wfid":{"description":"Which of this business's flows to restore.","type":"string"},"version":{"description":"The saved version to make the newest again.","type":"integer","minimum":1}},"required":["token","wfid","version"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Save an earlier version of this business's flow as its newest. It is checked again first, and the versions in between are kept.","tags":["workflows"]}},"/api/workflow/unarchive":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"wfid":{"description":"Which flow, by its id.","type":"string"}},"required":["token","wfid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"wfid":{"description":"Which flow, by its id.","type":"string"}},"required":["token","wfid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"wfid":{"description":"Which flow, by its id.","type":"string"}},"required":["token","wfid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"wfid":{"description":"Which flow, by its id.","type":"string"}},"required":["token","wfid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Bring back a flow this business archived: its latest version, switched off.","tags":["workflows"]}},"/api/workflow/customise":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"wfid":{"description":"Which flow, by its id.","type":"string"}},"required":["token","wfid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"wfid":{"description":"Which flow, by its id.","type":"string"}},"required":["token","wfid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"wfid":{"description":"Which flow, by its id.","type":"string"}},"required":["token","wfid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"wfid":{"description":"Which flow, by its id.","type":"string"}},"required":["token","wfid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"A copy of one of stub's flows for this business to change. Nothing is saved until the copy is submitted; once it is, it runs instead of stub's.","tags":["workflows"]}},"/api/hook/events":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"The system events a workflow may be attached to, with the phases each one offers.","tags":["hooks"]}},"/api/hook/subscribe":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"definition":{"description":"The subscription as an EDN string. A map with :id (keyword), :event (one of the declared system events), :phase (:pre or :post), :handler {:workflow <wfid>}, and optionally :priority, :async, :disabled and :description. The :mode is always :observe and the scope is always the submitting business — both are forced. It is validated before it is saved.","type":"string"}},"required":["token","definition"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"definition":{"description":"The subscription as an EDN string. A map with :id (keyword), :event (one of the declared system events), :phase (:pre or :post), :handler {:workflow <wfid>}, and optionally :priority, :async, :disabled and :description. The :mode is always :observe and the scope is always the submitting business — both are forced. It is validated before it is saved.","type":"string"}},"required":["token","definition"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"definition":{"description":"The subscription as an EDN string. A map with :id (keyword), :event (one of the declared system events), :phase (:pre or :post), :handler {:workflow <wfid>}, and optionally :priority, :async, :disabled and :description. The :mode is always :observe and the scope is always the submitting business — both are forced. It is validated before it is saved.","type":"string"}},"required":["token","definition"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"definition":{"description":"The subscription as an EDN string. A map with :id (keyword), :event (one of the declared system events), :phase (:pre or :post), :handler {:workflow <wfid>}, and optionally :priority, :async, :disabled and :description. The :mode is always :observe and the scope is always the submitting business — both are forced. It is validated before it is saved.","type":"string"}},"required":["token","definition"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Subscribe a validated workflow to a system event. The subscription is validated before it is saved; re-submitting the same id edits it rather than adding a second one.","tags":["hooks"]}},"/api/hook/list":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"List this business's subscriptions.","tags":["hooks"]}},"/api/hook/defaults":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Which app handles each takeover event for this business, what else could, and what is chosen.","tags":["hooks"]}},"/api/hook/defaults/set":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"event":{"description":"The system event, e.g. \"invoice/pay\".","type":"string"},"install":{"description":"The installation to handle it, or \"stub\" for stub's own implementation. Whatever held the event is switched off.","type":"string"}},"required":["token","event","install"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"event":{"description":"The system event, e.g. \"invoice/pay\".","type":"string"},"install":{"description":"The installation to handle it, or \"stub\" for stub's own implementation. Whatever held the event is switched off.","type":"string"}},"required":["token","event","install"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"event":{"description":"The system event, e.g. \"invoice/pay\".","type":"string"},"install":{"description":"The installation to handle it, or \"stub\" for stub's own implementation. Whatever held the event is switched off.","type":"string"}},"required":["token","event","install"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"event":{"description":"The system event, e.g. \"invoice/pay\".","type":"string"},"install":{"description":"The installation to handle it, or \"stub\" for stub's own implementation. Whatever held the event is switched off.","type":"string"}},"required":["token","event","install"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Choose which installation handles an event for this business, the way a primary browser is set. Whatever held it is switched off.","tags":["hooks"]}},"/api/hook/toggle":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"hookid":{"description":"The subscription's id.","type":"string"},"enabled":{"description":"false disables it without deleting it.","type":"boolean"}},"required":["token","hookid","enabled"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"hookid":{"description":"The subscription's id.","type":"string"},"enabled":{"description":"false disables it without deleting it.","type":"boolean"}},"required":["token","hookid","enabled"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"hookid":{"description":"The subscription's id.","type":"string"},"enabled":{"description":"false disables it without deleting it.","type":"boolean"}},"required":["token","hookid","enabled"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"hookid":{"description":"The subscription's id.","type":"string"},"enabled":{"description":"false disables it without deleting it.","type":"boolean"}},"required":["token","hookid","enabled"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Switch one subscription on or off. Disabling keeps it, so it can be switched back on without re-authoring it.","tags":["hooks"]}},"/api/toggl/time-summary":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"period":{"description":"Month to bill as \"YYYY-MM\". Defaults to the month in progress.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"period":{"description":"Month to bill as \"YYYY-MM\". Defaults to the month in progress.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"period":{"description":"Month to bill as \"YYYY-MM\". Defaults to the month in progress.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"period":{"description":"Month to bill as \"YYYY-MM\". Defaults to the month in progress.","oneOf":[{"type":"string"},{"type":"null"}]}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"What each client's invoice for a month of tracked Toggl time should say, and what it already says. Folds the period's time entries into one line per project (hours × rate), matches each Toggl client to a stub client, finds the period's existing invoice by its [toggl:YYYY-MM] marker, and stamps each line with the id of the invoice line it already has. Reports clients it could not bill under :skipped. Reads only — it writes nothing.","tags":["time tracking"]}},"/api/profile/connections":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"List the bank connections the signed-in person approved, with the businesses that use each one and the businesses it can be shared into.","tags":["user profile"]}},"/api/profile/connections/share":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"app":{"type":"string"},"from":{"type":"string"},"to":{"type":"string"}},"required":["token","app","from","to"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"app":{"type":"string"},"from":{"type":"string"},"to":{"type":"string"}},"required":["token","app","from","to"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"app":{"type":"string"},"from":{"type":"string"},"to":{"type":"string"}},"required":["token","app","from","to"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"app":{"type":"string"},"from":{"type":"string"},"to":{"type":"string"}},"required":["token","app","from","to"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Share the connection one of your businesses uses into another. You need to be able to edit bank accounts on both.","tags":["user profile"]}},"/api/profile/connections/unshare":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"app":{"type":"string"},"businessid":{"type":"string"}},"required":["token","app","businessid"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"app":{"type":"string"},"businessid":{"type":"string"}},"required":["token","app","businessid"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"app":{"type":"string"},"businessid":{"type":"string"}},"required":["token","app","businessid"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"app":{"type":"string"},"businessid":{"type":"string"}},"required":["token","app","businessid"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Stop a business using a connection. On the last business that uses it, the connection is disconnected at the bank.","tags":["user profile"]}},"/api/portfolio/list":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"The signed-in person's portfolios, whether portfolios are offered to them, and every business they can open.","tags":["user profile"]}},"/api/portfolio/save":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"},"businesses":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token","name"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"},"businesses":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token","name"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"},"businesses":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token","name"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"},"businesses":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["token","name"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Create a portfolio, or change one you hold: its name and its businesses. You can only add businesses you can open; businesses left out of a change are kept.","tags":["user profile"]}},"/api/portfolio/leave":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"},"id":{"type":"string"}},"required":["token","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"Stop holding a portfolio. When its last owner leaves, it is deleted.","tags":["user profile"]}},"/api/business/uncategorised":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+msgpack":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/transit+json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}},"application/edn":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Verified. Here's looking at you, kid."},"400":{"description":"We don't do that here."},"401":{"description":"Na fam. You're not authorized."}},"summary":"How many expenses and income records still need a category, by the rule the web app's banner applies.","tags":["business management"]}}}}