{"openapi":"3.1.0","info":{"title":"Synx Public API","version":"1.0.0","description":"Synx Business OS API. Authenticated routes use `Authorization: Bearer <token>` and tenant-scoped routes also support `X-Organization-Id` to select the active organization. List endpoints use the standard query contract: `page`, `limit`, `sort`, `order`, `search`, `status`, `from`, `to`.","contact":{"name":"Synx Support","email":"support@synx.ee"}},"servers":[{"url":"https://synx.ee/api/v1","description":"Production"},{"url":"http://localhost:3002/api/v1","description":"Local development"}],"security":[{"bearerAuth":[]}],"tags":[{"name":"Auth","description":"Authentication, token rotation and MFA."},{"name":"Organizations","description":"Organizations and memberships."},{"name":"Users","description":"Org-scoped user directory."},{"name":"Roles","description":"Roles, permissions and RBAC catalog."},{"name":"Customers","description":"Customer management."},{"name":"Products","description":"Product catalog."},{"name":"Services","description":"Service catalog."},{"name":"Invoices","description":"Invoice lifecycle, PDF and audit trail."},{"name":"E-Invoices","description":"Electronic invoice generation and provider connectivity."},{"name":"Accounting","description":"Accounts, journal entries and VAT declarations."},{"name":"Documents","description":"Document metadata, versions and downloads."},{"name":"Signatures","description":"Signature request lifecycle and digital ID providers."},{"name":"Notifications","description":"Notifications and preferences."},{"name":"Email","description":"Email messages, send flow and templates."},{"name":"SMS","description":"SMS send and delivery history."},{"name":"Push","description":"Push subscription lifecycle."},{"name":"QR","description":"QR center and asset rendering."},{"name":"Booking","description":"Bookings and booking resources."},{"name":"POS","description":"POS sessions and transactions."},{"name":"Payments","description":"Payment intents, confirmations, refunds and Stripe webhook ingress."},{"name":"Subscriptions","description":"Plans and organization subscriptions."},{"name":"Webhooks","description":"Webhook endpoints, events and deliveries."},{"name":"Integrations","description":"Third-party integrations and sync health."},{"name":"Audit","description":"Audit log explorer."},{"name":"Admin","description":"Superadmin platform operations."},{"name":"Health","description":"Health checks and versioning."},{"name":"Employees","description":"Employee directory public API."},{"name":"Time Tracking","description":"Time entry public API."},{"name":"Banking","description":"Bank transaction public API."},{"name":"Reports","description":"Read-only reporting API."},{"name":"Reference","description":"Currencies and other reference data."},{"name":"Bulk","description":"Bulk mutation API."},{"name":"GraphQL","description":"Simplified query DSL endpoint."}],"paths":{"/auth/register":{"post":{"tags":["Auth"],"summary":"Register a new owner user and organization","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterRequest"},"example":{"name":"Anna Kask","email":"owner@acme.ee","password":"StrongPass123!","termsAccepted":true,"privacyAccepted":true,"policyVersion":"registration:terms=2025-01-01;privacy=2025-01-01"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/RegistrationResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}},"example":{"success":true,"data":{"id":"usr_123","email":"owner@acme.ee","organizationId":"org_123","requiresEmailVerification":true},"meta":{"requestId":"req_123"}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/auth/login":{"post":{"tags":["Auth"],"summary":"Authenticate and create a bearer session","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"},"example":{"email":"owner@acme.ee","password":"StrongPass123!","organizationId":"org_123"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/AuthSession"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}},"example":{"success":true,"data":{"accessToken":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...","refreshToken":"rt_123","activeOrganizationId":"org_123","roleIds":["owner"],"permissions":["invoices.read","invoices.create"],"user":{"id":"usr_123","email":"owner@acme.ee","status":"ACTIVE"}},"meta":{"requestId":"req_123"}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/auth/logout":{"post":{"tags":["Auth"],"summary":"Revoke the active refresh token","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshTokenRequest"},"example":{"refreshToken":"rt_123"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}},"example":{"success":true,"data":{"revoked":true},"meta":{"requestId":"req_123"}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/auth/refresh":{"post":{"tags":["Auth"],"summary":"Rotate access and refresh tokens","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshTokenRequest"},"example":{"refreshToken":"rt_123"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/AuthSession"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/auth/forgot-password":{"post":{"tags":["Auth"],"summary":"Request password reset email","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailRequest"},"example":{"email":"owner@acme.ee"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}},"example":{"success":true,"data":{"queued":true},"meta":{"requestId":"req_123"}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/auth/reset-password":{"post":{"tags":["Auth"],"summary":"Reset password using reset token","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetPasswordRequest"},"example":{"token":"reset_token","newPassword":"EvenStronger123!"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}},"example":{"success":true,"data":{"passwordUpdated":true},"meta":{"requestId":"req_123"}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/auth/verify-email":{"post":{"tags":["Auth"],"summary":"Verify email address using token","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyEmailRequest"},"example":{"token":"verify_token"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}},"example":{"success":true,"data":{"verified":true},"meta":{"requestId":"req_123"}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/auth/me":{"get":{"tags":["Auth"],"summary":"Get current authenticated user context","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/MeContext"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}},"example":{"success":true,"data":{"user":{"id":"usr_123","email":"owner@acme.ee","status":"ACTIVE","organizations":[{"id":"org_123","name":"Acme OÜ","role":"owner"}]}},"meta":{"requestId":"req_123"}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/auth/mfa/setup":{"post":{"tags":["Auth"],"summary":"Start MFA setup","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/MfaSetup"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}},"example":{"success":true,"data":{"secret":"BASE32SECRET","otpauthUrl":"otpauth://totp/Synx:owner@acme.ee?secret=BASE32SECRET"},"meta":{"requestId":"req_123"}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/auth/mfa/verify":{"post":{"tags":["Auth"],"summary":"Verify MFA setup or login challenge","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MfaVerifyRequest"},"example":{"code":"123456"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/auth/mfa/disable":{"post":{"tags":["Auth"],"summary":"Disable MFA","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MfaVerifyRequest"},"example":{"code":"123456"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/organizations":{"get":{"tags":["Organizations"],"summary":"List organizations available to the caller","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"},{"$ref":"#/components/parameters/PageQuery"},{"$ref":"#/components/parameters/LimitQuery"},{"$ref":"#/components/parameters/SortQuery"},{"$ref":"#/components/parameters/OrderQuery"},{"$ref":"#/components/parameters/SearchQuery"},{"$ref":"#/components/parameters/StatusQuery"},{"$ref":"#/components/parameters/FromQuery"},{"$ref":"#/components/parameters/ToQuery"}],"responses":{"200":{"description":"Paginated result","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/Organization"}},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}},"example":{"success":true,"data":[{"id":"org_123","name":"Acme OÜ","status":"ACTIVE"}],"meta":{"requestId":"req_123","page":1,"limit":25,"total":120,"totalPages":5}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Organizations"],"summary":"Create organization","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationInput"},"example":{"name":"Acme OÜ","legalName":"Acme OÜ","taxNumber":"12345678"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Organization"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/organizations/{organizationId}":{"parameters":[{"$ref":"#/components/parameters/OrganizationIdPath"},{"$ref":"#/components/parameters/OrganizationHeader"}],"get":{"tags":["Organizations"],"summary":"Get organization","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Organization"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"patch":{"tags":["Organizations"],"summary":"Update organization","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationInput"},"example":{"phone":"+37255550000"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Organization"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["Organizations"],"summary":"Archive organization","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/organizations/{organizationId}/members":{"parameters":[{"$ref":"#/components/parameters/OrganizationIdPath"},{"$ref":"#/components/parameters/OrganizationHeader"},{"$ref":"#/components/parameters/PageQuery"},{"$ref":"#/components/parameters/LimitQuery"}],"get":{"tags":["Organizations"],"summary":"List organization members","responses":{"200":{"description":"Paginated result","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/User"}},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}},"example":{"success":true,"data":[{"id":"usr_123","email":"member@acme.ee","status":"ACTIVE"}],"meta":{"requestId":"req_123","page":1,"limit":25,"total":120,"totalPages":5}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/organizations/{organizationId}/members/invite":{"parameters":[{"$ref":"#/components/parameters/OrganizationIdPath"},{"$ref":"#/components/parameters/OrganizationHeader"}],"post":{"tags":["Organizations"],"summary":"Invite organization member","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteRequest"},"example":{"email":"new@acme.ee","role":"member"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/organizations/{organizationId}/members/{memberId}":{"parameters":[{"$ref":"#/components/parameters/OrganizationIdPath"},{"$ref":"#/components/parameters/MemberIdPath"},{"$ref":"#/components/parameters/OrganizationHeader"}],"patch":{"tags":["Organizations"],"summary":"Update member role or status","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMemberRequest"},"example":{"role":"admin","status":"ACTIVE"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["Organizations"],"summary":"Remove member from organization","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/users":{"get":{"tags":["Users"],"summary":"List users in active organization","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"},{"$ref":"#/components/parameters/PageQuery"},{"$ref":"#/components/parameters/LimitQuery"},{"$ref":"#/components/parameters/SortQuery"},{"$ref":"#/components/parameters/OrderQuery"},{"$ref":"#/components/parameters/SearchQuery"},{"$ref":"#/components/parameters/StatusQuery"},{"$ref":"#/components/parameters/FromQuery"},{"$ref":"#/components/parameters/ToQuery"}],"responses":{"200":{"description":"Paginated result","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/User"}},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}},"example":{"success":true,"data":[{"id":"usr_123","email":"user@acme.ee","status":"ACTIVE"}],"meta":{"requestId":"req_123","page":1,"limit":25,"total":120,"totalPages":5}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/users/{userId}":{"parameters":[{"$ref":"#/components/parameters/UserIdPath"},{"$ref":"#/components/parameters/OrganizationHeader"}],"get":{"tags":["Users"],"summary":"Get user","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/User"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"patch":{"tags":["Users"],"summary":"Update user","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserInput"},"example":{"firstName":"Mari","lastName":"Tamm"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/User"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["Users"],"summary":"Remove user from active organization","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/roles":{"get":{"tags":["Roles"],"summary":"List custom roles","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"}],"responses":{"200":{"description":"Paginated result","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/Role"}},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}},"example":{"success":true,"data":[{"id":"role_1","key":"accountant","name":"Accountant"}],"meta":{"requestId":"req_123","page":1,"limit":25,"total":120,"totalPages":5}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Roles"],"summary":"Create custom role","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoleInput"},"example":{"key":"finance.readonly","name":"Finance Readonly","permissions":["invoices.read","accounting.read"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Role"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/roles/{roleId}":{"parameters":[{"$ref":"#/components/parameters/RoleIdPath"},{"$ref":"#/components/parameters/OrganizationHeader"}],"get":{"tags":["Roles"],"summary":"Get role","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Role"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"patch":{"tags":["Roles"],"summary":"Update role","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoleInput"},"example":{"name":"Updated role name"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Role"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["Roles"],"summary":"Delete role","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/permissions":{"get":{"tags":["Roles"],"summary":"List permission catalog","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"}],"responses":{"200":{"description":"Paginated result","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/Permission"}},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}},"example":{"success":true,"data":[{"key":"invoices.read","description":"Read invoices"}],"meta":{"requestId":"req_123","page":1,"limit":25,"total":120,"totalPages":5}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/roles/{roleId}/permissions":{"parameters":[{"$ref":"#/components/parameters/RoleIdPath"},{"$ref":"#/components/parameters/OrganizationHeader"}],"post":{"tags":["Roles"],"summary":"Attach permission to role","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RolePermissionInput"},"example":{"permission":"payments.manage"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/roles/{roleId}/permissions/{permissionId}":{"parameters":[{"$ref":"#/components/parameters/RoleIdPath"},{"$ref":"#/components/parameters/PermissionIdPath"},{"$ref":"#/components/parameters/OrganizationHeader"}],"delete":{"tags":["Roles"],"summary":"Detach permission from role","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/customers":{"get":{"tags":["Customers"],"summary":"List customers","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"},{"$ref":"#/components/parameters/PageQuery"},{"$ref":"#/components/parameters/LimitQuery"},{"$ref":"#/components/parameters/SortQuery"},{"$ref":"#/components/parameters/OrderQuery"},{"$ref":"#/components/parameters/SearchQuery"},{"$ref":"#/components/parameters/StatusQuery"},{"$ref":"#/components/parameters/FromQuery"},{"$ref":"#/components/parameters/ToQuery"}],"responses":{"200":{"description":"Paginated result","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/Customer"}},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}},"example":{"success":true,"data":[{"id":"cus_1","name":"ACME OÜ","email":"finance@acme.ee"}],"meta":{"requestId":"req_123","page":1,"limit":25,"total":120,"totalPages":5}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Customers"],"summary":"Create customer","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerInput"},"example":{"name":"ACME OÜ","email":"finance@acme.ee","vatNumber":"EE101010101"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Customer"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/customers/{customerId}":{"parameters":[{"$ref":"#/components/parameters/CustomerIdPath"},{"$ref":"#/components/parameters/OrganizationHeader"}],"get":{"tags":["Customers"],"summary":"Get customer","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Customer"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"patch":{"tags":["Customers"],"summary":"Update customer","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerInput"},"example":{"phone":"+37255550000"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Customer"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["Customers"],"summary":"Archive customer","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/products":{"get":{"tags":["Products"],"summary":"List products","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"},{"$ref":"#/components/parameters/PageQuery"},{"$ref":"#/components/parameters/LimitQuery"},{"$ref":"#/components/parameters/SortQuery"},{"$ref":"#/components/parameters/OrderQuery"},{"$ref":"#/components/parameters/SearchQuery"},{"$ref":"#/components/parameters/StatusQuery"},{"$ref":"#/components/parameters/FromQuery"},{"$ref":"#/components/parameters/ToQuery"}],"responses":{"200":{"description":"Paginated result","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/Product"}},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}},"example":{"success":true,"data":[{"id":"prd_1","name":"Subscription","unitPrice":1999,"currency":"EUR"}],"meta":{"requestId":"req_123","page":1,"limit":25,"total":120,"totalPages":5}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Products"],"summary":"Create product","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductInput"},"example":{"name":"Subscription","unitPrice":1999,"costPrice":0,"currency":"EUR"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Product"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/products/{productId}":{"parameters":[{"$ref":"#/components/parameters/ProductIdPath"},{"$ref":"#/components/parameters/OrganizationHeader"}],"get":{"tags":["Products"],"summary":"Get product","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Product"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"patch":{"tags":["Products"],"summary":"Update product","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductInput"},"example":{"name":"Updated product"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Product"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["Products"],"summary":"Delete product","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/services":{"get":{"tags":["Services"],"summary":"List services","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"},{"$ref":"#/components/parameters/PageQuery"},{"$ref":"#/components/parameters/LimitQuery"},{"$ref":"#/components/parameters/SortQuery"},{"$ref":"#/components/parameters/OrderQuery"},{"$ref":"#/components/parameters/SearchQuery"},{"$ref":"#/components/parameters/StatusQuery"},{"$ref":"#/components/parameters/FromQuery"},{"$ref":"#/components/parameters/ToQuery"}],"responses":{"200":{"description":"Paginated result","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/Service"}},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}},"example":{"success":true,"data":[{"id":"srv_1","name":"Consulting hour","unitPrice":10000,"currency":"EUR"}],"meta":{"requestId":"req_123","page":1,"limit":25,"total":120,"totalPages":5}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Services"],"summary":"Create service","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceInput"},"example":{"name":"Consulting hour","unitPrice":10000,"currency":"EUR"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Service"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/services/{serviceId}":{"parameters":[{"$ref":"#/components/parameters/ServiceIdPath"},{"$ref":"#/components/parameters/OrganizationHeader"}],"get":{"tags":["Services"],"summary":"Get service","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Service"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"patch":{"tags":["Services"],"summary":"Update service","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceInput"},"example":{"name":"Updated service"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Service"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["Services"],"summary":"Delete service","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/invoices":{"get":{"tags":["Invoices"],"summary":"List invoices","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"},{"$ref":"#/components/parameters/PageQuery"},{"$ref":"#/components/parameters/LimitQuery"},{"$ref":"#/components/parameters/SortQuery"},{"$ref":"#/components/parameters/OrderQuery"},{"$ref":"#/components/parameters/SearchQuery"},{"$ref":"#/components/parameters/StatusQuery"},{"$ref":"#/components/parameters/FromQuery"},{"$ref":"#/components/parameters/ToQuery"},{"name":"direction","in":"query","schema":{"type":"string","enum":["OUTGOING","INCOMING"]}},{"name":"contactId","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Paginated result","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/Invoice"}},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}},"example":{"success":true,"data":[{"id":"inv_1","number":"2026/00001","status":"DRAFT","totalCents":12000,"currency":"EUR"}],"meta":{"requestId":"req_123","page":1,"limit":25,"total":120,"totalPages":5}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Invoices"],"summary":"Create invoice","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceInput"},"example":{"customerId":"cus_1","issueDate":"2026-05-10T00:00:00.000Z","dueDate":"2026-05-25T00:00:00.000Z","currency":"EUR","lines":[{"description":"Consulting","quantity":2,"unitPrice":5000}]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Invoice"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/invoices/{invoiceId}":{"parameters":[{"$ref":"#/components/parameters/InvoiceIdPath"},{"$ref":"#/components/parameters/OrganizationHeader"}],"get":{"tags":["Invoices"],"summary":"Get invoice","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Invoice"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"patch":{"tags":["Invoices"],"summary":"Update draft invoice","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoicePatch"},"example":{"notes":"Updated payment terms"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Invoice"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["Invoices"],"summary":"Delete draft invoice","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/invoices/{invoiceId}/send":{"parameters":[{"$ref":"#/components/parameters/InvoiceIdPath"},{"$ref":"#/components/parameters/OrganizationHeader"}],"post":{"tags":["Invoices"],"summary":"Send invoice","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}},"example":{"success":true,"data":{"invoiceId":"inv_1","status":"SENT"},"meta":{"requestId":"req_123"}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/invoices/{invoiceId}/mark-paid":{"parameters":[{"$ref":"#/components/parameters/InvoiceIdPath"},{"$ref":"#/components/parameters/OrganizationHeader"}],"post":{"tags":["Invoices"],"summary":"Mark invoice as paid","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarkPaidRequest"},"example":{"amountCents":12000,"method":"BANK_TRANSFER","date":"2026-05-10T00:00:00.000Z"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/invoices/{invoiceId}/cancel":{"parameters":[{"$ref":"#/components/parameters/InvoiceIdPath"},{"$ref":"#/components/parameters/OrganizationHeader"}],"post":{"tags":["Invoices"],"summary":"Cancel invoice","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelRequest"},"example":{"reason":"Customer requested cancellation"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/invoices/{invoiceId}/duplicate":{"parameters":[{"$ref":"#/components/parameters/InvoiceIdPath"},{"$ref":"#/components/parameters/OrganizationHeader"}],"post":{"tags":["Invoices"],"summary":"Duplicate invoice","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Invoice"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/invoices/{invoiceId}/pdf":{"parameters":[{"$ref":"#/components/parameters/InvoiceIdPath"},{"$ref":"#/components/parameters/OrganizationHeader"}],"get":{"tags":["Invoices"],"summary":"Download invoice PDF","responses":{"200":{"description":"PDF file","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/invoices/{invoiceId}/audit":{"parameters":[{"$ref":"#/components/parameters/InvoiceIdPath"},{"$ref":"#/components/parameters/OrganizationHeader"},{"$ref":"#/components/parameters/LimitQuery"}],"get":{"tags":["Invoices"],"summary":"Get invoice audit timeline","responses":{"200":{"description":"Paginated result","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/AuditLog"}},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}},"example":{"success":true,"data":[{"id":"audit_1","action":"invoices.send","createdAt":"2026-05-10T10:00:00.000Z"}],"meta":{"requestId":"req_123","page":1,"limit":25,"total":1,"totalPages":1}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/einvoices/generate/{invoiceId}":{"parameters":[{"$ref":"#/components/parameters/InvoiceIdPath"},{"$ref":"#/components/parameters/OrganizationHeader"}],"post":{"tags":["E-Invoices"],"summary":"Generate e-invoice","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/einvoices/send/{invoiceId}":{"parameters":[{"$ref":"#/components/parameters/InvoiceIdPath"},{"$ref":"#/components/parameters/OrganizationHeader"}],"post":{"tags":["E-Invoices"],"summary":"Send e-invoice","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/einvoices/{einvoiceId}":{"parameters":[{"$ref":"#/components/parameters/EInvoiceIdPath"},{"$ref":"#/components/parameters/OrganizationHeader"}],"get":{"tags":["E-Invoices"],"summary":"Get e-invoice record","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/EInvoice"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/einvoices/{einvoiceId}/events":{"parameters":[{"$ref":"#/components/parameters/EInvoiceIdPath"},{"$ref":"#/components/parameters/OrganizationHeader"},{"$ref":"#/components/parameters/PageQuery"},{"$ref":"#/components/parameters/LimitQuery"}],"get":{"tags":["E-Invoices"],"summary":"List e-invoice events","responses":{"200":{"description":"Paginated result","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/GenericResult"}},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/einvoices/providers/connect":{"post":{"tags":["E-Invoices"],"summary":"Connect e-invoice provider","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntegrationConnectInput"},"example":{"provider":"peppol","credentials":{"endpoint":"https://provider.example/api"}}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/einvoices/providers/{connectionId}":{"delete":{"tags":["E-Invoices"],"summary":"Disconnect e-invoice provider","parameters":[{"$ref":"#/components/parameters/ConnectionIdPath"},{"$ref":"#/components/parameters/OrganizationHeader"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/accounting/accounts":{"get":{"tags":["Accounting"],"summary":"List chart of accounts","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"},{"$ref":"#/components/parameters/PageQuery"},{"$ref":"#/components/parameters/LimitQuery"},{"$ref":"#/components/parameters/SortQuery"},{"$ref":"#/components/parameters/OrderQuery"},{"$ref":"#/components/parameters/SearchQuery"},{"$ref":"#/components/parameters/StatusQuery"},{"$ref":"#/components/parameters/FromQuery"},{"$ref":"#/components/parameters/ToQuery"}],"responses":{"200":{"description":"Paginated result","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/Account"}},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Accounting"],"summary":"Create account","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountInput"},"example":{"code":"3000","name":"Sales revenue","type":"INCOME"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Account"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/accounting/accounts/{accountId}":{"parameters":[{"$ref":"#/components/parameters/AccountIdPath"},{"$ref":"#/components/parameters/OrganizationHeader"}],"patch":{"tags":["Accounting"],"summary":"Update account","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountInput"},"example":{"name":"Updated account name"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Account"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["Accounting"],"summary":"Delete account","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/accounting/journal-entries":{"get":{"tags":["Accounting"],"summary":"List journal entries","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"},{"$ref":"#/components/parameters/PageQuery"},{"$ref":"#/components/parameters/LimitQuery"},{"$ref":"#/components/parameters/SortQuery"},{"$ref":"#/components/parameters/OrderQuery"},{"$ref":"#/components/parameters/SearchQuery"},{"$ref":"#/components/parameters/StatusQuery"},{"$ref":"#/components/parameters/FromQuery"},{"$ref":"#/components/parameters/ToQuery"}],"responses":{"200":{"description":"Paginated result","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/JournalEntry"}},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Accounting"],"summary":"Create journal entry","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JournalEntryInput"},"example":{"reference":"monthly-close","date":"2026-05-01","lines":[{"accountCode":"3000","debit":0,"credit":10000}]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/JournalEntry"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/accounting/journal-entries/{entryId}":{"parameters":[{"$ref":"#/components/parameters/EntryIdPath"},{"$ref":"#/components/parameters/OrganizationHeader"}],"get":{"tags":["Accounting"],"summary":"Get journal entry","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/JournalEntry"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/accounting/vat/rates":{"get":{"tags":["Accounting"],"summary":"List VAT rates","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"}],"responses":{"200":{"description":"Paginated result","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/GenericResult"}},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Accounting"],"summary":"Create VAT rate","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VatRateInput"},"example":{"name":"Standard","code":"S","rate":20}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/accounting/vat/declarations":{"get":{"tags":["Accounting"],"summary":"List VAT declarations","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"},{"$ref":"#/components/parameters/PageQuery"},{"$ref":"#/components/parameters/LimitQuery"},{"$ref":"#/components/parameters/SortQuery"},{"$ref":"#/components/parameters/OrderQuery"},{"$ref":"#/components/parameters/SearchQuery"},{"$ref":"#/components/parameters/StatusQuery"},{"$ref":"#/components/parameters/FromQuery"},{"$ref":"#/components/parameters/ToQuery"}],"responses":{"200":{"description":"Paginated result","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/GenericResult"}},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Accounting"],"summary":"Create VAT declaration draft","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VatDeclarationInput"},"example":{"periodFrom":"2026-04-01","periodTo":"2026-04-30"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/documents":{"get":{"tags":["Documents"],"summary":"List documents","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"},{"$ref":"#/components/parameters/PageQuery"},{"$ref":"#/components/parameters/LimitQuery"},{"$ref":"#/components/parameters/SortQuery"},{"$ref":"#/components/parameters/OrderQuery"},{"$ref":"#/components/parameters/SearchQuery"},{"$ref":"#/components/parameters/StatusQuery"},{"$ref":"#/components/parameters/FromQuery"},{"$ref":"#/components/parameters/ToQuery"}],"responses":{"200":{"description":"Paginated result","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/Document"}},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Documents"],"summary":"Create or upload document","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentInput"},"example":{"name":"Contract.pdf","folderId":"fld_1"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Document"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/documents/{documentId}":{"parameters":[{"$ref":"#/components/parameters/DocumentIdPath"},{"$ref":"#/components/parameters/OrganizationHeader"}],"get":{"tags":["Documents"],"summary":"Get document","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Document"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"patch":{"tags":["Documents"],"summary":"Update document metadata","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentInput"},"example":{"name":"Updated Contract.pdf"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Document"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["Documents"],"summary":"Delete document","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/documents/{documentId}/versions":{"parameters":[{"$ref":"#/components/parameters/DocumentIdPath"},{"$ref":"#/components/parameters/OrganizationHeader"},{"$ref":"#/components/parameters/PageQuery"},{"$ref":"#/components/parameters/LimitQuery"}],"get":{"tags":["Documents"],"summary":"List document versions","responses":{"200":{"description":"Paginated result","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/GenericResult"}},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Documents"],"summary":"Create document version","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentVersionInput"},"example":{"notes":"Revised payment terms"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/documents/{documentId}/download":{"parameters":[{"$ref":"#/components/parameters/DocumentIdPath"},{"$ref":"#/components/parameters/OrganizationHeader"}],"get":{"tags":["Documents"],"summary":"Download document content","responses":{"200":{"description":"File stream","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/signatures/requests":{"get":{"tags":["Signatures"],"summary":"List signature requests","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"},{"$ref":"#/components/parameters/PageQuery"},{"$ref":"#/components/parameters/LimitQuery"},{"$ref":"#/components/parameters/SortQuery"},{"$ref":"#/components/parameters/OrderQuery"},{"$ref":"#/components/parameters/SearchQuery"},{"$ref":"#/components/parameters/StatusQuery"},{"$ref":"#/components/parameters/FromQuery"},{"$ref":"#/components/parameters/ToQuery"}],"responses":{"200":{"description":"Paginated result","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/SignatureRequest"}},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Signatures"],"summary":"Create signature request","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignatureRequestInput"},"example":{"documentId":"doc_1","subject":"Contract review","recipientEmails":["customer@acme.ee"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/SignatureRequest"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/signatures/requests/{requestId}":{"parameters":[{"$ref":"#/components/parameters/RequestIdPath"},{"$ref":"#/components/parameters/OrganizationHeader"}],"get":{"tags":["Signatures"],"summary":"Get signature request","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/SignatureRequest"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/signatures/requests/{requestId}/send":{"parameters":[{"$ref":"#/components/parameters/RequestIdPath"},{"$ref":"#/components/parameters/OrganizationHeader"}],"post":{"tags":["Signatures"],"summary":"Send signature request","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/signatures/requests/{requestId}/cancel":{"parameters":[{"$ref":"#/components/parameters/RequestIdPath"},{"$ref":"#/components/parameters/OrganizationHeader"}],"post":{"tags":["Signatures"],"summary":"Cancel signature request","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/signatures/providers/smart-id/start":{"post":{"tags":["Signatures"],"summary":"Start Smart-ID signing flow","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmartIdStartRequest"},"example":{"requestId":"sigreq_1","recipientId":"rcp_1","personalCode":"38802150000"}}}},"responses":{"202":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/EidSigningNotReady"}}}},"/signatures/providers/smart-id/status":{"post":{"tags":["Signatures"],"summary":"Get server-owned Smart-ID session status","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderStatusRequest"},"example":{"requestId":"sigreq_1","recipientId":"rcp_1"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/signatures/providers/mobile-id/start":{"post":{"tags":["Signatures"],"summary":"Start Mobile-ID signing flow","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MobileIdStartRequest"},"example":{"requestId":"sigreq_1","recipientId":"rcp_1","personalCode":"38802150000","phoneNumber":"+37250000000"}}}},"responses":{"202":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/EidSigningNotReady"}}}},"/signatures/providers/mobile-id/status":{"post":{"tags":["Signatures"],"summary":"Get server-owned Mobile-ID session status","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderStatusRequest"},"example":{"requestId":"sigreq_1","recipientId":"rcp_1"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/notifications":{"get":{"tags":["Notifications"],"summary":"List notifications","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"},{"$ref":"#/components/parameters/PageQuery"},{"$ref":"#/components/parameters/LimitQuery"},{"$ref":"#/components/parameters/SortQuery"},{"$ref":"#/components/parameters/OrderQuery"},{"$ref":"#/components/parameters/SearchQuery"},{"$ref":"#/components/parameters/StatusQuery"},{"$ref":"#/components/parameters/FromQuery"},{"$ref":"#/components/parameters/ToQuery"}],"responses":{"200":{"description":"Paginated result","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/Notification"}},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Notifications"],"summary":"Create notification","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationInput"},"example":{"userId":"usr_123","title":"Invoice overdue","body":"Invoice 2026/00001 is overdue","channel":"in_app"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Notification"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/notifications/{notificationId}":{"parameters":[{"$ref":"#/components/parameters/NotificationIdPath"},{"$ref":"#/components/parameters/OrganizationHeader"}],"delete":{"tags":["Notifications"],"summary":"Delete notification","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/notifications/{notificationId}/read":{"parameters":[{"$ref":"#/components/parameters/NotificationIdPath"},{"$ref":"#/components/parameters/OrganizationHeader"}],"patch":{"tags":["Notifications"],"summary":"Mark notification as read","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/notifications/read-all":{"patch":{"tags":["Notifications"],"summary":"Mark all notifications as read","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/notification-preferences":{"get":{"tags":["Notifications"],"summary":"Get notification preferences","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}},"example":{"success":true,"data":{"email":true,"sms":false,"push":true},"meta":{"requestId":"req_123"}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"patch":{"tags":["Notifications"],"summary":"Update notification preferences","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationPreferencesInput"},"example":{"email":true,"sms":false,"push":true}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/email/messages":{"get":{"tags":["Email"],"summary":"List email messages","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"},{"$ref":"#/components/parameters/PageQuery"},{"$ref":"#/components/parameters/LimitQuery"},{"$ref":"#/components/parameters/SortQuery"},{"$ref":"#/components/parameters/OrderQuery"},{"$ref":"#/components/parameters/SearchQuery"},{"$ref":"#/components/parameters/StatusQuery"},{"$ref":"#/components/parameters/FromQuery"},{"$ref":"#/components/parameters/ToQuery"}],"responses":{"200":{"description":"Paginated result","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/EmailMessage"}},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/email/messages/{messageId}":{"parameters":[{"$ref":"#/components/parameters/MessageIdPath"},{"$ref":"#/components/parameters/OrganizationHeader"}],"get":{"tags":["Email"],"summary":"Get email message","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/EmailMessage"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/email/send":{"post":{"tags":["Email"],"summary":"Send email","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailSendInput"},"example":{"to":["client@acme.ee"],"templateId":"invoice-reminder","variables":{"invoiceNumber":"INV-1001"},"category":"billing.invoice","sender":"arve","replyTo":"support@acme.ee"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/email/templates":{"get":{"tags":["Email"],"summary":"List email templates","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"},{"$ref":"#/components/parameters/PageQuery"},{"$ref":"#/components/parameters/LimitQuery"},{"$ref":"#/components/parameters/SortQuery"},{"$ref":"#/components/parameters/OrderQuery"},{"$ref":"#/components/parameters/SearchQuery"},{"$ref":"#/components/parameters/StatusQuery"},{"$ref":"#/components/parameters/FromQuery"},{"$ref":"#/components/parameters/ToQuery"}],"responses":{"200":{"description":"Paginated result","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/GenericResult"}},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Email"],"summary":"Create email template","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailTemplateInput"},"example":{"name":"Invoice reminder","subject":"Invoice reminder","html":"<p>Hi {{customerName}}</p>"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/email/templates/{templateId}":{"parameters":[{"$ref":"#/components/parameters/TemplateIdPath"},{"$ref":"#/components/parameters/OrganizationHeader"}],"patch":{"tags":["Email"],"summary":"Update email template","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailTemplateInput"},"example":{"subject":"Updated reminder subject"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["Email"],"summary":"Delete email template","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/sms/messages":{"get":{"tags":["SMS"],"summary":"List SMS messages","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"},{"$ref":"#/components/parameters/PageQuery"},{"$ref":"#/components/parameters/LimitQuery"},{"$ref":"#/components/parameters/SortQuery"},{"$ref":"#/components/parameters/OrderQuery"},{"$ref":"#/components/parameters/SearchQuery"},{"$ref":"#/components/parameters/StatusQuery"},{"$ref":"#/components/parameters/FromQuery"},{"$ref":"#/components/parameters/ToQuery"}],"responses":{"200":{"description":"Paginated result","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/SmsMessage"}},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/sms/messages/{messageId}":{"parameters":[{"$ref":"#/components/parameters/MessageIdPath"},{"$ref":"#/components/parameters/OrganizationHeader"}],"get":{"tags":["SMS"],"summary":"Get SMS message","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/SmsMessage"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/sms/send":{"post":{"tags":["SMS"],"summary":"Send SMS","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmsSendInput"},"example":{"to":"+37250000000","body":"Invoice 2026/00001 is now overdue."}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/push/subscribe":{"post":{"tags":["Push"],"summary":"Subscribe push endpoint","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PushSubscribeInput"},"example":{"endpoint":"https://fcm.googleapis.com/fcm/send/abc","keys":{"p256dh":"abc","auth":"def"},"name":"Chrome Desktop"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/push/unsubscribe":{"post":{"tags":["Push"],"summary":"Unsubscribe push endpoint","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PushUnsubscribeInput"},"example":{"subscriptionId":"sub_123"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/push/test":{"post":{"tags":["Push"],"summary":"Send test push notification","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/qr":{"get":{"tags":["QR"],"summary":"List QR codes","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"},{"$ref":"#/components/parameters/PageQuery"},{"$ref":"#/components/parameters/LimitQuery"},{"$ref":"#/components/parameters/SortQuery"},{"$ref":"#/components/parameters/OrderQuery"},{"$ref":"#/components/parameters/SearchQuery"},{"$ref":"#/components/parameters/StatusQuery"},{"$ref":"#/components/parameters/FromQuery"},{"$ref":"#/components/parameters/ToQuery"}],"responses":{"200":{"description":"Paginated result","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/QrCode"}},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["QR"],"summary":"Create QR code","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QrInput"},"example":{"targetType":"invoice","targetId":"inv_1","payload":"https://synx.ee/portal/invoice/token"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/QrCode"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/qr/{qrId}":{"parameters":[{"$ref":"#/components/parameters/QrIdPath"},{"$ref":"#/components/parameters/OrganizationHeader"}],"get":{"tags":["QR"],"summary":"Get QR code","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/QrCode"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["QR"],"summary":"Delete QR code","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/qr/{qrId}/png":{"parameters":[{"$ref":"#/components/parameters/QrIdPath"},{"$ref":"#/components/parameters/OrganizationHeader"}],"get":{"tags":["QR"],"summary":"Download QR PNG","responses":{"200":{"description":"PNG image","content":{"image/png":{"schema":{"type":"string","format":"binary"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/qr/{qrId}/svg":{"parameters":[{"$ref":"#/components/parameters/QrIdPath"},{"$ref":"#/components/parameters/OrganizationHeader"}],"get":{"tags":["QR"],"summary":"Download QR SVG","responses":{"200":{"description":"SVG image","content":{"image/svg+xml":{"schema":{"type":"string"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/bookings":{"get":{"tags":["Booking"],"summary":"List bookings","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"},{"$ref":"#/components/parameters/PageQuery"},{"$ref":"#/components/parameters/LimitQuery"},{"$ref":"#/components/parameters/SortQuery"},{"$ref":"#/components/parameters/OrderQuery"},{"$ref":"#/components/parameters/SearchQuery"},{"$ref":"#/components/parameters/StatusQuery"},{"$ref":"#/components/parameters/FromQuery"},{"$ref":"#/components/parameters/ToQuery"}],"responses":{"200":{"description":"Paginated result","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/Booking"}},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Booking"],"summary":"Create booking","description":"Requires booking:write. Creates only DRAFT or CONFIRMED. Active bookings exclusively reserve an active resource; adjacent time windows are allowed. Booking, strict audit and replay receipt commit atomically.","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"},{"name":"Idempotency-Key","in":"header","required":true,"description":"Unique create key, scoped to authenticated user, organization and operation. Reuse unchanged for retries for at least 24 hours; changed payload returns 409. Missing key returns 428.","schema":{"type":"string","minLength":8,"maxLength":255},"example":"414a7d06-2f54-45bf-8c55-3290d691c99b"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BookingInput"},"example":{"resourceId":"res_1","title":"Client onboarding","startsAt":"2026-05-10T10:00:00.000Z","endsAt":"2026-05-10T11:00:00.000Z"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Booking"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"428":{"description":"Idempotency-Key is required (IDEMPOTENCY_KEY_REQUIRED)"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/bookings/{bookingId}":{"parameters":[{"$ref":"#/components/parameters/BookingIdPath"},{"$ref":"#/components/parameters/OrganizationHeader"}],"get":{"tags":["Booking"],"summary":"Get booking","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Booking"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"patch":{"tags":["Booking"],"summary":"Update booking","description":"Omitted properties are preserved, nullable properties support explicit clears. DRAFT can become CONFIRMED/CANCELLED; CONFIRMED can become COMPLETED/CANCELLED/NO_SHOW. Terminal bookings are read-only. Supply expectedUpdatedAt for optimistic concurrency; stale versions return 409.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BookingUpdateInput"},"example":{"endsAt":"2026-05-10T12:00:00.000Z","expectedUpdatedAt":"2026-05-09T12:00:00.000Z"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Booking"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["Booking"],"summary":"Delete draft booking","description":"Only DRAFT bookings can be deleted. Confirmed bookings must be cancelled; terminal bookings are read-only (409).","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/booking-resources":{"get":{"tags":["Booking"],"summary":"List booking resources","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"},{"$ref":"#/components/parameters/PageQuery"},{"$ref":"#/components/parameters/LimitQuery"},{"$ref":"#/components/parameters/SearchQuery"},{"name":"active","in":"query","schema":{"type":"boolean"},"description":"true for active resources, false for inactive resources; omitted lists both"},{"name":"type","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Paginated result","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/GenericResult"}},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Booking"],"summary":"Create booking resource","description":"Requires booking:resource_manage and Idempotency-Key. Resource codes are unique within the organization. Capacity is informational; booking windows reserve the resource exclusively.","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"},{"name":"Idempotency-Key","in":"header","required":true,"description":"Unique create key, scoped to authenticated user, organization and operation. Reuse unchanged for retries for at least 24 hours; changed payload returns 409. Missing key returns 428.","schema":{"type":"string","minLength":8,"maxLength":255},"example":"414a7d06-2f54-45bf-8c55-3290d691c99b"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BookingResourceInput"},"example":{"name":"Meeting Room 1","type":"ROOM","capacity":6}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"428":{"description":"Idempotency-Key is required (IDEMPOTENCY_KEY_REQUIRED)"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/booking-resources/{resourceId}":{"parameters":[{"$ref":"#/components/parameters/ResourceIdPath"},{"$ref":"#/components/parameters/OrganizationHeader"}],"patch":{"tags":["Booking"],"summary":"Update booking resource","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BookingResourceUpdateInput"},"example":{"capacity":8}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["Booking"],"summary":"Delete booking resource","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/pos/sessions":{"get":{"tags":["POS"],"summary":"List POS sessions","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"},{"$ref":"#/components/parameters/PageQuery"},{"$ref":"#/components/parameters/LimitQuery"},{"$ref":"#/components/parameters/SortQuery"},{"$ref":"#/components/parameters/OrderQuery"},{"$ref":"#/components/parameters/SearchQuery"},{"$ref":"#/components/parameters/StatusQuery"},{"$ref":"#/components/parameters/FromQuery"},{"$ref":"#/components/parameters/ToQuery"}],"responses":{"200":{"description":"Paginated result","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/PosSession"}},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["POS"],"summary":"Open POS session","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PosSessionInput"},"example":{"terminalId":"term_1"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/PosSession"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/pos/sessions/{sessionId}":{"parameters":[{"$ref":"#/components/parameters/PosSessionIdPath"},{"$ref":"#/components/parameters/OrganizationHeader"}],"get":{"tags":["POS"],"summary":"Get POS session","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/PosSession"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/pos/sessions/{sessionId}/close":{"parameters":[{"$ref":"#/components/parameters/PosSessionIdPath"},{"$ref":"#/components/parameters/OrganizationHeader"}],"post":{"tags":["POS"],"summary":"Close POS session","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/pos/transactions":{"get":{"tags":["POS"],"summary":"List POS transactions","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"},{"$ref":"#/components/parameters/PageQuery"},{"$ref":"#/components/parameters/LimitQuery"},{"$ref":"#/components/parameters/SortQuery"},{"$ref":"#/components/parameters/OrderQuery"},{"$ref":"#/components/parameters/SearchQuery"},{"$ref":"#/components/parameters/StatusQuery"},{"$ref":"#/components/parameters/FromQuery"},{"$ref":"#/components/parameters/ToQuery"}],"responses":{"200":{"description":"Paginated result","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/PosTransaction"}},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["POS"],"summary":"Create POS transaction","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PosTransactionInput"},"example":{"sessionId":"sess_1","amount":12500,"type":"SALE","method":"CARD"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/PosTransaction"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/pos/transactions/{transactionId}":{"parameters":[{"$ref":"#/components/parameters/PosTransactionIdPath"},{"$ref":"#/components/parameters/OrganizationHeader"}],"get":{"tags":["POS"],"summary":"Get POS transaction","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/PosTransaction"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/payments":{"get":{"tags":["Payments"],"summary":"List payments","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"},{"$ref":"#/components/parameters/PageQuery"},{"$ref":"#/components/parameters/LimitQuery"},{"$ref":"#/components/parameters/SortQuery"},{"$ref":"#/components/parameters/OrderQuery"},{"$ref":"#/components/parameters/SearchQuery"},{"$ref":"#/components/parameters/StatusQuery"},{"$ref":"#/components/parameters/FromQuery"},{"$ref":"#/components/parameters/ToQuery"}],"responses":{"200":{"description":"Paginated result","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/Payment"}},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/payments/create-intent":{"post":{"tags":["Payments"],"summary":"Create payment intent","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentIntentInput"},"example":{"invoiceId":"inv_1","amount":12000,"currency":"EUR"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}},"example":{"success":true,"data":{"paymentIntentId":"pi_123","clientSecret":"pi_123_secret_abc"},"meta":{"requestId":"req_123"}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/payments/confirm":{"post":{"tags":["Payments"],"summary":"Confirm payment intent","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentConfirmInput"},"example":{"paymentIntentId":"pi_123"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Payment"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/payments/{paymentId}":{"parameters":[{"$ref":"#/components/parameters/PaymentIdPath"},{"$ref":"#/components/parameters/OrganizationHeader"}],"get":{"tags":["Payments"],"summary":"Get payment","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Payment"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/payments/{paymentId}/refund":{"parameters":[{"$ref":"#/components/parameters/PaymentIdPath"},{"$ref":"#/components/parameters/OrganizationHeader"}],"post":{"tags":["Payments"],"summary":"Refund payment","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefundInput"},"example":{"amount":12000,"reason":"Customer request"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/payments/stripe/webhook":{"post":{"tags":["Payments"],"summary":"Receive Stripe webhook","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true},"example":{"type":"payment_intent.succeeded"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/plans":{"get":{"tags":["Subscriptions"],"summary":"List subscription plans","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"}],"responses":{"200":{"description":"Paginated result","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/Plan"}},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/subscriptions":{"post":{"tags":["Subscriptions"],"summary":"Create subscription checkout or subscription record","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionInput"},"example":{"planId":"plan_basic","interval":"month"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Subscription"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/subscriptions/current":{"get":{"tags":["Subscriptions"],"summary":"Get current subscription","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Subscription"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"patch":{"tags":["Subscriptions"],"summary":"Update current subscription","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionInput"},"example":{"planId":"plan_pro","interval":"year"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Subscription"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/subscriptions/cancel":{"post":{"tags":["Subscriptions"],"summary":"Cancel subscription","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/subscriptions/resume":{"post":{"tags":["Subscriptions"],"summary":"Resume subscription","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/webhooks/endpoints":{"get":{"tags":["Webhooks"],"summary":"List webhook endpoints","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"},{"$ref":"#/components/parameters/PageQuery"},{"$ref":"#/components/parameters/LimitQuery"},{"$ref":"#/components/parameters/SortQuery"},{"$ref":"#/components/parameters/OrderQuery"},{"$ref":"#/components/parameters/SearchQuery"},{"$ref":"#/components/parameters/StatusQuery"},{"$ref":"#/components/parameters/FromQuery"},{"$ref":"#/components/parameters/ToQuery"}],"responses":{"200":{"description":"Paginated result","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEndpoint"}},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Webhooks"],"summary":"Create webhook endpoint","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointInput"},"example":{"url":"https://app.example.com/webhooks/synx","event":"invoice.paid","active":true}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/WebhookEndpoint"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/webhooks/endpoints/{endpointId}":{"parameters":[{"$ref":"#/components/parameters/EndpointIdPath"},{"$ref":"#/components/parameters/OrganizationHeader"}],"patch":{"tags":["Webhooks"],"summary":"Update webhook endpoint","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointInput"},"example":{"active":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/WebhookEndpoint"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["Webhooks"],"summary":"Delete webhook endpoint","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/webhooks/events":{"get":{"tags":["Webhooks"],"summary":"List webhook events","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"},{"$ref":"#/components/parameters/PageQuery"},{"$ref":"#/components/parameters/LimitQuery"},{"$ref":"#/components/parameters/SortQuery"},{"$ref":"#/components/parameters/OrderQuery"},{"$ref":"#/components/parameters/SearchQuery"},{"$ref":"#/components/parameters/StatusQuery"},{"$ref":"#/components/parameters/FromQuery"},{"$ref":"#/components/parameters/ToQuery"}],"responses":{"200":{"description":"Paginated result","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/GenericResult"}},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/webhooks/deliveries":{"get":{"tags":["Webhooks"],"summary":"List webhook deliveries","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"},{"$ref":"#/components/parameters/PageQuery"},{"$ref":"#/components/parameters/LimitQuery"},{"$ref":"#/components/parameters/SortQuery"},{"$ref":"#/components/parameters/OrderQuery"},{"$ref":"#/components/parameters/SearchQuery"},{"$ref":"#/components/parameters/StatusQuery"},{"$ref":"#/components/parameters/FromQuery"},{"$ref":"#/components/parameters/ToQuery"}],"responses":{"200":{"description":"Paginated result","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/GenericResult"}},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/webhooks/deliveries/{deliveryId}/retry":{"parameters":[{"$ref":"#/components/parameters/DeliveryIdPath"},{"$ref":"#/components/parameters/OrganizationHeader"}],"post":{"tags":["Webhooks"],"summary":"Retry failed delivery","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/integrations":{"get":{"tags":["Integrations"],"summary":"List integration connections","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"},{"$ref":"#/components/parameters/PageQuery"},{"$ref":"#/components/parameters/LimitQuery"},{"$ref":"#/components/parameters/SortQuery"},{"$ref":"#/components/parameters/OrderQuery"},{"$ref":"#/components/parameters/SearchQuery"},{"$ref":"#/components/parameters/StatusQuery"},{"$ref":"#/components/parameters/FromQuery"},{"$ref":"#/components/parameters/ToQuery"}],"responses":{"200":{"description":"Paginated result","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/IntegrationConnection"}},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/integrations/{provider}/connect":{"parameters":[{"$ref":"#/components/parameters/ProviderPath"},{"$ref":"#/components/parameters/OrganizationHeader"}],"post":{"tags":["Integrations"],"summary":"Connect integration provider","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntegrationConnectInput"},"example":{"provider":"banking","credentials":{"apiKey":"secret_key"}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/IntegrationConnection"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/integrations/{connectionId}":{"parameters":[{"$ref":"#/components/parameters/ConnectionIdPath"},{"$ref":"#/components/parameters/OrganizationHeader"}],"delete":{"tags":["Integrations"],"summary":"Delete integration connection","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/integrations/{connectionId}/sync":{"parameters":[{"$ref":"#/components/parameters/ConnectionIdPath"},{"$ref":"#/components/parameters/OrganizationHeader"}],"post":{"tags":["Integrations"],"summary":"Verify the provider connection (syncs only providers with a real sync adapter)","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/integrations/{connectionId}/status":{"parameters":[{"$ref":"#/components/parameters/ConnectionIdPath"},{"$ref":"#/components/parameters/OrganizationHeader"}],"get":{"tags":["Integrations"],"summary":"Get integration status","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/IntegrationConnection"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/audit-logs":{"get":{"tags":["Audit"],"summary":"List audit logs","parameters":[{"$ref":"#/components/parameters/OrganizationHeader"},{"$ref":"#/components/parameters/PageQuery"},{"$ref":"#/components/parameters/LimitQuery"},{"$ref":"#/components/parameters/SortQuery"},{"$ref":"#/components/parameters/OrderQuery"},{"$ref":"#/components/parameters/SearchQuery"},{"$ref":"#/components/parameters/StatusQuery"},{"$ref":"#/components/parameters/FromQuery"},{"$ref":"#/components/parameters/ToQuery"}],"responses":{"200":{"description":"Paginated result","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/AuditLog"}},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/audit-logs/{auditLogId}":{"parameters":[{"$ref":"#/components/parameters/AuditLogIdPath"},{"$ref":"#/components/parameters/OrganizationHeader"}],"get":{"tags":["Audit"],"summary":"Get audit log","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/AuditLog"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/admin/overview":{"get":{"tags":["Admin"],"summary":"Get admin overview","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/admin/organizations":{"get":{"tags":["Admin"],"summary":"List organizations for admin","parameters":[{"$ref":"#/components/parameters/PageQuery"},{"$ref":"#/components/parameters/LimitQuery"},{"$ref":"#/components/parameters/SortQuery"},{"$ref":"#/components/parameters/OrderQuery"},{"$ref":"#/components/parameters/SearchQuery"},{"$ref":"#/components/parameters/StatusQuery"},{"$ref":"#/components/parameters/FromQuery"},{"$ref":"#/components/parameters/ToQuery"}],"responses":{"200":{"description":"Paginated result","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/Organization"}},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/admin/organizations/{organizationId}/status":{"parameters":[{"$ref":"#/components/parameters/OrganizationIdPath"}],"patch":{"tags":["Admin"],"summary":"Update organization status","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusUpdateRequest"},"example":{"status":"SUSPENDED","reason":"Outstanding compliance issue"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/admin/users":{"get":{"tags":["Admin"],"summary":"List users for admin","parameters":[{"$ref":"#/components/parameters/PageQuery"},{"$ref":"#/components/parameters/LimitQuery"},{"$ref":"#/components/parameters/SortQuery"},{"$ref":"#/components/parameters/OrderQuery"},{"$ref":"#/components/parameters/SearchQuery"},{"$ref":"#/components/parameters/StatusQuery"},{"$ref":"#/components/parameters/FromQuery"},{"$ref":"#/components/parameters/ToQuery"}],"responses":{"200":{"description":"Paginated result","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/User"}},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/admin/users/{userId}/status":{"parameters":[{"$ref":"#/components/parameters/UserIdPath"}],"patch":{"tags":["Admin"],"summary":"Update user status","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusUpdateRequest"},"example":{"status":"SUSPENDED","reason":"Security review"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/admin/audit":{"get":{"tags":["Admin"],"summary":"Get platform audit explorer data","parameters":[{"$ref":"#/components/parameters/PageQuery"},{"$ref":"#/components/parameters/LimitQuery"},{"$ref":"#/components/parameters/SortQuery"},{"$ref":"#/components/parameters/OrderQuery"},{"$ref":"#/components/parameters/SearchQuery"},{"$ref":"#/components/parameters/StatusQuery"},{"$ref":"#/components/parameters/FromQuery"},{"$ref":"#/components/parameters/ToQuery"}],"responses":{"200":{"description":"Paginated result","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/AuditLog"}},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/admin/billing":{"get":{"tags":["Admin"],"summary":"Get billing overview","parameters":[{"$ref":"#/components/parameters/PageQuery"},{"$ref":"#/components/parameters/LimitQuery"},{"$ref":"#/components/parameters/SortQuery"},{"$ref":"#/components/parameters/OrderQuery"},{"$ref":"#/components/parameters/SearchQuery"},{"$ref":"#/components/parameters/StatusQuery"},{"$ref":"#/components/parameters/FromQuery"},{"$ref":"#/components/parameters/ToQuery"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/admin/system-health":{"get":{"tags":["Admin"],"summary":"Get system health dashboard payload","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/HealthStatus"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/health":{"get":{"tags":["Health"],"summary":"Get composite health","security":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/HealthStatus"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"503":{"$ref":"#/components/responses/InternalError"}}}},"/health/db":{"get":{"tags":["Health"],"summary":"Get database health","security":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/HealthStatus"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}}}}},"/health/redis":{"get":{"tags":["Health"],"summary":"Get Redis health","security":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/HealthStatus"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}}}}},"/health/queues":{"get":{"tags":["Health"],"summary":"Get queue health","security":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/HealthStatus"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}}}}},"/version":{"get":{"tags":["Health"],"summary":"Get API version","security":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/GenericResult"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}},"example":{"success":true,"data":{"name":"Synx API","version":"1.0.0","environment":"production"},"meta":{"requestId":"req_123"}}}}}}}},"/employees":{"get":{"tags":["Employees"],"summary":"List employees via public API","parameters":[{"$ref":"#/components/parameters/PageQuery"},{"$ref":"#/components/parameters/LimitQuery"},{"$ref":"#/components/parameters/StatusQuery"}],"responses":{"200":{"description":"Paginated employee result","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/User"}},"pagination":{"type":"object","properties":{"total":{"type":"integer"},"limit":{"type":"integer"},"offset":{"type":"integer"},"hasMore":{"type":"boolean"}}}}}}}}}}},"/time-entries":{"get":{"tags":["Time Tracking"],"summary":"List time entries via public API","parameters":[{"$ref":"#/components/parameters/LimitQuery"},{"$ref":"#/components/parameters/FromQuery"},{"$ref":"#/components/parameters/ToQuery"},{"$ref":"#/components/parameters/StatusQuery"}],"responses":{"200":{"description":"Paginated time entries","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/GenericResult"}},"pagination":{"type":"object","properties":{"total":{"type":"integer"},"limit":{"type":"integer"},"offset":{"type":"integer"},"hasMore":{"type":"boolean"}}}}}}}}}}},"/bank-transactions":{"get":{"tags":["Banking"],"summary":"List bank transactions via public API","parameters":[{"$ref":"#/components/parameters/LimitQuery"},{"$ref":"#/components/parameters/FromQuery"},{"$ref":"#/components/parameters/ToQuery"},{"$ref":"#/components/parameters/StatusQuery"}],"responses":{"200":{"description":"Paginated bank transactions","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/GenericResult"}},"pagination":{"type":"object","properties":{"total":{"type":"integer"},"limit":{"type":"integer"},"offset":{"type":"integer"},"hasMore":{"type":"boolean"}}}}}}}}}}},"/currencies":{"get":{"tags":["Reference"],"summary":"List supported currencies","responses":{"200":{"description":"Currency reference data","content":{"application/json":{"schema":{"type":"object","properties":{"baseCurrency":{"type":"string","example":"EUR"},"supported":{"type":"array","items":{"type":"string"}}}}}}}}}},"/reports/balance-sheet":{"get":{"tags":["Reports"],"summary":"Get balance sheet report","parameters":[{"name":"asOfDate","in":"query","schema":{"type":"string","format":"date-time"},"description":"ISO timestamp used as the report cutoff."}],"responses":{"200":{"description":"Balance sheet","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BalanceSheet"},"example":{"asOfDate":"2026-04-30T23:59:59.000Z","assets":[{"code":"1000","name":"Cash","balance":12000}],"liabilities":[{"code":"2000","name":"VAT payable","balance":3000}],"equity":[{"code":"3000","name":"Retained earnings","balance":9000}],"totals":{"assets":12000,"liabilities":3000,"equity":9000,"liabilitiesAndEquity":12000}}}}}}}},"/bulk":{"post":{"tags":["Bulk"],"summary":"Execute multiple operations in one request","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkRequest"},"example":{"operations":[{"op":"contact.create","data":{"name":"Foo Ltd"}},{"op":"product.update","id":"prd_1","data":{"name":"Updated product"}}]}}}},"responses":{"200":{"description":"Bulk result","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"op":{"type":"string"},"success":{"type":"boolean"},"data":{"$ref":"#/components/schemas/GenericResult"},"error":{"type":"string"}}}},"summary":{"type":"object","properties":{"total":{"type":"integer"},"success":{"type":"integer"},"failed":{"type":"integer"}}}}}}}}}}},"/graphql":{"post":{"tags":["GraphQL"],"summary":"Run simplified query DSL","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GraphqlDslRequest"},"example":{"query":"invoices","filters":{"status":"PAID"},"limit":50,"fields":["id","number","totalCents"]}}}},"responses":{"200":{"description":"Query result","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/GenericResult"}},"count":{"type":"integer"}}}}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Use `Authorization: Bearer <token>`. For public API routes this may also be an API key in Bearer format."}},"parameters":{"OrganizationHeader":{"name":"X-Organization-Id","in":"header","required":false,"schema":{"type":"string"},"description":"Required for tenant-scoped requests when the active organization is not already selected in the current token/session. The value must belong to an organization the caller has membership in.","example":"org_123"},"PageQuery":{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1},"description":"Pagination page number."},"LimitQuery":{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"description":"Page size limit."},"SortQuery":{"name":"sort","in":"query","schema":{"type":"string","default":"createdAt"},"description":"Field name to sort by."},"OrderQuery":{"name":"order","in":"query","schema":{"type":"string","enum":["asc","desc"],"default":"desc"},"description":"Sort direction."},"SearchQuery":{"name":"search","in":"query","schema":{"type":"string"},"description":"Free-text search term."},"StatusQuery":{"name":"status","in":"query","schema":{"type":"string"},"description":"Status filter."},"FromQuery":{"name":"from","in":"query","schema":{"type":"string","format":"date-time"},"description":"Lower inclusive timestamp boundary."},"ToQuery":{"name":"to","in":"query","schema":{"type":"string","format":"date-time"},"description":"Upper inclusive timestamp boundary."},"OrganizationIdPath":{"name":"organizationId","in":"path","required":true,"schema":{"type":"string"}},"MemberIdPath":{"name":"memberId","in":"path","required":true,"schema":{"type":"string"}},"UserIdPath":{"name":"userId","in":"path","required":true,"schema":{"type":"string"}},"RoleIdPath":{"name":"roleId","in":"path","required":true,"schema":{"type":"string"}},"PermissionIdPath":{"name":"permissionId","in":"path","required":true,"schema":{"type":"string"}},"CustomerIdPath":{"name":"customerId","in":"path","required":true,"schema":{"type":"string"}},"ProductIdPath":{"name":"productId","in":"path","required":true,"schema":{"type":"string"}},"ServiceIdPath":{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}},"InvoiceIdPath":{"name":"invoiceId","in":"path","required":true,"schema":{"type":"string"}},"EInvoiceIdPath":{"name":"einvoiceId","in":"path","required":true,"schema":{"type":"string"}},"AccountIdPath":{"name":"accountId","in":"path","required":true,"schema":{"type":"string"}},"EntryIdPath":{"name":"entryId","in":"path","required":true,"schema":{"type":"string"}},"DocumentIdPath":{"name":"documentId","in":"path","required":true,"schema":{"type":"string"}},"RequestIdPath":{"name":"requestId","in":"path","required":true,"schema":{"type":"string"}},"SignatureRequestIdPath":{"name":"requestId","in":"path","required":true,"schema":{"type":"string"}},"NotificationIdPath":{"name":"notificationId","in":"path","required":true,"schema":{"type":"string"}},"MessageIdPath":{"name":"messageId","in":"path","required":true,"schema":{"type":"string"}},"TemplateIdPath":{"name":"templateId","in":"path","required":true,"schema":{"type":"string"}},"QrIdPath":{"name":"qrId","in":"path","required":true,"schema":{"type":"string"}},"BookingIdPath":{"name":"bookingId","in":"path","required":true,"schema":{"type":"string"}},"ResourceIdPath":{"name":"resourceId","in":"path","required":true,"schema":{"type":"string"}},"PosSessionIdPath":{"name":"sessionId","in":"path","required":true,"schema":{"type":"string"}},"PosTransactionIdPath":{"name":"transactionId","in":"path","required":true,"schema":{"type":"string"}},"PaymentIdPath":{"name":"paymentId","in":"path","required":true,"schema":{"type":"string"}},"EndpointIdPath":{"name":"endpointId","in":"path","required":true,"schema":{"type":"string"}},"DeliveryIdPath":{"name":"deliveryId","in":"path","required":true,"schema":{"type":"string"}},"ProviderPath":{"name":"provider","in":"path","required":true,"schema":{"type":"string"}},"ConnectionIdPath":{"name":"connectionId","in":"path","required":true,"schema":{"type":"string"}},"AuditLogIdPath":{"name":"auditLogId","in":"path","required":true,"schema":{"type":"string"}}},"schemas":{"ResponseMeta":{"type":"object","properties":{"requestId":{"type":"string","example":"req_123"},"page":{"type":"integer","example":1},"limit":{"type":"integer","example":25},"total":{"type":"integer","example":120},"totalPages":{"type":"integer","example":5}}},"ErrorEnvelope":{"type":"object","required":["success","error"],"properties":{"success":{"type":"boolean","const":false},"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","example":"VALIDATION_ERROR"},"message":{"type":"string","example":"Invalid request payload"},"details":{"type":"object","additionalProperties":true}}}}},"GenericResult":{"type":"object","additionalProperties":true},"RegisterRequest":{"type":"object","required":["email","password","termsAccepted","privacyAccepted","policyVersion"],"additionalProperties":false,"properties":{"name":{"type":"string","minLength":1,"maxLength":200},"email":{"type":"string","format":"email"},"password":{"type":"string","minLength":8,"maxLength":200},"termsAccepted":{"type":"boolean","const":true},"privacyAccepted":{"type":"boolean","const":true},"policyVersion":{"type":"string","const":"registration:terms=2025-01-01;privacy=2025-01-01"}}},"RegistrationResult":{"type":"object","required":["id","email","organizationId","requiresEmailVerification"],"properties":{"id":{"type":"string"},"email":{"type":"string","format":"email"},"organizationId":{"type":"string"},"requiresEmailVerification":{"type":"boolean","const":true}}},"LoginRequest":{"type":"object","required":["email","password"],"properties":{"email":{"type":"string","format":"email"},"password":{"type":"string"},"organizationId":{"type":"string"}}},"RefreshTokenRequest":{"type":"object","required":["refreshToken"],"properties":{"refreshToken":{"type":"string"}}},"EmailRequest":{"type":"object","required":["email"],"properties":{"email":{"type":"string","format":"email"}}},"ResetPasswordRequest":{"type":"object","required":["token","newPassword"],"properties":{"token":{"type":"string"},"newPassword":{"type":"string","minLength":8}}},"VerifyEmailRequest":{"type":"object","required":["token"],"properties":{"token":{"type":"string"}}},"MfaVerifyRequest":{"type":"object","required":["code"],"properties":{"code":{"type":"string","minLength":6,"maxLength":10}}},"AuthSession":{"type":"object","properties":{"accessToken":{"type":"string"},"refreshToken":{"type":"string"},"activeOrganizationId":{"type":"string"},"roleIds":{"type":"array","items":{"type":"string"}},"permissions":{"type":"array","items":{"type":"string"}},"user":{"$ref":"#/components/schemas/User"}}},"MeContext":{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string","format":"email"},"status":{"type":"string"},"organizations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"role":{"type":"string"}}}}}}}},"MfaSetup":{"type":"object","properties":{"secret":{"type":"string"},"otpauthUrl":{"type":"string"}}},"User":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string","format":"email"},"firstName":{"type":"string"},"lastName":{"type":"string"},"status":{"type":"string","example":"ACTIVE"},"createdAt":{"type":"string","format":"date-time"}}},"UserInput":{"type":"object","properties":{"firstName":{"type":"string"},"lastName":{"type":"string"},"email":{"type":"string","format":"email"}}},"Organization":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"legalName":{"type":"string"},"status":{"type":"string","example":"ACTIVE"},"createdAt":{"type":"string","format":"date-time"}}},"OrganizationInput":{"type":"object","properties":{"name":{"type":"string"},"legalName":{"type":"string"},"taxNumber":{"type":"string"},"email":{"type":"string","format":"email"},"phone":{"type":"string"}}},"InviteRequest":{"type":"object","required":["email","role"],"properties":{"email":{"type":"string","format":"email"},"role":{"type":"string"}}},"UpdateMemberRequest":{"type":"object","properties":{"role":{"type":"string"},"status":{"type":"string"}}},"Role":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"name":{"type":"string"},"permissions":{"type":"array","items":{"type":"string"}}}},"RoleInput":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"permissions":{"type":"array","items":{"type":"string"}}}},"Permission":{"type":"object","properties":{"key":{"type":"string"},"description":{"type":"string"}}},"RolePermissionInput":{"type":"object","required":["permission"],"properties":{"permission":{"type":"string"}}},"Customer":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string","format":"email"},"phone":{"type":"string"},"vatNumber":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}}},"CustomerInput":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string","format":"email"},"phone":{"type":"string"},"vatNumber":{"type":"string"},"address":{"type":"string"}}},"Product":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"unitPrice":{"type":"integer"},"costPrice":{"type":"integer"},"currency":{"type":"string","example":"EUR"}}},"ProductInput":{"type":"object","properties":{"name":{"type":"string"},"sku":{"type":"string"},"unitPrice":{"type":"integer"},"costPrice":{"type":"integer"},"currency":{"type":"string","example":"EUR"}}},"Service":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"unitPrice":{"type":"integer"},"currency":{"type":"string","example":"EUR"}}},"ServiceInput":{"type":"object","properties":{"name":{"type":"string"},"unitPrice":{"type":"integer"},"currency":{"type":"string"}}},"InvoiceLineInput":{"type":"object","required":["description","quantity","unitPrice"],"properties":{"description":{"type":"string"},"quantity":{"type":"number"},"unitPrice":{"type":"integer"}}},"Invoice":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"status":{"type":"string","example":"DRAFT"},"totalCents":{"type":"integer"},"paidCents":{"type":"integer"},"currency":{"type":"string","example":"EUR"},"issueDate":{"type":"string","format":"date-time"},"dueDate":{"type":"string","format":"date-time"}}},"InvoiceInput":{"type":"object","required":["customerId","issueDate","dueDate","lines"],"properties":{"customerId":{"type":"string"},"issueDate":{"type":"string","format":"date-time"},"dueDate":{"type":"string","format":"date-time"},"currency":{"type":"string"},"lines":{"type":"array","items":{"$ref":"#/components/schemas/InvoiceLineInput"}}}},"InvoicePatch":{"type":"object","properties":{"notes":{"type":"string"},"reference":{"type":"string"},"dueDate":{"type":"string","format":"date-time"}}},"MarkPaidRequest":{"type":"object","properties":{"amountCents":{"type":"integer"},"method":{"type":"string"},"date":{"type":"string","format":"date-time"},"reference":{"type":"string"}}},"CancelRequest":{"type":"object","required":["reason"],"properties":{"reason":{"type":"string"}}},"EInvoice":{"type":"object","properties":{"id":{"type":"string"},"invoiceId":{"type":"string"},"provider":{"type":"string"},"status":{"type":"string"}}},"Account":{"type":"object","properties":{"id":{"type":"string"},"code":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"}}},"AccountInput":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"}}},"JournalEntry":{"type":"object","properties":{"id":{"type":"string"},"date":{"type":"string","format":"date"},"reference":{"type":"string"}}},"JournalEntryInput":{"type":"object","properties":{"reference":{"type":"string"},"date":{"type":"string","format":"date"},"lines":{"type":"array","items":{"type":"object","additionalProperties":true}}}},"VatRateInput":{"type":"object","properties":{"name":{"type":"string"},"code":{"type":"string"},"rate":{"type":"number"}}},"VatDeclarationInput":{"type":"object","properties":{"periodFrom":{"type":"string","format":"date"},"periodTo":{"type":"string","format":"date"}}},"Document":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}}},"DocumentInput":{"type":"object","properties":{"name":{"type":"string"},"folderId":{"type":"string"}}},"DocumentVersionInput":{"type":"object","properties":{"notes":{"type":"string"}}},"SignatureRequest":{"type":"object","properties":{"id":{"type":"string"},"subject":{"type":"string"},"status":{"type":"string"}}},"SignatureRequestInput":{"type":"object","properties":{"documentId":{"type":"string"},"subject":{"type":"string"},"recipientEmails":{"type":"array","items":{"type":"string","format":"email"}}}},"SmartIdStartRequest":{"type":"object","properties":{"requestId":{"type":"string"},"recipientId":{"type":"string"},"personalCode":{"type":"string"}}},"MobileIdStartRequest":{"type":"object","properties":{"requestId":{"type":"string"},"recipientId":{"type":"string"},"personalCode":{"type":"string"},"phoneNumber":{"type":"string"}}},"ProviderStatusRequest":{"type":"object","properties":{"requestId":{"type":"string"},"recipientId":{"type":"string"}}},"Notification":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"body":{"type":"string"},"status":{"type":"string"},"channel":{"type":"string"}}},"NotificationInput":{"type":"object","properties":{"userId":{"type":"string"},"title":{"type":"string"},"body":{"type":"string"},"channel":{"type":"string"}}},"NotificationPreferencesInput":{"type":"object","properties":{"email":{"type":"boolean"},"sms":{"type":"boolean"},"push":{"type":"boolean"}}},"EmailMessage":{"type":"object","properties":{"id":{"type":"string"},"to":{"type":"string","format":"email"},"subject":{"type":"string"},"status":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}}},"EmailSendInput":{"type":"object","required":["to"],"properties":{"to":{"type":"array","items":{"type":"string","format":"email"}},"subject":{"type":"string"},"html":{"type":"string","description":"Email body as HTML"},"text":{"type":"string","description":"Optional plain-text fallback"},"replyTo":{"type":"string","format":"email"},"sender":{"type":"string","description":"Explicit sender profile override","enum":["noreply","info","kiri","support","arve","id","palk","teated","raamat"]},"category":{"type":"string","description":"Semantic message category. Used if sender is not provided.","example":"billing.invoice"},"templateId":{"type":"string"},"variables":{"type":"object","additionalProperties":true}}},"EmailTemplateInput":{"type":"object","properties":{"name":{"type":"string"},"subject":{"type":"string"},"html":{"type":"string"}}},"SmsMessage":{"type":"object","properties":{"id":{"type":"string"},"to":{"type":"string"},"body":{"type":"string"},"status":{"type":"string"}}},"SmsSendInput":{"type":"object","properties":{"to":{"type":"string"},"body":{"type":"string"}}},"PushSubscribeInput":{"type":"object","properties":{"endpoint":{"type":"string","format":"uri"},"keys":{"type":"object","additionalProperties":true},"name":{"type":"string"}}},"PushUnsubscribeInput":{"type":"object","properties":{"subscriptionId":{"type":"string"}}},"QrCode":{"type":"object","properties":{"id":{"type":"string"},"targetType":{"type":"string"},"targetId":{"type":"string"},"payload":{"type":"string"}}},"QrInput":{"type":"object","properties":{"targetType":{"type":"string"},"targetId":{"type":"string"},"payload":{"type":"string"}}},"Booking":{"type":"object","properties":{"id":{"type":"string"},"resourceId":{"type":"string","nullable":true,"maxLength":191},"customerId":{"type":"string","nullable":true,"maxLength":191,"description":"Active client Contact ID in the authenticated organization"},"title":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","nullable":true,"maxLength":2000},"startsAt":{"type":"string","format":"date-time","description":"ISO instant with UTC or explicit offset"},"endsAt":{"type":"string","format":"date-time","description":"Must be strictly after startsAt"},"timezone":{"type":"string","default":"Europe/Tallinn","description":"Valid IANA timezone"},"location":{"type":"string","nullable":true,"maxLength":255},"notes":{"type":"string","nullable":true,"maxLength":4000},"metadata":{"type":"object","nullable":true,"additionalProperties":true},"organizationId":{"type":"string"},"resourceName":{"type":"string","nullable":true},"customerName":{"type":"string","nullable":true},"updatedAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["DRAFT","CONFIRMED","COMPLETED","CANCELLED","NO_SHOW"]}}},"BookingInput":{"type":"object","additionalProperties":false,"required":["title","startsAt","endsAt"],"properties":{"resourceId":{"type":"string","nullable":true,"maxLength":191},"customerId":{"type":"string","nullable":true,"maxLength":191,"description":"Active client Contact ID in the authenticated organization"},"title":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","nullable":true,"maxLength":2000},"startsAt":{"type":"string","format":"date-time","description":"ISO instant with UTC or explicit offset"},"endsAt":{"type":"string","format":"date-time","description":"Must be strictly after startsAt"},"timezone":{"type":"string","default":"Europe/Tallinn","description":"Valid IANA timezone"},"location":{"type":"string","nullable":true,"maxLength":255},"notes":{"type":"string","nullable":true,"maxLength":4000},"metadata":{"type":"object","nullable":true,"additionalProperties":true},"status":{"type":"string","enum":["DRAFT","CONFIRMED"],"default":"DRAFT"}}},"BookingUpdateInput":{"type":"object","additionalProperties":false,"properties":{"resourceId":{"type":"string","nullable":true,"maxLength":191},"customerId":{"type":"string","nullable":true,"maxLength":191,"description":"Active client Contact ID in the authenticated organization"},"title":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","nullable":true,"maxLength":2000},"startsAt":{"type":"string","format":"date-time","description":"ISO instant with UTC or explicit offset"},"endsAt":{"type":"string","format":"date-time","description":"Must be strictly after startsAt"},"timezone":{"type":"string","default":"Europe/Tallinn","description":"Valid IANA timezone"},"location":{"type":"string","nullable":true,"maxLength":255},"notes":{"type":"string","nullable":true,"maxLength":4000},"metadata":{"type":"object","nullable":true,"additionalProperties":true},"status":{"type":"string","enum":["DRAFT","CONFIRMED","COMPLETED","CANCELLED","NO_SHOW"]},"expectedUpdatedAt":{"type":"string","format":"date-time"}}},"BookingResourceInput":{"type":"object","additionalProperties":false,"required":["name","type"],"properties":{"name":{"type":"string","minLength":1,"maxLength":200},"code":{"type":"string","nullable":true,"maxLength":100},"type":{"type":"string","minLength":1,"maxLength":100},"location":{"type":"string","nullable":true,"maxLength":255},"capacity":{"type":"integer","nullable":true,"minimum":1,"maximum":100000,"description":"Informational only; reservations are exclusive, regardless of capacity"},"isActive":{"type":"boolean","default":true},"metadata":{"type":"object","nullable":true,"additionalProperties":true}}},"BookingResourceUpdateInput":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string","minLength":1,"maxLength":200},"code":{"type":"string","nullable":true,"maxLength":100},"type":{"type":"string","minLength":1,"maxLength":100},"location":{"type":"string","nullable":true,"maxLength":255},"capacity":{"type":"integer","nullable":true,"minimum":1,"maximum":100000,"description":"Informational only; reservations are exclusive, regardless of capacity"},"isActive":{"type":"boolean","default":true},"metadata":{"type":"object","nullable":true,"additionalProperties":true},"expectedUpdatedAt":{"type":"string","format":"date-time"}}},"PosSession":{"type":"object","properties":{"id":{"type":"string"},"terminalId":{"type":"string"},"status":{"type":"string"}}},"PosSessionInput":{"type":"object","properties":{"terminalId":{"type":"string"}}},"PosTransaction":{"type":"object","properties":{"id":{"type":"string"},"sessionId":{"type":"string"},"amount":{"type":"integer"},"type":{"type":"string"},"method":{"type":"string"}}},"PosTransactionInput":{"type":"object","properties":{"sessionId":{"type":"string"},"amount":{"type":"integer"},"type":{"type":"string"},"method":{"type":"string"}}},"Payment":{"type":"object","properties":{"id":{"type":"string"},"invoiceId":{"type":"string"},"amount":{"type":"integer"},"currency":{"type":"string"},"status":{"type":"string"}}},"PaymentIntentInput":{"type":"object","properties":{"invoiceId":{"type":"string"},"amount":{"type":"integer"},"currency":{"type":"string"}}},"PaymentConfirmInput":{"type":"object","properties":{"paymentIntentId":{"type":"string"}}},"RefundInput":{"type":"object","properties":{"amount":{"type":"integer"},"reason":{"type":"string"}}},"Plan":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"amount":{"type":"integer"},"interval":{"type":"string"}}},"Subscription":{"type":"object","properties":{"id":{"type":"string"},"planId":{"type":"string"},"status":{"type":"string"},"interval":{"type":"string"}}},"SubscriptionInput":{"type":"object","properties":{"planId":{"type":"string"},"interval":{"type":"string","enum":["month","year"]}}},"WebhookEndpoint":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string","format":"uri"},"event":{"type":"string"},"active":{"type":"boolean"}}},"WebhookEndpointInput":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"event":{"type":"string"},"active":{"type":"boolean"}}},"IntegrationConnection":{"type":"object","properties":{"id":{"type":"string"},"provider":{"type":"string"},"status":{"type":"string"},"verificationState":{"type":"string","enum":["VERIFIED","CONFIGURED_UNVERIFIED","ERROR","BLOCKED"]},"verified":{"type":"boolean"},"lastSyncAt":{"type":"string","format":"date-time"},"lastHealthCheckAt":{"type":"string","format":"date-time"},"lastError":{"type":"string"}}},"IntegrationConnectInput":{"type":"object","properties":{"provider":{"type":"string"},"credentials":{"type":"object","additionalProperties":true}}},"AuditLog":{"type":"object","properties":{"id":{"type":"string"},"action":{"type":"string"},"actorId":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"metadata":{"type":"object","additionalProperties":true}}},"StatusUpdateRequest":{"type":"object","required":["status","reason"],"properties":{"status":{"type":"string"},"reason":{"type":"string"}}},"HealthStatus":{"type":"object","properties":{"status":{"type":"string","example":"ok"},"database":{"type":"string","example":"connected"},"redis":{"type":"string","example":"connected"},"queues":{"type":"object","additionalProperties":true},"version":{"type":"string","example":"1.0.0"}}},"BalanceSheet":{"type":"object","properties":{"asOfDate":{"type":"string","format":"date-time"},"assets":{"type":"array","items":{"type":"object","additionalProperties":true}},"liabilities":{"type":"array","items":{"type":"object","additionalProperties":true}},"equity":{"type":"array","items":{"type":"object","additionalProperties":true}},"totals":{"type":"object","properties":{"assets":{"type":"number"},"liabilities":{"type":"number"},"equity":{"type":"number"},"liabilitiesAndEquity":{"type":"number"}}}}},"BulkRequest":{"type":"object","properties":{"operations":{"type":"array","items":{"type":"object","properties":{"op":{"type":"string"},"id":{"type":"string"},"data":{"type":"object","additionalProperties":true}}}}}},"GraphqlDslRequest":{"type":"object","properties":{"query":{"type":"string"},"filters":{"type":"object","additionalProperties":true},"limit":{"type":"integer"},"offset":{"type":"integer"},"fields":{"type":"array","items":{"type":"string"}},"orderBy":{"type":"string"},"orderDir":{"type":"string","enum":["asc","desc"]}}}},"responses":{"ValidationError":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"},"example":{"success":false,"error":{"code":"VALIDATION_ERROR","message":"Invalid request payload","details":{"issues":{"email":["Required"]}}}}}}},"Unauthorized":{"description":"Missing or invalid bearer token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"},"example":{"success":false,"error":{"code":"UNAUTHORIZED","message":"Authentication required"}}}}},"Forbidden":{"description":"Authenticated but not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"},"example":{"success":false,"error":{"code":"FORBIDDEN","message":"Insufficient permissions for this organization"}}}}},"NotFound":{"description":"Entity not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"},"example":{"success":false,"error":{"code":"NOT_FOUND","message":"Requested resource was not found"}}}}},"Conflict":{"description":"State conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"},"example":{"success":false,"error":{"code":"CONFLICT","message":"Current resource state does not allow this operation"}}}}},"RateLimited":{"description":"Too many requests","headers":{"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"},"example":{"success":false,"error":{"code":"RATE_LIMITED","message":"Too many requests. Please try again later."}}}}},"InternalError":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"},"example":{"success":false,"error":{"code":"INTERNAL_ERROR","message":"Something went wrong"}}}}},"EidSigningNotReady":{"description":"Smart-ID and Mobile-ID signing are unavailable until the ASiC-E evidence pipeline is ready","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"},"example":{"success":false,"error":{"code":"EID_SIGNING_NOT_READY","message":"Smart-ID/Mobile-ID signing is temporarily unavailable"}}}}}}}}