{
  "openapi": "3.0.0",
  "info": {
    "title": "Fintech API",
    "version": "1.0.0"
  },
  "paths": {
    "/v1/audit/engagement": {
      "post": {
        "operationId": "postAuditEngagement",
        "tags": [
          "audit"
        ],
        "summary": "Create a new audit engagement for an organization. Requires organization_id, auditor_org_id, and fiscal_year.",
        "description": "Create a new audit engagement for an organization. Requires organization_id, auditor_org_id, and fiscal_year.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateEngagementRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateEngagementResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/audit/engagements": {
      "get": {
        "operationId": "getAuditEngagements",
        "tags": [
          "audit"
        ],
        "summary": "List audit engagements. Requires organization_id or auditor_org_id as query params.",
        "description": "List audit engagements. Requires organization_id or auditor_org_id as query params.",
        "parameters": [
          {
            "name": "auditor_org_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organization_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListEngagementsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-query-requirements": {
          "anyOf": [
            [
              "auditor_org_id",
              "organization_id"
            ]
          ]
        }
      }
    },
    "/v1/audit/flag-record": {
      "post": {
        "operationId": "postAuditFlagRecord",
        "tags": [
          "audit"
        ],
        "summary": "Flag a financial record for audit review. Requires engagement_id, record_type, record_id, and issue_type.",
        "description": "Flag a financial record for audit review. Requires engagement_id, record_type, record_id, and issue_type.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FlagRecordRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlagRecordResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/billing/cancel-subscription": {
      "post": {
        "operationId": "postBillingCancelSubscription",
        "tags": [
          "billing"
        ],
        "summary": "Cancel subscription immediately or at period end.",
        "description": "Cancel subscription immediately or at period end.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CancelSubscriptionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CancelSubscriptionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/billing/checkout": {
      "post": {
        "operationId": "postBillingCheckout",
        "tags": [
          "billing"
        ],
        "summary": "Create provider checkout session for billing.",
        "description": "Create provider checkout session for billing.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCheckoutSessionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateCheckoutSessionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/billing/confirm-payment": {
      "post": {
        "operationId": "postBillingConfirmPayment",
        "tags": [
          "billing"
        ],
        "summary": "Confirm and reconcile a payment reference/session.",
        "description": "Confirm and reconcile a payment reference/session.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConfirmPaymentRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConfirmPaymentResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/billing/invoices": {
      "post": {
        "operationId": "postBillingInvoices",
        "tags": [
          "billing"
        ],
        "summary": "List invoices for workspace billing account.",
        "description": "List invoices for workspace billing account.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ListInvoicesRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListInvoicesResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/billing/payment-method": {
      "post": {
        "operationId": "postBillingPaymentMethod",
        "tags": [
          "billing"
        ],
        "summary": "Update provider payment method reference.",
        "description": "Update provider payment method reference.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePaymentMethodRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdatePaymentMethodResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/billing/quote": {
      "post": {
        "operationId": "postBillingQuote",
        "tags": [
          "billing"
        ],
        "summary": "Generate a billing quote for a plan and cycle.",
        "description": "Generate a billing quote for a plan and cycle.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GetQuoteRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetQuoteResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/billing/refresh-entitlement": {
      "post": {
        "operationId": "postBillingRefreshEntitlement",
        "tags": [
          "billing"
        ],
        "summary": "Refresh workspace entitlement from billing state.",
        "description": "Refresh workspace entitlement from billing state.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RefreshEntitlementRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RefreshEntitlementResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/billing/subscription": {
      "post": {
        "operationId": "postBillingSubscription",
        "tags": [
          "billing"
        ],
        "summary": "Get billing account, subscription, and entitlement for a workspace.",
        "description": "Get billing account, subscription, and entitlement for a workspace.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GetSubscriptionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetSubscriptionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/billing/transfer-payer": {
      "post": {
        "operationId": "postBillingTransferPayer",
        "tags": [
          "billing"
        ],
        "summary": "Transfer organization payer ownership.",
        "description": "Transfer organization payer ownership.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TransferPayerRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransferPayerResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/billing/webhooks/paystack": {
      "post": {
        "operationId": "postBillingWebhooksPaystack",
        "tags": [
          "billing"
        ],
        "summary": "Handle Paystack webhook events.",
        "description": "Handle Paystack webhook events. Signature header: `x-paystack-signature`. Reference: https://paystack.com/docs/payments/webhooks/.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaystackWebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardSuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/v1/billing/webhooks/stripe": {
      "post": {
        "operationId": "postBillingWebhooksStripe",
        "tags": [
          "billing"
        ],
        "summary": "Handle Stripe webhook events.",
        "description": "Handle Stripe webhook events. Signature header: `Stripe-Signature`. Reference: https://docs.stripe.com/webhooks.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StripeWebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardSuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/v1/budget/create": {
      "post": {
        "operationId": "postBudgetCreate",
        "tags": [
          "budget"
        ],
        "summary": "Create a new budget for a profile. Requires profile_public_id, name, period_start, period_end.",
        "description": "Create a new budget for a profile. Requires profile_public_id, name, period_start, period_end.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateBudgetRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateBudgetResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/budget/delete": {
      "delete": {
        "operationId": "deleteBudgetDelete",
        "tags": [
          "budget"
        ],
        "summary": "Delete a budget and all its envelopes. Requires public_id and profile_public_id.",
        "description": "Delete a budget and all its envelopes. Requires public_id and profile_public_id.",
        "parameters": [
          {
            "name": "profile_public_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "public_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteBudgetResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-query-requirements": {
          "required": [
            "profile_public_id",
            "public_id"
          ]
        }
      }
    },
    "/v1/budget/envelope/create": {
      "post": {
        "operationId": "postBudgetEnvelopeCreate",
        "tags": [
          "budget"
        ],
        "summary": "Create a new envelope in a budget. Requires budget_public_id, profile_public_id, name.",
        "description": "Create a new envelope in a budget. Requires budget_public_id, profile_public_id, name.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateEnvelopeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateEnvelopeResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/budget/envelope/delete": {
      "delete": {
        "operationId": "deleteBudgetEnvelopeDelete",
        "tags": [
          "budget"
        ],
        "summary": "Delete an envelope. Requires public_id and profile_public_id.",
        "description": "Delete an envelope. Requires public_id and profile_public_id.",
        "parameters": [
          {
            "name": "profile_public_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "public_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteEnvelopeResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-query-requirements": {
          "required": [
            "profile_public_id",
            "public_id"
          ]
        }
      }
    },
    "/v1/budget/envelope/reorder": {
      "put": {
        "operationId": "putBudgetEnvelopeReorder",
        "tags": [
          "budget"
        ],
        "summary": "Reorder envelopes by priority. Requires budget_public_id, profile_public_id, envelope_public_ids (ordered list).",
        "description": "Reorder envelopes by priority. Requires budget_public_id, profile_public_id, envelope_public_ids (ordered list).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReorderEnvelopesRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReorderEnvelopesResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/budget/envelope/transaction": {
      "post": {
        "operationId": "postBudgetEnvelopeTransaction",
        "tags": [
          "budget"
        ],
        "summary": "Record a transaction (fund/spend/refund) on an envelope. Requires envelope_public_id, profile_public_id, amount, transaction_type.",
        "description": "Record a transaction (fund/spend/refund) on an envelope. Requires envelope_public_id, profile_public_id, amount, transaction_type.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RecordEnvelopeTransactionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordEnvelopeTransactionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/budget/envelope/update": {
      "put": {
        "operationId": "putBudgetEnvelopeUpdate",
        "tags": [
          "budget"
        ],
        "summary": "Update an existing envelope. Requires public_id and profile_public_id.",
        "description": "Update an existing envelope. Requires public_id and profile_public_id.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateEnvelopeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateEnvelopeResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/budget/summary": {
      "get": {
        "operationId": "getBudgetSummary",
        "tags": [
          "budget"
        ],
        "summary": "Get budget summary for a profile. Requires profile_public_id. Optional: period_start, period_end.",
        "description": "Get budget summary for a profile. Requires profile_public_id. Optional: period_start, period_end.",
        "parameters": [
          {
            "name": "profile_public_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "period_end",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "period_start",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetBudgetSummaryResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-query-requirements": {
          "required": [
            "profile_public_id"
          ]
        }
      }
    },
    "/v1/budget/update": {
      "put": {
        "operationId": "putBudgetUpdate",
        "tags": [
          "budget"
        ],
        "summary": "Update an existing budget. Requires public_id and profile_public_id.",
        "description": "Update an existing budget. Requires public_id and profile_public_id.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateBudgetRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateBudgetResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/business/account": {
      "post": {
        "operationId": "postBusinessAccount",
        "tags": [
          "business"
        ],
        "summary": "Create a business account",
        "description": "Create a business account",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAccountRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateAccountResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/business/accounts": {
      "get": {
        "operationId": "getBusinessAccounts",
        "tags": [
          "business"
        ],
        "summary": "List accounts for a business organization. Requires organization_id.",
        "description": "List accounts for a business organization. Requires organization_id.",
        "parameters": [
          {
            "name": "organization_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListAccountsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-query-requirements": {
          "required": [
            "organization_id"
          ]
        }
      }
    },
    "/v1/business/activity": {
      "get": {
        "operationId": "getBusinessActivity",
        "tags": [
          "business"
        ],
        "summary": "List scoped business activity derived from journal history. Requires organization_id. Optional: page_size, page_token.",
        "description": "List scoped business activity derived from journal history. Requires organization_id. Optional: page_size, page_token.",
        "parameters": [
          {
            "name": "organization_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListBusinessActivityResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-query-requirements": {
          "required": [
            "organization_id"
          ]
        }
      }
    },
    "/v1/business/contact": {
      "post": {
        "operationId": "postBusinessContact",
        "tags": [
          "business"
        ],
        "summary": "Create a business contact",
        "description": "Create a business contact",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateContactRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateContactResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/business/contacts": {
      "get": {
        "operationId": "getBusinessContacts",
        "tags": [
          "business"
        ],
        "summary": "List business contacts",
        "description": "List business contacts",
        "parameters": [
          {
            "name": "organization_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListContactsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-query-requirements": {
          "required": [
            "organization_id"
          ]
        }
      }
    },
    "/v1/business/context/switch": {
      "post": {
        "operationId": "postBusinessContextSwitch",
        "tags": [
          "business"
        ],
        "summary": "Switch active context",
        "description": "Switch active context",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SwitchContextRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SwitchContextResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/business/inventory": {
      "put": {
        "operationId": "putBusinessInventory",
        "tags": [
          "business"
        ],
        "summary": "Update inventory for a business organization. Requires organization_id, item_id, and quantity_change.",
        "description": "Update inventory for a business organization. Requires organization_id, item_id, and quantity_change.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateInventoryRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateInventoryResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/business/inventory/delete": {
      "delete": {
        "operationId": "deleteBusinessInventoryDelete",
        "tags": [
          "business"
        ],
        "summary": "Delete inventory item",
        "description": "Delete inventory item",
        "parameters": [
          {
            "name": "item_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organization_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteInventoryItemResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-query-requirements": {
          "required": [
            "item_id",
            "organization_id"
          ]
        }
      }
    },
    "/v1/business/inventory/list": {
      "get": {
        "operationId": "getBusinessInventoryList",
        "tags": [
          "business"
        ],
        "summary": "List inventory",
        "description": "List inventory",
        "parameters": [
          {
            "name": "organization_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListInventoryResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-query-requirements": {
          "required": [
            "organization_id"
          ]
        }
      }
    },
    "/v1/business/journal-entry": {
      "post": {
        "operationId": "postBusinessJournalEntry",
        "tags": [
          "business"
        ],
        "summary": "Post a journal entry",
        "description": "Post a journal entry",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PostJournalEntryRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostJournalEntryResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/business/journal/bill/payment": {
      "post": {
        "operationId": "postBusinessJournalBillPayment",
        "tags": [
          "business"
        ],
        "summary": "Record a bill payment settlement. Requires organization_id and bill_entry_id.",
        "description": "Record a bill payment settlement. Requires organization_id and bill_entry_id.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RecordBillPaymentRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordBillPaymentResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/business/journal/entries": {
      "get": {
        "operationId": "getBusinessJournalEntries",
        "tags": [
          "business"
        ],
        "summary": "List journal entries for a business organization. Requires organization_id.",
        "description": "List journal entries for a business organization. Requires organization_id.",
        "parameters": [
          {
            "name": "organization_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "end_date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "start_date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListJournalEntriesResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-query-requirements": {
          "required": [
            "organization_id"
          ]
        }
      }
    },
    "/v1/business/journal/entry": {
      "put": {
        "operationId": "putBusinessJournalEntry",
        "tags": [
          "business"
        ],
        "summary": "Update a journal entry. Requires organization_id and entry_id.",
        "description": "Update a journal entry. Requires organization_id and entry_id.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateJournalEntryRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateJournalEntryResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/business/journal/history": {
      "get": {
        "operationId": "getBusinessJournalHistory",
        "tags": [
          "business"
        ],
        "summary": "List journal entry history. Requires organization_id. Optional: entry_id, page_size, page_token.",
        "description": "List journal entry history. Requires organization_id. Optional: entry_id, page_size, page_token.",
        "parameters": [
          {
            "name": "organization_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "entry_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListJournalEntryHistoryResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-query-requirements": {
          "required": [
            "organization_id"
          ]
        }
      }
    },
    "/v1/business/journal/invoice/receipt": {
      "post": {
        "operationId": "postBusinessJournalInvoiceReceipt",
        "tags": [
          "business"
        ],
        "summary": "Record an invoice receipt settlement. Requires organization_id and invoice_entry_id.",
        "description": "Record an invoice receipt settlement. Requires organization_id and invoice_entry_id.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RecordInvoiceReceiptRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordInvoiceReceiptResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/business/member/add": {
      "post": {
        "operationId": "postBusinessMemberAdd",
        "tags": [
          "business"
        ],
        "summary": "Add a member to a business organization. Requires organization_id and user_id.",
        "description": "Add a member to a business organization. Requires organization_id and user_id.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddMemberRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddMemberResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/business/member/delete": {
      "post": {
        "operationId": "postBusinessMemberDelete",
        "tags": [
          "business"
        ],
        "summary": "Delete a member from a business organization. Requires organization_id and user_id.",
        "description": "Delete a member from a business organization. Requires organization_id and user_id.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeleteMemberRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteMemberResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/business/members": {
      "get": {
        "operationId": "getBusinessMembers",
        "tags": [
          "business"
        ],
        "summary": "List members of a business organization. Requires organization_id.",
        "description": "List members of a business organization. Requires organization_id.",
        "parameters": [
          {
            "name": "organization_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListMembersResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-query-requirements": {
          "required": [
            "organization_id"
          ]
        }
      }
    },
    "/v1/business/organization": {
      "post": {
        "operationId": "postBusinessOrganization",
        "tags": [
          "business"
        ],
        "summary": "Create a new business organization. Requires name, type, and region.",
        "description": "Create a new business organization. Requires name, type, and region.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateOrganizationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateOrganizationResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/business/organization/get": {
      "get": {
        "operationId": "getBusinessOrganizationGet",
        "tags": [
          "business"
        ],
        "summary": "Get details of a business organization. Requires organization_id.",
        "description": "Get details of a business organization. Requires organization_id.",
        "parameters": [
          {
            "name": "organization_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetOrganizationResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-query-requirements": {
          "required": [
            "organization_id"
          ]
        }
      }
    },
    "/v1/business/payroll": {
      "get": {
        "operationId": "getBusinessPayroll",
        "tags": [
          "business"
        ],
        "summary": "List payroll runs",
        "description": "List payroll runs",
        "parameters": [
          {
            "name": "organization_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "page_token",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListPayrollRunsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-query-requirements": {
          "required": [
            "organization_id"
          ]
        }
      }
    },
    "/v1/business/payroll/estimate": {
      "post": {
        "operationId": "postBusinessPayrollEstimate",
        "tags": [
          "business"
        ],
        "summary": "Estimate payroll taxes for a business organization. Requires organization_id and employee details.",
        "description": "Estimate payroll taxes for a business organization. Requires organization_id and employee details.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EstimatePayrollRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EstimatePayrollResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/business/payroll/run": {
      "post": {
        "operationId": "postBusinessPayrollRun",
        "tags": [
          "business"
        ],
        "summary": "Run payroll for a business organization. Requires organization_id, period_start, and period_end.",
        "description": "Run payroll for a business organization. Requires organization_id, period_start, and period_end.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RunPayrollRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunPayrollResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/compliance/check-tcc": {
      "post": {
        "operationId": "postComplianceCheckTcc",
        "tags": [
          "compliance"
        ],
        "summary": "Check the status of a Tax Clearance Certificate (TCC).",
        "description": "Check the status of a Tax Clearance Certificate (TCC).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CheckTCCRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckTCCResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/compliance/file-return": {
      "post": {
        "operationId": "postComplianceFileReturn",
        "tags": [
          "compliance"
        ],
        "summary": "File a tax return for a specific period and filing type.",
        "description": "File a tax return for a specific period and filing type.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FileReturnRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileReturnResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/compliance/verify-tin": {
      "post": {
        "operationId": "postComplianceVerifyTin",
        "tags": [
          "compliance"
        ],
        "summary": "Verify a Tax Identification Number (TIN) with the relevant authority.",
        "description": "Verify a Tax Identification Number (TIN) with the relevant authority.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VerifyTINRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VerifyTINResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/finance/receipt/upload": {
      "post": {
        "operationId": "postFinanceReceiptUpload",
        "tags": [
          "finance"
        ],
        "summary": "Upload a receipt for a transaction. Requires multipart/form-data.",
        "description": "Upload a receipt for a transaction. Requires multipart/form-data.",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardSuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/finance/summary": {
      "get": {
        "operationId": "getFinanceSummary",
        "tags": [
          "finance"
        ],
        "summary": "Get financial summary for a period. Requires period_start and period_end.",
        "description": "Get financial summary for a period. Requires period_start and period_end.",
        "parameters": [
          {
            "name": "period_end",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "period_start",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organization_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profile_public_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user_public_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetFinancialSummaryResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-query-requirements": {
          "required": [
            "period_end",
            "period_start"
          ]
        }
      }
    },
    "/v1/finance/transaction": {
      "post": {
        "operationId": "postFinanceTransaction",
        "tags": [
          "finance"
        ],
        "summary": "Create a new financial transaction (income/expense). Requires amount, type, and category.",
        "description": "Create a new financial transaction (income/expense). Requires amount, type, and category.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTransactionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateTransactionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/media/analyze": {
      "post": {
        "operationId": "postMediaAnalyze",
        "tags": [
          "media"
        ],
        "summary": "Analyze an uploaded document. Supports optional pdf_password for encrypted PDFs.",
        "description": "Analyze an uploaded document. Supports optional pdf_password for encrypted PDFs.",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardSuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/media/batch/upload": {
      "post": {
        "operationId": "postMediaBatchUpload",
        "tags": [
          "media"
        ],
        "summary": "Batch upload multiple financial documents for processing. Requires multipart/form-data with 'files' field.",
        "description": "Batch upload multiple financial documents for processing. Requires multipart/form-data with 'files' field.",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardSuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/media/document/": {
      "get": {
        "operationId": "getMediaDocument",
        "tags": [
          "media"
        ],
        "summary": "GET: view a stored media document by public ID. POST /{id}/unlock: unlock encrypted PDF and requeue analysis.",
        "description": "GET: view a stored media document by public ID. POST /{id}/unlock: unlock encrypted PDF and requeue analysis.",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardSuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/media/entry": {
      "post": {
        "operationId": "postMediaEntry",
        "tags": [
          "media"
        ],
        "summary": "Create a financial entry (income/expense/journal) from an analyzed document.",
        "description": "Create a financial entry (income/expense/journal) from an analyzed document.",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardSuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/media/files/": {
      "get": {
        "operationId": "getMediaFiles",
        "tags": [
          "media"
        ],
        "summary": "View a stored file by storage path URL. Supports personal and organization context with permission checks.",
        "description": "View a stored file by storage path URL. Supports personal and organization context with permission checks.",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardSuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/media/receipts/": {
      "get": {
        "operationId": "getMediaReceipts",
        "tags": [
          "media"
        ],
        "summary": "Legacy alias for stored file path lookups. Requires authenticated access and permission checks.",
        "description": "Legacy alias for stored file path lookups. Requires authenticated access and permission checks.",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardSuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/media/status": {
      "post": {
        "operationId": "postMediaStatus",
        "tags": [
          "media"
        ],
        "summary": "Retrieve processing status for uploaded documents (analysis, review, and entry creation state).",
        "description": "Retrieve processing status for uploaded documents (analysis, review, and entry creation state).",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedResult"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/media/train": {
      "post": {
        "operationId": "postMediaTrain",
        "tags": [
          "media"
        ],
        "summary": "Train the document classifier with user feedback on document type and content.",
        "description": "Train the document classifier with user feedback on document type and content.",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardSuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/media/train/dataset": {
      "post": {
        "operationId": "postMediaTrainDataset",
        "tags": [
          "media"
        ],
        "summary": "Trigger training from a dataset directory (server-side path).",
        "description": "Trigger training from a dataset directory (server-side path).",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardSuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/media/train/upload": {
      "post": {
        "operationId": "postMediaTrainUpload",
        "tags": [
          "media"
        ],
        "summary": "Upload a zip file or multiple JSON files for training.",
        "description": "Upload a zip file or multiple JSON files for training.",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardSuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/media/upload": {
      "post": {
        "operationId": "postMediaUpload",
        "tags": [
          "media"
        ],
        "summary": "Upload a financial document (receipt, invoice, etc.) for processing. Requires multipart/form-data.",
        "description": "Upload a financial document (receipt, invoice, etc.) for processing. Requires multipart/form-data.",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/UploadDocumentRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UploadDocumentResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sensor/generate-qr": {
      "post": {
        "operationId": "postSensorGenerateQr",
        "tags": [
          "sensor"
        ],
        "summary": "Generate a transport-safe QR payload for a sensor request.",
        "description": "Generate a transport-safe QR payload for a sensor request.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateQrPayloadRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenerateQrPayloadResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sensor/issue-challenge": {
      "post": {
        "operationId": "postSensorIssueChallenge",
        "tags": [
          "sensor"
        ],
        "summary": "Issue a short-lived challenge for a target sensor action.",
        "description": "Issue a short-lived challenge for a target sensor action.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IssueChallengeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IssueChallengeResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sensor/redeem-invite": {
      "post": {
        "operationId": "postSensorRedeemInvite",
        "tags": [
          "sensor"
        ],
        "summary": "Redeem a signed sensor invite payload for organization membership.",
        "description": "Redeem a signed sensor invite payload for organization membership.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RedeemInviteRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RedeemInviteResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sensor/register-device": {
      "post": {
        "operationId": "postSensorRegisterDevice",
        "tags": [
          "sensor"
        ],
        "summary": "Register or update a trusted device for sensor communication.",
        "description": "Register or update a trusted device for sensor communication.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterDeviceRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegisterDeviceResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sensor/resolve-request": {
      "post": {
        "operationId": "postSensorResolveRequest",
        "tags": [
          "sensor"
        ],
        "summary": "Resolve a verified sensor request and optionally dispatch its target event.",
        "description": "Resolve a verified sensor request and optionally dispatch its target event.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResolveSensorCommand"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResolveSensorResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sensor/revoke-device": {
      "post": {
        "operationId": "postSensorRevokeDevice",
        "tags": [
          "sensor"
        ],
        "summary": "Revoke a device and invalidate active challenges/keys.",
        "description": "Revoke a device and invalidate active challenges/keys.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RevokeDeviceRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RevokeDeviceResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sensor/rotate-device-key": {
      "post": {
        "operationId": "postSensorRotateDeviceKey",
        "tags": [
          "sensor"
        ],
        "summary": "Rotate the active key used for sensor proof generation on a device.",
        "description": "Rotate the active key used for sensor proof generation on a device.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RotateDeviceKeyRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RotateDeviceKeyResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sensor/scan-qr": {
      "post": {
        "operationId": "postSensorScanQr",
        "tags": [
          "sensor"
        ],
        "summary": "Decode and validate a scanned sensor QR payload.",
        "description": "Decode and validate a scanned sensor QR payload.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScanQrPayloadRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScanQrPayloadResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sensor/submit-request": {
      "post": {
        "operationId": "postSensorSubmitRequest",
        "tags": [
          "sensor"
        ],
        "summary": "Submit a sensor-originated request for verification and processing.",
        "description": "Submit a sensor-originated request for verification and processing.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SubmitSensorCommand"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubmitSensorResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sensor/verify-request": {
      "post": {
        "operationId": "postSensorVerifyRequest",
        "tags": [
          "sensor"
        ],
        "summary": "Verify a previously submitted sensor request.",
        "description": "Verify a previously submitted sensor request.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VerifySensorCommand"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VerifySensorResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/tax/business/liability": {
      "post": {
        "operationId": "postTaxBusinessLiability",
        "tags": [
          "tax"
        ],
        "summary": "Calculate estimated tax liability for a business organization.",
        "description": "Calculate estimated tax liability for a business organization.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CalculateBusinessLiabilityRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalculateBusinessLiabilityResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/tax/expense": {
      "post": {
        "operationId": "postTaxExpense",
        "tags": [
          "tax"
        ],
        "summary": "Create a new expense entry for a tax profile. Requires profile_public_id, amount, and transaction_date.",
        "description": "Create a new expense entry for a tax profile. Requires profile_public_id, amount, and transaction_date.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateExpenseEntryRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateExpenseEntryResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/tax/expense/delete": {
      "delete": {
        "operationId": "deleteTaxExpenseDelete",
        "tags": [
          "tax"
        ],
        "summary": "Delete an expense entry. Requires public_id and profile_public_id.",
        "description": "Delete an expense entry. Requires public_id and profile_public_id.",
        "parameters": [
          {
            "name": "profile_public_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "public_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteExpenseEntryResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-query-requirements": {
          "required": [
            "profile_public_id",
            "public_id"
          ]
        }
      }
    },
    "/v1/tax/expense/update": {
      "put": {
        "operationId": "putTaxExpenseUpdate",
        "tags": [
          "tax"
        ],
        "summary": "Update an existing expense entry. Requires public_id and profile_public_id.",
        "description": "Update an existing expense entry. Requires public_id and profile_public_id.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateExpenseEntryRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateExpenseEntryResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/tax/income": {
      "post": {
        "operationId": "postTaxIncome",
        "tags": [
          "tax"
        ],
        "summary": "Create a new income entry for a tax profile. Requires profile_public_id, amount, and transaction_date.",
        "description": "Create a new income entry for a tax profile. Requires profile_public_id, amount, and transaction_date.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateIncomeEntryRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateIncomeEntryResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/tax/income/delete": {
      "delete": {
        "operationId": "deleteTaxIncomeDelete",
        "tags": [
          "tax"
        ],
        "summary": "Delete an income entry. Requires public_id and profile_public_id.",
        "description": "Delete an income entry. Requires public_id and profile_public_id.",
        "parameters": [
          {
            "name": "profile_public_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "public_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteIncomeEntryResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-query-requirements": {
          "required": [
            "profile_public_id",
            "public_id"
          ]
        }
      }
    },
    "/v1/tax/income/update": {
      "put": {
        "operationId": "putTaxIncomeUpdate",
        "tags": [
          "tax"
        ],
        "summary": "Update an existing income entry. Requires public_id and profile_public_id.",
        "description": "Update an existing income entry. Requires public_id and profile_public_id.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateIncomeEntryRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateIncomeEntryResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/tax/liability": {
      "post": {
        "operationId": "postTaxLiability",
        "tags": [
          "tax"
        ],
        "summary": "Calculate tax liability for a profile and tax year. Returns breakdown of taxes and deductions.",
        "description": "Calculate tax liability for a profile and tax year. Returns breakdown of taxes and deductions.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CalculateLiabilityRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalculateLiabilityResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/tax/paye/calculate": {
      "post": {
        "operationId": "postTaxPayeCalculate",
        "tags": [
          "tax"
        ],
        "summary": "Calculate PAYE (Pay As You Earn) tax for a given gross income and region.",
        "description": "Calculate PAYE (Pay As You Earn) tax for a given gross income and region.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CalculatePAYERequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalculatePAYEResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/tax/profile/revoke": {
      "post": {
        "operationId": "postTaxProfileRevoke",
        "tags": [
          "tax"
        ],
        "summary": "Revoke access to a shared tax profile. Requires profile_public_id and grantee_user_public_id.",
        "description": "Revoke access to a shared tax profile. Requires profile_public_id and grantee_user_public_id.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RevokeProfileRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RevokeProfileResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/tax/profile/share": {
      "post": {
        "operationId": "postTaxProfileShare",
        "tags": [
          "tax"
        ],
        "summary": "Share a tax profile with another user. Requires profile_public_id and grantee_user_public_id.",
        "description": "Share a tax profile with another user. Requires profile_public_id and grantee_user_public_id.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ShareProfileRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShareProfileResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/tax/profile/shared": {
      "get": {
        "operationId": "getTaxProfileShared",
        "tags": [
          "tax"
        ],
        "summary": "Get a list of profiles shared with the current user.",
        "description": "Get a list of profiles shared with the current user.",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetSharedProfilesResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/tax/profile/upsert": {
      "post": {
        "operationId": "postTaxProfileUpsert",
        "tags": [
          "tax"
        ],
        "summary": "Create or update a tax profile. Requires user_public_id or organization_public_id.",
        "description": "Create or update a tax profile. Requires user_public_id or organization_public_id.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpsertProfileRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpsertProfileResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/user/authenticate": {
      "post": {
        "operationId": "postUserAuthenticate",
        "tags": [
          "user"
        ],
        "summary": "Authenticate a user with email and password. Returns session and refresh tokens.",
        "description": "Authenticate a user with email and password. Returns session and refresh tokens.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AuthenticateUserRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticateUserResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/v1/user/forgot-password": {
      "post": {
        "operationId": "postUserForgotPassword",
        "tags": [
          "user"
        ],
        "summary": "Trigger a password reset email for the given address.",
        "description": "Trigger a password reset email for the given address.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ForgotPasswordRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForgotPasswordResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/user/refresh": {
      "post": {
        "operationId": "postUserRefresh",
        "tags": [
          "user"
        ],
        "summary": "Refresh an expired session token using a valid refresh token.",
        "description": "Refresh an expired session token using a valid refresh token.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RefreshTokenRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RefreshTokenResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/v1/user/register": {
      "post": {
        "operationId": "postUserRegister",
        "tags": [
          "user"
        ],
        "summary": "Register a new user account. Returns the created user record.",
        "description": "Register a new user account. Returns the created user record.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterUserRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegisterUserResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/v1/user/reset-password": {
      "post": {
        "operationId": "postUserResetPassword",
        "tags": [
          "user"
        ],
        "summary": "Reset password using a valid token.",
        "description": "Reset password using a valid token.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResetPasswordRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResetPasswordResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/user/update": {
      "put": {
        "operationId": "putUserUpdate",
        "tags": [
          "user"
        ],
        "summary": "Update user profile details such as name, address, and phone number.",
        "description": "Update user profile details such as name, address, and phone number.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateUserRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateUserResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/user/upgrade": {
      "post": {
        "operationId": "postUserUpgrade",
        "tags": [
          "user"
        ],
        "summary": "Upgrade a guest user account to a full registered account.",
        "description": "Upgrade a guest user account to a full registered account.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpgradeGuestUserRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpgradeGuestUserResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Account": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "createdBy": {
            "type": "string"
          },
          "currencyCode": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "isSystem": {
            "type": "boolean"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string",
            "format": "date"
          },
          "updatedBy": {
            "type": "string",
            "format": "date"
          }
        }
      },
      "AddMemberRequest": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "format": "email"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "organizationId": {
            "type": "string"
          },
          "roleId": {
            "type": "string"
          }
        }
      },
      "AddMemberResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          }
        }
      },
      "AnalysisResult": {
        "type": "object",
        "properties": {
          "categories": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "classification": {
            "type": "string"
          },
          "confidence": {
            "type": "number",
            "format": "double"
          },
          "insights": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "isTaxDeductible": {
            "type": "boolean"
          },
          "isViable": {
            "type": "boolean"
          },
          "postingIntent": {
            "type": "string"
          },
          "processedAt": {
            "type": "string"
          },
          "reasonCodes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "requiresReview": {
            "type": "boolean"
          },
          "taxCategory": {
            "type": "string"
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "Annotation": {
        "type": "object",
        "properties": {
          "content": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "createdBy": {
            "type": "string"
          },
          "position": {
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        }
      },
      "AuthenticateUserRequest": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "format": "email"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "password": {
            "type": "string",
            "minLength": 8
          }
        }
      },
      "AuthenticateUserResponse": {
        "type": "object",
        "properties": {
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "refreshToken": {
            "type": "string"
          },
          "sessionToken": {
            "type": "string"
          },
          "user": {
            "$ref": "#/components/schemas/User"
          }
        }
      },
      "BillingAccount": {
        "type": "object",
        "properties": {
          "accountType": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "currencyCode": {
            "type": "string"
          },
          "defaultPaymentMethodRef": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "providerPreference": {
            "type": "string"
          },
          "publicId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string",
            "format": "date"
          }
        }
      },
      "Budget": {
        "type": "object",
        "properties": {
          "createdAt": {
            "type": "string"
          },
          "currencyCode": {
            "type": "string"
          },
          "envelopes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BudgetEnvelope"
            }
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "name": {
            "type": "string"
          },
          "periodEnd": {
            "type": "string"
          },
          "periodStart": {
            "type": "string"
          },
          "periodType": {
            "type": "string"
          },
          "profilePublicId": {
            "type": "string"
          },
          "publicId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "totalBudgetAmount": {
            "type": "number",
            "format": "double"
          },
          "totalIncomeTarget": {
            "type": "number",
            "format": "double"
          },
          "updatedAt": {
            "type": "string",
            "format": "date"
          }
        }
      },
      "BudgetEnvelope": {
        "type": "object",
        "properties": {
          "allocatedAmount": {
            "type": "number",
            "format": "double"
          },
          "autoAllocatePct": {
            "type": "number",
            "format": "double"
          },
          "budgetPublicId": {
            "type": "string"
          },
          "categoryCode": {
            "type": "string"
          },
          "color": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "emoji": {
            "type": "string"
          },
          "isDeductibleHint": {
            "type": "boolean"
          },
          "isSavingsGoal": {
            "type": "boolean"
          },
          "lockUntil": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "name": {
            "type": "string"
          },
          "notes": {
            "type": "string"
          },
          "priority": {
            "type": "integer",
            "format": "int32"
          },
          "publicId": {
            "type": "string"
          },
          "savingsProgress": {
            "type": "number",
            "format": "double"
          },
          "savingsTarget": {
            "type": "number",
            "format": "double"
          },
          "spentAmount": {
            "type": "number",
            "format": "double"
          },
          "updatedAt": {
            "type": "string",
            "format": "date"
          }
        }
      },
      "BudgetSummary": {
        "type": "object",
        "properties": {
          "budgets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Budget"
            }
          },
          "deductibleAllocated": {
            "type": "number",
            "format": "double"
          },
          "envelopeCount": {
            "type": "integer",
            "format": "int32"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "profilePublicId": {
            "type": "string"
          },
          "savingsProgress": {
            "type": "number",
            "format": "double"
          },
          "totalAllocated": {
            "type": "number",
            "format": "double"
          },
          "totalRemaining": {
            "type": "number",
            "format": "double"
          },
          "totalSpent": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "BusinessActivityItem": {
        "type": "object",
        "properties": {
          "action": {
            "type": "string"
          },
          "actorName": {
            "type": "string"
          },
          "actorUserId": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "entryId": {
            "type": "string"
          },
          "entryType": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "newStatus": {
            "type": "string"
          },
          "organizationId": {
            "type": "string"
          },
          "previousStatus": {
            "type": "string"
          },
          "reference": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          }
        }
      },
      "BusinessContact": {
        "type": "object",
        "properties": {
          "address": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "createdBy": {
            "type": "string"
          },
          "defaultAccountId": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "id": {
            "type": "string"
          },
          "matchKeywords": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "name": {
            "type": "string"
          },
          "notes": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "taxId": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string",
            "format": "date"
          },
          "updatedBy": {
            "type": "string",
            "format": "date"
          }
        }
      },
      "CalculateBusinessLiabilityRequest": {
        "type": "object",
        "properties": {
          "currencyCode": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "organizationId": {
            "type": "string"
          },
          "taxYear": {
            "type": "string"
          }
        }
      },
      "CalculateBusinessLiabilityResponse": {
        "type": "object",
        "properties": {
          "breakdown": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TaxLiabilityBreakdown"
            }
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "netProfit": {
            "type": "number",
            "format": "double"
          },
          "totalLiability": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "CalculateLiabilityRequest": {
        "type": "object",
        "properties": {
          "currencyCode": {
            "type": "string"
          },
          "profileId": {
            "type": "string"
          },
          "taxYear": {
            "type": "string"
          }
        }
      },
      "CalculateLiabilityResponse": {
        "type": "object",
        "properties": {
          "breakdowns": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TaxLiabilityBreakdown"
            }
          },
          "currencyCode": {
            "type": "string"
          },
          "deductibleExpenses": {
            "type": "number",
            "format": "double"
          },
          "deductions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DeductionBreakdown"
            }
          },
          "expensesByCategory": {
            "type": "object",
            "additionalProperties": {
              "type": "number",
              "format": "double"
            }
          },
          "grossIncome": {
            "type": "number",
            "format": "double"
          },
          "jurisdiction": {
            "$ref": "#/components/schemas/Jurisdiction"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "taxableIncome": {
            "type": "number",
            "format": "double"
          },
          "totalDeductions": {
            "type": "number",
            "format": "double"
          },
          "totalExpenses": {
            "type": "number",
            "format": "double"
          },
          "totalLiability": {
            "type": "number",
            "format": "double"
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "CalculatePAYERequest": {
        "type": "object",
        "properties": {
          "grossIncome": {
            "type": "number",
            "format": "double"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "regionCode": {
            "type": "string"
          },
          "taxYear": {
            "type": "string"
          }
        }
      },
      "CalculatePAYEResponse": {
        "type": "object",
        "properties": {
          "breakdown": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DeductionBreakdown"
            }
          },
          "effectiveRate": {
            "type": "number",
            "format": "double"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "taxAmount": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "CancelSubscriptionRequest": {
        "type": "object",
        "properties": {
          "cancelAtPeriodEnd": {
            "type": "boolean"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "organizationId": {
            "type": "string"
          },
          "workspaceId": {
            "type": "string"
          },
          "workspaceType": {
            "type": "string"
          }
        }
      },
      "CancelSubscriptionResponse": {
        "type": "object",
        "properties": {
          "entitlement": {
            "$ref": "#/components/schemas/Entitlement"
          },
          "subscription": {
            "$ref": "#/components/schemas/Subscription"
          }
        }
      },
      "CheckTCCRequest": {
        "type": "object",
        "properties": {
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "tin": {
            "type": "string"
          }
        }
      },
      "CheckTCCResponse": {
        "type": "object",
        "properties": {
          "certificateNumber": {
            "type": "string"
          },
          "expiryDate": {
            "type": "string",
            "format": "date"
          },
          "status": {
            "type": "string"
          },
          "valid": {
            "type": "boolean"
          }
        }
      },
      "CheckoutSession": {
        "type": "object",
        "properties": {
          "amountMinor": {
            "type": "integer",
            "format": "int64"
          },
          "checkoutUrl": {
            "type": "string",
            "format": "uri"
          },
          "currencyCode": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "provider": {
            "type": "string"
          },
          "reference": {
            "type": "string"
          },
          "sessionId": {
            "type": "string"
          }
        }
      },
      "ConfirmPaymentRequest": {
        "type": "object",
        "properties": {
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "organizationId": {
            "type": "string"
          },
          "provider": {
            "type": "string"
          },
          "reference": {
            "type": "string"
          },
          "sessionId": {
            "type": "string"
          }
        }
      },
      "ConfirmPaymentResponse": {
        "type": "object",
        "properties": {
          "entitlement": {
            "$ref": "#/components/schemas/Entitlement"
          },
          "invoice": {
            "$ref": "#/components/schemas/Invoice"
          },
          "payment": {
            "$ref": "#/components/schemas/Payment"
          },
          "subscription": {
            "$ref": "#/components/schemas/Subscription"
          }
        }
      },
      "CreateAccountRequest": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "currencyCode": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "name": {
            "type": "string"
          },
          "organizationId": {
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        }
      },
      "CreateAccountResponse": {
        "type": "object",
        "properties": {
          "account": {
            "$ref": "#/components/schemas/Account"
          }
        }
      },
      "CreateBudgetRequest": {
        "type": "object",
        "properties": {
          "currencyCode": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "name": {
            "type": "string"
          },
          "periodEnd": {
            "type": "string"
          },
          "periodStart": {
            "type": "string"
          },
          "periodType": {
            "type": "string"
          },
          "profilePublicId": {
            "type": "string"
          },
          "totalIncomeTarget": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "CreateBudgetResponse": {
        "type": "object",
        "properties": {
          "budget": {
            "$ref": "#/components/schemas/Budget"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          }
        }
      },
      "CreateCheckoutSessionRequest": {
        "type": "object",
        "properties": {
          "billingCycle": {
            "type": "string"
          },
          "cancelUrl": {
            "type": "string",
            "format": "uri"
          },
          "domain": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "organizationId": {
            "type": "string"
          },
          "planCode": {
            "type": "string"
          },
          "regionCode": {
            "type": "string"
          },
          "seatCount": {
            "type": "integer",
            "format": "int32"
          },
          "successUrl": {
            "type": "string",
            "format": "uri"
          },
          "workspaceId": {
            "type": "string"
          },
          "workspaceType": {
            "type": "string"
          }
        }
      },
      "CreateCheckoutSessionResponse": {
        "type": "object",
        "properties": {
          "checkoutSession": {
            "$ref": "#/components/schemas/CheckoutSession"
          },
          "quote": {
            "$ref": "#/components/schemas/Quote"
          }
        }
      },
      "CreateContactRequest": {
        "type": "object",
        "properties": {
          "address": {
            "type": "string"
          },
          "defaultAccountId": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "matchKeywords": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "name": {
            "type": "string"
          },
          "notes": {
            "type": "string"
          },
          "organizationId": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "taxId": {
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        }
      },
      "CreateContactResponse": {
        "type": "object",
        "properties": {
          "contact": {
            "$ref": "#/components/schemas/BusinessContact"
          }
        }
      },
      "CreateEngagementRequest": {
        "type": "object",
        "properties": {
          "auditorOrgId": {
            "type": "string"
          },
          "fiscalYear": {
            "type": "integer",
            "format": "int32"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "organizationId": {
            "type": "string"
          }
        }
      },
      "CreateEngagementResponse": {
        "type": "object",
        "properties": {
          "engagement": {
            "$ref": "#/components/schemas/Engagement"
          }
        }
      },
      "CreateEnvelopeRequest": {
        "type": "object",
        "properties": {
          "allocatedAmount": {
            "type": "number",
            "format": "double"
          },
          "autoAllocatePct": {
            "type": "number",
            "format": "double"
          },
          "budgetPublicId": {
            "type": "string"
          },
          "categoryCode": {
            "type": "string"
          },
          "color": {
            "type": "string"
          },
          "emoji": {
            "type": "string"
          },
          "isSavingsGoal": {
            "type": "boolean"
          },
          "lockUntil": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "name": {
            "type": "string"
          },
          "notes": {
            "type": "string"
          },
          "priority": {
            "type": "integer",
            "format": "int32"
          },
          "profilePublicId": {
            "type": "string"
          },
          "savingsTarget": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "CreateEnvelopeResponse": {
        "type": "object",
        "properties": {
          "envelope": {
            "$ref": "#/components/schemas/BudgetEnvelope"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          }
        }
      },
      "CreateExpenseEntryRequest": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "format": "double"
          },
          "description": {
            "type": "string"
          },
          "expenseCategoryCode": {
            "type": "string"
          },
          "isDeductible": {
            "type": "boolean"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "profilePublicId": {
            "type": "string"
          },
          "requiresDocumentation": {
            "type": "boolean"
          },
          "transactionDate": {
            "type": "string",
            "format": "date"
          }
        }
      },
      "CreateExpenseEntryResponse": {
        "type": "object",
        "properties": {
          "entry": {
            "$ref": "#/components/schemas/ExpenseEntry"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          }
        }
      },
      "CreateIncomeEntryRequest": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "format": "double"
          },
          "description": {
            "type": "string"
          },
          "incomeCategoryCode": {
            "type": "string"
          },
          "isExempt": {
            "type": "boolean"
          },
          "isFinalWithholding": {
            "type": "boolean"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "profilePublicId": {
            "type": "string"
          },
          "transactionDate": {
            "type": "string",
            "format": "date"
          }
        }
      },
      "CreateIncomeEntryResponse": {
        "type": "object",
        "properties": {
          "entry": {
            "$ref": "#/components/schemas/IncomeEntry"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          }
        }
      },
      "CreateOrganizationRequest": {
        "type": "object",
        "properties": {
          "industryCode": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "name": {
            "type": "string"
          },
          "settings": {
            "type": "object",
            "additionalProperties": {}
          },
          "taxId": {
            "type": "string"
          }
        }
      },
      "CreateOrganizationResponse": {
        "type": "object",
        "properties": {
          "organization": {
            "$ref": "#/components/schemas/Organization"
          }
        }
      },
      "CreateTransactionRequest": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "format": "double"
          },
          "category": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "profilePublicId": {
            "type": "string"
          },
          "receiptUrl": {
            "type": "string",
            "format": "uri"
          },
          "transactionDate": {
            "type": "string",
            "format": "date"
          },
          "type": {
            "type": "string"
          },
          "userPublicId": {
            "type": "string"
          }
        }
      },
      "CreateTransactionResponse": {
        "type": "object",
        "properties": {
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "transaction": {
            "$ref": "#/components/schemas/Transaction"
          }
        }
      },
      "DeductionBreakdown": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "format": "double"
          },
          "description": {
            "type": "string"
          }
        }
      },
      "DeleteBudgetRequest": {
        "type": "object",
        "properties": {
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "profilePublicId": {
            "type": "string"
          },
          "publicId": {
            "type": "string"
          }
        }
      },
      "DeleteBudgetResponse": {
        "type": "object",
        "properties": {
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "profilePublicId": {
            "type": "string"
          },
          "publicId": {
            "type": "string"
          }
        }
      },
      "DeleteEnvelopeRequest": {
        "type": "object",
        "properties": {
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "profilePublicId": {
            "type": "string"
          },
          "publicId": {
            "type": "string"
          }
        }
      },
      "DeleteEnvelopeResponse": {
        "type": "object",
        "properties": {
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "profilePublicId": {
            "type": "string"
          },
          "publicId": {
            "type": "string"
          }
        }
      },
      "DeleteExpenseEntryRequest": {
        "type": "object",
        "properties": {
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "profilePublicId": {
            "type": "string"
          },
          "publicId": {
            "type": "string"
          }
        }
      },
      "DeleteExpenseEntryResponse": {
        "type": "object",
        "properties": {
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "profilePublicId": {
            "type": "string"
          },
          "publicId": {
            "type": "string"
          }
        }
      },
      "DeleteIncomeEntryRequest": {
        "type": "object",
        "properties": {
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "profilePublicId": {
            "type": "string"
          },
          "publicId": {
            "type": "string"
          }
        }
      },
      "DeleteIncomeEntryResponse": {
        "type": "object",
        "properties": {
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "profilePublicId": {
            "type": "string"
          },
          "publicId": {
            "type": "string"
          }
        }
      },
      "DeleteInventoryItemRequest": {
        "type": "object",
        "properties": {
          "itemId": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "organizationId": {
            "type": "string"
          }
        }
      },
      "DeleteInventoryItemResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          }
        }
      },
      "DeleteMemberRequest": {
        "type": "object",
        "properties": {
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "organizationId": {
            "type": "string"
          },
          "userId": {
            "type": "string"
          }
        }
      },
      "DeleteMemberResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          }
        }
      },
      "DeviceKey": {
        "type": "object",
        "properties": {
          "createdAt": {
            "type": "string"
          },
          "fingerprint": {
            "type": "string"
          },
          "keyVersion": {
            "type": "integer",
            "format": "int32"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "publicKeyHex": {
            "type": "string"
          },
          "revokedAt": {
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        }
      },
      "DocumentItem": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "format": "double"
          },
          "category": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "quantity": {
            "type": "integer",
            "format": "int32"
          },
          "taxCode": {
            "type": "string"
          }
        }
      },
      "Engagement": {
        "type": "object",
        "properties": {
          "auditorOrgId": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "createdBy": {
            "type": "string"
          },
          "fiscalYear": {
            "type": "integer",
            "format": "int32"
          },
          "id": {
            "type": "string"
          },
          "organizationId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string",
            "format": "date"
          },
          "updatedBy": {
            "type": "string",
            "format": "date"
          }
        }
      },
      "Entitlement": {
        "type": "object",
        "properties": {
          "canRead": {
            "type": "boolean"
          },
          "canWrite": {
            "type": "boolean"
          },
          "graceUntil": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "reasonCode": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "workspaceId": {
            "type": "string"
          },
          "workspaceType": {
            "type": "string"
          }
        }
      },
      "EnvelopeTransaction": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "format": "double"
          },
          "createdAt": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "envelopePublicId": {
            "type": "string"
          },
          "linkedExpensePublicId": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "publicId": {
            "type": "string"
          },
          "transactionDate": {
            "type": "string",
            "format": "date"
          },
          "transactionType": {
            "type": "string"
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "example": "BAD_REQUEST"
          },
          "details": {
            "type": "object",
            "additionalProperties": {}
          },
          "error": {
            "type": "string",
            "example": "validation failed"
          }
        },
        "required": [
          "error"
        ]
      },
      "EstimatePayrollRequest": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PayrollItem"
            }
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "organizationId": {
            "type": "string"
          }
        }
      },
      "EstimatePayrollResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EstimatedPayrollItem"
            }
          }
        }
      },
      "EstimatedPayrollItem": {
        "type": "object",
        "properties": {
          "effectiveRate": {
            "type": "number",
            "format": "double"
          },
          "grossPay": {
            "type": "number",
            "format": "double"
          },
          "netPay": {
            "type": "number",
            "format": "double"
          },
          "taxAmount": {
            "type": "number",
            "format": "double"
          },
          "userId": {
            "type": "string"
          }
        }
      },
      "EvidenceManifest": {
        "type": "object",
        "properties": {
          "documentPublicId": {
            "type": "string"
          },
          "documentType": {
            "type": "string"
          },
          "fileSize": {
            "type": "integer",
            "format": "int64"
          },
          "mimeType": {
            "type": "string"
          },
          "usage": {
            "type": "string"
          },
          "viewUrl": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "EvidenceRef": {
        "type": "object",
        "properties": {
          "documentPublicId": {
            "type": "string"
          },
          "usage": {
            "type": "string"
          }
        }
      },
      "ExpenseEntry": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "format": "double"
          },
          "createdAt": {
            "type": "string"
          },
          "createdBy": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "expenseCategoryCode": {
            "type": "string"
          },
          "isDeductible": {
            "type": "boolean"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "profilePublicId": {
            "type": "string"
          },
          "publicId": {
            "type": "string"
          },
          "requiresDocumentation": {
            "type": "boolean"
          },
          "transactionDate": {
            "type": "string",
            "format": "date"
          },
          "updatedAt": {
            "type": "string",
            "format": "date"
          },
          "updatedBy": {
            "type": "string",
            "format": "date"
          }
        }
      },
      "ExtractedData": {
        "type": "object",
        "properties": {
          "accountHolder": {
            "type": "string"
          },
          "accountNumber": {
            "type": "string"
          },
          "closingBalance": {
            "type": "number",
            "format": "double"
          },
          "confidenceScore": {
            "type": "number",
            "format": "double"
          },
          "currency": {
            "type": "string"
          },
          "customFields": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "documentDate": {
            "type": "string",
            "format": "date"
          },
          "invoiceNumber": {
            "type": "string"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DocumentItem"
            }
          },
          "merchantName": {
            "type": "string"
          },
          "openingBalance": {
            "type": "number",
            "format": "double"
          },
          "paymentMethod": {
            "type": "string"
          },
          "taxAmount": {
            "type": "string"
          },
          "totalAmount": {
            "type": "number",
            "format": "double"
          },
          "transactionDate": {
            "type": "string",
            "format": "date"
          },
          "transactions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TransactionLine"
            }
          },
          "vendorName": {
            "type": "string"
          }
        }
      },
      "FileReturnRequest": {
        "type": "object",
        "properties": {
          "evidence": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EvidenceRef"
            }
          },
          "filingType": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "organizationId": {
            "type": "string"
          },
          "payload": {
            "type": "object",
            "additionalProperties": {}
          },
          "periodEnd": {
            "type": "string"
          },
          "periodStart": {
            "type": "string"
          }
        }
      },
      "FileReturnResponse": {
        "type": "object",
        "properties": {
          "filing": {
            "$ref": "#/components/schemas/Filing"
          }
        }
      },
      "Filing": {
        "type": "object",
        "properties": {
          "confirmationRef": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "createdBy": {
            "type": "string"
          },
          "evidenceImages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EvidenceManifest"
            }
          },
          "filingType": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "organizationId": {
            "type": "string"
          },
          "periodEnd": {
            "type": "string"
          },
          "periodStart": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "submittedAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string",
            "format": "date"
          },
          "updatedBy": {
            "type": "string",
            "format": "date"
          }
        }
      },
      "FinancialDocument": {
        "type": "object",
        "properties": {
          "analysisResult": {
            "$ref": "#/components/schemas/AnalysisResult"
          },
          "annotations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Annotation"
            }
          },
          "createdAt": {
            "type": "string"
          },
          "createdBy": {
            "type": "string"
          },
          "documentType": {
            "type": "string",
            "enum": [
              "DOCUMENT_TYPE_UNSPECIFIED",
              "DOCUMENT_TYPE_RECEIPT",
              "DOCUMENT_TYPE_INVOICE",
              "DOCUMENT_TYPE_BANK_STATEMENT",
              "DOCUMENT_TYPE_TAX_DOCUMENT",
              "DOCUMENT_TYPE_PAYSLIP",
              "DOCUMENT_TYPE_CONTRACT",
              "DOCUMENT_TYPE_OTHER"
            ]
          },
          "extractedData": {
            "$ref": "#/components/schemas/ExtractedData"
          },
          "fileSize": {
            "type": "integer",
            "format": "int64"
          },
          "fileUrl": {
            "type": "string",
            "format": "uri"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "mimeType": {
            "type": "string"
          },
          "profilePublicId": {
            "type": "string"
          },
          "publicId": {
            "type": "string"
          },
          "transactionPublicId": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string",
            "format": "date"
          },
          "updatedBy": {
            "type": "string",
            "format": "date"
          },
          "viewUrl": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "FinancialSummary": {
        "type": "object",
        "properties": {
          "deductibleExpenses": {
            "type": "number",
            "format": "double"
          },
          "exemptIncome": {
            "type": "number",
            "format": "double"
          },
          "expensesByCategory": {
            "type": "object",
            "additionalProperties": {
              "type": "number",
              "format": "double"
            }
          },
          "incomeByCategory": {
            "type": "object",
            "additionalProperties": {
              "type": "number",
              "format": "double"
            }
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "netIncome": {
            "type": "number",
            "format": "double"
          },
          "periodEnd": {
            "type": "string"
          },
          "periodStart": {
            "type": "string"
          },
          "profilePublicId": {
            "type": "string"
          },
          "taxableIncome": {
            "type": "number",
            "format": "double"
          },
          "totalExpenses": {
            "type": "number",
            "format": "double"
          },
          "totalIncome": {
            "type": "number",
            "format": "double"
          },
          "transactions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Transaction"
            }
          }
        }
      },
      "Flag": {
        "type": "object",
        "properties": {
          "auditorComment": {
            "type": "string"
          },
          "clientResponse": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "createdBy": {
            "type": "string"
          },
          "engagementId": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "issueType": {
            "type": "string"
          },
          "recordId": {
            "type": "string"
          },
          "recordType": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string",
            "format": "date"
          },
          "updatedBy": {
            "type": "string",
            "format": "date"
          }
        }
      },
      "FlagRecordRequest": {
        "type": "object",
        "properties": {
          "comment": {
            "type": "string"
          },
          "engagementId": {
            "type": "string"
          },
          "issueType": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "recordId": {
            "type": "string"
          },
          "recordType": {
            "type": "string"
          }
        }
      },
      "FlagRecordResponse": {
        "type": "object",
        "properties": {
          "flag": {
            "$ref": "#/components/schemas/Flag"
          }
        }
      },
      "ForgotPasswordRequest": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "format": "email"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          }
        }
      },
      "ForgotPasswordResponse": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          }
        }
      },
      "GenerateQrPayloadRequest": {
        "type": "object",
        "properties": {
          "challengeId": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "payload": {
            "type": "object",
            "additionalProperties": {}
          },
          "targetEvent": {
            "type": "string"
          }
        }
      },
      "GenerateQrPayloadResponse": {
        "type": "object",
        "properties": {
          "envelopeHash": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string"
          },
          "qrPayload": {
            "type": "string"
          },
          "targetEvent": {
            "type": "string"
          }
        }
      },
      "GetBudgetSummaryRequest": {
        "type": "object",
        "properties": {
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "periodEnd": {
            "type": "string"
          },
          "periodStart": {
            "type": "string"
          },
          "profilePublicId": {
            "type": "string"
          }
        }
      },
      "GetBudgetSummaryResponse": {
        "type": "object",
        "properties": {
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "summary": {
            "$ref": "#/components/schemas/BudgetSummary"
          }
        }
      },
      "GetFinancialSummaryRequest": {
        "type": "object",
        "properties": {
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "organizationId": {
            "type": "string"
          },
          "periodEnd": {
            "type": "string"
          },
          "periodStart": {
            "type": "string"
          },
          "profilePublicId": {
            "type": "string"
          },
          "userPublicId": {
            "type": "string"
          }
        }
      },
      "GetFinancialSummaryResponse": {
        "type": "object",
        "properties": {
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "summary": {
            "$ref": "#/components/schemas/FinancialSummary"
          }
        }
      },
      "GetOrganizationRequest": {
        "type": "object",
        "properties": {
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "organizationId": {
            "type": "string"
          }
        }
      },
      "GetOrganizationResponse": {
        "type": "object",
        "properties": {
          "organization": {
            "$ref": "#/components/schemas/Organization"
          }
        }
      },
      "GetQuoteRequest": {
        "type": "object",
        "properties": {
          "billingCycle": {
            "type": "string"
          },
          "domain": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "organizationId": {
            "type": "string"
          },
          "planCode": {
            "type": "string"
          },
          "regionCode": {
            "type": "string"
          },
          "seatCount": {
            "type": "integer",
            "format": "int32"
          },
          "workspaceId": {
            "type": "string"
          },
          "workspaceType": {
            "type": "string"
          }
        }
      },
      "GetQuoteResponse": {
        "type": "object",
        "properties": {
          "quote": {
            "$ref": "#/components/schemas/Quote"
          }
        }
      },
      "GetSharedProfilesRequest": {
        "type": "object",
        "properties": {
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          }
        }
      },
      "GetSharedProfilesResponse": {
        "type": "object",
        "properties": {
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "profiles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SharedProfile"
            }
          }
        }
      },
      "GetSubscriptionRequest": {
        "type": "object",
        "properties": {
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "organizationId": {
            "type": "string"
          },
          "workspaceId": {
            "type": "string"
          },
          "workspaceType": {
            "type": "string"
          }
        }
      },
      "GetSubscriptionResponse": {
        "type": "object",
        "properties": {
          "billingAccount": {
            "$ref": "#/components/schemas/BillingAccount"
          },
          "entitlement": {
            "$ref": "#/components/schemas/Entitlement"
          },
          "subscription": {
            "$ref": "#/components/schemas/Subscription"
          }
        }
      },
      "GlobalContext": {
        "type": "object",
        "description": "Server-enriched request context for identity and routing. Treat as internal context metadata, not a guaranteed client input contract.",
        "properties": {
          "auditContext": {
            "type": "string"
          },
          "deviceId": {
            "type": "string"
          },
          "extras": {
            "type": "object",
            "additionalProperties": {}
          },
          "organizationId": {
            "type": "string"
          },
          "roleId": {
            "type": "string"
          },
          "sessionId": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "userId": {
            "type": "string"
          }
        }
      },
      "IncomeEntry": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "format": "double"
          },
          "createdAt": {
            "type": "string"
          },
          "createdBy": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "incomeCategoryCode": {
            "type": "string"
          },
          "isExempt": {
            "type": "boolean"
          },
          "isFinalWithholding": {
            "type": "boolean"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "profilePublicId": {
            "type": "string"
          },
          "publicId": {
            "type": "string"
          },
          "transactionDate": {
            "type": "string",
            "format": "date"
          },
          "updatedAt": {
            "type": "string",
            "format": "date"
          },
          "updatedBy": {
            "type": "string",
            "format": "date"
          }
        }
      },
      "InventoryItem": {
        "type": "object",
        "properties": {
          "category": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "createdBy": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "name": {
            "type": "string"
          },
          "quantity": {
            "type": "number",
            "format": "double"
          },
          "sku": {
            "type": "string"
          },
          "unitCost": {
            "type": "number",
            "format": "double"
          },
          "unitPrice": {
            "type": "number",
            "format": "double"
          },
          "updatedAt": {
            "type": "string",
            "format": "date"
          },
          "updatedBy": {
            "type": "string",
            "format": "date"
          }
        }
      },
      "Invoice": {
        "type": "object",
        "properties": {
          "amountDueMinor": {
            "type": "integer",
            "format": "int64"
          },
          "amountPaidMinor": {
            "type": "integer",
            "format": "int64"
          },
          "currencyCode": {
            "type": "string"
          },
          "discountMinor": {
            "type": "integer",
            "format": "int64"
          },
          "dueAt": {
            "type": "string"
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InvoiceLine"
            }
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "periodEnd": {
            "type": "string"
          },
          "periodStart": {
            "type": "string"
          },
          "publicId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "subtotalMinor": {
            "type": "integer",
            "format": "int64"
          },
          "taxMinor": {
            "type": "integer",
            "format": "int64"
          },
          "totalMinor": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "InvoiceLine": {
        "type": "object",
        "properties": {
          "currencyCode": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "itemType": {
            "type": "string"
          },
          "lineTotalMinor": {
            "type": "integer",
            "format": "int64"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "quantity": {
            "type": "integer",
            "format": "int32"
          },
          "unitAmountMinor": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "IssueChallengeRequest": {
        "type": "object",
        "properties": {
          "deviceId": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "targetEvent": {
            "type": "string"
          },
          "ttlSeconds": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "IssueChallengeResponse": {
        "type": "object",
        "properties": {
          "challenge": {
            "$ref": "#/components/schemas/SensorChallenge"
          }
        }
      },
      "JournalEntry": {
        "type": "object",
        "properties": {
          "contactId": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "createdBy": {
            "type": "string"
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "description": {
            "type": "string"
          },
          "dueDate": {
            "type": "string",
            "format": "date"
          },
          "entryType": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/JournalLine"
            }
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "organizationId": {
            "type": "string"
          },
          "reference": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string",
            "format": "date"
          },
          "updatedBy": {
            "type": "string",
            "format": "date"
          }
        }
      },
      "JournalEntryHistoryItem": {
        "type": "object",
        "properties": {
          "action": {
            "type": "string"
          },
          "actorUserId": {
            "type": "string"
          },
          "afterState": {
            "type": "object",
            "additionalProperties": {}
          },
          "beforeState": {
            "type": "object",
            "additionalProperties": {}
          },
          "createdAt": {
            "type": "string"
          },
          "entryId": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "newStatus": {
            "type": "string"
          },
          "organizationId": {
            "type": "string"
          },
          "previousStatus": {
            "type": "string"
          }
        }
      },
      "JournalLine": {
        "type": "object",
        "properties": {
          "accountId": {
            "type": "string"
          },
          "credit": {
            "type": "number",
            "format": "double"
          },
          "debit": {
            "type": "number",
            "format": "double"
          },
          "description": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          }
        }
      },
      "Jurisdiction": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "currencyCode": {
            "type": "string"
          },
          "isActive": {
            "type": "boolean"
          },
          "jurisdictionType": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "taxAuthorityName": {
            "type": "string"
          }
        }
      },
      "ListAccountsRequest": {
        "type": "object",
        "properties": {
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "organizationId": {
            "type": "string"
          }
        }
      },
      "ListAccountsResponse": {
        "type": "object",
        "properties": {
          "accounts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Account"
            }
          }
        }
      },
      "ListBusinessActivityRequest": {
        "type": "object",
        "properties": {
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "organizationId": {
            "type": "string"
          },
          "pageSize": {
            "type": "integer",
            "format": "int32"
          },
          "pageToken": {
            "type": "string"
          }
        }
      },
      "ListBusinessActivityResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BusinessActivityItem"
            }
          },
          "nextPageToken": {
            "type": "string"
          }
        }
      },
      "ListContactsRequest": {
        "type": "object",
        "properties": {
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "organizationId": {
            "type": "string"
          },
          "pageSize": {
            "type": "integer",
            "format": "int32"
          },
          "pageToken": {
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        }
      },
      "ListContactsResponse": {
        "type": "object",
        "properties": {
          "contacts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BusinessContact"
            }
          },
          "nextPageToken": {
            "type": "string"
          }
        }
      },
      "ListEngagementsRequest": {
        "type": "object",
        "properties": {
          "auditorOrgId": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "organizationId": {
            "type": "string"
          }
        }
      },
      "ListEngagementsResponse": {
        "type": "object",
        "properties": {
          "engagements": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Engagement"
            }
          }
        }
      },
      "ListInventoryRequest": {
        "type": "object",
        "properties": {
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "organizationId": {
            "type": "string"
          },
          "pageSize": {
            "type": "integer",
            "format": "int32"
          },
          "pageToken": {
            "type": "string"
          }
        }
      },
      "ListInventoryResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InventoryItem"
            }
          },
          "nextPageToken": {
            "type": "string"
          }
        }
      },
      "ListInvoicesRequest": {
        "type": "object",
        "properties": {
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "organizationId": {
            "type": "string"
          },
          "pageSize": {
            "type": "integer",
            "format": "int32"
          },
          "pageToken": {
            "type": "string"
          },
          "workspaceId": {
            "type": "string"
          },
          "workspaceType": {
            "type": "string"
          }
        }
      },
      "ListInvoicesResponse": {
        "type": "object",
        "properties": {
          "invoices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Invoice"
            }
          },
          "nextPageToken": {
            "type": "string"
          }
        }
      },
      "ListJournalEntriesRequest": {
        "type": "object",
        "properties": {
          "endDate": {
            "type": "string",
            "format": "date"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "organizationId": {
            "type": "string"
          },
          "pageSize": {
            "type": "integer",
            "format": "int32"
          },
          "pageToken": {
            "type": "string"
          },
          "startDate": {
            "type": "string",
            "format": "date"
          }
        }
      },
      "ListJournalEntriesResponse": {
        "type": "object",
        "properties": {
          "entries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/JournalEntry"
            }
          },
          "nextPageToken": {
            "type": "string"
          }
        }
      },
      "ListJournalEntryHistoryRequest": {
        "type": "object",
        "properties": {
          "entryId": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "organizationId": {
            "type": "string"
          },
          "pageSize": {
            "type": "integer",
            "format": "int32"
          },
          "pageToken": {
            "type": "string"
          }
        }
      },
      "ListJournalEntryHistoryResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/JournalEntryHistoryItem"
            }
          },
          "nextPageToken": {
            "type": "string"
          }
        }
      },
      "ListMembersRequest": {
        "type": "object",
        "properties": {
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "organizationId": {
            "type": "string"
          }
        }
      },
      "ListMembersResponse": {
        "type": "object",
        "properties": {
          "members": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Member"
            }
          }
        }
      },
      "ListPayrollRunsRequest": {
        "type": "object",
        "properties": {
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "organizationId": {
            "type": "string"
          },
          "pageSize": {
            "type": "integer",
            "format": "int32"
          },
          "pageToken": {
            "type": "string"
          }
        }
      },
      "ListPayrollRunsResponse": {
        "type": "object",
        "properties": {
          "nextPageToken": {
            "type": "string"
          },
          "runs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PayrollRun"
            }
          }
        }
      },
      "Member": {
        "type": "object",
        "properties": {
          "createdAt": {
            "type": "string"
          },
          "createdBy": {
            "type": "string"
          },
          "currencyCode": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "fullName": {
            "type": "string"
          },
          "joinedAt": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "salary": {
            "type": "number",
            "format": "double"
          },
          "status": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string",
            "format": "date"
          },
          "updatedBy": {
            "type": "string",
            "format": "date"
          },
          "userId": {
            "type": "string"
          }
        }
      },
      "Metadata": {
        "type": "object",
        "description": "Transport metadata used for tracing and context propagation. Clients may send metadata, but security-sensitive fields are server authoritative.",
        "properties": {
          "aiConfidence": {
            "type": "number",
            "format": "double"
          },
          "categories": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "embeddingId": {
            "type": "string"
          },
          "extras": {
            "type": "object",
            "additionalProperties": {}
          },
          "gamificationState": {
            "type": "string"
          },
          "globalContext": {
            "description": "Optional contextual hints. User/organization/session values may be overwritten by authenticated server context.",
            "$ref": "#/components/schemas/GlobalContext"
          },
          "knowledgeGraph": {
            "type": "string"
          },
          "sourceRef": {
            "type": "string"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "validityPeriod": {
            "$ref": "#/components/schemas/ValidityPeriod"
          }
        }
      },
      "Organization": {
        "type": "object",
        "properties": {
          "createdAt": {
            "type": "string"
          },
          "createdBy": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "industryCode": {
            "type": "string"
          },
          "isPrimary": {
            "type": "boolean"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "name": {
            "type": "string"
          },
          "settings": {
            "type": "object",
            "additionalProperties": {}
          },
          "subscriptionStatus": {
            "type": "string"
          },
          "taxId": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string",
            "format": "date"
          },
          "updatedBy": {
            "type": "string",
            "format": "date"
          }
        }
      },
      "PaginatedResult": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {}
          },
          "pagination": {
            "$ref": "#/components/schemas/Pagination"
          }
        }
      },
      "Pagination": {
        "type": "object",
        "properties": {
          "next_page_token": {
            "type": "string",
            "example": "cursor:def456"
          },
          "page_size": {
            "type": "integer",
            "format": "int32",
            "example": 50
          },
          "page_token": {
            "type": "string",
            "example": "cursor:abc123"
          },
          "total_count": {
            "type": "integer",
            "format": "int64",
            "example": 120
          }
        }
      },
      "Payment": {
        "type": "object",
        "properties": {
          "amountMinor": {
            "type": "integer",
            "format": "int64"
          },
          "currencyCode": {
            "type": "string"
          },
          "idempotencyKey": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "processedAt": {
            "type": "string"
          },
          "provider": {
            "type": "string"
          },
          "providerTxnId": {
            "type": "string"
          },
          "publicId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        }
      },
      "PayrollItem": {
        "type": "object",
        "properties": {
          "bonus": {
            "type": "number",
            "format": "double"
          },
          "deductions": {
            "type": "number",
            "format": "double"
          },
          "grossPay": {
            "type": "number",
            "format": "double"
          },
          "userId": {
            "type": "string"
          }
        }
      },
      "PayrollRun": {
        "type": "object",
        "properties": {
          "createdAt": {
            "type": "string"
          },
          "createdBy": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "journalEntryId": {
            "type": "string"
          },
          "organizationId": {
            "type": "string"
          },
          "paymentDate": {
            "type": "string",
            "format": "date"
          },
          "periodEnd": {
            "type": "string"
          },
          "periodStart": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "totalPayout": {
            "type": "number",
            "format": "double"
          },
          "totalTaxWithheld": {
            "type": "number",
            "format": "double"
          },
          "updatedAt": {
            "type": "string",
            "format": "date"
          },
          "updatedBy": {
            "type": "string",
            "format": "date"
          }
        }
      },
      "PaystackWebhookEvent": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "additionalProperties": {}
          },
          "event": {
            "type": "string",
            "description": "Provider event type (for example: charge.success)."
          }
        }
      },
      "PostJournalEntryRequest": {
        "type": "object",
        "properties": {
          "contactId": {
            "type": "string"
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "description": {
            "type": "string"
          },
          "dueDate": {
            "type": "string",
            "format": "date"
          },
          "entryType": {
            "type": "string"
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/JournalLine"
            }
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "organizationId": {
            "type": "string"
          },
          "reference": {
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        }
      },
      "PostJournalEntryResponse": {
        "type": "object",
        "properties": {
          "entry": {
            "$ref": "#/components/schemas/JournalEntry"
          }
        }
      },
      "Quote": {
        "type": "object",
        "properties": {
          "billingCycle": {
            "type": "string"
          },
          "currencyCode": {
            "type": "string"
          },
          "discountMinor": {
            "type": "integer",
            "format": "int64"
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InvoiceLine"
            }
          },
          "market": {
            "type": "string"
          },
          "marketSource": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "provider": {
            "type": "string"
          },
          "subtotalMinor": {
            "type": "integer",
            "format": "int64"
          },
          "taxMinor": {
            "type": "integer",
            "format": "int64"
          },
          "totalMinor": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "RecordBillPaymentRequest": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "format": "double"
          },
          "billEntryId": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "organizationId": {
            "type": "string"
          },
          "paymentAccountId": {
            "type": "string"
          },
          "paymentDate": {
            "type": "string",
            "format": "date"
          },
          "reference": {
            "type": "string"
          }
        }
      },
      "RecordBillPaymentResponse": {
        "type": "object",
        "properties": {
          "fullySettled": {
            "type": "boolean"
          },
          "remainingAmount": {
            "type": "number",
            "format": "double"
          },
          "settlementEntry": {
            "$ref": "#/components/schemas/JournalEntry"
          },
          "sourceEntry": {
            "$ref": "#/components/schemas/JournalEntry"
          }
        }
      },
      "RecordEnvelopeTransactionRequest": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "format": "double"
          },
          "description": {
            "type": "string"
          },
          "envelopePublicId": {
            "type": "string"
          },
          "linkedExpensePublicId": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "profilePublicId": {
            "type": "string"
          },
          "transactionDate": {
            "type": "string",
            "format": "date"
          },
          "transactionType": {
            "type": "string"
          }
        }
      },
      "RecordEnvelopeTransactionResponse": {
        "type": "object",
        "properties": {
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "transaction": {
            "$ref": "#/components/schemas/EnvelopeTransaction"
          },
          "updatedEnvelope": {
            "$ref": "#/components/schemas/BudgetEnvelope"
          }
        }
      },
      "RecordInvoiceReceiptRequest": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "format": "double"
          },
          "description": {
            "type": "string"
          },
          "invoiceEntryId": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "organizationId": {
            "type": "string"
          },
          "receiptAccountId": {
            "type": "string"
          },
          "receiptDate": {
            "type": "string",
            "format": "date"
          },
          "reference": {
            "type": "string"
          }
        }
      },
      "RecordInvoiceReceiptResponse": {
        "type": "object",
        "properties": {
          "fullySettled": {
            "type": "boolean"
          },
          "remainingAmount": {
            "type": "number",
            "format": "double"
          },
          "settlementEntry": {
            "$ref": "#/components/schemas/JournalEntry"
          },
          "sourceEntry": {
            "$ref": "#/components/schemas/JournalEntry"
          }
        }
      },
      "RedeemInviteRequest": {
        "type": "object",
        "properties": {
          "deviceId": {
            "type": "string"
          },
          "invitePayload": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "userPublicId": {
            "type": "string"
          }
        }
      },
      "RedeemInviteResponse": {
        "type": "object",
        "properties": {
          "memberStatus": {
            "type": "string"
          },
          "organizationId": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "redeemed": {
            "type": "boolean"
          },
          "requestId": {
            "type": "string"
          },
          "roleId": {
            "type": "string"
          }
        }
      },
      "RefreshEntitlementRequest": {
        "type": "object",
        "properties": {
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "organizationId": {
            "type": "string"
          },
          "workspaceId": {
            "type": "string"
          },
          "workspaceType": {
            "type": "string"
          }
        }
      },
      "RefreshEntitlementResponse": {
        "type": "object",
        "properties": {
          "entitlement": {
            "$ref": "#/components/schemas/Entitlement"
          }
        }
      },
      "RefreshTokenRequest": {
        "type": "object",
        "properties": {
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "refreshToken": {
            "type": "string"
          }
        }
      },
      "RefreshTokenResponse": {
        "type": "object",
        "properties": {
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "refreshToken": {
            "type": "string"
          },
          "sessionToken": {
            "type": "string"
          }
        }
      },
      "RegisterDeviceRequest": {
        "type": "object",
        "properties": {
          "deviceId": {
            "type": "string"
          },
          "deviceLabel": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "platform": {
            "type": "string"
          },
          "publicKeyHex": {
            "type": "string"
          },
          "userPublicId": {
            "type": "string"
          }
        }
      },
      "RegisterDeviceResponse": {
        "type": "object",
        "properties": {
          "activeKey": {
            "$ref": "#/components/schemas/DeviceKey"
          },
          "device": {
            "$ref": "#/components/schemas/SensorDevice"
          }
        }
      },
      "RegisterUserRequest": {
        "type": "object",
        "properties": {
          "avatarUrl": {
            "type": "string",
            "format": "uri"
          },
          "currencyCode": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "fullName": {
            "type": "string"
          },
          "isGuest": {
            "type": "boolean"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "password": {
            "type": "string",
            "minLength": 8
          },
          "region": {
            "type": "string"
          },
          "role": {
            "type": "string"
          }
        }
      },
      "RegisterUserResponse": {
        "type": "object",
        "properties": {
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "publicId": {
            "type": "string"
          },
          "user": {
            "$ref": "#/components/schemas/User"
          }
        }
      },
      "ReorderEnvelopesRequest": {
        "type": "object",
        "properties": {
          "budgetPublicId": {
            "type": "string"
          },
          "envelopePublicIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "profilePublicId": {
            "type": "string"
          }
        }
      },
      "ReorderEnvelopesResponse": {
        "type": "object",
        "properties": {
          "envelopes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BudgetEnvelope"
            }
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          }
        }
      },
      "ResetPasswordRequest": {
        "type": "object",
        "properties": {
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "newPassword": {
            "type": "string",
            "minLength": 8
          },
          "token": {
            "type": "string"
          }
        }
      },
      "ResetPasswordResponse": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          }
        }
      },
      "ResolveSensorCommand": {
        "type": "object",
        "properties": {
          "dispatch": {
            "type": "boolean"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "requestId": {
            "type": "string"
          }
        }
      },
      "ResolveSensorResponse": {
        "type": "object",
        "properties": {
          "dispatched": {
            "type": "boolean"
          },
          "dispatchedEventType": {
            "type": "string"
          },
          "request": {
            "$ref": "#/components/schemas/SensorRequestRecord"
          }
        }
      },
      "RevokeDeviceRequest": {
        "type": "object",
        "properties": {
          "deviceId": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "reason": {
            "type": "string"
          }
        }
      },
      "RevokeDeviceResponse": {
        "type": "object",
        "properties": {
          "device": {
            "$ref": "#/components/schemas/SensorDevice"
          },
          "status": {
            "type": "string"
          }
        }
      },
      "RevokeProfileRequest": {
        "type": "object",
        "properties": {
          "granteeUserPublicId": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "profilePublicId": {
            "type": "string"
          }
        }
      },
      "RevokeProfileResponse": {
        "type": "object",
        "properties": {
          "granteeUserPublicId": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "profilePublicId": {
            "type": "string"
          }
        }
      },
      "RotateDeviceKeyRequest": {
        "type": "object",
        "properties": {
          "deviceId": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "newPublicKeyHex": {
            "type": "string"
          }
        }
      },
      "RotateDeviceKeyResponse": {
        "type": "object",
        "properties": {
          "activeKey": {
            "$ref": "#/components/schemas/DeviceKey"
          },
          "device": {
            "$ref": "#/components/schemas/SensorDevice"
          }
        }
      },
      "RunPayrollRequest": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PayrollItem"
            }
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "organizationId": {
            "type": "string"
          },
          "paymentDate": {
            "type": "string",
            "format": "date"
          },
          "periodEnd": {
            "type": "string"
          },
          "periodStart": {
            "type": "string"
          }
        }
      },
      "RunPayrollResponse": {
        "type": "object",
        "properties": {
          "journalEntryId": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "totalPayout": {
            "type": "number",
            "format": "double"
          },
          "totalTaxWithheld": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "ScanQrPayloadRequest": {
        "type": "object",
        "properties": {
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "qrPayload": {
            "type": "string"
          }
        }
      },
      "ScanQrPayloadResponse": {
        "type": "object",
        "properties": {
          "challengeId": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string"
          },
          "payload": {
            "type": "object",
            "additionalProperties": {}
          },
          "reason": {
            "type": "string"
          },
          "requestNonce": {
            "type": "string"
          },
          "targetEvent": {
            "type": "string"
          },
          "valid": {
            "type": "boolean"
          }
        }
      },
      "SensorArtifact": {
        "type": "object",
        "properties": {
          "artifactHash": {
            "type": "string"
          },
          "artifactType": {
            "type": "string"
          },
          "mediaDocumentPublicId": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          }
        }
      },
      "SensorChallenge": {
        "type": "object",
        "properties": {
          "challengeToken": {
            "type": "string"
          },
          "consumedAt": {
            "type": "string"
          },
          "devicePublicId": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "nonce": {
            "type": "string"
          },
          "publicId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "targetEvent": {
            "type": "string"
          }
        }
      },
      "SensorDevice": {
        "type": "object",
        "properties": {
          "activeKeyFingerprint": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "deviceId": {
            "type": "string"
          },
          "deviceLabel": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "platform": {
            "type": "string"
          },
          "publicId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string",
            "format": "date"
          },
          "userPublicId": {
            "type": "string"
          }
        }
      },
      "SensorProof": {
        "type": "object",
        "properties": {
          "challengeId": {
            "type": "string"
          },
          "deviceSignature": {
            "type": "string"
          },
          "interactionPubKey": {
            "type": "string"
          },
          "interactionSignature": {
            "type": "string"
          },
          "serverSignature": {
            "type": "string"
          }
        }
      },
      "SensorRequestRecord": {
        "type": "object",
        "properties": {
          "artifacts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SensorArtifact"
            }
          },
          "challengeId": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "devicePublicId": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "payload": {
            "type": "object",
            "additionalProperties": {}
          },
          "proof": {
            "$ref": "#/components/schemas/SensorProof"
          },
          "publicId": {
            "type": "string"
          },
          "requestNonce": {
            "type": "string"
          },
          "resolvedAt": {
            "type": "string"
          },
          "resolvedEventId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "targetEvent": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string",
            "format": "date"
          },
          "verificationReason": {
            "type": "string"
          }
        }
      },
      "ShareProfileRequest": {
        "type": "object",
        "properties": {
          "granteeUserPublicId": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "profilePublicId": {
            "type": "string"
          }
        }
      },
      "ShareProfileResponse": {
        "type": "object",
        "properties": {
          "grantedByUserPublicId": {
            "type": "string"
          },
          "granteeUserPublicId": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "profilePublicId": {
            "type": "string"
          }
        }
      },
      "SharedProfile": {
        "type": "object",
        "properties": {
          "canManage": {
            "type": "boolean"
          },
          "ownerAvatarUrl": {
            "type": "string",
            "format": "uri"
          },
          "ownerName": {
            "type": "string"
          },
          "profilePublicId": {
            "type": "string"
          }
        }
      },
      "StandardSuccessResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "additionalProperties": {}
          },
          "message": {
            "type": "string",
            "example": "Successful response"
          },
          "status": {
            "type": "string",
            "example": "ok"
          }
        }
      },
      "StripeWebhookEvent": {
        "type": "object",
        "properties": {
          "created": {
            "type": "integer",
            "format": "int64"
          },
          "data": {
            "type": "object",
            "properties": {
              "object": {
                "type": "object",
                "additionalProperties": {}
              }
            }
          },
          "id": {
            "type": "string"
          },
          "livemode": {
            "type": "boolean"
          },
          "type": {
            "type": "string",
            "description": "Provider event type (for example: checkout.session.completed)."
          }
        }
      },
      "SubmitSensorCommand": {
        "type": "object",
        "properties": {
          "artifacts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SensorArtifact"
            }
          },
          "challengeId": {
            "type": "string"
          },
          "deviceId": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "payload": {
            "type": "object",
            "additionalProperties": {}
          },
          "proof": {
            "$ref": "#/components/schemas/SensorProof"
          },
          "requestNonce": {
            "type": "string"
          },
          "targetEvent": {
            "type": "string"
          }
        }
      },
      "SubmitSensorResponse": {
        "type": "object",
        "properties": {
          "request": {
            "$ref": "#/components/schemas/SensorRequestRecord"
          }
        }
      },
      "Subscription": {
        "type": "object",
        "properties": {
          "billingCycle": {
            "type": "string"
          },
          "cancelAtPeriodEnd": {
            "type": "boolean"
          },
          "currentPeriodEnd": {
            "type": "string"
          },
          "currentPeriodStart": {
            "type": "string"
          },
          "graceUntil": {
            "type": "string"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SubscriptionItem"
            }
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "nextRenewalAt": {
            "type": "string"
          },
          "publicId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        }
      },
      "SubscriptionItem": {
        "type": "object",
        "properties": {
          "billingCycle": {
            "type": "string"
          },
          "currencyCode": {
            "type": "string"
          },
          "itemType": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "quantity": {
            "type": "integer",
            "format": "int32"
          },
          "unitAmountMinor": {
            "type": "integer",
            "format": "int64"
          },
          "workspaceId": {
            "type": "string"
          },
          "workspaceType": {
            "type": "string"
          }
        }
      },
      "SwitchContextRequest": {
        "type": "object",
        "properties": {
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "organizationId": {
            "type": "string"
          }
        }
      },
      "SwitchContextResponse": {
        "type": "object",
        "properties": {
          "activeContextId": {
            "type": "string"
          },
          "refreshToken": {
            "type": "string"
          },
          "sessionToken": {
            "type": "string"
          }
        }
      },
      "TaxLiabilityBreakdown": {
        "type": "object",
        "properties": {
          "appliedRules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TaxRule"
            }
          },
          "effectiveRate": {
            "type": "number",
            "format": "double"
          },
          "taxAmount": {
            "type": "number",
            "format": "double"
          },
          "taxType": {
            "type": "string"
          },
          "taxableAmount": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "TaxProfile": {
        "type": "object",
        "properties": {
          "createdAt": {
            "type": "string"
          },
          "createdBy": {
            "type": "string"
          },
          "currencyCode": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "organizationPublicId": {
            "type": "string"
          },
          "profileType": {
            "type": "string"
          },
          "publicId": {
            "type": "string"
          },
          "regionCode": {
            "type": "string"
          },
          "residencyStatusPublicId": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string",
            "format": "date"
          },
          "updatedBy": {
            "type": "string",
            "format": "date"
          },
          "userPublicId": {
            "type": "string"
          }
        }
      },
      "TaxRule": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "jurisdictionCode": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "ruleDefJson": {
            "type": "string"
          },
          "ruleName": {
            "type": "string"
          },
          "taxType": {
            "type": "string"
          }
        }
      },
      "Transaction": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "format": "double"
          },
          "category": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "createdBy": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "profilePublicId": {
            "type": "string"
          },
          "publicId": {
            "type": "string"
          },
          "receiptUrl": {
            "type": "string",
            "format": "uri"
          },
          "transactionDate": {
            "type": "string",
            "format": "date"
          },
          "type": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string",
            "format": "date"
          },
          "updatedBy": {
            "type": "string",
            "format": "date"
          }
        }
      },
      "TransactionLine": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "format": "double"
          },
          "category": {
            "type": "string"
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "description": {
            "type": "string"
          },
          "reference": {
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        }
      },
      "TransferPayerRequest": {
        "type": "object",
        "properties": {
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "newOwnerUserId": {
            "type": "string"
          },
          "organizationId": {
            "type": "string"
          }
        }
      },
      "TransferPayerResponse": {
        "type": "object",
        "properties": {
          "billingAccount": {
            "$ref": "#/components/schemas/BillingAccount"
          },
          "status": {
            "type": "string"
          }
        }
      },
      "UpdateBudgetRequest": {
        "type": "object",
        "properties": {
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "name": {
            "type": "string"
          },
          "profilePublicId": {
            "type": "string"
          },
          "publicId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "totalIncomeTarget": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "UpdateBudgetResponse": {
        "type": "object",
        "properties": {
          "budget": {
            "$ref": "#/components/schemas/Budget"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          }
        }
      },
      "UpdateEnvelopeRequest": {
        "type": "object",
        "properties": {
          "allocatedAmount": {
            "type": "number",
            "format": "double"
          },
          "autoAllocatePct": {
            "type": "number",
            "format": "double"
          },
          "categoryCode": {
            "type": "string"
          },
          "color": {
            "type": "string"
          },
          "emoji": {
            "type": "string"
          },
          "isSavingsGoal": {
            "type": "boolean"
          },
          "lockUntil": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "name": {
            "type": "string"
          },
          "notes": {
            "type": "string"
          },
          "priority": {
            "type": "integer",
            "format": "int32"
          },
          "profilePublicId": {
            "type": "string"
          },
          "publicId": {
            "type": "string"
          },
          "savingsTarget": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "UpdateEnvelopeResponse": {
        "type": "object",
        "properties": {
          "envelope": {
            "$ref": "#/components/schemas/BudgetEnvelope"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          }
        }
      },
      "UpdateExpenseEntryRequest": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "format": "double"
          },
          "description": {
            "type": "string"
          },
          "expenseCategoryCode": {
            "type": "string"
          },
          "isDeductible": {
            "type": "boolean"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "profilePublicId": {
            "type": "string"
          },
          "publicId": {
            "type": "string"
          },
          "requiresDocumentation": {
            "type": "boolean"
          },
          "transactionDate": {
            "type": "string",
            "format": "date"
          }
        }
      },
      "UpdateExpenseEntryResponse": {
        "type": "object",
        "properties": {
          "entry": {
            "$ref": "#/components/schemas/ExpenseEntry"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          }
        }
      },
      "UpdateIncomeEntryRequest": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "format": "double"
          },
          "description": {
            "type": "string"
          },
          "incomeCategoryCode": {
            "type": "string"
          },
          "isExempt": {
            "type": "boolean"
          },
          "isFinalWithholding": {
            "type": "boolean"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "profilePublicId": {
            "type": "string"
          },
          "publicId": {
            "type": "string"
          },
          "transactionDate": {
            "type": "string",
            "format": "date"
          }
        }
      },
      "UpdateIncomeEntryResponse": {
        "type": "object",
        "properties": {
          "entry": {
            "$ref": "#/components/schemas/IncomeEntry"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          }
        }
      },
      "UpdateInventoryRequest": {
        "type": "object",
        "properties": {
          "itemId": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "name": {
            "type": "string"
          },
          "organizationId": {
            "type": "string"
          },
          "quantityChange": {
            "type": "number",
            "format": "double"
          },
          "reason": {
            "type": "string"
          },
          "sku": {
            "type": "string"
          },
          "unitCost": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "UpdateInventoryResponse": {
        "type": "object",
        "properties": {
          "journalEntryId": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "newQuantity": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "UpdateJournalEntryRequest": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string"
          },
          "entryId": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "organizationId": {
            "type": "string"
          },
          "reference": {
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        }
      },
      "UpdateJournalEntryResponse": {
        "type": "object",
        "properties": {
          "entry": {
            "$ref": "#/components/schemas/JournalEntry"
          }
        }
      },
      "UpdatePaymentMethodRequest": {
        "type": "object",
        "properties": {
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "organizationId": {
            "type": "string"
          },
          "paymentMethodRef": {
            "type": "string"
          },
          "provider": {
            "type": "string"
          },
          "setDefault": {
            "type": "boolean"
          },
          "workspaceId": {
            "type": "string"
          },
          "workspaceType": {
            "type": "string"
          }
        }
      },
      "UpdatePaymentMethodResponse": {
        "type": "object",
        "properties": {
          "billingAccount": {
            "$ref": "#/components/schemas/BillingAccount"
          }
        }
      },
      "UpdateUserRequest": {
        "type": "object",
        "properties": {
          "address": {
            "type": "string"
          },
          "avatarUrl": {
            "type": "string",
            "format": "uri"
          },
          "currencyCode": {
            "type": "string"
          },
          "firstName": {
            "type": "string"
          },
          "fullName": {
            "type": "string"
          },
          "lastName": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "phoneNumber": {
            "type": "string"
          },
          "publicId": {
            "type": "string"
          },
          "subscriptionTier": {
            "type": "string"
          }
        }
      },
      "UpdateUserResponse": {
        "type": "object",
        "properties": {
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "user": {
            "$ref": "#/components/schemas/User"
          }
        }
      },
      "UpgradeGuestUserRequest": {
        "type": "object",
        "properties": {
          "currencyCode": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "fullName": {
            "type": "string"
          },
          "guestPublicId": {
            "type": "string"
          },
          "password": {
            "type": "string",
            "minLength": 8
          },
          "region": {
            "type": "string"
          }
        }
      },
      "UpgradeGuestUserResponse": {
        "type": "object",
        "properties": {
          "publicId": {
            "type": "string"
          },
          "refreshToken": {
            "type": "string"
          },
          "sessionToken": {
            "type": "string"
          },
          "user": {
            "$ref": "#/components/schemas/User"
          }
        }
      },
      "UploadDocumentRequest": {
        "type": "object",
        "properties": {
          "documentType": {
            "type": "string",
            "enum": [
              "DOCUMENT_TYPE_UNSPECIFIED",
              "DOCUMENT_TYPE_RECEIPT",
              "DOCUMENT_TYPE_INVOICE",
              "DOCUMENT_TYPE_BANK_STATEMENT",
              "DOCUMENT_TYPE_TAX_DOCUMENT",
              "DOCUMENT_TYPE_PAYSLIP",
              "DOCUMENT_TYPE_CONTRACT",
              "DOCUMENT_TYPE_OTHER"
            ]
          },
          "fileData": {
            "type": "string",
            "format": "byte"
          },
          "filename": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "mimeType": {
            "type": "string"
          },
          "organizationId": {
            "type": "string"
          },
          "pdfPassword": {
            "type": "string",
            "minLength": 8
          },
          "profilePublicId": {
            "type": "string"
          },
          "transactionPublicId": {
            "type": "string"
          }
        }
      },
      "UploadDocumentResponse": {
        "type": "object",
        "properties": {
          "document": {
            "$ref": "#/components/schemas/FinancialDocument"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          }
        }
      },
      "UpsertProfileRequest": {
        "type": "object",
        "properties": {
          "currencyCode": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "organizationPublicId": {
            "type": "string"
          },
          "profileType": {
            "type": "string"
          },
          "regionCode": {
            "type": "string"
          },
          "residencyStatusPublicId": {
            "type": "string"
          },
          "userPublicId": {
            "type": "string"
          }
        }
      },
      "UpsertProfileResponse": {
        "type": "object",
        "properties": {
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "profile": {
            "$ref": "#/components/schemas/TaxProfile"
          }
        }
      },
      "User": {
        "type": "object",
        "properties": {
          "address": {
            "type": "string"
          },
          "avatarUrl": {
            "type": "string",
            "format": "uri"
          },
          "createdAt": {
            "type": "string"
          },
          "createdBy": {
            "type": "string"
          },
          "currencyCode": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "firstName": {
            "type": "string"
          },
          "fullName": {
            "type": "string"
          },
          "guestExpiresAt": {
            "type": "string"
          },
          "isActive": {
            "type": "boolean"
          },
          "isAdmin": {
            "type": "boolean"
          },
          "lastName": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "phoneNumber": {
            "type": "string"
          },
          "publicId": {
            "type": "string"
          },
          "region": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "subscriptionTier": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string",
            "format": "date"
          },
          "updatedBy": {
            "type": "string",
            "format": "date"
          }
        }
      },
      "ValidityPeriod": {
        "type": "object",
        "properties": {
          "effectiveFrom": {
            "type": "string"
          },
          "effectiveTo": {
            "type": "string"
          }
        }
      },
      "VerifySensorCommand": {
        "type": "object",
        "properties": {
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "requestId": {
            "type": "string"
          }
        }
      },
      "VerifySensorResponse": {
        "type": "object",
        "properties": {
          "request": {
            "$ref": "#/components/schemas/SensorRequestRecord"
          },
          "verified": {
            "type": "boolean"
          }
        }
      },
      "VerifyTINRequest": {
        "type": "object",
        "properties": {
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "tin": {
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        }
      },
      "VerifyTINResponse": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "registrationDate": {
            "type": "string",
            "format": "date"
          },
          "taxOffice": {
            "type": "string"
          },
          "valid": {
            "type": "boolean"
          }
        }
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "JWT bearer token. Example: Authorization: Bearer \u003ctoken\u003e"
      }
    }
  },
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "audit"
    },
    {
      "name": "billing"
    },
    {
      "name": "budget"
    },
    {
      "name": "business"
    },
    {
      "name": "compliance"
    },
    {
      "name": "finance"
    },
    {
      "name": "media"
    },
    {
      "name": "sensor"
    },
    {
      "name": "tax"
    },
    {
      "name": "user"
    }
  ]
}
