{"openapi":"3.0.0","info":{"version":"0.1.1","title":"@usenullish/nullish-server"},"security":[{"ApiKey":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"http","scheme":"bearer","description":"An API key with the REST API permission, created in the user settings."}},"schemas":{},"parameters":{}},"paths":{"/organizations":{"get":{"tags":["Organizations"],"parameters":[{"schema":{"type":"number","nullable":true},"required":false,"name":"limit","in":"query"},{"schema":{"type":"number","nullable":true},"required":false,"name":"offset","in":"query"},{"schema":{"type":"string","minLength":1},"required":true,"name":"sort","in":"query"},{"schema":{"type":"string","enum":["asc","desc"]},"required":true,"name":"direction","in":"query"},{"schema":{"type":"string","minLength":1,"description":"Matches part of the name, email or city of the organization, case-insensitive, e.g. Acme"},"required":false,"description":"Matches part of the name, email or city of the organization, case-insensitive, e.g. Acme","name":"search","in":"query"}],"responses":{"200":{"description":"Retrieve a list of organizations","content":{"application/json":{"schema":{"type":"object","properties":{"organizations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"legalForm":{"type":"string","enum":["llc","corporation","sole_proprietorship"]},"careOf":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"postalCode":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"country":{"type":"string","nullable":true,"maxLength":2},"language":{"type":"string","nullable":true,"maxLength":2},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"website":{"type":"string","nullable":true},"deletedAt":{"type":"object","nullable":true,"properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","name","legalForm","careOf","address","postalCode","city","country","language","email","phone","website","deletedAt","createdAt","updatedAt","version"]}}},"required":["organizations"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for organizations","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}},"post":{"tags":["Organizations"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":3,"maxLength":255},"legalForm":{"type":"string","enum":["llc","corporation","sole_proprietorship"]},"careOf":{"type":"string","nullable":true,"maxLength":255,"description":"Care of line, e.g. c/o Jane Doe"},"address":{"type":"string","nullable":true,"maxLength":255,"description":"Street and number only, e.g. Sihlquai 131. The postal code, city and country have their own fields."},"postalCode":{"type":"string","nullable":true,"maxLength":16,"description":"Postal code, e.g. 8005"},"city":{"type":"string","nullable":true,"maxLength":255,"description":"City, e.g. Zürich"},"country":{"type":"string","nullable":true,"minLength":2,"maxLength":2,"description":"ISO 3166-1 alpha-2 country code, e.g. CH"},"language":{"type":"string","nullable":true,"pattern":"^[a-z]{2}$","description":"ISO 639-1 language code, e.g. fr"},"email":{"type":"string","nullable":true,"format":"email"},"phone":{"type":"string","nullable":true,"description":"Phone number in E.164 format, e.g. +41791234567"},"website":{"type":"string","nullable":true,"format":"uri"}},"required":["name","legalForm"]}}}},"responses":{"201":{"description":"Create an organization","content":{"application/json":{"schema":{"type":"object","properties":{"organization":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"legalForm":{"type":"string","enum":["llc","corporation","sole_proprietorship"]},"careOf":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"postalCode":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"country":{"type":"string","nullable":true,"maxLength":2},"language":{"type":"string","nullable":true,"maxLength":2},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"website":{"type":"string","nullable":true},"deletedAt":{"type":"object","nullable":true,"properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","name","legalForm","careOf","address","postalCode","city","country","language","email","phone","website","deletedAt","createdAt","updatedAt","version"]}},"required":["organization"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for organizations","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/organizations/{id}":{"get":{"tags":["Organizations"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Get an organization","content":{"application/json":{"schema":{"type":"object","properties":{"organization":{"type":"object","nullable":true,"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"legalForm":{"type":"string","enum":["llc","corporation","sole_proprietorship"]},"careOf":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"postalCode":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"country":{"type":"string","nullable":true,"maxLength":2},"language":{"type":"string","nullable":true,"maxLength":2},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"website":{"type":"string","nullable":true},"deletedAt":{"type":"object","nullable":true,"properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","name","legalForm","careOf","address","postalCode","city","country","language","email","phone","website","deletedAt","createdAt","updatedAt","version"]}},"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for organizations","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}},"patch":{"tags":["Organizations"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":3,"maxLength":255},"careOf":{"type":"string","nullable":true,"maxLength":255,"description":"Care of line, e.g. c/o Jane Doe"},"address":{"type":"string","nullable":true,"maxLength":255,"description":"Street and number only, e.g. Sihlquai 131. The postal code, city and country have their own fields."},"postalCode":{"type":"string","nullable":true,"maxLength":16,"description":"Postal code, e.g. 8005"},"city":{"type":"string","nullable":true,"maxLength":255,"description":"City, e.g. Zürich"},"country":{"type":"string","nullable":true,"minLength":2,"maxLength":2,"description":"ISO 3166-1 alpha-2 country code, e.g. CH"},"language":{"type":"string","nullable":true,"pattern":"^[a-z]{2}$","description":"ISO 639-1 language code, e.g. fr"},"email":{"type":"string","nullable":true,"format":"email"},"phone":{"type":"string","nullable":true,"description":"Phone number in E.164 format, e.g. +41791234567"},"website":{"type":"string","nullable":true,"format":"uri"},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["version"]}}}},"responses":{"200":{"description":"Update an organization","content":{"application/json":{"schema":{"type":"object","properties":{"organization":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"legalForm":{"type":"string","enum":["llc","corporation","sole_proprietorship"]},"careOf":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"postalCode":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"country":{"type":"string","nullable":true,"maxLength":2},"language":{"type":"string","nullable":true,"maxLength":2},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"website":{"type":"string","nullable":true},"deletedAt":{"type":"object","nullable":true,"properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","name","legalForm","careOf","address","postalCode","city","country","language","email","phone","website","deletedAt","createdAt","updatedAt","version"]}},"required":["organization"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for organizations","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/organizations/{parentId}/delete":{"post":{"tags":["Organizations"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"}],"responses":{"200":{"description":"Mark an organization as deleted. It stays readable by its members but can no longer be modified, and it is deleted with all its records after a grace period of 30 days. Only admins mark an organization as deleted.","content":{"application/json":{"schema":{"type":"object","properties":{"organization":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"legalForm":{"type":"string","enum":["llc","corporation","sole_proprietorship"]},"careOf":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"postalCode":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"country":{"type":"string","nullable":true,"maxLength":2},"language":{"type":"string","nullable":true,"maxLength":2},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"website":{"type":"string","nullable":true},"deletedAt":{"type":"object","nullable":true,"properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","name","legalForm","careOf","address","postalCode","city","country","language","email","phone","website","deletedAt","createdAt","updatedAt","version"]}},"required":["organization"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for organizations","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/organizations/{parentId}/members":{"get":{"tags":["Members"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"},{"schema":{"type":"number","nullable":true},"required":false,"name":"limit","in":"query"},{"schema":{"type":"number","nullable":true},"required":false,"name":"offset","in":"query"},{"schema":{"type":"string","minLength":1},"required":true,"name":"sort","in":"query"},{"schema":{"type":"string","enum":["asc","desc"]},"required":true,"name":"direction","in":"query"}],"responses":{"200":{"description":"Retrieve the members of an organization with their name, email and image. Only admins see them.","content":{"application/json":{"schema":{"type":"object","properties":{"members":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"userId":{"type":"string"},"organizationId":{"type":"string","format":"uuid"},"role":{"type":"string","enum":["admin","accountant","reviewer"]},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647},"name":{"type":"string"},"email":{"type":"string"},"image":{"type":"string","nullable":true}},"required":["id","userId","organizationId","role","createdAt","updatedAt","version","name","email","image"]}}},"required":["members"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for members","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/members/{id}":{"delete":{"tags":["Members"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Remove a member from an organization, or leave it when the membership is your own. Only admins remove others. Also deletes the person's chat conversations in that organization. An organization keeps at least one admin."},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for members","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/invitations/preview":{"post":{"tags":["Invitations"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","minLength":1}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Preview the invitation of a token before accepting or declining it: the name of the organization. The invitation must not be expired, must have been sent to the email of the signed-in user, who must not already be a member.","content":{"application/json":{"schema":{"type":"object","properties":{"organizationName":{"type":"string"}},"required":["organizationName"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for invitations","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/invitations/accept":{"post":{"tags":["Invitations"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","minLength":1}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Accept an invitation with its token and join the organization with its role. The invitation must not be expired, must have been sent to the email of the signed-in user, who must not already be a member.","content":{"application/json":{"schema":{"type":"object","properties":{"membership":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"role":{"type":"string","enum":["admin","accountant","reviewer"]}},"required":["id","organizationId","role"]}},"required":["membership"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for invitations","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/invitations/decline":{"post":{"tags":["Invitations"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","minLength":1}},"required":["token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Decline an invitation with its token: it is deleted and its link stops working. The invitation must not be expired, must have been sent to the email of the signed-in user, who must not already be a member.","content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for invitations","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/organizations/{parentId}/invitations":{"get":{"tags":["Invitations"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"},{"schema":{"type":"number","nullable":true},"required":false,"name":"limit","in":"query"},{"schema":{"type":"number","nullable":true},"required":false,"name":"offset","in":"query"},{"schema":{"type":"string","minLength":1},"required":true,"name":"sort","in":"query"},{"schema":{"type":"string","enum":["asc","desc"]},"required":true,"name":"direction","in":"query"}],"responses":{"200":{"description":"Retrieve the pending invitations of an organization. Only admins see them.","content":{"application/json":{"schema":{"type":"object","properties":{"invitations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"email":{"type":"string"},"role":{"type":"string","enum":["admin","accountant","reviewer"]},"expiresAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","email","role","expiresAt","createdAt","updatedAt","version"]}}},"required":["invitations"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for invitations","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}},"post":{"tags":["Invitations"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email"},"role":{"type":"string","enum":["admin","accountant","reviewer"]}},"required":["email","role"]}}}},"responses":{"201":{"description":"Invite a person by email with a role. Only admins invite. The token is returned once, to share as a link, and expires after 7 days.","content":{"application/json":{"schema":{"type":"object","properties":{"invitation":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"email":{"type":"string"},"role":{"type":"string","enum":["admin","accountant","reviewer"]},"expiresAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","email","role","expiresAt","createdAt","updatedAt","version"]},"token":{"type":"string","minLength":1}},"required":["invitation","token"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for invitations","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/invitations/{id}":{"delete":{"tags":["Invitations"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Revoke a pending invitation. Only admins revoke."},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for invitations","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/organizations/{parentId}/accounting/vat/settings":{"get":{"tags":["VAT Settings"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"},{"schema":{"type":"number","nullable":true},"required":false,"name":"limit","in":"query"},{"schema":{"type":"number","nullable":true},"required":false,"name":"offset","in":"query"},{"schema":{"type":"string","minLength":1},"required":true,"name":"sort","in":"query"},{"schema":{"type":"string","enum":["asc","desc"]},"required":true,"name":"direction","in":"query"}],"responses":{"200":{"description":"Retrieve a list of VAT settings","content":{"application/json":{"schema":{"type":"object","properties":{"settings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"vatNumber":{"type":"string"},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","vatNumber","createdAt","updatedAt","version"]}}},"required":["settings"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for vat settings","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}},"post":{"tags":["VAT Settings"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"vatNumber":{"type":"string","pattern":"^CHE-\\d{3}\\.\\d{3}\\.\\d{3} (MWST|TVA|IVA)$"}},"required":["vatNumber"]}}}},"responses":{"201":{"description":"Create a VAT setting","content":{"application/json":{"schema":{"type":"object","properties":{"setting":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"vatNumber":{"type":"string"},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","vatNumber","createdAt","updatedAt","version"]}},"required":["setting"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for vat settings","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/accounting/vat/settings/{id}":{"get":{"tags":["VAT Settings"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Get a VAT setting","content":{"application/json":{"schema":{"type":"object","properties":{"setting":{"type":"object","nullable":true,"properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"vatNumber":{"type":"string"},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","vatNumber","createdAt","updatedAt","version"]}},"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for vat settings","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}},"patch":{"tags":["VAT Settings"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"vatNumber":{"type":"string","pattern":"^CHE-\\d{3}\\.\\d{3}\\.\\d{3} (MWST|TVA|IVA)$"},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["version"]}}}},"responses":{"200":{"description":"Update a VAT setting","content":{"application/json":{"schema":{"type":"object","properties":{"setting":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"vatNumber":{"type":"string"},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","vatNumber","createdAt","updatedAt","version"]}},"required":["setting"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for vat settings","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/organizations/{parentId}/accounting/vat/methods":{"get":{"tags":["VAT Methods"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"},{"schema":{"type":"number","nullable":true},"required":false,"name":"limit","in":"query"},{"schema":{"type":"number","nullable":true},"required":false,"name":"offset","in":"query"},{"schema":{"type":"string","minLength":1},"required":true,"name":"sort","in":"query"},{"schema":{"type":"string","enum":["asc","desc"]},"required":true,"name":"direction","in":"query"}],"responses":{"200":{"description":"Retrieve the VAT methods of the fiscal years","content":{"application/json":{"schema":{"type":"object","properties":{"methods":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"periodId":{"type":"string","format":"uuid"},"remunerationMethod":{"type":"string","enum":["agreed","received"]},"paymentMethod":{"type":"string","enum":["net_rate","effective"]},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","periodId","remunerationMethod","paymentMethod","createdAt","updatedAt","version"]}}},"required":["methods"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for vat methods","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}},"post":{"tags":["VAT Methods"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"periodId":{"type":"string","format":"uuid"},"remunerationMethod":{"type":"string","enum":["agreed","received"]},"paymentMethod":{"type":"string","enum":["net_rate","effective"]}},"required":["periodId","remunerationMethod","paymentMethod"]}}}},"responses":{"201":{"description":"Create the VAT methods of a fiscal year","content":{"application/json":{"schema":{"type":"object","properties":{"method":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"periodId":{"type":"string","format":"uuid"},"remunerationMethod":{"type":"string","enum":["agreed","received"]},"paymentMethod":{"type":"string","enum":["net_rate","effective"]},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","periodId","remunerationMethod","paymentMethod","createdAt","updatedAt","version"]}},"required":["method"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for vat methods","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/accounting/vat/methods/{id}":{"get":{"tags":["VAT Methods"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Get the VAT methods of a fiscal year","content":{"application/json":{"schema":{"type":"object","properties":{"method":{"type":"object","nullable":true,"properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"periodId":{"type":"string","format":"uuid"},"remunerationMethod":{"type":"string","enum":["agreed","received"]},"paymentMethod":{"type":"string","enum":["net_rate","effective"]},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","periodId","remunerationMethod","paymentMethod","createdAt","updatedAt","version"]}},"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for vat methods","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}},"patch":{"tags":["VAT Methods"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"remunerationMethod":{"type":"string","enum":["agreed","received"]},"paymentMethod":{"type":"string","enum":["net_rate","effective"]},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["version"]}}}},"responses":{"200":{"description":"Update the VAT methods of a fiscal year","content":{"application/json":{"schema":{"type":"object","properties":{"method":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"periodId":{"type":"string","format":"uuid"},"remunerationMethod":{"type":"string","enum":["agreed","received"]},"paymentMethod":{"type":"string","enum":["net_rate","effective"]},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","periodId","remunerationMethod","paymentMethod","createdAt","updatedAt","version"]}},"required":["method"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for vat methods","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/organizations/{parentId}/accounting/vat/rates":{"get":{"tags":["VAT Rates"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"},{"schema":{"type":"number","nullable":true},"required":false,"name":"limit","in":"query"},{"schema":{"type":"number","nullable":true},"required":false,"name":"offset","in":"query"},{"schema":{"type":"string","minLength":1},"required":true,"name":"sort","in":"query"},{"schema":{"type":"string","enum":["asc","desc"]},"required":true,"name":"direction","in":"query"},{"schema":{"type":"string","enum":["net_rate_tax","acquisition_tax_investments","acquisition_tax_materials","non_consideration","non_taxable_turnover","import_tax_materials","import_tax_investments","sales_tax_due","input_tax_materials","input_tax_investments"]},"required":false,"name":"type","in":"query"},{"schema":{"type":"string","format":"date"},"required":false,"name":"validOn","in":"query"}],"responses":{"200":{"description":"Retrieve a list of VAT rates","content":{"application/json":{"schema":{"type":"object","properties":{"rates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"code":{"type":"string"},"type":{"type":"string","enum":["net_rate_tax","acquisition_tax_investments","acquisition_tax_materials","non_consideration","non_taxable_turnover","import_tax_materials","import_tax_investments","sales_tax_due","input_tax_materials","input_tax_investments"]},"rate":{"type":"number","minimum":-9007199254740991,"maximum":9007199254740991},"netRate":{"type":"number","nullable":true,"minimum":-9007199254740991,"maximum":9007199254740991},"startOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"endOn":{"type":"object","nullable":true,"properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","code","type","rate","netRate","startOn","endOn","createdAt","updatedAt","version"]}}},"required":["rates"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for vat rates","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}},"post":{"tags":["VAT Rates"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"type":{"type":"string","enum":["net_rate_tax","acquisition_tax_investments","acquisition_tax_materials","non_consideration","non_taxable_turnover","import_tax_materials","import_tax_investments","sales_tax_due","input_tax_materials","input_tax_investments"]},"rate":{"type":"number","minimum":-9007199254740991,"maximum":9007199254740991},"netRate":{"type":"number","nullable":true,"minimum":-9007199254740991,"maximum":9007199254740991},"startOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"endOn":{"type":"object","nullable":true,"properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false}},"required":["code","type","rate","startOn","endOn"]}}}},"responses":{"201":{"description":"Create a VAT rate","content":{"application/json":{"schema":{"type":"object","properties":{"rate":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"code":{"type":"string"},"type":{"type":"string","enum":["net_rate_tax","acquisition_tax_investments","acquisition_tax_materials","non_consideration","non_taxable_turnover","import_tax_materials","import_tax_investments","sales_tax_due","input_tax_materials","input_tax_investments"]},"rate":{"type":"number","minimum":-9007199254740991,"maximum":9007199254740991},"netRate":{"type":"number","nullable":true,"minimum":-9007199254740991,"maximum":9007199254740991},"startOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"endOn":{"type":"object","nullable":true,"properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","code","type","rate","netRate","startOn","endOn","createdAt","updatedAt","version"]}},"required":["rate"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for vat rates","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/accounting/vat/rates/{id}":{"get":{"tags":["VAT Rates"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Get a VAT rate","content":{"application/json":{"schema":{"type":"object","properties":{"rate":{"type":"object","nullable":true,"properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"code":{"type":"string"},"type":{"type":"string","enum":["net_rate_tax","acquisition_tax_investments","acquisition_tax_materials","non_consideration","non_taxable_turnover","import_tax_materials","import_tax_investments","sales_tax_due","input_tax_materials","input_tax_investments"]},"rate":{"type":"number","minimum":-9007199254740991,"maximum":9007199254740991},"netRate":{"type":"number","nullable":true,"minimum":-9007199254740991,"maximum":9007199254740991},"startOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"endOn":{"type":"object","nullable":true,"properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","code","type","rate","netRate","startOn","endOn","createdAt","updatedAt","version"]}},"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for vat rates","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}},"patch":{"tags":["VAT Rates"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"type":{"type":"string","enum":["net_rate_tax","acquisition_tax_investments","acquisition_tax_materials","non_consideration","non_taxable_turnover","import_tax_materials","import_tax_investments","sales_tax_due","input_tax_materials","input_tax_investments"]},"rate":{"type":"number","minimum":-9007199254740991,"maximum":9007199254740991},"netRate":{"type":"number","nullable":true,"minimum":-9007199254740991,"maximum":9007199254740991},"startOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"endOn":{"type":"object","nullable":true,"properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["version"]}}}},"responses":{"200":{"description":"Update a VAT rate","content":{"application/json":{"schema":{"type":"object","properties":{"rate":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"code":{"type":"string"},"type":{"type":"string","enum":["net_rate_tax","acquisition_tax_investments","acquisition_tax_materials","non_consideration","non_taxable_turnover","import_tax_materials","import_tax_investments","sales_tax_due","input_tax_materials","input_tax_investments"]},"rate":{"type":"number","minimum":-9007199254740991,"maximum":9007199254740991},"netRate":{"type":"number","nullable":true,"minimum":-9007199254740991,"maximum":9007199254740991},"startOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"endOn":{"type":"object","nullable":true,"properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","code","type","rate","netRate","startOn","endOn","createdAt","updatedAt","version"]}},"required":["rate"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for vat rates","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/organizations/{parentId}/accounting/vat/periods":{"get":{"tags":["VAT Periods"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"},{"schema":{"type":"number","nullable":true},"required":false,"name":"limit","in":"query"},{"schema":{"type":"number","nullable":true},"required":false,"name":"offset","in":"query"},{"schema":{"type":"string","minLength":1},"required":true,"name":"sort","in":"query"},{"schema":{"type":"string","enum":["asc","desc"]},"required":true,"name":"direction","in":"query"},{"schema":{"type":"string","enum":["open","closed"]},"required":false,"name":"status","in":"query"}],"responses":{"200":{"description":"Retrieve a list of VAT periods","content":{"application/json":{"schema":{"type":"object","properties":{"periods":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"startOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"endOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"status":{"type":"string","enum":["open","closed"]},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","startOn","endOn","status","createdAt","updatedAt","version"]}}},"required":["periods"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for vat periods","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}},"post":{"tags":["VAT Periods"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"startOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"endOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"status":{"type":"string","enum":["open","closed"]}},"required":["startOn","endOn"]}}}},"responses":{"201":{"description":"Create a VAT period","content":{"application/json":{"schema":{"type":"object","properties":{"period":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"startOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"endOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"status":{"type":"string","enum":["open","closed"]},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","startOn","endOn","status","createdAt","updatedAt","version"]}},"required":["period"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for vat periods","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/accounting/vat/periods/{id}":{"get":{"tags":["VAT Periods"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Get a VAT period","content":{"application/json":{"schema":{"type":"object","properties":{"period":{"type":"object","nullable":true,"properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"startOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"endOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"status":{"type":"string","enum":["open","closed"]},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","startOn","endOn","status","createdAt","updatedAt","version"]}},"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for vat periods","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}},"patch":{"tags":["VAT Periods"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"startOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"endOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"status":{"type":"string","enum":["open","closed"]},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["version"]}}}},"responses":{"200":{"description":"Update a VAT period","content":{"application/json":{"schema":{"type":"object","properties":{"period":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"startOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"endOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"status":{"type":"string","enum":["open","closed"]},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","startOn","endOn","status","createdAt","updatedAt","version"]}},"required":["period"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for vat periods","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/organizations/{parentId}/accounting/vat/method-summaries":{"get":{"tags":["VAT Methods"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"},{"schema":{"type":"number","nullable":true},"required":false,"name":"limit","in":"query"},{"schema":{"type":"number","nullable":true},"required":false,"name":"offset","in":"query"},{"schema":{"type":"string","minLength":1},"required":true,"name":"sort","in":"query"},{"schema":{"type":"string","enum":["asc","desc"]},"required":true,"name":"direction","in":"query"}],"responses":{"200":{"description":"Retrieve a list of VAT methods with their period, sorted by the columns of the period","content":{"application/json":{"schema":{"type":"object","properties":{"vatMethodSummaries":{"type":"array","items":{"type":"object","properties":{"vatMethod":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"periodId":{"type":"string","format":"uuid"},"remunerationMethod":{"type":"string","enum":["agreed","received"]},"paymentMethod":{"type":"string","enum":["net_rate","effective"]},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","periodId","remunerationMethod","paymentMethod","createdAt","updatedAt","version"]},"period":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"startOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"endOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"status":{"type":"string","enum":["open","closed"]},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","startOn","endOn","status","createdAt","updatedAt","version"]}},"required":["vatMethod","period"],"additionalProperties":false}}},"required":["vatMethodSummaries"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for vat methods","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/organizations/{parentId}/accounting/settings":{"get":{"tags":["Accounting Settings"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"},{"schema":{"type":"number","nullable":true},"required":false,"name":"limit","in":"query"},{"schema":{"type":"number","nullable":true},"required":false,"name":"offset","in":"query"},{"schema":{"type":"string","minLength":1},"required":true,"name":"sort","in":"query"},{"schema":{"type":"string","enum":["asc","desc"]},"required":true,"name":"direction","in":"query"}],"responses":{"200":{"description":"Retrieve a list of accounting settings","content":{"application/json":{"schema":{"type":"object","properties":{"settings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"baseCurrency":{"type":"string","maxLength":20},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","baseCurrency","createdAt","updatedAt","version"]}}},"required":["settings"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for accounting settings","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}},"post":{"tags":["Accounting Settings"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"baseCurrency":{"type":"string","maxLength":20}}}}}},"responses":{"201":{"description":"Create an accounting setting","content":{"application/json":{"schema":{"type":"object","properties":{"setting":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"baseCurrency":{"type":"string","maxLength":20},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","baseCurrency","createdAt","updatedAt","version"]}},"required":["setting"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for accounting settings","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/accounting/settings/{id}":{"get":{"tags":["Accounting Settings"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Get an accounting setting","content":{"application/json":{"schema":{"type":"object","properties":{"setting":{"type":"object","nullable":true,"properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"baseCurrency":{"type":"string","maxLength":20},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","baseCurrency","createdAt","updatedAt","version"]}},"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for accounting settings","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}},"patch":{"tags":["Accounting Settings"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"baseCurrency":{"type":"string","maxLength":20},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["version"]}}}},"responses":{"200":{"description":"Update an accounting setting","content":{"application/json":{"schema":{"type":"object","properties":{"setting":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"baseCurrency":{"type":"string","maxLength":20},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","baseCurrency","createdAt","updatedAt","version"]}},"required":["setting"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for accounting settings","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/organizations/{parentId}/billing/settings":{"get":{"tags":["Billing Settings"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"},{"schema":{"type":"number","nullable":true},"required":false,"name":"limit","in":"query"},{"schema":{"type":"number","nullable":true},"required":false,"name":"offset","in":"query"},{"schema":{"type":"string","minLength":1},"required":true,"name":"sort","in":"query"},{"schema":{"type":"string","enum":["asc","desc"]},"required":true,"name":"direction","in":"query"}],"responses":{"200":{"description":"Retrieve a list of billing settings","content":{"application/json":{"schema":{"type":"object","properties":{"settings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"paymentTermDays":{"type":"integer","minimum":-2147483648,"maximum":2147483647},"vatRateId":{"type":"string","nullable":true,"format":"uuid"},"bankRelationId":{"type":"string","nullable":true,"format":"uuid"},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","paymentTermDays","vatRateId","bankRelationId","createdAt","updatedAt","version"]}}},"required":["settings"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for billing settings","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}},"post":{"tags":["Billing Settings"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"paymentTermDays":{"type":"integer","minimum":-2147483648,"maximum":2147483647},"vatRateId":{"type":"string","nullable":true,"format":"uuid"},"bankRelationId":{"type":"string","nullable":true,"format":"uuid"}}}}}},"responses":{"201":{"description":"Create a billing setting","content":{"application/json":{"schema":{"type":"object","properties":{"setting":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"paymentTermDays":{"type":"integer","minimum":-2147483648,"maximum":2147483647},"vatRateId":{"type":"string","nullable":true,"format":"uuid"},"bankRelationId":{"type":"string","nullable":true,"format":"uuid"},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","paymentTermDays","vatRateId","bankRelationId","createdAt","updatedAt","version"]}},"required":["setting"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for billing settings","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/billing/settings/{id}":{"get":{"tags":["Billing Settings"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Get a billing setting","content":{"application/json":{"schema":{"type":"object","properties":{"setting":{"type":"object","nullable":true,"properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"paymentTermDays":{"type":"integer","minimum":-2147483648,"maximum":2147483647},"vatRateId":{"type":"string","nullable":true,"format":"uuid"},"bankRelationId":{"type":"string","nullable":true,"format":"uuid"},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","paymentTermDays","vatRateId","bankRelationId","createdAt","updatedAt","version"]}},"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for billing settings","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}},"patch":{"tags":["Billing Settings"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"paymentTermDays":{"type":"integer","minimum":-2147483648,"maximum":2147483647},"vatRateId":{"type":"string","nullable":true,"format":"uuid"},"bankRelationId":{"type":"string","nullable":true,"format":"uuid"},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["version"]}}}},"responses":{"200":{"description":"Update a billing setting","content":{"application/json":{"schema":{"type":"object","properties":{"setting":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"paymentTermDays":{"type":"integer","minimum":-2147483648,"maximum":2147483647},"vatRateId":{"type":"string","nullable":true,"format":"uuid"},"bankRelationId":{"type":"string","nullable":true,"format":"uuid"},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","paymentTermDays","vatRateId","bankRelationId","createdAt","updatedAt","version"]}},"required":["setting"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for billing settings","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/organizations/{parentId}/billing/document-templates":{"get":{"tags":["Document Templates"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"},{"schema":{"type":"number","nullable":true},"required":false,"name":"limit","in":"query"},{"schema":{"type":"number","nullable":true},"required":false,"name":"offset","in":"query"},{"schema":{"type":"string","minLength":1},"required":true,"name":"sort","in":"query"},{"schema":{"type":"string","enum":["asc","desc"]},"required":true,"name":"direction","in":"query"},{"schema":{"type":"string","enum":["invoice"]},"required":false,"name":"type","in":"query"}],"responses":{"200":{"description":"Retrieve a list of document templates","content":{"application/json":{"schema":{"type":"object","properties":{"templates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["invoice"]},"name":{"type":"string"},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","type","name","createdAt","updatedAt","version"]}}},"required":["templates"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for document templates","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}},"post":{"tags":["Document Templates"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["invoice"]},"name":{"type":"string"}},"required":["type","name"]}}}},"responses":{"201":{"description":"Create a document template","content":{"application/json":{"schema":{"type":"object","properties":{"template":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["invoice"]},"name":{"type":"string"},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","type","name","createdAt","updatedAt","version"]}},"required":["template"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for document templates","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/billing/document-templates/{id}":{"get":{"tags":["Document Templates"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Get a document template","content":{"application/json":{"schema":{"type":"object","properties":{"template":{"type":"object","nullable":true,"properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["invoice"]},"name":{"type":"string"},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","type","name","createdAt","updatedAt","version"]}},"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for document templates","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}},"patch":{"tags":["Document Templates"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["invoice"]},"name":{"type":"string"},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["version"]}}}},"responses":{"200":{"description":"Update a document template","content":{"application/json":{"schema":{"type":"object","properties":{"template":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["invoice"]},"name":{"type":"string"},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","type","name","createdAt","updatedAt","version"]}},"required":["template"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for document templates","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}},"delete":{"tags":["Document Templates"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Delete a document template"},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for document templates","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/billing/document-templates/{parentId}/contents":{"get":{"tags":["Document Template Contents"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"},{"schema":{"type":"number","nullable":true},"required":false,"name":"limit","in":"query"},{"schema":{"type":"number","nullable":true},"required":false,"name":"offset","in":"query"},{"schema":{"type":"string","minLength":1},"required":true,"name":"sort","in":"query"},{"schema":{"type":"string","enum":["asc","desc"]},"required":true,"name":"direction","in":"query"},{"schema":{"type":"string","pattern":"^[a-z]{2}$","description":"ISO 639-1 language code, e.g. fr"},"required":false,"description":"ISO 639-1 language code, e.g. fr","name":"language","in":"query"}],"responses":{"200":{"description":"Retrieve the contents of a document template, one per language","content":{"application/json":{"schema":{"type":"object","properties":{"contents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"templateId":{"type":"string","format":"uuid"},"language":{"type":"string","maxLength":2},"html":{"type":"string"},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","templateId","language","html","createdAt","updatedAt","version"]}}},"required":["contents"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for document template contents","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}},"post":{"tags":["Document Template Contents"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"language":{"type":"string","pattern":"^[a-z]{2}$","description":"ISO 639-1 language code, e.g. fr"},"html":{"type":"string"}},"required":["language","html"]}}}},"responses":{"201":{"description":"Create the content of a document template in a language","content":{"application/json":{"schema":{"type":"object","properties":{"content":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"templateId":{"type":"string","format":"uuid"},"language":{"type":"string","maxLength":2},"html":{"type":"string"},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","templateId","language","html","createdAt","updatedAt","version"]}},"required":["content"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for document template contents","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/billing/template-contents/{id}":{"get":{"tags":["Document Template Contents"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Get a document template content","content":{"application/json":{"schema":{"type":"object","properties":{"content":{"type":"object","nullable":true,"properties":{"id":{"type":"string","format":"uuid"},"templateId":{"type":"string","format":"uuid"},"language":{"type":"string","maxLength":2},"html":{"type":"string"},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","templateId","language","html","createdAt","updatedAt","version"]}},"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for document template contents","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}},"patch":{"tags":["Document Template Contents"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"language":{"type":"string","pattern":"^[a-z]{2}$","description":"ISO 639-1 language code, e.g. fr"},"html":{"type":"string"},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["version"]}}}},"responses":{"200":{"description":"Update a document template content","content":{"application/json":{"schema":{"type":"object","properties":{"content":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"templateId":{"type":"string","format":"uuid"},"language":{"type":"string","maxLength":2},"html":{"type":"string"},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","templateId","language","html","createdAt","updatedAt","version"]}},"required":["content"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for document template contents","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}},"delete":{"tags":["Document Template Contents"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Delete a document template content"},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for document template contents","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/organizations/{parentId}/banking/relations":{"get":{"tags":["Bank Accounts"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"},{"schema":{"type":"number","nullable":true},"required":false,"name":"limit","in":"query"},{"schema":{"type":"number","nullable":true},"required":false,"name":"offset","in":"query"},{"schema":{"type":"string","minLength":1},"required":true,"name":"sort","in":"query"},{"schema":{"type":"string","enum":["asc","desc"]},"required":true,"name":"direction","in":"query"}],"responses":{"200":{"description":"Retrieve a list of bank relations","content":{"application/json":{"schema":{"type":"object","properties":{"bankRelations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"name":{"type":"string"},"iban":{"type":"string","description":"IBAN in uppercase without spaces, e.g. CH9300762011623852957"},"invoiceIban":{"type":"string","nullable":true,"description":"IBAN in uppercase without spaces, e.g. CH9300762011623852957"},"currency":{"type":"string","maxLength":20},"accountId":{"type":"string","format":"uuid"},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","name","iban","invoiceIban","currency","accountId","createdAt","updatedAt","version"]}}},"required":["bankRelations"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for bank accounts","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}},"post":{"tags":["Bank Accounts"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"iban":{"type":"string","description":"IBAN in uppercase without spaces, e.g. CH9300762011623852957"},"invoiceIban":{"type":"string","nullable":true,"description":"IBAN in uppercase without spaces, e.g. CH9300762011623852957"},"currency":{"type":"string","maxLength":20},"accountId":{"type":"string","format":"uuid"}},"required":["name","iban","currency","accountId"]}}}},"responses":{"201":{"description":"Create a bank relation","content":{"application/json":{"schema":{"type":"object","properties":{"bankRelation":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"name":{"type":"string"},"iban":{"type":"string","description":"IBAN in uppercase without spaces, e.g. CH9300762011623852957"},"invoiceIban":{"type":"string","nullable":true,"description":"IBAN in uppercase without spaces, e.g. CH9300762011623852957"},"currency":{"type":"string","maxLength":20},"accountId":{"type":"string","format":"uuid"},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","name","iban","invoiceIban","currency","accountId","createdAt","updatedAt","version"]}},"required":["bankRelation"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for bank accounts","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/banking/relations/{id}":{"get":{"tags":["Bank Accounts"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Get a bank relation","content":{"application/json":{"schema":{"type":"object","properties":{"bankRelation":{"type":"object","nullable":true,"properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"name":{"type":"string"},"iban":{"type":"string","description":"IBAN in uppercase without spaces, e.g. CH9300762011623852957"},"invoiceIban":{"type":"string","nullable":true,"description":"IBAN in uppercase without spaces, e.g. CH9300762011623852957"},"currency":{"type":"string","maxLength":20},"accountId":{"type":"string","format":"uuid"},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","name","iban","invoiceIban","currency","accountId","createdAt","updatedAt","version"]}},"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for bank accounts","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}},"patch":{"tags":["Bank Accounts"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"iban":{"type":"string","description":"IBAN in uppercase without spaces, e.g. CH9300762011623852957"},"invoiceIban":{"type":"string","nullable":true,"description":"IBAN in uppercase without spaces, e.g. CH9300762011623852957"},"currency":{"type":"string","maxLength":20},"accountId":{"type":"string","format":"uuid"},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["version"]}}}},"responses":{"200":{"description":"Update a bank relation","content":{"application/json":{"schema":{"type":"object","properties":{"bankRelation":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"name":{"type":"string"},"iban":{"type":"string","description":"IBAN in uppercase without spaces, e.g. CH9300762011623852957"},"invoiceIban":{"type":"string","nullable":true,"description":"IBAN in uppercase without spaces, e.g. CH9300762011623852957"},"currency":{"type":"string","maxLength":20},"accountId":{"type":"string","format":"uuid"},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","name","iban","invoiceIban","currency","accountId","createdAt","updatedAt","version"]}},"required":["bankRelation"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for bank accounts","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}},"delete":{"tags":["Bank Accounts"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Delete a bank relation"},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for bank accounts","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/banking/relations/{parentId}/statements/import":{"post":{"tags":["Bank relations"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"}},"required":["file"],"additionalProperties":false}}}},"responses":{"200":{"description":"Bank statements imported","content":{"application/json":{"schema":{"type":"object","properties":{"statements":{"type":"object","properties":{"processed":{"type":"integer","minimum":0},"ignored":{"type":"integer","minimum":0}},"required":["processed","ignored"],"additionalProperties":false},"movements":{"type":"object","properties":{"inserted":{"type":"integer","minimum":0},"existing":{"type":"integer","minimum":0}},"required":["inserted","existing"],"additionalProperties":false}},"required":["statements","movements"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for bank relations","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/organizations/{parentId}/banking/relation-summaries":{"get":{"tags":["Bank relation summaries"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"},{"schema":{"type":"number","nullable":true},"required":false,"name":"limit","in":"query"},{"schema":{"type":"number","nullable":true},"required":false,"name":"offset","in":"query"},{"schema":{"type":"string","minLength":1},"required":true,"name":"sort","in":"query"},{"schema":{"type":"string","enum":["asc","desc"]},"required":true,"name":"direction","in":"query"}],"responses":{"200":{"description":"Retrieve a list of bank relations with their movements to reconcile","content":{"application/json":{"schema":{"type":"object","properties":{"bankRelationSummaries":{"type":"array","items":{"type":"object","properties":{"bankRelation":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"name":{"type":"string"},"iban":{"type":"string","description":"IBAN in uppercase without spaces, e.g. CH9300762011623852957"},"invoiceIban":{"type":"string","nullable":true,"description":"IBAN in uppercase without spaces, e.g. CH9300762011623852957"},"currency":{"type":"string","maxLength":20},"accountId":{"type":"string","format":"uuid"},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","name","iban","invoiceIban","currency","accountId","createdAt","updatedAt","version"]},"movements":{"type":"object","properties":{"unreconciled":{"type":"integer","minimum":0}},"required":["unreconciled"],"additionalProperties":false},"balance":{"type":"object","nullable":true,"properties":{"amount":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false,"description":"Closing balance of the latest statement imported, in the smallest unit of the currency of the bank relation."},"on":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false,"description":"The last day of that statement."}},"required":["amount","on"],"additionalProperties":false,"description":"What the bank says the account holds, null when no statement was imported."}},"required":["bankRelation","movements","balance"],"additionalProperties":false}}},"required":["bankRelationSummaries"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for bank relation summaries","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/banking/relations/{parentId}/movements":{"get":{"tags":["Bank movements"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"},{"schema":{"type":"number","nullable":true},"required":false,"name":"limit","in":"query"},{"schema":{"type":"number","nullable":true},"required":false,"name":"offset","in":"query"},{"schema":{"type":"string","minLength":1},"required":true,"name":"sort","in":"query"},{"schema":{"type":"string","enum":["asc","desc"]},"required":true,"name":"direction","in":"query"},{"schema":{"type":"string","enum":["unreconciled","reconciled","ignored"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","format":"date"},"required":false,"name":"bookedOnFrom","in":"query"},{"schema":{"type":"string","format":"date"},"required":false,"name":"bookedOnTo","in":"query"}],"responses":{"200":{"description":"Retrieve the movements of a bank relation","content":{"application/json":{"schema":{"type":"object","properties":{"bankMovements":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"bankRelationId":{"type":"string","format":"uuid"},"statementId":{"type":"string","format":"uuid"},"bankReference":{"type":"string","nullable":true},"bookedOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"valueOn":{"type":"object","nullable":true,"properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"amount":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false,"description":"Amount in the smallest unit of the currency. Positive means money came into the bank relation, negative means it left."},"currency":{"type":"string","maxLength":20},"counterpartyName":{"type":"string","nullable":true},"counterpartyAddress":{"type":"string","nullable":true},"counterpartyIban":{"type":"string","nullable":true},"creditorReference":{"type":"string","nullable":true},"communication":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"foreignAmount":{"type":"object","nullable":true,"properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false,"description":"For information only: the amount in another currency, e.g. what the payer sent, in the smallest unit of foreignCurrency. Signed like amount."},"foreignCurrency":{"type":"string","nullable":true,"maxLength":20},"bankFeesAmount":{"type":"object","nullable":true,"properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false,"description":"For information only: the fees of the banks, in the smallest unit of bankFeesCurrency."},"bankFeesCurrency":{"type":"string","nullable":true,"maxLength":20},"status":{"type":"string","enum":["unreconciled","reconciled","ignored"]},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","bankRelationId","statementId","bankReference","bookedOn","valueOn","amount","currency","counterpartyName","counterpartyAddress","counterpartyIban","creditorReference","communication","description","foreignAmount","foreignCurrency","bankFeesAmount","bankFeesCurrency","status","createdAt","updatedAt","version"]}}},"required":["bankMovements"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for bank movements","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/banking/movements/{id}":{"get":{"tags":["Bank movements"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Get a bank movement","content":{"application/json":{"schema":{"type":"object","properties":{"bankMovement":{"type":"object","nullable":true,"properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"bankRelationId":{"type":"string","format":"uuid"},"statementId":{"type":"string","format":"uuid"},"bankReference":{"type":"string","nullable":true},"bookedOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"valueOn":{"type":"object","nullable":true,"properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"amount":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false,"description":"Amount in the smallest unit of the currency. Positive means money came into the bank relation, negative means it left."},"currency":{"type":"string","maxLength":20},"counterpartyName":{"type":"string","nullable":true},"counterpartyAddress":{"type":"string","nullable":true},"counterpartyIban":{"type":"string","nullable":true},"creditorReference":{"type":"string","nullable":true},"communication":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"foreignAmount":{"type":"object","nullable":true,"properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false,"description":"For information only: the amount in another currency, e.g. what the payer sent, in the smallest unit of foreignCurrency. Signed like amount."},"foreignCurrency":{"type":"string","nullable":true,"maxLength":20},"bankFeesAmount":{"type":"object","nullable":true,"properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false,"description":"For information only: the fees of the banks, in the smallest unit of bankFeesCurrency."},"bankFeesCurrency":{"type":"string","nullable":true,"maxLength":20},"status":{"type":"string","enum":["unreconciled","reconciled","ignored"]},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","bankRelationId","statementId","bankReference","bookedOn","valueOn","amount","currency","counterpartyName","counterpartyAddress","counterpartyIban","creditorReference","communication","description","foreignAmount","foreignCurrency","bankFeesAmount","bankFeesCurrency","status","createdAt","updatedAt","version"]}},"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for bank movements","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/banking/relations/{parentId}/movement-summaries":{"get":{"tags":["Bank movement summaries"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"},{"schema":{"type":"number","nullable":true},"required":false,"name":"limit","in":"query"},{"schema":{"type":"number","nullable":true},"required":false,"name":"offset","in":"query"},{"schema":{"type":"string","minLength":1},"required":true,"name":"sort","in":"query"},{"schema":{"type":"string","enum":["asc","desc"]},"required":true,"name":"direction","in":"query"},{"schema":{"type":"string","enum":["unreconciled","reconciled","ignored"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","format":"date"},"required":false,"name":"bookedOnFrom","in":"query"},{"schema":{"type":"string","format":"date"},"required":false,"name":"bookedOnTo","in":"query"}],"responses":{"200":{"description":"Retrieve the movements of a bank relation, each with the open invoice suggested by its payment reference","content":{"application/json":{"schema":{"type":"object","properties":{"bankMovementSummaries":{"type":"array","items":{"type":"object","properties":{"movement":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"bankRelationId":{"type":"string","format":"uuid"},"statementId":{"type":"string","format":"uuid"},"bankReference":{"type":"string","nullable":true},"bookedOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"valueOn":{"type":"object","nullable":true,"properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"amount":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false,"description":"Amount in the smallest unit of the currency. Positive means money came into the bank relation, negative means it left."},"currency":{"type":"string","maxLength":20},"counterpartyName":{"type":"string","nullable":true},"counterpartyAddress":{"type":"string","nullable":true},"counterpartyIban":{"type":"string","nullable":true},"creditorReference":{"type":"string","nullable":true},"communication":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"foreignAmount":{"type":"object","nullable":true,"properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false,"description":"For information only: the amount in another currency, e.g. what the payer sent, in the smallest unit of foreignCurrency. Signed like amount."},"foreignCurrency":{"type":"string","nullable":true,"maxLength":20},"bankFeesAmount":{"type":"object","nullable":true,"properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false,"description":"For information only: the fees of the banks, in the smallest unit of bankFeesCurrency."},"bankFeesCurrency":{"type":"string","nullable":true,"maxLength":20},"status":{"type":"string","enum":["unreconciled","reconciled","ignored"]},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","bankRelationId","statementId","bankReference","bookedOn","valueOn","amount","currency","counterpartyName","counterpartyAddress","counterpartyIban","creditorReference","communication","description","foreignAmount","foreignCurrency","bankFeesAmount","bankFeesCurrency","status","createdAt","updatedAt","version"]},"suggestedInvoice":{"type":"object","nullable":true,"properties":{"invoice":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"clientId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["draft","open","paid","uncollectible","void"]},"number":{"type":"integer","nullable":true,"minimum":-2147483648,"maximum":2147483647},"paymentReference":{"type":"string","nullable":true},"issueOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"dueOn":{"type":"object","nullable":true,"properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"vatRateId":{"type":"string","nullable":true,"format":"uuid"},"currency":{"type":"string","maxLength":20},"exchangeRate":{"type":"number","description":"Exchange rate to the base currency of the organization: what one unit of the currency is worth in the base currency, as usually quoted (e.g. 0.93 for 1 EUR = 0.93 CHF). It must be 1 when the currency is the base currency."},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","clientId","status","number","paymentReference","issueOn","dueOn","vatRateId","currency","exchangeRate","createdAt","updatedAt","version"]},"client":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"amounts":{"type":"object","properties":{"totals":{"type":"object","properties":{"subtotal":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"vat":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"total":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false}},"required":["subtotal","vat","total"],"additionalProperties":false},"balance":{"type":"object","properties":{"paid":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"remaining":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false}},"required":["paid","remaining"],"additionalProperties":false}},"required":["totals","balance"],"additionalProperties":false}},"required":["invoice","client","amounts"],"additionalProperties":false}},"required":["movement","suggestedInvoice"],"additionalProperties":false}}},"required":["bankMovementSummaries"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for bank movement summaries","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/banking/movements/{parentId}/reconcile":{"post":{"tags":["Bank movements"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["invoice"]},"invoiceId":{"type":"string","format":"uuid"}},"required":["type","invoiceId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["account"]},"accountId":{"type":"string","format":"uuid"},"description":{"type":"string","nullable":true},"vatRateId":{"type":"string","nullable":true,"format":"uuid"}},"required":["type","accountId","description"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"Bank movement reconciled with an invoice or booked on an account","content":{"application/json":{"schema":{"type":"object","properties":{"bankMovement":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"bankRelationId":{"type":"string","format":"uuid"},"statementId":{"type":"string","format":"uuid"},"bankReference":{"type":"string","nullable":true},"bookedOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"valueOn":{"type":"object","nullable":true,"properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"amount":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false,"description":"Amount in the smallest unit of the currency. Positive means money came into the bank relation, negative means it left."},"currency":{"type":"string","maxLength":20},"counterpartyName":{"type":"string","nullable":true},"counterpartyAddress":{"type":"string","nullable":true},"counterpartyIban":{"type":"string","nullable":true},"creditorReference":{"type":"string","nullable":true},"communication":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"foreignAmount":{"type":"object","nullable":true,"properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false,"description":"For information only: the amount in another currency, e.g. what the payer sent, in the smallest unit of foreignCurrency. Signed like amount."},"foreignCurrency":{"type":"string","nullable":true,"maxLength":20},"bankFeesAmount":{"type":"object","nullable":true,"properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false,"description":"For information only: the fees of the banks, in the smallest unit of bankFeesCurrency."},"bankFeesCurrency":{"type":"string","nullable":true,"maxLength":20},"status":{"type":"string","enum":["unreconciled","reconciled","ignored"]},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","bankRelationId","statementId","bankReference","bookedOn","valueOn","amount","currency","counterpartyName","counterpartyAddress","counterpartyIban","creditorReference","communication","description","foreignAmount","foreignCurrency","bankFeesAmount","bankFeesCurrency","status","createdAt","updatedAt","version"]}},"required":["bankMovement"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for bank movements","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/banking/movements/{parentId}/ignore":{"post":{"tags":["Bank movements"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"}],"responses":{"200":{"description":"Bank movement set to ignored, which cannot be undone","content":{"application/json":{"schema":{"type":"object","properties":{"bankMovement":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"bankRelationId":{"type":"string","format":"uuid"},"statementId":{"type":"string","format":"uuid"},"bankReference":{"type":"string","nullable":true},"bookedOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"valueOn":{"type":"object","nullable":true,"properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"amount":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false,"description":"Amount in the smallest unit of the currency. Positive means money came into the bank relation, negative means it left."},"currency":{"type":"string","maxLength":20},"counterpartyName":{"type":"string","nullable":true},"counterpartyAddress":{"type":"string","nullable":true},"counterpartyIban":{"type":"string","nullable":true},"creditorReference":{"type":"string","nullable":true},"communication":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"foreignAmount":{"type":"object","nullable":true,"properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false,"description":"For information only: the amount in another currency, e.g. what the payer sent, in the smallest unit of foreignCurrency. Signed like amount."},"foreignCurrency":{"type":"string","nullable":true,"maxLength":20},"bankFeesAmount":{"type":"object","nullable":true,"properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false,"description":"For information only: the fees of the banks, in the smallest unit of bankFeesCurrency."},"bankFeesCurrency":{"type":"string","nullable":true,"maxLength":20},"status":{"type":"string","enum":["unreconciled","reconciled","ignored"]},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","bankRelationId","statementId","bankReference","bookedOn","valueOn","amount","currency","counterpartyName","counterpartyAddress","counterpartyIban","creditorReference","communication","description","foreignAmount","foreignCurrency","bankFeesAmount","bankFeesCurrency","status","createdAt","updatedAt","version"]}},"required":["bankMovement"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for bank movements","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/organizations/{parentId}/accounting/accounts":{"get":{"tags":["Accounts"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"},{"schema":{"type":"number","nullable":true},"required":false,"name":"limit","in":"query"},{"schema":{"type":"number","nullable":true},"required":false,"name":"offset","in":"query"},{"schema":{"type":"string","minLength":1},"required":true,"name":"sort","in":"query"},{"schema":{"type":"string","enum":["asc","desc"]},"required":true,"name":"direction","in":"query"},{"schema":{"type":"string","enum":["asset","liability","equity","income","expense","closing"]},"required":false,"name":"type","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"parentId","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"search","in":"query"}],"responses":{"200":{"description":"Retrieve a list of accounts","content":{"application/json":{"schema":{"type":"object","properties":{"accounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"parentId":{"type":"string","nullable":true,"format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"name":{"type":"string","nullable":true},"code":{"type":"string"},"type":{"type":"string","enum":["asset","liability","equity","income","expense","closing"]},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","parentId","organizationId","name","code","type","createdAt","updatedAt","version"]}}},"required":["accounts"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for accounts","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}},"post":{"tags":["Accounts"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"parentId":{"type":"string","nullable":true,"format":"uuid"},"name":{"type":"string","nullable":true},"code":{"type":"string"},"type":{"type":"string","enum":["asset","liability","equity","income","expense","closing"]}},"required":["code","type"]}}}},"responses":{"201":{"description":"Create an account","content":{"application/json":{"schema":{"type":"object","properties":{"account":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"parentId":{"type":"string","nullable":true,"format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"name":{"type":"string","nullable":true},"code":{"type":"string"},"type":{"type":"string","enum":["asset","liability","equity","income","expense","closing"]},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","parentId","organizationId","name","code","type","createdAt","updatedAt","version"]}},"required":["account"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for accounts","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/accounting/accounts/{id}":{"get":{"tags":["Accounts"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Get an account","content":{"application/json":{"schema":{"type":"object","properties":{"account":{"type":"object","nullable":true,"properties":{"id":{"type":"string","format":"uuid"},"parentId":{"type":"string","nullable":true,"format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"name":{"type":"string","nullable":true},"code":{"type":"string"},"type":{"type":"string","enum":["asset","liability","equity","income","expense","closing"]},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","parentId","organizationId","name","code","type","createdAt","updatedAt","version"]}},"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for accounts","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}},"patch":{"tags":["Accounts"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"parentId":{"type":"string","nullable":true,"format":"uuid"},"name":{"type":"string","nullable":true},"code":{"type":"string"},"type":{"type":"string","enum":["asset","liability","equity","income","expense","closing"]},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["version"]}}}},"responses":{"200":{"description":"Update an account","content":{"application/json":{"schema":{"type":"object","properties":{"account":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"parentId":{"type":"string","nullable":true,"format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"name":{"type":"string","nullable":true},"code":{"type":"string"},"type":{"type":"string","enum":["asset","liability","equity","income","expense","closing"]},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","parentId","organizationId","name","code","type","createdAt","updatedAt","version"]}},"required":["account"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for accounts","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}},"delete":{"tags":["Accounts"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Delete an account"},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for accounts","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/organizations/{parentId}/accounting/system-accounts":{"get":{"tags":["System Accounts"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"},{"schema":{"type":"number","nullable":true},"required":false,"name":"limit","in":"query"},{"schema":{"type":"number","nullable":true},"required":false,"name":"offset","in":"query"},{"schema":{"type":"string","minLength":1},"required":true,"name":"sort","in":"query"},{"schema":{"type":"string","enum":["asc","desc"]},"required":true,"name":"direction","in":"query"},{"schema":{"type":"string","enum":["bank_account","debtor","creditor","customer_credit_balance","default_income","default_expense","income_reduction","bad_debts","expense_reduction","vat_tax_due","settlement_account_vat","vat_remuneration_received","regards_tax","tax_pre_material","tax_pre_investment","transitory_tax_account_pre","tax_pre_tax_cuts","tax_pre_tax_correction","rounding_differences","exchange_rate_losses","exchange_rate_gains","profit_and_loss","opening_balance_sheet","closing_balance_sheet","annual_profit","annual_result","correction","balance_takeover","capital","capital_contributions","private_account"]},"required":false,"name":"purpose","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"accountId","in":"query"}],"responses":{"200":{"description":"Retrieve a list of system accounts","content":{"application/json":{"schema":{"type":"object","properties":{"accounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"accountId":{"type":"string","format":"uuid"},"purpose":{"type":"string","enum":["bank_account","debtor","creditor","customer_credit_balance","default_income","default_expense","income_reduction","bad_debts","expense_reduction","vat_tax_due","settlement_account_vat","vat_remuneration_received","regards_tax","tax_pre_material","tax_pre_investment","transitory_tax_account_pre","tax_pre_tax_cuts","tax_pre_tax_correction","rounding_differences","exchange_rate_losses","exchange_rate_gains","profit_and_loss","opening_balance_sheet","closing_balance_sheet","annual_profit","annual_result","correction","balance_takeover","capital","capital_contributions","private_account"]},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","accountId","purpose","createdAt","updatedAt","version"]}}},"required":["accounts"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for system accounts","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}},"post":{"tags":["System Accounts"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"accountId":{"type":"string","format":"uuid"},"purpose":{"type":"string","enum":["bank_account","debtor","creditor","customer_credit_balance","default_income","default_expense","income_reduction","bad_debts","expense_reduction","vat_tax_due","settlement_account_vat","vat_remuneration_received","regards_tax","tax_pre_material","tax_pre_investment","transitory_tax_account_pre","tax_pre_tax_cuts","tax_pre_tax_correction","rounding_differences","exchange_rate_losses","exchange_rate_gains","profit_and_loss","opening_balance_sheet","closing_balance_sheet","annual_profit","annual_result","correction","balance_takeover","capital","capital_contributions","private_account"]}},"required":["accountId","purpose"]}}}},"responses":{"201":{"description":"Create a system account","content":{"application/json":{"schema":{"type":"object","properties":{"account":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"accountId":{"type":"string","format":"uuid"},"purpose":{"type":"string","enum":["bank_account","debtor","creditor","customer_credit_balance","default_income","default_expense","income_reduction","bad_debts","expense_reduction","vat_tax_due","settlement_account_vat","vat_remuneration_received","regards_tax","tax_pre_material","tax_pre_investment","transitory_tax_account_pre","tax_pre_tax_cuts","tax_pre_tax_correction","rounding_differences","exchange_rate_losses","exchange_rate_gains","profit_and_loss","opening_balance_sheet","closing_balance_sheet","annual_profit","annual_result","correction","balance_takeover","capital","capital_contributions","private_account"]},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","accountId","purpose","createdAt","updatedAt","version"]}},"required":["account"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for system accounts","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/accounting/system-accounts/{id}":{"get":{"tags":["System Accounts"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Get a system account","content":{"application/json":{"schema":{"type":"object","properties":{"account":{"type":"object","nullable":true,"properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"accountId":{"type":"string","format":"uuid"},"purpose":{"type":"string","enum":["bank_account","debtor","creditor","customer_credit_balance","default_income","default_expense","income_reduction","bad_debts","expense_reduction","vat_tax_due","settlement_account_vat","vat_remuneration_received","regards_tax","tax_pre_material","tax_pre_investment","transitory_tax_account_pre","tax_pre_tax_cuts","tax_pre_tax_correction","rounding_differences","exchange_rate_losses","exchange_rate_gains","profit_and_loss","opening_balance_sheet","closing_balance_sheet","annual_profit","annual_result","correction","balance_takeover","capital","capital_contributions","private_account"]},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","accountId","purpose","createdAt","updatedAt","version"]}},"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for system accounts","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}},"patch":{"tags":["System Accounts"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"accountId":{"type":"string","format":"uuid"},"purpose":{"type":"string","enum":["bank_account","debtor","creditor","customer_credit_balance","default_income","default_expense","income_reduction","bad_debts","expense_reduction","vat_tax_due","settlement_account_vat","vat_remuneration_received","regards_tax","tax_pre_material","tax_pre_investment","transitory_tax_account_pre","tax_pre_tax_cuts","tax_pre_tax_correction","rounding_differences","exchange_rate_losses","exchange_rate_gains","profit_and_loss","opening_balance_sheet","closing_balance_sheet","annual_profit","annual_result","correction","balance_takeover","capital","capital_contributions","private_account"]},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["version"]}}}},"responses":{"200":{"description":"Update a system account","content":{"application/json":{"schema":{"type":"object","properties":{"account":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"accountId":{"type":"string","format":"uuid"},"purpose":{"type":"string","enum":["bank_account","debtor","creditor","customer_credit_balance","default_income","default_expense","income_reduction","bad_debts","expense_reduction","vat_tax_due","settlement_account_vat","vat_remuneration_received","regards_tax","tax_pre_material","tax_pre_investment","transitory_tax_account_pre","tax_pre_tax_cuts","tax_pre_tax_correction","rounding_differences","exchange_rate_losses","exchange_rate_gains","profit_and_loss","opening_balance_sheet","closing_balance_sheet","annual_profit","annual_result","correction","balance_takeover","capital","capital_contributions","private_account"]},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","accountId","purpose","createdAt","updatedAt","version"]}},"required":["account"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for system accounts","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/organizations/{parentId}/accounting/periods":{"get":{"tags":["Periods"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"},{"schema":{"type":"number","nullable":true},"required":false,"name":"limit","in":"query"},{"schema":{"type":"number","nullable":true},"required":false,"name":"offset","in":"query"},{"schema":{"type":"string","minLength":1},"required":true,"name":"sort","in":"query"},{"schema":{"type":"string","enum":["asc","desc"]},"required":true,"name":"direction","in":"query"},{"schema":{"type":"string","enum":["open","closed"]},"required":false,"name":"status","in":"query"}],"responses":{"200":{"description":"Retrieve a list of periods","content":{"application/json":{"schema":{"type":"object","properties":{"periods":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"startOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"endOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"status":{"type":"string","enum":["open","closed"]},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","startOn","endOn","status","createdAt","updatedAt","version"]}}},"required":["periods"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for periods","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}},"post":{"tags":["Periods"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"startOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"endOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"status":{"type":"string","enum":["open","closed"]}},"required":["startOn","endOn","status"]}}}},"responses":{"201":{"description":"Create a period","content":{"application/json":{"schema":{"type":"object","properties":{"period":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"startOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"endOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"status":{"type":"string","enum":["open","closed"]},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","startOn","endOn","status","createdAt","updatedAt","version"]}},"required":["period"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for periods","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/accounting/periods/{id}":{"get":{"tags":["Periods"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Get a period","content":{"application/json":{"schema":{"type":"object","properties":{"period":{"type":"object","nullable":true,"properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"startOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"endOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"status":{"type":"string","enum":["open","closed"]},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","startOn","endOn","status","createdAt","updatedAt","version"]}},"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for periods","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}},"patch":{"tags":["Periods"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"startOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"endOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["version"]}}}},"responses":{"200":{"description":"Update a period","content":{"application/json":{"schema":{"type":"object","properties":{"period":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"startOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"endOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"status":{"type":"string","enum":["open","closed"]},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","startOn","endOn","status","createdAt","updatedAt","version"]}},"required":["period"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for periods","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/accounting/periods/{parentId}/close":{"post":{"tags":["Periods"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"mode":{"type":"string","enum":["closing_entries","status_only"],"default":"closing_entries"}},"additionalProperties":false}}}},"responses":{"200":{"description":"Period closed","content":{"application/json":{"schema":{"type":"object","properties":{"period":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"startOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"endOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"status":{"type":"string","enum":["open","closed"]},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","startOn","endOn","status","createdAt","updatedAt","version"]}},"required":["period"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for periods","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/organizations/{parentId}/billing/clients":{"get":{"tags":["Clients"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"},{"schema":{"type":"number","nullable":true},"required":false,"name":"limit","in":"query"},{"schema":{"type":"number","nullable":true},"required":false,"name":"offset","in":"query"},{"schema":{"type":"string","minLength":1},"required":true,"name":"sort","in":"query"},{"schema":{"type":"string","enum":["asc","desc"]},"required":true,"name":"direction","in":"query"},{"schema":{"type":"string","enum":["company","individual"]},"required":false,"name":"type","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"search","in":"query"}],"responses":{"200":{"description":"Retrieve a list of clients","content":{"application/json":{"schema":{"type":"object","properties":{"clients":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["company","individual"]},"name":{"type":"string"},"careOf":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"postalCode":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"country":{"type":"string","nullable":true,"maxLength":2},"language":{"type":"string","nullable":true,"maxLength":2},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"website":{"type":"string","nullable":true},"vatNumber":{"type":"string","nullable":true},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","type","name","careOf","address","postalCode","city","country","language","email","phone","website","vatNumber","createdAt","updatedAt","version"]}}},"required":["clients"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for clients","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}},"post":{"tags":["Clients"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["company","individual"]},"name":{"type":"string","minLength":1,"maxLength":255},"careOf":{"type":"string","nullable":true,"maxLength":255,"description":"Care of line, e.g. c/o Jane Doe"},"address":{"type":"string","nullable":true,"maxLength":255,"description":"Street and number only, e.g. Sihlquai 131. The postal code, city and country have their own fields."},"postalCode":{"type":"string","nullable":true,"maxLength":16,"description":"Postal code, e.g. 8005"},"city":{"type":"string","nullable":true,"maxLength":255,"description":"City, e.g. Zürich"},"country":{"type":"string","nullable":true,"minLength":2,"maxLength":2,"description":"ISO 3166-1 alpha-2 country code, e.g. CH"},"language":{"type":"string","nullable":true,"pattern":"^[a-z]{2}$","description":"ISO 639-1 language code, e.g. fr"},"email":{"type":"string","nullable":true,"format":"email"},"phone":{"type":"string","nullable":true,"description":"Phone number in E.164 format, e.g. +41791234567"},"website":{"type":"string","nullable":true,"format":"uri"},"vatNumber":{"type":"string","nullable":true,"pattern":"^CHE-\\d{3}\\.\\d{3}\\.\\d{3} (MWST|TVA|IVA)$"}},"required":["type","name"]}}}},"responses":{"201":{"description":"Create a client","content":{"application/json":{"schema":{"type":"object","properties":{"client":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["company","individual"]},"name":{"type":"string"},"careOf":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"postalCode":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"country":{"type":"string","nullable":true,"maxLength":2},"language":{"type":"string","nullable":true,"maxLength":2},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"website":{"type":"string","nullable":true},"vatNumber":{"type":"string","nullable":true},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","type","name","careOf","address","postalCode","city","country","language","email","phone","website","vatNumber","createdAt","updatedAt","version"]}},"required":["client"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for clients","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/billing/clients/{id}":{"get":{"tags":["Clients"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Get a client","content":{"application/json":{"schema":{"type":"object","properties":{"client":{"type":"object","nullable":true,"properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["company","individual"]},"name":{"type":"string"},"careOf":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"postalCode":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"country":{"type":"string","nullable":true,"maxLength":2},"language":{"type":"string","nullable":true,"maxLength":2},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"website":{"type":"string","nullable":true},"vatNumber":{"type":"string","nullable":true},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","type","name","careOf","address","postalCode","city","country","language","email","phone","website","vatNumber","createdAt","updatedAt","version"]}},"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for clients","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}},"patch":{"tags":["Clients"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["company","individual"]},"name":{"type":"string","minLength":1,"maxLength":255},"careOf":{"type":"string","nullable":true,"maxLength":255,"description":"Care of line, e.g. c/o Jane Doe"},"address":{"type":"string","nullable":true,"maxLength":255,"description":"Street and number only, e.g. Sihlquai 131. The postal code, city and country have their own fields."},"postalCode":{"type":"string","nullable":true,"maxLength":16,"description":"Postal code, e.g. 8005"},"city":{"type":"string","nullable":true,"maxLength":255,"description":"City, e.g. Zürich"},"country":{"type":"string","nullable":true,"minLength":2,"maxLength":2,"description":"ISO 3166-1 alpha-2 country code, e.g. CH"},"language":{"type":"string","nullable":true,"pattern":"^[a-z]{2}$","description":"ISO 639-1 language code, e.g. fr"},"email":{"type":"string","nullable":true,"format":"email"},"phone":{"type":"string","nullable":true,"description":"Phone number in E.164 format, e.g. +41791234567"},"website":{"type":"string","nullable":true,"format":"uri"},"vatNumber":{"type":"string","nullable":true,"pattern":"^CHE-\\d{3}\\.\\d{3}\\.\\d{3} (MWST|TVA|IVA)$"},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["version"]}}}},"responses":{"200":{"description":"Update a client","content":{"application/json":{"schema":{"type":"object","properties":{"client":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["company","individual"]},"name":{"type":"string"},"careOf":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"postalCode":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"country":{"type":"string","nullable":true,"maxLength":2},"language":{"type":"string","nullable":true,"maxLength":2},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"website":{"type":"string","nullable":true},"vatNumber":{"type":"string","nullable":true},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","type","name","careOf","address","postalCode","city","country","language","email","phone","website","vatNumber","createdAt","updatedAt","version"]}},"required":["client"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for clients","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}},"delete":{"tags":["Clients"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Delete a client"},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for clients","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/billing/clients/{parentId}/contacts":{"get":{"tags":["Client Contacts"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"},{"schema":{"type":"number","nullable":true},"required":false,"name":"limit","in":"query"},{"schema":{"type":"number","nullable":true},"required":false,"name":"offset","in":"query"},{"schema":{"type":"string","minLength":1},"required":true,"name":"sort","in":"query"},{"schema":{"type":"string","enum":["asc","desc"]},"required":true,"name":"direction","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"search","in":"query"}],"responses":{"200":{"description":"Retrieve a list of client contacts","content":{"application/json":{"schema":{"type":"object","properties":{"contacts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"lastName":{"type":"string"},"firstName":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","lastName","firstName","email","phone","createdAt","updatedAt","version"]}}},"required":["contacts"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for client contacts","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}},"post":{"tags":["Client Contacts"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"lastName":{"type":"string"},"firstName":{"type":"string","nullable":true},"email":{"type":"string","nullable":true,"format":"email"},"phone":{"type":"string","nullable":true,"description":"Phone number in E.164 format, e.g. +41791234567"}},"required":["lastName"]}}}},"responses":{"201":{"description":"Create a client contact","content":{"application/json":{"schema":{"type":"object","properties":{"contact":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"lastName":{"type":"string"},"firstName":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","lastName","firstName","email","phone","createdAt","updatedAt","version"]}},"required":["contact"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for client contacts","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/billing/contacts/{id}":{"get":{"tags":["Client Contacts"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Get a client contact","content":{"application/json":{"schema":{"type":"object","properties":{"contact":{"type":"object","nullable":true,"properties":{"id":{"type":"string","format":"uuid"},"lastName":{"type":"string"},"firstName":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","lastName","firstName","email","phone","createdAt","updatedAt","version"]}},"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for client contacts","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}},"patch":{"tags":["Client Contacts"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"lastName":{"type":"string"},"firstName":{"type":"string","nullable":true},"email":{"type":"string","nullable":true,"format":"email"},"phone":{"type":"string","nullable":true,"description":"Phone number in E.164 format, e.g. +41791234567"},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["version"]}}}},"responses":{"200":{"description":"Update a client contact","content":{"application/json":{"schema":{"type":"object","properties":{"contact":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"lastName":{"type":"string"},"firstName":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","lastName","firstName","email","phone","createdAt","updatedAt","version"]}},"required":["contact"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for client contacts","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}},"delete":{"tags":["Client Contacts"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Delete a contact"},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for client contacts","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/organizations/{parentId}/billing/invoices":{"get":{"tags":["Invoices"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"},{"schema":{"type":"number","nullable":true},"required":false,"name":"limit","in":"query"},{"schema":{"type":"number","nullable":true},"required":false,"name":"offset","in":"query"},{"schema":{"type":"string","minLength":1},"required":true,"name":"sort","in":"query"},{"schema":{"type":"string","enum":["asc","desc"]},"required":true,"name":"direction","in":"query"},{"schema":{"type":"string","enum":["draft","open","paid","uncollectible","void"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"clientId","in":"query"},{"schema":{"type":"string","format":"date"},"required":false,"name":"issueOnFrom","in":"query"},{"schema":{"type":"string","format":"date"},"required":false,"name":"issueOnTo","in":"query"}],"responses":{"200":{"description":"Retrieve a list of invoices","content":{"application/json":{"schema":{"type":"object","properties":{"invoices":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"clientId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["draft","open","paid","uncollectible","void"]},"number":{"type":"integer","nullable":true,"minimum":-2147483648,"maximum":2147483647},"paymentReference":{"type":"string","nullable":true},"issueOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"dueOn":{"type":"object","nullable":true,"properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"vatRateId":{"type":"string","nullable":true,"format":"uuid"},"currency":{"type":"string","maxLength":20},"exchangeRate":{"type":"number","description":"Exchange rate to the base currency of the organization: what one unit of the currency is worth in the base currency, as usually quoted (e.g. 0.93 for 1 EUR = 0.93 CHF). It must be 1 when the currency is the base currency."},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","clientId","status","number","paymentReference","issueOn","dueOn","vatRateId","currency","exchangeRate","createdAt","updatedAt","version"]}}},"required":["invoices"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for invoices","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}},"post":{"tags":["Invoices"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"clientId":{"type":"string","format":"uuid"},"issueOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"dueOn":{"type":"object","nullable":true,"properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"vatRateId":{"type":"string","nullable":true,"format":"uuid"},"currency":{"type":"string","maxLength":20},"exchangeRate":{"type":"number","description":"Exchange rate to the base currency of the organization: what one unit of the currency is worth in the base currency, as usually quoted (e.g. 0.93 for 1 EUR = 0.93 CHF). It must be 1 when the currency is the base currency."}},"required":["clientId","issueOn","dueOn","currency"]}}}},"responses":{"201":{"description":"Create an invoice","content":{"application/json":{"schema":{"type":"object","properties":{"invoice":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"clientId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["draft","open","paid","uncollectible","void"]},"number":{"type":"integer","nullable":true,"minimum":-2147483648,"maximum":2147483647},"paymentReference":{"type":"string","nullable":true},"issueOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"dueOn":{"type":"object","nullable":true,"properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"vatRateId":{"type":"string","nullable":true,"format":"uuid"},"currency":{"type":"string","maxLength":20},"exchangeRate":{"type":"number","description":"Exchange rate to the base currency of the organization: what one unit of the currency is worth in the base currency, as usually quoted (e.g. 0.93 for 1 EUR = 0.93 CHF). It must be 1 when the currency is the base currency."},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","clientId","status","number","paymentReference","issueOn","dueOn","vatRateId","currency","exchangeRate","createdAt","updatedAt","version"]}},"required":["invoice"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for invoices","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/billing/invoices/{id}":{"get":{"tags":["Invoices"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Get an invoice","content":{"application/json":{"schema":{"type":"object","properties":{"invoice":{"type":"object","nullable":true,"properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"clientId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["draft","open","paid","uncollectible","void"]},"number":{"type":"integer","nullable":true,"minimum":-2147483648,"maximum":2147483647},"paymentReference":{"type":"string","nullable":true},"issueOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"dueOn":{"type":"object","nullable":true,"properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"vatRateId":{"type":"string","nullable":true,"format":"uuid"},"currency":{"type":"string","maxLength":20},"exchangeRate":{"type":"number","description":"Exchange rate to the base currency of the organization: what one unit of the currency is worth in the base currency, as usually quoted (e.g. 0.93 for 1 EUR = 0.93 CHF). It must be 1 when the currency is the base currency."},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","clientId","status","number","paymentReference","issueOn","dueOn","vatRateId","currency","exchangeRate","createdAt","updatedAt","version"]}},"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for invoices","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}},"patch":{"tags":["Invoices"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"issueOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"dueOn":{"type":"object","nullable":true,"properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"vatRateId":{"type":"string","nullable":true,"format":"uuid"},"currency":{"type":"string","maxLength":20},"exchangeRate":{"type":"number","description":"Exchange rate to the base currency of the organization: what one unit of the currency is worth in the base currency, as usually quoted (e.g. 0.93 for 1 EUR = 0.93 CHF). It must be 1 when the currency is the base currency."},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["version"]}}}},"responses":{"200":{"description":"Update an invoice","content":{"application/json":{"schema":{"type":"object","properties":{"invoice":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"clientId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["draft","open","paid","uncollectible","void"]},"number":{"type":"integer","nullable":true,"minimum":-2147483648,"maximum":2147483647},"paymentReference":{"type":"string","nullable":true},"issueOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"dueOn":{"type":"object","nullable":true,"properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"vatRateId":{"type":"string","nullable":true,"format":"uuid"},"currency":{"type":"string","maxLength":20},"exchangeRate":{"type":"number","description":"Exchange rate to the base currency of the organization: what one unit of the currency is worth in the base currency, as usually quoted (e.g. 0.93 for 1 EUR = 0.93 CHF). It must be 1 when the currency is the base currency."},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","clientId","status","number","paymentReference","issueOn","dueOn","vatRateId","currency","exchangeRate","createdAt","updatedAt","version"]}},"required":["invoice"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for invoices","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}},"delete":{"tags":["Invoices"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Delete a draft invoice"},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for invoices","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/organizations/{parentId}/billing/invoice-summaries":{"get":{"tags":["Invoice summaries"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"},{"schema":{"type":"number","nullable":true},"required":false,"name":"limit","in":"query"},{"schema":{"type":"number","nullable":true},"required":false,"name":"offset","in":"query"},{"schema":{"type":"string","minLength":1},"required":true,"name":"sort","in":"query"},{"schema":{"type":"string","enum":["asc","desc"]},"required":true,"name":"direction","in":"query"},{"schema":{"type":"string","enum":["draft","open","paid","uncollectible","void"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"clientId","in":"query"},{"schema":{"type":"string","format":"date"},"required":false,"name":"issueOnFrom","in":"query"},{"schema":{"type":"string","format":"date"},"required":false,"name":"issueOnTo","in":"query"}],"responses":{"200":{"description":"Retrieve a list of invoices with their amounts","content":{"application/json":{"schema":{"type":"object","properties":{"invoiceSummaries":{"type":"array","items":{"type":"object","properties":{"invoice":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"clientId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["draft","open","paid","uncollectible","void"]},"number":{"type":"integer","nullable":true,"minimum":-2147483648,"maximum":2147483647},"paymentReference":{"type":"string","nullable":true},"issueOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"dueOn":{"type":"object","nullable":true,"properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"vatRateId":{"type":"string","nullable":true,"format":"uuid"},"currency":{"type":"string","maxLength":20},"exchangeRate":{"type":"number","description":"Exchange rate to the base currency of the organization: what one unit of the currency is worth in the base currency, as usually quoted (e.g. 0.93 for 1 EUR = 0.93 CHF). It must be 1 when the currency is the base currency."},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","clientId","status","number","paymentReference","issueOn","dueOn","vatRateId","currency","exchangeRate","createdAt","updatedAt","version"]},"client":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"amounts":{"type":"object","properties":{"totals":{"type":"object","properties":{"subtotal":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"vat":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"total":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false}},"required":["subtotal","vat","total"],"additionalProperties":false},"balance":{"type":"object","properties":{"paid":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"remaining":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false}},"required":["paid","remaining"],"additionalProperties":false}},"required":["totals","balance"],"additionalProperties":false}},"required":["invoice","client","amounts"],"additionalProperties":false}}},"required":["invoiceSummaries"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for invoice summaries","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/billing/invoice-summaries/{id}":{"get":{"tags":["Invoice summaries"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Get an invoice with its amounts","content":{"application/json":{"schema":{"type":"object","properties":{"invoiceSummary":{"type":"object","nullable":true,"properties":{"invoice":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"clientId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["draft","open","paid","uncollectible","void"]},"number":{"type":"integer","nullable":true,"minimum":-2147483648,"maximum":2147483647},"paymentReference":{"type":"string","nullable":true},"issueOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"dueOn":{"type":"object","nullable":true,"properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"vatRateId":{"type":"string","nullable":true,"format":"uuid"},"currency":{"type":"string","maxLength":20},"exchangeRate":{"type":"number","description":"Exchange rate to the base currency of the organization: what one unit of the currency is worth in the base currency, as usually quoted (e.g. 0.93 for 1 EUR = 0.93 CHF). It must be 1 when the currency is the base currency."},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","clientId","status","number","paymentReference","issueOn","dueOn","vatRateId","currency","exchangeRate","createdAt","updatedAt","version"]},"client":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"amounts":{"type":"object","properties":{"totals":{"type":"object","properties":{"subtotal":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"vat":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"total":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false}},"required":["subtotal","vat","total"],"additionalProperties":false},"balance":{"type":"object","properties":{"paid":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"remaining":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false}},"required":["paid","remaining"],"additionalProperties":false}},"required":["totals","balance"],"additionalProperties":false}},"required":["invoice","client","amounts"],"additionalProperties":false}},"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for invoice summaries","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/organizations/{parentId}/accounting/journal-summaries":{"get":{"tags":["Journal summaries"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"},{"schema":{"type":"number","nullable":true},"required":false,"name":"limit","in":"query"},{"schema":{"type":"number","nullable":true},"required":false,"name":"offset","in":"query"},{"schema":{"type":"string","minLength":1},"required":true,"name":"sort","in":"query"},{"schema":{"type":"string","enum":["asc","desc"]},"required":true,"name":"direction","in":"query"},{"schema":{"type":"number","nullable":true},"required":false,"name":"number","in":"query"},{"schema":{"type":"string","format":"date"},"required":false,"name":"validOnFrom","in":"query"},{"schema":{"type":"string","format":"date"},"required":false,"name":"validOnTo","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"reference","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"accountId","in":"query"}],"responses":{"200":{"description":"Retrieve a list of journal entries with their postings and the invoice they book","content":{"application/json":{"schema":{"type":"object","properties":{"journalSummaries":{"type":"array","items":{"type":"object","properties":{"entry":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"number":{"type":"integer","minimum":-2147483648,"maximum":2147483647},"validOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"reference":{"type":"string","nullable":true},"migrated":{"type":"boolean"},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","number","validOn","reference","migrated","createdAt","updatedAt","version"]},"postings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"journalEntryId":{"type":"string","format":"uuid"},"accountId":{"type":"string","format":"uuid"},"description":{"type":"string","nullable":true},"debit":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"credit":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"vatRateId":{"type":"string","nullable":true,"format":"uuid"},"currency":{"type":"string","maxLength":20},"exchangeRate":{"type":"number","description":"Exchange rate to the base currency of the organization: what one unit of the currency is worth in the base currency, as usually quoted (e.g. 0.93 for 1 EUR = 0.93 CHF). It must be 1 when the currency is the base currency."},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","journalEntryId","accountId","description","debit","credit","vatRateId","currency","exchangeRate","createdAt","updatedAt","version"]},"minItems":2},"invoiceJournal":{"type":"object","nullable":true,"properties":{"invoiceId":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["open","payment","void","uncollectible"]}},"required":["invoiceId","type"]},"periodJournal":{"type":"object","nullable":true,"properties":{"periodId":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["opening","result"]}},"required":["periodId","type"]},"movementJournal":{"type":"object","nullable":true,"properties":{"movementId":{"type":"string","format":"uuid"},"bankRelationId":{"type":"string","format":"uuid"}},"required":["movementId","bankRelationId"],"additionalProperties":false},"vatPostings":{"type":"array","items":{"type":"object","properties":{"postingId":{"type":"string","format":"uuid"},"vatPostingId":{"type":"string","format":"uuid"}},"required":["postingId","vatPostingId"]}}},"required":["entry","postings","invoiceJournal","periodJournal","movementJournal","vatPostings"],"additionalProperties":false}}},"required":["journalSummaries"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for journal summaries","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/accounting/journal-summaries/{id}":{"get":{"tags":["Journal summaries"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Get a journal entry with its postings and the invoice it books","content":{"application/json":{"schema":{"type":"object","properties":{"journalSummary":{"type":"object","nullable":true,"properties":{"entry":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"number":{"type":"integer","minimum":-2147483648,"maximum":2147483647},"validOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"reference":{"type":"string","nullable":true},"migrated":{"type":"boolean"},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","number","validOn","reference","migrated","createdAt","updatedAt","version"]},"postings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"journalEntryId":{"type":"string","format":"uuid"},"accountId":{"type":"string","format":"uuid"},"description":{"type":"string","nullable":true},"debit":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"credit":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"vatRateId":{"type":"string","nullable":true,"format":"uuid"},"currency":{"type":"string","maxLength":20},"exchangeRate":{"type":"number","description":"Exchange rate to the base currency of the organization: what one unit of the currency is worth in the base currency, as usually quoted (e.g. 0.93 for 1 EUR = 0.93 CHF). It must be 1 when the currency is the base currency."},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","journalEntryId","accountId","description","debit","credit","vatRateId","currency","exchangeRate","createdAt","updatedAt","version"]},"minItems":2},"invoiceJournal":{"type":"object","nullable":true,"properties":{"invoiceId":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["open","payment","void","uncollectible"]}},"required":["invoiceId","type"]},"periodJournal":{"type":"object","nullable":true,"properties":{"periodId":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["opening","result"]}},"required":["periodId","type"]},"movementJournal":{"type":"object","nullable":true,"properties":{"movementId":{"type":"string","format":"uuid"},"bankRelationId":{"type":"string","format":"uuid"}},"required":["movementId","bankRelationId"],"additionalProperties":false},"vatPostings":{"type":"array","items":{"type":"object","properties":{"postingId":{"type":"string","format":"uuid"},"vatPostingId":{"type":"string","format":"uuid"}},"required":["postingId","vatPostingId"]}}},"required":["entry","postings","invoiceJournal","periodJournal","movementJournal","vatPostings"],"additionalProperties":false}},"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for journal summaries","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/billing/invoices/{parentId}/lines":{"get":{"tags":["Invoice Lines"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"},{"schema":{"type":"number","nullable":true},"required":false,"name":"limit","in":"query"},{"schema":{"type":"number","nullable":true},"required":false,"name":"offset","in":"query"},{"schema":{"type":"string","minLength":1},"required":true,"name":"sort","in":"query"},{"schema":{"type":"string","enum":["asc","desc"]},"required":true,"name":"direction","in":"query"},{"schema":{"type":"string","enum":["item","discount"]},"required":false,"name":"type","in":"query"}],"responses":{"200":{"description":"Retrieve a list of invoice lines","content":{"application/json":{"schema":{"type":"object","properties":{"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["item","discount"]},"description":{"type":"string"},"quantity":{"type":"number","minimum":-9007199254740991,"maximum":9007199254740991},"unitPrice":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","type","description","quantity","unitPrice","createdAt","updatedAt","version"]}}},"required":["lines"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for invoice lines","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}},"post":{"tags":["Invoice Lines"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["item","discount"]},"description":{"type":"string"},"quantity":{"type":"number","minimum":-9007199254740991,"maximum":9007199254740991},"unitPrice":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false}},"required":["type","description","quantity","unitPrice"]}}}},"responses":{"201":{"description":"Create an invoice line","content":{"application/json":{"schema":{"type":"object","properties":{"line":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["item","discount"]},"description":{"type":"string"},"quantity":{"type":"number","minimum":-9007199254740991,"maximum":9007199254740991},"unitPrice":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","type","description","quantity","unitPrice","createdAt","updatedAt","version"]}},"required":["line"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for invoice lines","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/billing/lines/{id}":{"get":{"tags":["Invoice Lines"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Get an invoice line","content":{"application/json":{"schema":{"type":"object","properties":{"line":{"type":"object","nullable":true,"properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["item","discount"]},"description":{"type":"string"},"quantity":{"type":"number","minimum":-9007199254740991,"maximum":9007199254740991},"unitPrice":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","type","description","quantity","unitPrice","createdAt","updatedAt","version"]}},"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for invoice lines","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}},"patch":{"tags":["Invoice Lines"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["item","discount"]},"description":{"type":"string"},"quantity":{"type":"number","minimum":-9007199254740991,"maximum":9007199254740991},"unitPrice":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["type","unitPrice"]}}}},"responses":{"200":{"description":"Update an invoice line","content":{"application/json":{"schema":{"type":"object","properties":{"line":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["item","discount"]},"description":{"type":"string"},"quantity":{"type":"number","minimum":-9007199254740991,"maximum":9007199254740991},"unitPrice":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","type","description","quantity","unitPrice","createdAt","updatedAt","version"]}},"required":["line"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for invoice lines","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}},"delete":{"tags":["Invoice Lines"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Delete a line of a draft invoice"},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for invoice lines","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/billing/invoices/{parentId}/open":{"post":{"tags":["Invoices"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"}],"responses":{"200":{"description":"Invoice set to open","content":{"application/json":{"schema":{"type":"object","properties":{"invoice":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"clientId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["draft","open","paid","uncollectible","void"]},"number":{"type":"integer","nullable":true,"minimum":-2147483648,"maximum":2147483647},"paymentReference":{"type":"string","nullable":true},"issueOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"dueOn":{"type":"object","nullable":true,"properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"vatRateId":{"type":"string","nullable":true,"format":"uuid"},"currency":{"type":"string","maxLength":20},"exchangeRate":{"type":"number","description":"Exchange rate to the base currency of the organization: what one unit of the currency is worth in the base currency, as usually quoted (e.g. 0.93 for 1 EUR = 0.93 CHF). It must be 1 when the currency is the base currency."},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","clientId","status","number","paymentReference","issueOn","dueOn","vatRateId","currency","exchangeRate","createdAt","updatedAt","version"]}},"required":["invoice"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for invoices","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/billing/invoices/{parentId}/pay":{"post":{"tags":["Invoices"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"amount":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"currency":{"type":"string","maxLength":20},"exchangeRate":{"type":"number","minimum":0,"exclusiveMinimum":true,"default":1,"description":"Exchange rate to the base currency of the organization: what one unit of the currency is worth in the base currency, as usually quoted (e.g. 0.93 for 1 EUR = 0.93 CHF). It must be 1 when the currency is the base currency."},"validOn":{"type":"object","nullable":true,"properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"bankRelationId":{"type":"string","nullable":true,"format":"uuid","description":"The bank relation the payment was received on, one of the organization of the invoice. Without it, the payment is booked on the bank_account system account"}},"required":["amount","currency","validOn"],"additionalProperties":false}}}},"responses":{"200":{"description":"Invoice set to paid","content":{"application/json":{"schema":{"type":"object","properties":{"invoice":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"clientId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["draft","open","paid","uncollectible","void"]},"number":{"type":"integer","nullable":true,"minimum":-2147483648,"maximum":2147483647},"paymentReference":{"type":"string","nullable":true},"issueOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"dueOn":{"type":"object","nullable":true,"properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"vatRateId":{"type":"string","nullable":true,"format":"uuid"},"currency":{"type":"string","maxLength":20},"exchangeRate":{"type":"number","description":"Exchange rate to the base currency of the organization: what one unit of the currency is worth in the base currency, as usually quoted (e.g. 0.93 for 1 EUR = 0.93 CHF). It must be 1 when the currency is the base currency."},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","clientId","status","number","paymentReference","issueOn","dueOn","vatRateId","currency","exchangeRate","createdAt","updatedAt","version"]}},"required":["invoice"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for invoices","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/billing/invoices/{parentId}/void":{"post":{"tags":["Invoices"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"validOn":{"type":"object","nullable":true,"properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false}},"required":["validOn"],"additionalProperties":false}}}},"responses":{"200":{"description":"Invoice set to void","content":{"application/json":{"schema":{"type":"object","properties":{"invoice":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"clientId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["draft","open","paid","uncollectible","void"]},"number":{"type":"integer","nullable":true,"minimum":-2147483648,"maximum":2147483647},"paymentReference":{"type":"string","nullable":true},"issueOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"dueOn":{"type":"object","nullable":true,"properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"vatRateId":{"type":"string","nullable":true,"format":"uuid"},"currency":{"type":"string","maxLength":20},"exchangeRate":{"type":"number","description":"Exchange rate to the base currency of the organization: what one unit of the currency is worth in the base currency, as usually quoted (e.g. 0.93 for 1 EUR = 0.93 CHF). It must be 1 when the currency is the base currency."},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","clientId","status","number","paymentReference","issueOn","dueOn","vatRateId","currency","exchangeRate","createdAt","updatedAt","version"]}},"required":["invoice"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for invoices","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/billing/invoices/{parentId}/uncollectible":{"post":{"tags":["Invoices"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"validOn":{"type":"object","nullable":true,"properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false}},"required":["validOn"],"additionalProperties":false}}}},"responses":{"200":{"description":"Invoice set to uncollectible","content":{"application/json":{"schema":{"type":"object","properties":{"invoice":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"clientId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["draft","open","paid","uncollectible","void"]},"number":{"type":"integer","nullable":true,"minimum":-2147483648,"maximum":2147483647},"paymentReference":{"type":"string","nullable":true},"issueOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"dueOn":{"type":"object","nullable":true,"properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"vatRateId":{"type":"string","nullable":true,"format":"uuid"},"currency":{"type":"string","maxLength":20},"exchangeRate":{"type":"number","description":"Exchange rate to the base currency of the organization: what one unit of the currency is worth in the base currency, as usually quoted (e.g. 0.93 for 1 EUR = 0.93 CHF). It must be 1 when the currency is the base currency."},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","clientId","status","number","paymentReference","issueOn","dueOn","vatRateId","currency","exchangeRate","createdAt","updatedAt","version"]}},"required":["invoice"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for invoices","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/billing/invoices/{parentId}/pdf/generate":{"post":{"tags":["Invoices"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"template":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["custom"]},"id":{"type":"string","format":"uuid","description":"The ID of the document template content to print, which sets the template and the language of the document"}},"required":["type","id"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["default"]},"language":{"type":"string","enum":["en","fr","de","it"],"description":"The language of the default template provided by Nullish"}},"required":["type","language"],"additionalProperties":false}],"description":"The template to print: a template content of the organization, or the default template in a language"},"bankRelationId":{"type":"string","nullable":true,"format":"uuid","description":"The bank relation printed on the document, one of the organization of the invoice"}},"required":["template"],"additionalProperties":false}}}},"responses":{"200":{"description":"PDF generation queued for the invoice","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["queued"]},"jobId":{"type":"string","format":"uuid"}},"required":["status","jobId"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for invoices","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/billing/invoices/{parentId}/pdf/jobs/{id}":{"get":{"tags":["Invoices"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"}],"responses":{"200":{"description":"PDF generation job status","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"status":{"type":"string","enum":["completed"]},"result":{"type":"object","properties":{"documentId":{"type":"string","format":"uuid"}},"required":["documentId"],"additionalProperties":false}},"required":["status","result"],"additionalProperties":false},{"type":"object","properties":{"status":{"type":"string","enum":["failed"]},"reason":{"type":"string"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"type":"string","enum":["unknown","active","delayed","prioritized","waiting","waiting-children"]}},"required":["status"],"additionalProperties":false}]}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for invoices","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/billing/invoices/{parentId}/pdf/documents/{id}/download":{"get":{"tags":["Invoices"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"}],"responses":{"200":{"description":"Download the generated PDF invoice file","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for invoices","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/organizations/{parentId}/accounting/journal":{"get":{"tags":["Journal"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"},{"schema":{"type":"number","nullable":true},"required":false,"name":"limit","in":"query"},{"schema":{"type":"number","nullable":true},"required":false,"name":"offset","in":"query"},{"schema":{"type":"string","minLength":1},"required":true,"name":"sort","in":"query"},{"schema":{"type":"string","enum":["asc","desc"]},"required":true,"name":"direction","in":"query"},{"schema":{"type":"number","nullable":true},"required":false,"name":"number","in":"query"},{"schema":{"type":"string","format":"date"},"required":false,"name":"validOnFrom","in":"query"},{"schema":{"type":"string","format":"date"},"required":false,"name":"validOnTo","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"reference","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"accountId","in":"query"}],"responses":{"200":{"description":"Retrieve a list of journal entries","content":{"application/json":{"schema":{"type":"object","properties":{"journalEntries":{"type":"array","items":{"type":"object","properties":{"entry":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"number":{"type":"integer","minimum":-2147483648,"maximum":2147483647},"validOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"reference":{"type":"string","nullable":true},"migrated":{"type":"boolean"},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","number","validOn","reference","migrated","createdAt","updatedAt","version"]},"postings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"journalEntryId":{"type":"string","format":"uuid"},"accountId":{"type":"string","format":"uuid"},"description":{"type":"string","nullable":true},"debit":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"credit":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"vatRateId":{"type":"string","nullable":true,"format":"uuid"},"currency":{"type":"string","maxLength":20},"exchangeRate":{"type":"number","description":"Exchange rate to the base currency of the organization: what one unit of the currency is worth in the base currency, as usually quoted (e.g. 0.93 for 1 EUR = 0.93 CHF). It must be 1 when the currency is the base currency."},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","journalEntryId","accountId","description","debit","credit","vatRateId","currency","exchangeRate","createdAt","updatedAt","version"]},"minItems":2}},"required":["entry","postings"],"additionalProperties":false}}},"required":["journalEntries"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for journal","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}},"post":{"tags":["Journal"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"entry":{"type":"object","properties":{"validOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"reference":{"type":"string","nullable":true}},"required":["validOn","reference"]},"postings":{"type":"array","items":{"type":"object","properties":{"accountId":{"type":"string","format":"uuid"},"description":{"type":"string","nullable":true},"debit":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"credit":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"vatRateId":{"type":"string","nullable":true,"format":"uuid"},"currency":{"type":"string","maxLength":20},"exchangeRate":{"type":"number","description":"Exchange rate to the base currency of the organization: what one unit of the currency is worth in the base currency, as usually quoted (e.g. 0.93 for 1 EUR = 0.93 CHF). It must be 1 when the currency is the base currency."}},"required":["accountId","debit","credit","currency"]},"minItems":2}},"required":["entry","postings"],"additionalProperties":false}}}},"responses":{"201":{"description":"Create a journal entry","content":{"application/json":{"schema":{"type":"object","properties":{"journalEntry":{"type":"object","properties":{"entry":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"number":{"type":"integer","minimum":-2147483648,"maximum":2147483647},"validOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"reference":{"type":"string","nullable":true},"migrated":{"type":"boolean"},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","number","validOn","reference","migrated","createdAt","updatedAt","version"]},"postings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"journalEntryId":{"type":"string","format":"uuid"},"accountId":{"type":"string","format":"uuid"},"description":{"type":"string","nullable":true},"debit":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"credit":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"vatRateId":{"type":"string","nullable":true,"format":"uuid"},"currency":{"type":"string","maxLength":20},"exchangeRate":{"type":"number","description":"Exchange rate to the base currency of the organization: what one unit of the currency is worth in the base currency, as usually quoted (e.g. 0.93 for 1 EUR = 0.93 CHF). It must be 1 when the currency is the base currency."},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","journalEntryId","accountId","description","debit","credit","vatRateId","currency","exchangeRate","createdAt","updatedAt","version"]},"minItems":2}},"required":["entry","postings"],"additionalProperties":false}},"required":["journalEntry"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for journal","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/accounting/journal/{id}":{"get":{"tags":["Journal"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Get a journal entry","content":{"application/json":{"schema":{"type":"object","properties":{"journalEntry":{"type":"object","nullable":true,"properties":{"entry":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"number":{"type":"integer","minimum":-2147483648,"maximum":2147483647},"validOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"reference":{"type":"string","nullable":true},"migrated":{"type":"boolean"},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","number","validOn","reference","migrated","createdAt","updatedAt","version"]},"postings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"journalEntryId":{"type":"string","format":"uuid"},"accountId":{"type":"string","format":"uuid"},"description":{"type":"string","nullable":true},"debit":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"credit":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"vatRateId":{"type":"string","nullable":true,"format":"uuid"},"currency":{"type":"string","maxLength":20},"exchangeRate":{"type":"number","description":"Exchange rate to the base currency of the organization: what one unit of the currency is worth in the base currency, as usually quoted (e.g. 0.93 for 1 EUR = 0.93 CHF). It must be 1 when the currency is the base currency."},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","journalEntryId","accountId","description","debit","credit","vatRateId","currency","exchangeRate","createdAt","updatedAt","version"]},"minItems":2}},"required":["entry","postings"],"additionalProperties":false}},"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for journal","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}},"delete":{"tags":["Journal"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Delete a journal entry with its postings"},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for journal","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}},"patch":{"tags":["Journal"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"entry":{"type":"object","properties":{"validOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"reference":{"type":"string","nullable":true},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["validOn","reference","version"]},"postings":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"accountId":{"type":"string","format":"uuid"},"description":{"type":"string","nullable":true},"debit":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"credit":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"vatRateId":{"type":"string","nullable":true,"format":"uuid"},"currency":{"type":"string","maxLength":20},"exchangeRate":{"type":"number","description":"Exchange rate to the base currency of the organization: what one unit of the currency is worth in the base currency, as usually quoted (e.g. 0.93 for 1 EUR = 0.93 CHF). It must be 1 when the currency is the base currency."},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","accountId","description","debit","credit","vatRateId","currency","exchangeRate","version"]},{"type":"object","properties":{"accountId":{"type":"string","format":"uuid"},"description":{"type":"string","nullable":true},"debit":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"credit":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"vatRateId":{"type":"string","nullable":true,"format":"uuid"},"currency":{"type":"string","maxLength":20},"exchangeRate":{"type":"number","description":"Exchange rate to the base currency of the organization: what one unit of the currency is worth in the base currency, as usually quoted (e.g. 0.93 for 1 EUR = 0.93 CHF). It must be 1 when the currency is the base currency."}},"required":["accountId","description","debit","credit","vatRateId","currency","exchangeRate"]}]},"minItems":2}},"required":["entry","postings"],"additionalProperties":false}}}},"responses":{"200":{"description":"Update a journal entry","content":{"application/json":{"schema":{"type":"object","properties":{"journalEntry":{"type":"object","properties":{"entry":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"number":{"type":"integer","minimum":-2147483648,"maximum":2147483647},"validOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"reference":{"type":"string","nullable":true},"migrated":{"type":"boolean"},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","number","validOn","reference","migrated","createdAt","updatedAt","version"]},"postings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"journalEntryId":{"type":"string","format":"uuid"},"accountId":{"type":"string","format":"uuid"},"description":{"type":"string","nullable":true},"debit":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"credit":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"vatRateId":{"type":"string","nullable":true,"format":"uuid"},"currency":{"type":"string","maxLength":20},"exchangeRate":{"type":"number","description":"Exchange rate to the base currency of the organization: what one unit of the currency is worth in the base currency, as usually quoted (e.g. 0.93 for 1 EUR = 0.93 CHF). It must be 1 when the currency is the base currency."},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","journalEntryId","accountId","description","debit","credit","vatRateId","currency","exchangeRate","createdAt","updatedAt","version"]},"minItems":2}},"required":["entry","postings"],"additionalProperties":false}},"required":["journalEntry"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for journal","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/currencies":{"get":{"tags":["Currencies"],"parameters":[{"schema":{"type":"number","nullable":true},"required":false,"name":"limit","in":"query"},{"schema":{"type":"number","nullable":true},"required":false,"name":"offset","in":"query"},{"schema":{"type":"string","minLength":1},"required":true,"name":"sort","in":"query"},{"schema":{"type":"string","enum":["asc","desc"]},"required":true,"name":"direction","in":"query"}],"responses":{"200":{"description":"Currencies","content":{"application/json":{"schema":{"type":"object","properties":{"currencies":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","maxLength":20},"type":{"type":"string","enum":["fiat","crypto"]},"decimals":{"type":"integer","minimum":-2147483648,"maximum":2147483647},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["code","type","decimals","createdAt","updatedAt","version"]}}},"required":["currencies"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for currencies","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/organizations/{parentId}/accounting/reports/account-balances":{"get":{"tags":["Reports"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"periodId","in":"query"}],"responses":{"200":{"description":"Retrieves the account balances of the organization for a period","content":{"application/json":{"schema":{"type":"object","properties":{"accountBalances":{"type":"array","items":{"type":"object","properties":{"organizationId":{"type":"string","nullable":true,"format":"uuid"},"periodId":{"type":"string","nullable":true,"format":"uuid"},"accountId":{"type":"string","nullable":true,"format":"uuid"},"parentId":{"type":"string","nullable":true,"format":"uuid"},"code":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"type":{"type":"string","nullable":true},"totalDebit":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"totalCredit":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"balance":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"computedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false}},"required":["organizationId","periodId","accountId","parentId","code","name","type","totalDebit","totalCredit","balance","computedAt"]}}},"required":["accountBalances"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for reports","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/organizations/{parentId}/accounting/reports/balance-sheet":{"get":{"tags":["Reports"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"periodId","in":"query"}],"responses":{"200":{"description":"Retrieves the balance sheet of the organization for a period","content":{"application/json":{"schema":{"type":"object","properties":{"balanceSheet":{"type":"array","items":{"type":"object","properties":{"organizationId":{"type":"string","nullable":true,"format":"uuid"},"periodId":{"type":"string","nullable":true,"format":"uuid"},"accountId":{"type":"string","nullable":true,"format":"uuid"},"parentId":{"type":"string","nullable":true,"format":"uuid"},"code":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"type":{"type":"string","nullable":true},"totalDebit":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"totalCredit":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"balance":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"computedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false}},"required":["organizationId","periodId","accountId","parentId","code","name","type","totalDebit","totalCredit","balance","computedAt"]}}},"required":["balanceSheet"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for reports","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/organizations/{parentId}/accounting/reports/income-statement":{"get":{"tags":["Reports"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"periodId","in":"query"}],"responses":{"200":{"description":"Retrieves the income statement of the organization for a period","content":{"application/json":{"schema":{"type":"object","properties":{"incomeStatement":{"type":"array","items":{"type":"object","properties":{"organizationId":{"type":"string","nullable":true,"format":"uuid"},"periodId":{"type":"string","nullable":true,"format":"uuid"},"accountId":{"type":"string","nullable":true,"format":"uuid"},"parentId":{"type":"string","nullable":true,"format":"uuid"},"code":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"type":{"type":"string","nullable":true},"totalDebit":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"totalCredit":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"balance":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"computedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false}},"required":["organizationId","periodId","accountId","parentId","code","name","type","totalDebit","totalCredit","balance","computedAt"]}}},"required":["incomeStatement"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for reports","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/organizations/{parentId}/accounting/reports/vat/declaration":{"post":{"tags":["Reports"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"vatPeriodId":{"type":"string","format":"uuid"}},"required":["vatPeriodId"],"additionalProperties":false}}}},"responses":{"200":{"description":"Generates the VAT declaration report for the organization and VAT period","content":{"application/json":{"schema":{"type":"object","properties":{"box200":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"box220":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"box225":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"box235":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"box289":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"box299":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"box303":{"type":"array","items":{"type":"object","properties":{"taxableBase":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"taxAmount":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"rate":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false}},"required":["taxableBase","taxAmount","rate"]}},"box302":{"type":"array","items":{"type":"object","properties":{"taxableBase":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"taxAmount":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"rate":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false}},"required":["taxableBase","taxAmount","rate"]}},"box323":{"type":"array","items":{"type":"object","properties":{"taxableBase":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"taxAmount":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"rate":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false}},"required":["taxableBase","taxAmount","rate"]}},"box322":{"type":"array","items":{"type":"object","properties":{"taxableBase":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"taxAmount":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"rate":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false}},"required":["taxableBase","taxAmount","rate"]}},"box383":{"type":"object","properties":{"taxableBase":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"taxAmount":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false}},"required":["taxableBase","taxAmount"]},"box382":{"type":"object","properties":{"taxableBase":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"taxAmount":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false}},"required":["taxableBase","taxAmount"]},"box399":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"box400":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"box405":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"box415":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"box470":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"box471":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"box479":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"box500":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"box510":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"box910":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false}},"required":["box200","box220","box225","box235","box289","box299","box303","box302","box323","box322","box383","box382","box399","box400","box405","box415","box470","box471","box479","box500","box510","box910"]}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for reports","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/organizations/{parentId}/accounting/reports/account-ledger":{"get":{"tags":["Reports"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"},{"schema":{"type":"number","nullable":true},"required":false,"name":"limit","in":"query"},{"schema":{"type":"number","nullable":true},"required":false,"name":"offset","in":"query"},{"schema":{"type":"string","minLength":1},"required":true,"name":"sort","in":"query"},{"schema":{"type":"string","enum":["asc","desc"]},"required":true,"name":"direction","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"periodId","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"accountId","in":"query"},{"schema":{"type":"number","nullable":true},"required":false,"name":"number","in":"query"},{"schema":{"type":"string","format":"date"},"required":false,"name":"validOnFrom","in":"query"},{"schema":{"type":"string","format":"date"},"required":false,"name":"validOnTo","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"reference","in":"query"}],"responses":{"200":{"description":"Retrieves the postings of an account of the organization for a period","content":{"application/json":{"schema":{"type":"object","properties":{"postings":{"type":"array","items":{"type":"object","properties":{"postingId":{"type":"string","format":"uuid"},"journalEntryId":{"type":"string","format":"uuid"},"number":{"type":"integer","minimum":-2147483648,"maximum":2147483647},"validOn":{"type":"object","properties":{"__date__":{"type":"string","minLength":1}},"required":["__date__"],"additionalProperties":false},"reference":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"currency":{"type":"string","maxLength":20},"debit":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false,"description":"Debit in the currency of the posting"},"credit":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false,"description":"Credit in the currency of the posting"},"baseDebit":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false,"description":"Debit converted to the base currency of the organization"},"baseCredit":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false,"description":"Credit converted to the base currency of the organization"},"balance":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false,"description":"Balance of the account after this posting, in the base currency of the organization"}},"required":["postingId","journalEntryId","number","validOn","reference","description","currency","debit","credit","baseDebit","baseCredit","balance"],"additionalProperties":false}},"totals":{"type":"object","properties":{"baseDebit":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false,"description":"Total debit of the filtered postings, in the base currency of the organization"},"baseCredit":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false,"description":"Total credit of the filtered postings, in the base currency of the organization"},"balance":{"type":"object","nullable":true,"properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false,"description":"Balance of the account after the latest filtered posting, in the base currency of the organization, null without postings"}},"required":["baseDebit","baseCredit","balance"],"additionalProperties":false}},"required":["postings","totals"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for reports","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/organizations/{parentId}/accounting/reports/active-accounts":{"get":{"tags":["Reports"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"periodId","in":"query"}],"responses":{"200":{"description":"Retrieves the accounts of the organization that have postings in a period","content":{"application/json":{"schema":{"type":"object","properties":{"accountIds":{"type":"array","items":{"type":"string","format":"uuid"}}},"required":["accountIds"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for reports","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/chat":{"post":{"tags":["Chat"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["unscoped"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["organization"]},"organizationId":{"type":"string","format":"uuid"},"readOnly":{"type":"boolean","default":true}},"required":["type","organizationId"],"additionalProperties":false}]},"conversationId":{"type":"string","format":"uuid"},"message":{"type":"string","minLength":1}},"required":["domain","message"],"additionalProperties":false}}}},"responses":{"200":{"description":"Streams the events of the chat as server-sent events","content":{"text/event-stream":{"schema":{"type":"string"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for chat","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/chat/conversations":{"get":{"tags":["Chat"],"parameters":[{"schema":{"type":"number","nullable":true},"required":false,"name":"limit","in":"query"},{"schema":{"type":"number","nullable":true},"required":false,"name":"offset","in":"query"},{"schema":{"type":"string","minLength":1},"required":true,"name":"sort","in":"query"},{"schema":{"type":"string","enum":["asc","desc"]},"required":true,"name":"direction","in":"query"}],"responses":{"200":{"description":"Retrieve the conversations of the signed-in user that belong to no organization","content":{"application/json":{"schema":{"type":"object","properties":{"conversations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"userId":{"type":"string"},"organizationId":{"type":"string","nullable":true,"format":"uuid"},"title":{"type":"string","nullable":true},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","userId","organizationId","title","createdAt","updatedAt","version"]}}},"required":["conversations"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for chat","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/chat/conversations/{id}":{"get":{"tags":["Chat"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Get a conversation of the signed-in user","content":{"application/json":{"schema":{"type":"object","properties":{"chat":{"type":"object","nullable":true,"properties":{"conversation":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"userId":{"type":"string"},"organizationId":{"type":"string","nullable":true,"format":"uuid"},"title":{"type":"string","nullable":true},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","userId","organizationId","title","createdAt","updatedAt","version"]},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"conversationId":{"type":"string","format":"uuid"},"position":{"type":"integer","minimum":-2147483648,"maximum":2147483647},"role":{"type":"string","enum":["user","assistant","tool"]},"content":{"type":"string","nullable":true},"toolCalls":{"type":"array","nullable":true,"items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["function"]},"function":{"type":"object","properties":{"name":{"type":"string"},"arguments":{"type":"string"}},"required":["name","arguments"],"additionalProperties":false}},"required":["id","type","function"],"additionalProperties":false}},"toolCallId":{"type":"string","nullable":true},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false}},"required":["id","conversationId","position","role","content","toolCallId","createdAt"]}}},"required":["conversation","messages"],"additionalProperties":false}},"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for chat","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}},"delete":{"tags":["Chat"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Delete a conversation of the signed-in user with its messages"},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for chat","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/organizations/{parentId}/conversations":{"get":{"tags":["Chat"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"},{"schema":{"type":"number","nullable":true},"required":false,"name":"limit","in":"query"},{"schema":{"type":"number","nullable":true},"required":false,"name":"offset","in":"query"},{"schema":{"type":"string","minLength":1},"required":true,"name":"sort","in":"query"},{"schema":{"type":"string","enum":["asc","desc"]},"required":true,"name":"direction","in":"query"}],"responses":{"200":{"description":"Retrieve the conversations of the signed-in user in an organization","content":{"application/json":{"schema":{"type":"object","properties":{"conversations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"userId":{"type":"string"},"organizationId":{"type":"string","nullable":true,"format":"uuid"},"title":{"type":"string","nullable":true},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","userId","organizationId","title","createdAt","updatedAt","version"]}}},"required":["conversations"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for chat","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/chat/conversations/{parentId}/messages":{"get":{"tags":["Chat"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"},{"schema":{"type":"number","nullable":true},"required":false,"name":"limit","in":"query"},{"schema":{"type":"number","nullable":true},"required":false,"name":"offset","in":"query"},{"schema":{"type":"string","minLength":1},"required":true,"name":"sort","in":"query"},{"schema":{"type":"string","enum":["asc","desc"]},"required":true,"name":"direction","in":"query"},{"schema":{"type":"integer","nullable":true},"required":false,"name":"positionBefore","in":"query"},{"schema":{"type":"string"},"required":false,"name":"textOnly","in":"query"}],"responses":{"200":{"description":"Retrieve a list of messages of a conversation of the signed-in user","content":{"application/json":{"schema":{"type":"object","properties":{"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"conversationId":{"type":"string","format":"uuid"},"position":{"type":"integer","minimum":-2147483648,"maximum":2147483647},"role":{"type":"string","enum":["user","assistant","tool"]},"content":{"type":"string","nullable":true},"toolCalls":{"type":"array","nullable":true,"items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["function"]},"function":{"type":"object","properties":{"name":{"type":"string"},"arguments":{"type":"string"}},"required":["name","arguments"],"additionalProperties":false}},"required":["id","type","function"],"additionalProperties":false}},"toolCallId":{"type":"string","nullable":true},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false}},"required":["id","conversationId","position","role","content","toolCallId","createdAt"]}}},"required":["messages"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for chat","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/user/api-keys":{"get":{"tags":["User"],"responses":{"200":{"description":"Lists the API keys of the signed-in user","content":{"application/json":{"schema":{"type":"object","properties":{"apiKeys":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"start":{"type":"string","nullable":true},"permissions":{"type":"object","nullable":true,"properties":{"mcp":{"type":"array","items":{"type":"string","enum":["read","write"]},"minItems":1},"api":{"type":"array","items":{"type":"string","enum":["read","write"]},"minItems":1}}},"expiresAt":{"type":"object","nullable":true,"properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"lastRequest":{"type":"object","nullable":true,"properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false}},"required":["id","name","start","permissions","expiresAt","lastRequest","createdAt"]}}},"required":["apiKeys"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for user","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}},"post":{"tags":["User"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":32},"expiresInDays":{"type":"integer","minimum":1,"maximum":365},"permissions":{"type":"object","properties":{"mcp":{"type":"array","items":{"type":"string","enum":["read","write"]},"minItems":1},"api":{"type":"array","items":{"type":"string","enum":["read","write"]},"minItems":1}}}},"required":["name","expiresInDays","permissions"],"additionalProperties":false}}}},"responses":{"201":{"description":"Creates an API key for the signed-in user","content":{"application/json":{"schema":{"type":"object","properties":{"apiKey":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"start":{"type":"string","nullable":true},"permissions":{"type":"object","nullable":true,"properties":{"mcp":{"type":"array","items":{"type":"string","enum":["read","write"]},"minItems":1},"api":{"type":"array","items":{"type":"string","enum":["read","write"]},"minItems":1}}},"expiresAt":{"type":"object","nullable":true,"properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"lastRequest":{"type":"object","nullable":true,"properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false}},"required":["id","name","start","permissions","expiresAt","lastRequest","createdAt"]},"key":{"type":"string"}},"required":["apiKey","key"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for user","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/user/api-keys/{id}":{"delete":{"tags":["User"],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Deletes an API key of the signed-in user"},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for user","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/user/reports/llm-usage":{"get":{"tags":["Reports"],"responses":{"200":{"description":"Returns the LLM usage of the signed-in user this month, per model","content":{"application/json":{"schema":{"type":"object","properties":{"llmUsage":{"type":"array","items":{"type":"object","properties":{"model":{"type":"string"},"inputTokens":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false},"outputTokens":{"type":"object","properties":{"__bigint__":{"type":"string","minLength":1}},"required":["__bigint__"],"additionalProperties":false}},"required":["model","inputTokens","outputTokens"]}}},"required":["llmUsage"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for reports","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/user/assistant":{"get":{"tags":["User"],"responses":{"200":{"description":"Returns the assistant of the signed-in user: its models, null when it is not enabled","content":{"application/json":{"schema":{"type":"object","properties":{"assistant":{"type":"object","properties":{"models":{"type":"array","nullable":true,"items":{"type":"object","properties":{"model":{"type":"string"}},"required":["model"],"additionalProperties":false},"minItems":1}},"required":["models"],"additionalProperties":false}},"required":["assistant"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for user","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/organizations/{parentId}/migrations":{"get":{"tags":["Migrations"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"},{"schema":{"type":"number","nullable":true},"required":false,"name":"limit","in":"query"},{"schema":{"type":"number","nullable":true},"required":false,"name":"offset","in":"query"},{"schema":{"type":"string","minLength":1},"required":true,"name":"sort","in":"query"},{"schema":{"type":"string","enum":["asc","desc"]},"required":true,"name":"direction","in":"query"}],"responses":{"200":{"description":"Retrieve the migrations of an organization","content":{"application/json":{"schema":{"type":"object","properties":{"migrations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"userId":{"type":"string","nullable":true},"provider":{"type":"string","enum":["bexio"]},"status":{"type":"string","enum":["draft","succeeded","failed"]},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","userId","provider","status","createdAt","updatedAt","version"]}}},"required":["migrations"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for migrations","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}},"post":{"tags":["Migrations"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"type":"string","enum":["bexio"]}},"required":["provider"]}}}},"responses":{"201":{"description":"Create a draft migration","content":{"application/json":{"schema":{"type":"object","properties":{"migration":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"userId":{"type":"string","nullable":true},"provider":{"type":"string","enum":["bexio"]},"status":{"type":"string","enum":["draft","succeeded","failed"]},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","userId","provider","status","createdAt","updatedAt","version"]}},"required":["migration"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for migrations","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/migrations/{id}":{"get":{"tags":["Migrations"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Get a migration","content":{"application/json":{"schema":{"type":"object","properties":{"migration":{"type":"object","nullable":true,"properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"userId":{"type":"string","nullable":true},"provider":{"type":"string","enum":["bexio"]},"status":{"type":"string","enum":["draft","succeeded","failed"]},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","userId","provider","status","createdAt","updatedAt","version"]}},"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for migrations","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}},"delete":{"tags":["Migrations"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Delete a draft migration and its datasets"},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for migrations","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/organizations/{parentId}/migration-dataset-summaries":{"get":{"tags":["Migrations"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"},{"schema":{"type":"number","nullable":true},"required":false,"name":"limit","in":"query"},{"schema":{"type":"number","nullable":true},"required":false,"name":"offset","in":"query"},{"schema":{"type":"string","minLength":1},"required":true,"name":"sort","in":"query"},{"schema":{"type":"string","enum":["asc","desc"]},"required":true,"name":"direction","in":"query"},{"schema":{"type":"string","enum":["accounts","clients","balances","journal","invoices"]},"required":false,"name":"type","in":"query"},{"schema":{"type":"string","enum":["draft","succeeded","failed"]},"required":false,"name":"status","in":"query"}],"responses":{"200":{"description":"Retrieve a list of the migration files of an organization with their migration","content":{"application/json":{"schema":{"type":"object","properties":{"datasetSummaries":{"type":"array","items":{"type":"object","properties":{"dataset":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["accounts","clients","balances","journal","invoices"]},"name":{"type":"string"},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","type","name","createdAt","updatedAt","version"]},"migration":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"userId":{"type":"string","nullable":true},"provider":{"type":"string","enum":["bexio"]},"status":{"type":"string","enum":["draft","succeeded","failed"]},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","organizationId","userId","provider","status","createdAt","updatedAt","version"]}},"required":["dataset","migration"],"additionalProperties":false}}},"required":["datasetSummaries"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for migrations","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/migrations/{parentId}/datasets":{"post":{"tags":["Migrations"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"oneOf":[{"type":"object","properties":{"file":{"type":"string","format":"binary"},"type":{"type":"string","enum":["accounts"]}},"required":["file","type"],"additionalProperties":false},{"type":"object","properties":{"file":{"type":"string","format":"binary"},"type":{"type":"string","enum":["balances"]},"validOn":{"type":"string","format":"date"}},"required":["file","type","validOn"],"additionalProperties":false},{"type":"object","properties":{"file":{"type":"string","format":"binary"},"type":{"type":"string","enum":["journal"]}},"required":["file","type"],"additionalProperties":false},{"type":"object","properties":{"file":{"type":"string","format":"binary"},"type":{"type":"string","enum":["clients"]}},"required":["file","type"],"additionalProperties":false},{"type":"object","properties":{"file":{"type":"string","format":"binary"},"type":{"type":"string","enum":["invoices"]}},"required":["file","type"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"Dataset read from the file and added to the draft migration","content":{"application/json":{"schema":{"type":"object","properties":{"dataset":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["accounts","clients","balances","journal","invoices"]},"name":{"type":"string"},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","type","name","createdAt","updatedAt","version"]}},"required":["dataset"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for migrations","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}},"get":{"tags":["Migrations"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"},{"schema":{"type":"number","nullable":true},"required":false,"name":"limit","in":"query"},{"schema":{"type":"number","nullable":true},"required":false,"name":"offset","in":"query"},{"schema":{"type":"string","minLength":1},"required":true,"name":"sort","in":"query"},{"schema":{"type":"string","enum":["asc","desc"]},"required":true,"name":"direction","in":"query"}],"responses":{"200":{"description":"Retrieve the datasets of a migration, without their data","content":{"application/json":{"schema":{"type":"object","properties":{"datasets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["accounts","clients","balances","journal","invoices"]},"name":{"type":"string"},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","type","name","createdAt","updatedAt","version"]}}},"required":["datasets"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for migrations","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/migrations/{parentId}/datasets/{id}/replace":{"post":{"tags":["Migrations"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"oneOf":[{"type":"object","properties":{"file":{"type":"string","format":"binary"},"type":{"type":"string","enum":["accounts"]}},"required":["file","type"],"additionalProperties":false},{"type":"object","properties":{"file":{"type":"string","format":"binary"},"type":{"type":"string","enum":["balances"]},"validOn":{"type":"string","format":"date"}},"required":["file","type","validOn"],"additionalProperties":false},{"type":"object","properties":{"file":{"type":"string","format":"binary"},"type":{"type":"string","enum":["journal"]}},"required":["file","type"],"additionalProperties":false},{"type":"object","properties":{"file":{"type":"string","format":"binary"},"type":{"type":"string","enum":["clients"]}},"required":["file","type"],"additionalProperties":false},{"type":"object","properties":{"file":{"type":"string","format":"binary"},"type":{"type":"string","enum":["invoices"]}},"required":["file","type"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"Dataset of the draft migration replaced by the one read from the file","content":{"application/json":{"schema":{"type":"object","properties":{"dataset":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["accounts","clients","balances","journal","invoices"]},"name":{"type":"string"},"createdAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"updatedAt":{"type":"object","properties":{"__timestamp__":{"type":"string","minLength":1}},"required":["__timestamp__"],"additionalProperties":false},"version":{"type":"integer","minimum":-2147483648,"maximum":2147483647}},"required":["id","type","name","createdAt","updatedAt","version"]}},"required":["dataset"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for migrations","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/migrations/datasets/{id}":{"delete":{"tags":["Migrations"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Delete a dataset of a migration that has not succeeded"},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for migrations","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/migrations/{parentId}/run":{"post":{"tags":["Migrations"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"}],"responses":{"200":{"description":"Migration queued to run","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["queued"]},"jobId":{"type":"string","format":"uuid"}},"required":["status","jobId"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for migrations","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/migrations/{parentId}/run/jobs/{id}":{"get":{"tags":["Migrations"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"parentId","in":"path"}],"responses":{"200":{"description":"Migration run job status","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"status":{"type":"string","enum":["completed"]},"result":{"nullable":true}},"required":["status","result"],"additionalProperties":false},{"type":"object","properties":{"status":{"type":"string","enum":["failed"]},"reason":{"type":"string"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"type":"string","enum":["unknown","active","delayed","prioritized","waiting","waiting-children"]}},"required":["status"],"additionalProperties":false}]}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for migrations","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}},"/health":{"get":{"tags":["Health"],"security":[],"responses":{"200":{"description":"Health check","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]}},"required":["status"],"additionalProperties":false}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}},"500":{"description":"Internal server error for health","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["unauthorized","not_found","validation","conflict","rejected","limited","unexpected"]}},"required":["error","code"],"additionalProperties":false}}}}}}}}}