{
  "openapi": "3.1.0",
  "info": {
    "title": "PaymentHooks API",
    "version": "1.0.0",
    "description": "Payment orchestration API. Authenticate with a secret API key as `Authorization: Bearer phk_live_...` (or the `x-api-key` header). Every response uses the envelope `{ data, error }`; on failure `data` is null and `error` carries `code` and `message`. Amounts are integers in the smallest currency unit. Generated from the route handlers by scripts/generate-openapi.ts.",
    "contact": {
      "name": "PaymentHooks",
      "url": "https://paymenthooks.com/docs/api-reference"
    },
    "license": {
      "name": "Proprietary",
      "identifier": "LicenseRef-Proprietary"
    }
  },
  "servers": [
    {
      "url": "https://paymenthooks.com/api/v1",
      "description": "Production"
    }
  ],
  "tags": [
    {
      "name": "API Keys"
    },
    {
      "name": "Account"
    },
    {
      "name": "Admin"
    },
    {
      "name": "Analytics"
    },
    {
      "name": "Audit Log"
    },
    {
      "name": "Authentication"
    },
    {
      "name": "Balance"
    },
    {
      "name": "Billing"
    },
    {
      "name": "Billing Page"
    },
    {
      "name": "Brand Assets"
    },
    {
      "name": "Branding"
    },
    {
      "name": "Business Entities"
    },
    {
      "name": "Cashfree"
    },
    {
      "name": "Checkout Sessions"
    },
    {
      "name": "Communications"
    },
    {
      "name": "Compliance"
    },
    {
      "name": "Connect"
    },
    {
      "name": "Contact"
    },
    {
      "name": "Coupons"
    },
    {
      "name": "Credit Notes"
    },
    {
      "name": "Currency"
    },
    {
      "name": "Custom Domains"
    },
    {
      "name": "Customers"
    },
    {
      "name": "Developer"
    },
    {
      "name": "Disputes"
    },
    {
      "name": "Email Delivery"
    },
    {
      "name": "Email Layouts"
    },
    {
      "name": "Email Templates"
    },
    {
      "name": "Emails"
    },
    {
      "name": "Embed Policy"
    },
    {
      "name": "Events"
    },
    {
      "name": "External Transactions"
    },
    {
      "name": "Features & Entitlements"
    },
    {
      "name": "Gateway Marketplace"
    },
    {
      "name": "Gateway Oauth"
    },
    {
      "name": "Gateways"
    },
    {
      "name": "Hosted Invoices"
    },
    {
      "name": "Imports"
    },
    {
      "name": "Insights"
    },
    {
      "name": "Invoice Settings"
    },
    {
      "name": "Invoices"
    },
    {
      "name": "Merchant"
    },
    {
      "name": "Meter Events"
    },
    {
      "name": "Meters"
    },
    {
      "name": "Newsletter"
    },
    {
      "name": "Notifications"
    },
    {
      "name": "Onboarding"
    },
    {
      "name": "Orders"
    },
    {
      "name": "Pay Pages"
    },
    {
      "name": "Payment Element"
    },
    {
      "name": "Payment Links"
    },
    {
      "name": "Payment Methods"
    },
    {
      "name": "Payments"
    },
    {
      "name": "Payouts"
    },
    {
      "name": "Plans"
    },
    {
      "name": "Prices"
    },
    {
      "name": "Products"
    },
    {
      "name": "Quote Pages"
    },
    {
      "name": "Quotes"
    },
    {
      "name": "Receipt Pages"
    },
    {
      "name": "Refunds"
    },
    {
      "name": "Reports"
    },
    {
      "name": "Routing"
    },
    {
      "name": "Status"
    },
    {
      "name": "Subscription Schedules"
    },
    {
      "name": "Subscriptions"
    },
    {
      "name": "Tax"
    },
    {
      "name": "Tax Codes"
    },
    {
      "name": "Team"
    },
    {
      "name": "Team & Roles"
    },
    {
      "name": "Tenants"
    },
    {
      "name": "Tokens"
    },
    {
      "name": "Transactions"
    },
    {
      "name": "Webhooks"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    },
    {
      "apiKeyHeader": []
    }
  ],
  "paths": {
    "/account/audit-log": {
      "get": {
        "tags": [
          "Account"
        ],
        "summary": "List your account's activity log",
        "description": "Your account's activity (audit) log, newest first: sign-ins, API keys, team, refunds, disputes, webhooks, gateways, businesses, tax and settings changes. Only your own account's entries are returned. Needs the account owner's session, or a team member or API key with `audit:read`. Query: `action` (prefix, e.g. `auth.` or `api_key.revoked`), `actor` (user id or part of a name), `actorType` (user, team_member, api_key, admin, system, customer), `entityType`, `from` / `to` (ISO 8601), `page`, `pageSize` (max 100). Each entry has id, timestamp, action, entityType, entityId, userId, userName, actorType, ipAddress, userAgent and details (secrets are never recorded). Entries are append-only.\n\nRequired API key scope: `audit:read`.",
        "operationId": "getAccount_AuditLog",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "actor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "actorType",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "entityType",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 10000
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 100
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "audit:read"
      }
    },
    "/account/audit-log/export": {
      "get": {
        "tags": [
          "Account"
        ],
        "summary": "Export your account's activity log as CSV",
        "description": "The same entries as GET /account/audit-log as text/csv, with the same filters (no paging): the newest 10,000 matching entries. `X-Export-Rows` gives the row count and `X-Export-Truncated: true` means more entries matched. The export is itself recorded as `audit_log.exported`.\n\nRequired API key scope: `audit:read`.",
        "operationId": "getAccount_AuditLog_Export",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "actor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "actorType",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "entityType",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "audit:read"
      }
    },
    "/admin/analytics/platform-mrr": {
      "get": {
        "tags": [
          "Admin"
        ],
        "summary": "Retrieve analytics platform mrr",
        "description": "Restricted to platform administrators (dashboard admin session); API keys are not accepted.",
        "operationId": "getAdmin_Analytics_PlatformMrr",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "x-admin": true
      }
    },
    "/admin/contact-submissions": {
      "get": {
        "tags": [
          "Admin"
        ],
        "summary": "List admin contact submissions",
        "description": "Restricted to platform administrators (dashboard admin session); API keys are not accepted.",
        "operationId": "getAdmin_ContactSubmissions",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "x-admin": true
      }
    },
    "/admin/new-tenant-notifications": {
      "get": {
        "tags": [
          "Admin"
        ],
        "summary": "List admin new tenant notifications",
        "description": "Restricted to platform administrators (dashboard admin session); API keys are not accepted.",
        "operationId": "getAdmin_NewTenantNotifications",
        "parameters": [
          {
            "name": "tenantId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "x-admin": true
      }
    },
    "/admin/notification-channels": {
      "get": {
        "tags": [
          "Admin"
        ],
        "summary": "List notification channel configuration",
        "description": "Restricted to platform administrators (dashboard admin session); API keys are not accepted.",
        "operationId": "getAdmin_NotificationChannels",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "x-admin": true
      }
    },
    "/admin/notification-channels/rules": {
      "get": {
        "tags": [
          "Admin"
        ],
        "summary": "List notification channel rules",
        "description": "Restricted to platform administrators (dashboard admin session); API keys are not accepted.",
        "operationId": "getAdmin_NotificationChannels_Rules",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "x-admin": true
      },
      "put": {
        "tags": [
          "Admin"
        ],
        "summary": "Update notification channel rules",
        "description": "Restricted to platform administrators (dashboard admin session); API keys are not accepted.",
        "operationId": "putAdmin_NotificationChannels_Rules",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is validated by `bodySchema` in src/app/api/v1/admin/notification-channels/rules/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "x-admin": true
      }
    },
    "/admin/notification-channels/test": {
      "post": {
        "tags": [
          "Admin"
        ],
        "summary": "Send a notification channel test message",
        "description": "Restricted to platform administrators (dashboard admin session); API keys are not accepted.",
        "operationId": "postAdmin_NotificationChannels_Test",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is validated by `bodySchema` in src/app/api/v1/admin/notification-channels/test/route.ts."
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "x-admin": true
      }
    },
    "/admin/notification-channels/{channel}": {
      "put": {
        "tags": [
          "Admin"
        ],
        "summary": "Update a notification channel",
        "description": "Restricted to platform administrators (dashboard admin session); API keys are not accepted.",
        "operationId": "putAdmin_NotificationChannels_ByChannel",
        "parameters": [
          {
            "name": "channel",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is validated by `bodySchema` in src/app/api/v1/admin/notification-channels/[channel]/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "x-admin": true
      },
      "delete": {
        "tags": [
          "Admin"
        ],
        "summary": "Delete a notification channel",
        "description": "Restricted to platform administrators (dashboard admin session); API keys are not accepted.",
        "operationId": "deleteAdmin_NotificationChannels_ByChannel",
        "parameters": [
          {
            "name": "channel",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "x-admin": true
      }
    },
    "/admin/platform-catalog/sync": {
      "post": {
        "tags": [
          "Admin"
        ],
        "summary": "Create a platform catalog sync",
        "description": "Restricted to platform administrators (dashboard admin session); API keys are not accepted.",
        "operationId": "postAdmin_PlatformCatalog_Sync",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "x-admin": true
      }
    },
    "/admin/regions": {
      "get": {
        "tags": [
          "Admin"
        ],
        "summary": "List admin regions",
        "description": "Restricted to platform administrators (dashboard admin session); API keys are not accepted.",
        "operationId": "getAdmin_Regions",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "x-admin": true
      }
    },
    "/admin/schedule-outbox": {
      "get": {
        "tags": [
          "Admin"
        ],
        "summary": "Retrieve admin schedule outbox",
        "description": "Restricted to platform administrators (dashboard admin session); API keys are not accepted.",
        "operationId": "getAdmin_ScheduleOutbox",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "x-admin": true
      }
    },
    "/admin/schedule-outbox/drain": {
      "post": {
        "tags": [
          "Admin"
        ],
        "summary": "Create a schedule outbox drain",
        "description": "Restricted to platform administrators (dashboard admin session); API keys are not accepted.",
        "operationId": "postAdmin_ScheduleOutbox_Drain",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/admin/schedule-outbox/drain/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "x-admin": true
      }
    },
    "/admin/settings": {
      "get": {
        "tags": [
          "Admin"
        ],
        "summary": "Retrieve admin settings",
        "description": "Restricted to platform administrators (dashboard admin session); API keys are not accepted.",
        "operationId": "getAdmin_Settings",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "x-admin": true
      },
      "put": {
        "tags": [
          "Admin"
        ],
        "summary": "Update admin settings",
        "description": "Restricted to platform administrators (dashboard admin session); API keys are not accepted.",
        "operationId": "putAdmin_Settings",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/admin/settings/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "x-admin": true
      }
    },
    "/analytics": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Retrieve analytics",
        "description": "Required API key scope: `reports:read`.",
        "operationId": "getAnalytics",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "period",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "reports:read"
      }
    },
    "/analytics/events": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "List analytics events",
        "description": "Required API key scope: `reports:read`.",
        "operationId": "getAnalytics_Events",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "reports:read",
        "x-streaming": true
      }
    },
    "/analytics/subscriptions": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "List analytics subscriptions",
        "description": "Required API key scope: `reports:read`.",
        "operationId": "getAnalytics_Subscriptions",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "reports:read"
      }
    },
    "/api-keys": {
      "get": {
        "tags": [
          "API Keys"
        ],
        "summary": "List API keys",
        "description": "Required API key scope: `account:read`.",
        "operationId": "getApiKeys",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:read"
      },
      "post": {
        "tags": [
          "API Keys"
        ],
        "summary": "Create an API key",
        "description": "Required API key scope: `account:write`.",
        "operationId": "postApiKeys",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is validated by `createApiKeySchema` in src/app/api/v1/api-keys/route.ts."
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:write"
      }
    },
    "/api-keys/usage": {
      "get": {
        "tags": [
          "API Keys"
        ],
        "summary": "Retrieve API key usage",
        "description": "Required API key scope: `account:read`.",
        "operationId": "getApiKeys_Usage",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:read"
      }
    },
    "/api-keys/{keyId}": {
      "get": {
        "tags": [
          "API Keys"
        ],
        "summary": "Retrieve an API key",
        "description": "Required API key scope: `account:read`.",
        "operationId": "getApiKeys_ByKeyId",
        "parameters": [
          {
            "name": "keyId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:read"
      },
      "patch": {
        "tags": [
          "API Keys"
        ],
        "summary": "Update an API key",
        "description": "Required API key scope: `account:write`.",
        "operationId": "patchApiKeys_ByKeyId",
        "parameters": [
          {
            "name": "keyId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is validated by `updateScopesSchema` in src/app/api/v1/api-keys/[keyId]/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:write"
      },
      "delete": {
        "tags": [
          "API Keys"
        ],
        "summary": "Delete an API key",
        "description": "Required API key scope: `account:write`.",
        "operationId": "deleteApiKeys_ByKeyId",
        "parameters": [
          {
            "name": "keyId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:write"
      }
    },
    "/audit-log": {
      "get": {
        "tags": [
          "Audit Log"
        ],
        "summary": "Retrieve audit log",
        "description": "Restricted to platform administrators (dashboard admin session); API keys are not accepted.",
        "operationId": "getAuditLog",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "actorType",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "entityId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "entityType",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "merchantId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 10000
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 100
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "sortDirection",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "sortField",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 50
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "userId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "x-admin": true
      }
    },
    "/auth/forgot-password": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "Request a password reset email",
        "description": "Public endpoint: no API key required.",
        "operationId": "postAuth_ForgotPassword",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is validated by `forgotPasswordSchema` in src/app/api/v1/auth/forgot-password/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": []
      }
    },
    "/auth/magic-link": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "Send a magic sign-in link",
        "description": "Public endpoint: no API key required.",
        "operationId": "postAuth_MagicLink",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is validated by `sendSchema` in src/app/api/v1/auth/magic-link/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "security": []
      }
    },
    "/auth/magic-link/verify": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "Verify a magic sign-in link",
        "description": "Public endpoint: no API key required.",
        "operationId": "postAuth_MagicLink_Verify",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is validated by `verifySchema` in src/app/api/v1/auth/magic-link/verify/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "security": []
      }
    },
    "/auth/mfa": {
      "get": {
        "tags": [
          "Authentication"
        ],
        "summary": "Retrieve MFA enrolment status",
        "description": "",
        "operationId": "getAuth_Mfa",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ]
      },
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "Verify an MFA code",
        "description": "",
        "operationId": "postAuth_Mfa",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MfaCodeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Authentication"
        ],
        "summary": "Turn off two-factor authentication",
        "description": "",
        "operationId": "deleteAuth_Mfa",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ]
      }
    },
    "/auth/mfa/challenge": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "Create a mfa challenge",
        "description": "Public endpoint: no API key required.",
        "operationId": "postAuth_Mfa_Challenge",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/auth/mfa/challenge/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": []
      }
    },
    "/auth/oauth/identities": {
      "get": {
        "tags": [
          "Authentication"
        ],
        "summary": "List linked OAuth identities",
        "description": "",
        "operationId": "getAuth_Oauth_Identities",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ]
      }
    },
    "/auth/oauth/identities/{id}": {
      "delete": {
        "tags": [
          "Authentication"
        ],
        "summary": "Unlink an OAuth identity",
        "description": "",
        "operationId": "deleteAuth_Oauth_Identities_ById",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ]
      }
    },
    "/auth/oauth/link/{provider}/start": {
      "get": {
        "tags": [
          "Authentication"
        ],
        "summary": "Start linking an OAuth identity",
        "description": "",
        "operationId": "getAuth_Oauth_Link_ByProvider_Start",
        "parameters": [
          {
            "name": "provider",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "returnTo",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "302": {
            "description": "Redirect to the next step of the flow (see the Location header)."
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ]
      }
    },
    "/auth/oauth/providers": {
      "get": {
        "tags": [
          "Authentication"
        ],
        "summary": "List enabled OAuth providers",
        "description": "Public endpoint: no API key required.",
        "operationId": "getAuth_Oauth_Providers",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": []
      }
    },
    "/auth/oauth/{provider}/callback": {
      "get": {
        "tags": [
          "Authentication"
        ],
        "summary": "Complete OAuth sign-in",
        "description": "",
        "operationId": "getAuth_Oauth_ByProvider_Callback",
        "parameters": [
          {
            "name": "provider",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "code",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "error",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "302": {
            "description": "Redirect to the next step of the flow (see the Location header)."
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ]
      }
    },
    "/auth/oauth/{provider}/start": {
      "get": {
        "tags": [
          "Authentication"
        ],
        "summary": "Start OAuth sign-in",
        "description": "Public endpoint: no API key required.",
        "operationId": "getAuth_Oauth_ByProvider_Start",
        "parameters": [
          {
            "name": "provider",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "returnTo",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "302": {
            "description": "Redirect to the next step of the flow (see the Location header)."
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "security": []
      }
    },
    "/auth/reset-password": {
      "get": {
        "tags": [
          "Authentication"
        ],
        "summary": "Validate a password reset token",
        "description": "Public endpoint: no API key required.",
        "operationId": "getAuth_ResetPassword",
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "security": []
      },
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "Reset a password",
        "description": "Public endpoint: no API key required.",
        "operationId": "postAuth_ResetPassword",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is validated by `resetSchema` in src/app/api/v1/auth/reset-password/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "security": []
      }
    },
    "/auth/session": {
      "get": {
        "tags": [
          "Authentication"
        ],
        "summary": "Retrieve the current session",
        "description": "Dashboard session only: API keys are not accepted.",
        "operationId": "getAuth_Session",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {},
          {
            "sessionCookie": []
          }
        ]
      },
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "Sign in with email and password",
        "description": "Dashboard session only: API keys are not accepted.",
        "operationId": "postAuth_Session",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoginRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ]
      }
    },
    "/auth/sessions": {
      "get": {
        "tags": [
          "Authentication"
        ],
        "summary": "List active sign-in sessions",
        "description": "Dashboard session only: API keys are not accepted.",
        "operationId": "getAuth_Sessions",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Authentication"
        ],
        "summary": "Sign out of all other sessions",
        "description": "Dashboard session only: API keys are not accepted.",
        "operationId": "deleteAuth_Sessions",
        "parameters": [
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ]
      }
    },
    "/auth/sessions/revoke-all": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "Revoke all other sign-in sessions",
        "description": "Dashboard session only: API keys are not accepted.",
        "operationId": "postAuth_Sessions_RevokeAll",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ]
      }
    },
    "/auth/sessions/{sessionId}/revoke": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "Revoke a sign-in session",
        "description": "Dashboard session only: API keys are not accepted.",
        "operationId": "postAuth_Sessions_BySessionId_Revoke",
        "parameters": [
          {
            "name": "sessionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ]
      }
    },
    "/auth/signup": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "Create a merchant account",
        "description": "Public endpoint: no API key required.",
        "operationId": "postAuth_Signup",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is validated by `signupSchema` in src/app/api/v1/auth/signup/route.ts."
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "security": []
      }
    },
    "/balance": {
      "get": {
        "tags": [
          "Balance"
        ],
        "summary": "Retrieve balance",
        "description": "Required API key scope: `payments:read`.",
        "operationId": "getBalance",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "payments:read"
      }
    },
    "/balance/transactions": {
      "get": {
        "tags": [
          "Balance"
        ],
        "summary": "List balance transactions",
        "description": "Required API key scope: `payments:read`.",
        "operationId": "getBalance_Transactions",
        "parameters": [
          {
            "name": "dateFrom",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "dateTo",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "sortDirection",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "sortField",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 50
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "payments:read"
      }
    },
    "/billing": {
      "get": {
        "tags": [
          "Billing"
        ],
        "summary": "Retrieve billing",
        "description": "Required API key scope: `billing:read`.",
        "operationId": "getBilling",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "billing:read"
      }
    },
    "/billing-page/access": {
      "post": {
        "tags": [
          "Billing Page"
        ],
        "summary": "Create a billing page access",
        "description": "Public endpoint: no API key required.",
        "operationId": "postBillingPage_Access",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is validated by `bodySchema` in src/app/api/v1/billing-page/access/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": []
      }
    },
    "/billing-page/cancel": {
      "post": {
        "tags": [
          "Billing Page"
        ],
        "summary": "Create a billing page cancel",
        "description": "Public endpoint: no API key required.",
        "operationId": "postBillingPage_Cancel",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/billing-page/cancel/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": []
      }
    },
    "/billing-page/change-plan": {
      "post": {
        "tags": [
          "Billing Page"
        ],
        "summary": "Change plan from the billing page",
        "description": "Public endpoint: no API key required.",
        "operationId": "postBillingPage_ChangePlan",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/billing-page/change-plan/route.ts."
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "402": {
            "$ref": "#/components/responses/Error402"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": []
      }
    },
    "/billing-page/export": {
      "get": {
        "tags": [
          "Billing Page"
        ],
        "summary": "Export billing history (billing page token)",
        "description": "Public endpoint: no API key required.",
        "operationId": "getBillingPage_Export",
        "parameters": [
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "token",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": []
      }
    },
    "/billing-page/pause": {
      "post": {
        "tags": [
          "Billing Page"
        ],
        "summary": "Create a billing page pause",
        "description": "Public endpoint: no API key required.",
        "operationId": "postBillingPage_Pause",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/billing-page/pause/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": []
      }
    },
    "/billing-page/pay-invoice": {
      "post": {
        "tags": [
          "Billing Page"
        ],
        "summary": "Pay a renewal invoice from the billing page",
        "description": "Public endpoint: no API key required.",
        "operationId": "postBillingPage_PayInvoice",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/billing-page/pay-invoice/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": []
      }
    },
    "/billing-page/plan-options": {
      "get": {
        "tags": [
          "Billing Page"
        ],
        "summary": "List billing page plan options",
        "description": "Public endpoint: no API key required.",
        "operationId": "getBillingPage_PlanOptions",
        "parameters": [
          {
            "name": "subscriptionId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "token",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": []
      }
    },
    "/billing-page/preview": {
      "get": {
        "tags": [
          "Billing Page"
        ],
        "summary": "Preview the hosted billing page",
        "description": "Required API key scope: `billing:read`.",
        "operationId": "getBillingPage_Preview",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "billing:read"
      }
    },
    "/billing-page/reauthorise": {
      "post": {
        "tags": [
          "Billing Page"
        ],
        "summary": "Create a billing page reauthorise",
        "description": "Public endpoint: no API key required.",
        "operationId": "postBillingPage_Reauthorise",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/billing-page/reauthorise/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": []
      }
    },
    "/billing-page/resolve": {
      "get": {
        "tags": [
          "Billing Page"
        ],
        "summary": "Resolve a billing page token (public)",
        "description": "Public endpoint: no API key required.",
        "operationId": "getBillingPage_Resolve",
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": []
      }
    },
    "/billing-page/setup-session": {
      "post": {
        "tags": [
          "Billing Page"
        ],
        "summary": "Create a billing page setup session",
        "description": "Public endpoint: no API key required.",
        "operationId": "postBillingPage_SetupSession",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/billing-page/setup-session/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": []
      }
    },
    "/billing-page/tokens": {
      "get": {
        "tags": [
          "Billing Page"
        ],
        "summary": "List billing page tokens",
        "description": "Required API key scope: `billing:read`.",
        "operationId": "getBillingPage_Tokens",
        "parameters": [
          {
            "name": "customerId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "billing:read"
      },
      "post": {
        "tags": [
          "Billing Page"
        ],
        "summary": "Create a billing page token",
        "description": "Required API key scope: `billing:write`.",
        "operationId": "postBillingPage_Tokens",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/billing-page/tokens/route.ts."
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "billing:write"
      }
    },
    "/billing-page/tokens/{tokenId}": {
      "delete": {
        "tags": [
          "Billing Page"
        ],
        "summary": "Delete a token",
        "description": "Required API key scope: `billing:write`.",
        "operationId": "deleteBillingPage_Tokens_ByTokenId",
        "parameters": [
          {
            "name": "tokenId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "billing:write"
      }
    },
    "/billing/upgrade": {
      "post": {
        "tags": [
          "Billing"
        ],
        "summary": "Upgrade the platform plan",
        "description": "Required API key scope: `billing:write`.",
        "operationId": "postBilling_Upgrade",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/billing/upgrade/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "billing:write"
      }
    },
    "/brand-assets/{assetId}": {
      "get": {
        "tags": [
          "Brand Assets"
        ],
        "summary": "Retrieve a brand asset",
        "description": "Public endpoint: no API key required.",
        "operationId": "getBrandAssets_ByAssetId",
        "parameters": [
          {
            "name": "assetId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": []
      }
    },
    "/branding": {
      "get": {
        "tags": [
          "Branding"
        ],
        "summary": "Retrieve branding",
        "description": "Required API key scope: `account:read`.",
        "operationId": "getBranding",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:read"
      },
      "put": {
        "tags": [
          "Branding"
        ],
        "summary": "Update branding",
        "description": "Required API key scope: `account:write`.",
        "operationId": "putBranding",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/branding/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:write"
      }
    },
    "/branding/assets/{kind}": {
      "post": {
        "tags": [
          "Branding"
        ],
        "summary": "Create an asset",
        "description": "Required API key scope: `account:write`.",
        "operationId": "postBranding_Assets_ByKind",
        "parameters": [
          {
            "name": "kind",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/branding/assets/[kind]/route.ts."
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:write"
      },
      "delete": {
        "tags": [
          "Branding"
        ],
        "summary": "Delete an asset",
        "description": "Required API key scope: `account:write`.",
        "operationId": "deleteBranding_Assets_ByKind",
        "parameters": [
          {
            "name": "kind",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:write"
      }
    },
    "/business-entities": {
      "get": {
        "tags": [
          "Business Entities"
        ],
        "summary": "List business entities",
        "description": "Required API key scope: `account:read`.",
        "operationId": "getBusinessEntities",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:read"
      },
      "post": {
        "tags": [
          "Business Entities"
        ],
        "summary": "Create a business entity",
        "description": "Required API key scope: `account:write`.",
        "operationId": "postBusinessEntities",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/business-entities/route.ts."
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:write"
      }
    },
    "/business-entities/{entityId}": {
      "get": {
        "tags": [
          "Business Entities"
        ],
        "summary": "Retrieve a business entity",
        "description": "Required API key scope: `account:read`.",
        "operationId": "getBusinessEntities_ByEntityId",
        "parameters": [
          {
            "name": "entityId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:read"
      },
      "put": {
        "tags": [
          "Business Entities"
        ],
        "summary": "Update a business entity",
        "description": "Required API key scope: `account:write`.",
        "operationId": "putBusinessEntities_ByEntityId",
        "parameters": [
          {
            "name": "entityId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/business-entities/[entityId]/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:write"
      },
      "delete": {
        "tags": [
          "Business Entities"
        ],
        "summary": "Delete a business entity",
        "description": "Required API key scope: `account:write`.",
        "operationId": "deleteBusinessEntities_ByEntityId",
        "parameters": [
          {
            "name": "entityId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:write"
      }
    },
    "/cashfree/subscription-redirect": {
      "get": {
        "tags": [
          "Cashfree"
        ],
        "summary": "Retrieve cashfree subscription redirect",
        "description": "",
        "operationId": "getCashfree_SubscriptionRedirect",
        "parameters": [
          {
            "name": "subs_session_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "target",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ]
      }
    },
    "/checkout-sessions": {
      "get": {
        "tags": [
          "Checkout Sessions"
        ],
        "summary": "List checkout sessions",
        "description": "Return a paginated list of checkout sessions, newest first. Requires payments:read.\n\nRequired API key scope: `payments:read`.",
        "operationId": "getCheckoutSessions",
        "parameters": [
          {
            "name": "dateFrom",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "dateTo",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "mode",
            "in": "query",
            "required": false,
            "description": "payment or subscription.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number (1-based). Defaults to 1.",
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 10000
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "description": "Results per page, 1-100. Defaults to 25.",
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 100
            }
          },
          {
            "name": "sortDirection",
            "in": "query",
            "required": false,
            "description": "asc or desc. Defaults to desc.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "sortField",
            "in": "query",
            "required": false,
            "description": "Field to sort by (e.g. createdAt, or a money column such as transactionAmountUsdCents). Defaults to createdAt.",
            "schema": {
              "type": "string",
              "maxLength": 50
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "open, pending, or complete.",
            "schema": {
              "type": "string",
              "maxLength": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "payments:read"
      },
      "post": {
        "tags": [
          "Checkout Sessions"
        ],
        "summary": "Create a checkout session",
        "description": "Create a checkout session. itemLocalCurrency is required with any inline line; when every line names one of your prices it is their one currency. itemLocalCurrencyAmount = sum of line items + tax + convenience fee, in itemLocalCurrency's smallest unit; itemAmountUsdCents is the same total in USD cents at itemUsdToLocalCurrencyRate. taxRate alone computes the tax from the subtotal. Line items keep their unitPrice and total in itemLocalCurrency. webhookUrl must use https. Returns 201. Requires payments:write; honours Idempotency-Key.\n\nRequired API key scope: `payments:write`.\n\nHonours the `Idempotency-Key` header.",
        "operationId": "postCheckoutSessions",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "lineItems": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "description": {
                          "type": "string",
                          "description": "Label for the line item. Required unless priceId is set."
                        },
                        "quantity": {
                          "type": "integer",
                          "description": "Number of units (>= 1)."
                        },
                        "unitPrice": {
                          "type": "integer",
                          "description": "Price per unit in the smallest unit of itemLocalCurrency. Required unless priceId is set (then the price's own amount is charged). The line total is computed for you."
                        },
                        "priceId": {
                          "type": "string",
                          "description": "One of your prices. In subscription mode a recurring price makes the line recurring."
                        },
                        "recurring": {
                          "type": "object",
                          "description": "Subscription mode: { interval: \"day\"|\"week\"|\"month\"|\"year\", intervalCount?, startsAt? }. The price is found or created once per description, amount, currency and interval. Recurring lines are grouped by interval, intervalCount and startsAt: each group becomes its own subscription after the one payment, on one payment method authorisation (the session returns subscriptions[]). startsAt (ISO date or date-time, future, at most 3 years; alias firstChargeAt) delays the line: it is not charged today and its subscription is first charged on that date (400 INVALID_STARTS_AT, STARTS_AT_IN_PAST, STARTS_AT_TOO_FAR; NO_AMOUNT_DUE when nothing is charged today). Lines without recurring are charged on the first payment only."
                        },
                        "adjustableQuantity": {
                          "type": "boolean",
                          "description": "Defaults to false: the quantity is fixed and the item cannot be removed. Set true to let the customer change the quantity or remove the item on the checkout page. Not supported with mode \"subscription\"."
                        },
                        "productKey": {
                          "type": "string",
                          "description": "Inline recurring lines: a stable key of what is sold, shared by every customer buying it (1-64 of a-z 0-9 _ - ., e.g. \"hosting_3\", \"com_domain_registration\"). One product per key and one price per key and cycle, in your default currency; another currency the line is in becomes that price's currency option at the exact line amount."
                        },
                        "productName": {
                          "type": "string",
                          "description": "Inline recurring lines with productKey: the item's name (max 255), e.g. \"Starter\" or \".com domain registration\"."
                        },
                        "productCategory": {
                          "type": "string",
                          "description": "Inline recurring lines with productKey: the item's category (max 100), e.g. \"Web Hosting\". The product is named \"<category> - <item>\" (\"Web Hosting - Starter\") and the price <category>_<item>, e.g. web_hosting_starter (no currency or amount: one price holds an amount per currency). Names are catalog references; customers see the product and their own line text."
                        }
                      },
                      "required": [
                        "quantity"
                      ]
                    },
                    "description": "Items to charge. Required in payment mode; in subscription mode send recurring line items or priceId."
                  },
                  "mode": {
                    "type": "string",
                    "enum": [
                      "payment",
                      "subscription"
                    ],
                    "description": "Defaults to \"payment\" (one-time). \"subscription\": PaymentHooks creates the subscription when the payment succeeds and auto-debits renewals. Other values return 400 INVALID_MODE; subscription mode without a recurring item returns 400 NO_RECURRING_ITEM."
                  },
                  "priceId": {
                    "type": "string",
                    "description": "Subscription mode: one of your recurring prices (the subscription's price). Replaces metadata.priceId, which is still accepted. A price with trialDays starts a free trial at checkout when every recurring line shares it (nothing of them charged today; 422 TRIAL_MISMATCH otherwise, 422 TRIAL_UNSUPPORTED_GATEWAY when no subscription gateway can save a method without charging)."
                  },
                  "itemLocalCurrency": {
                    "type": "string",
                    "description": "ISO 4217 code of the line item amounts, e.g. \"USD\" or \"INR\". Required when any line is priced inline (unitPrice without priceId). Derived when every line, and priceId, names one of your prices: their one currency (different currencies: 400 CURRENCY_MISMATCH). No default (see /docs/money-and-currencies)."
                  },
                  "itemTaxLocalCurrencyAmount": {
                    "type": "integer",
                    "description": "Tax in the smallest unit of itemLocalCurrency (non-negative integer), added to the total. Takes precedence over the computed value. Returned with itemTaxAmountUsdCents."
                  },
                  "taxRate": {
                    "type": "number",
                    "description": "Tax percentage, 0-100 (e.g. 18). When itemTaxLocalCurrencyAmount is omitted, tax is computed as round(subtotal x taxRate / 100)."
                  },
                  "itemConvenienceFeeLocalCurrencyAmount": {
                    "type": "integer",
                    "description": "Fee in the smallest unit of itemLocalCurrency (non-negative integer), added to the total. Returned with itemConvenienceFeeAmountUsdCents."
                  },
                  "customerId": {
                    "type": "string",
                    "description": "ID of an existing customer to associate with the session."
                  },
                  "customerEmail": {
                    "type": "string",
                    "description": "Pre-fills the email field on the hosted checkout."
                  },
                  "customerCountry": {
                    "type": "string",
                    "description": "The customer's billing country (ISO 3166-1 alpha-2). Used by automatic tax and pre-filled on the checkout; when omitted, the customer selects it on the checkout before paying. customerState (needed for India, the United States and Canada) and customerPostalCode are also accepted; invalid values return 400."
                  },
                  "successUrl": {
                    "type": "string",
                    "description": "Where the customer is sent after a successful payment."
                  },
                  "cancelUrl": {
                    "type": "string",
                    "description": "Where the customer is sent after a failed or cancelled payment."
                  },
                  "webhookUrl": {
                    "type": "string",
                    "description": "HTTPS URL that receives this session's events (max 2048 chars). http:// URLs return 400 VALIDATION_ERROR."
                  },
                  "captureMethod": {
                    "type": "string",
                    "enum": [
                      "automatic",
                      "manual"
                    ],
                    "description": "Defaults to \"automatic\"."
                  },
                  "payOnceOption": {
                    "type": "string",
                    "enum": [
                      "auto",
                      "on",
                      "off"
                    ],
                    "description": "Subscription checkouts: offer Pay once (first period only, renewals invoiced) next to Subscribe. auto (default) offers it unless Settings > Subscriptions > Offer Pay once is switched off; on always offers it; off never does."
                  },
                  "paymentMethod": {
                    "type": "string",
                    "description": "Preferred payment method, stored in metadata."
                  },
                  "theme": {
                    "type": "object",
                    "description": "Checkout branding: primaryColor and backgroundColor (hex), fontFamily, borderRadius, logoUrl."
                  },
                  "metadata": {
                    "type": "object",
                    "description": "Key-value pairs stored on the session.",
                    "additionalProperties": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "payments:write"
      }
    },
    "/checkout-sessions/{sessionId}": {
      "get": {
        "tags": [
          "Checkout Sessions"
        ],
        "summary": "Retrieve a checkout session",
        "description": "Retrieve a checkout session. Includes paymentId once a payment has been attempted. Requires payments:read.\n\nRequired API key scope: `payments:read`.",
        "operationId": "getCheckoutSessions_BySessionId",
        "parameters": [
          {
            "name": "sessionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "payments:read"
      }
    },
    "/checkout-sessions/{sessionId}/apply-coupon": {
      "post": {
        "tags": [
          "Checkout Sessions"
        ],
        "summary": "Apply a coupon to a checkout session",
        "description": "Public endpoint: no API key required.",
        "operationId": "postCheckoutSessions_BySessionId_ApplyCoupon",
        "parameters": [
          {
            "name": "sessionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/checkout-sessions/[sessionId]/apply-coupon/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "security": []
      },
      "delete": {
        "tags": [
          "Checkout Sessions"
        ],
        "summary": "Remove the coupon from a checkout session",
        "description": "Public endpoint: no API key required.",
        "operationId": "deleteCheckoutSessions_BySessionId_ApplyCoupon",
        "parameters": [
          {
            "name": "sessionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "security": []
      }
    },
    "/checkout-sessions/{sessionId}/billing-address": {
      "put": {
        "tags": [
          "Checkout Sessions"
        ],
        "summary": "Update checkout session billing address",
        "description": "Public endpoint: no API key required.",
        "operationId": "putCheckoutSessions_BySessionId_BillingAddress",
        "parameters": [
          {
            "name": "sessionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/checkout-sessions/[sessionId]/billing-address/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": []
      }
    },
    "/checkout-sessions/{sessionId}/events": {
      "get": {
        "tags": [
          "Checkout Sessions"
        ],
        "summary": "List checkout session events",
        "description": "Public endpoint: no API key required.",
        "operationId": "getCheckoutSessions_BySessionId_Events",
        "parameters": [
          {
            "name": "sessionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [],
        "x-streaming": true
      }
    },
    "/checkout-sessions/{sessionId}/gateway-keys": {
      "get": {
        "tags": [
          "Checkout Sessions"
        ],
        "summary": "Retrieve publishable gateway keys for a session",
        "description": "Public endpoint: no API key required.",
        "operationId": "getCheckoutSessions_BySessionId_GatewayKeys",
        "parameters": [
          {
            "name": "sessionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "connectionId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "security": []
      }
    },
    "/checkout-sessions/{sessionId}/order-notes": {
      "post": {
        "tags": [
          "Checkout Sessions"
        ],
        "summary": "Set checkout session order notes",
        "description": "Public endpoint: no API key required.",
        "operationId": "postCheckoutSessions_BySessionId_OrderNotes",
        "parameters": [
          {
            "name": "sessionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/checkout-sessions/[sessionId]/order-notes/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "security": []
      }
    },
    "/checkout-sessions/{sessionId}/pay": {
      "post": {
        "tags": [
          "Checkout Sessions"
        ],
        "summary": "Pay a checkout session",
        "description": "Public endpoint called by the hosted checkout to pay a session. The charge is in the customer's currency when the selected gateway supports it, otherwise USD, otherwise the session's itemLocalCurrency. The response transactionLocalCurrencyAmount and transactionLocalCurrency are what the gateway charged. In test mode the payment is simulated and succeeds. Errors: 409 SESSION_ALREADY_COMPLETED, 410 EXPIRED, 400 SESSION_CLOSED, 402 FRAUD_BLOCKED, 422 UNSUPPORTED_CURRENCY, 409 PRICE_CHANGED, 400 TERMS_NOT_ACCEPTED. Fraud screening fails closed: if it is unavailable the payment is rejected with 500 INTERNAL_ERROR and no gateway is called. When 3D Secure is required, status is action_required and actionUrl is returned.\n\nPublic endpoint: no API key required.",
        "operationId": "postCheckoutSessions_BySessionId_Pay",
        "parameters": [
          {
            "name": "sessionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "description": "Customer email. A customer record is found or created for it."
                  },
                  "cardNumber": {
                    "type": "string",
                    "description": "Card number (spaces allowed), for gateways that take card details directly."
                  },
                  "cardExpiry": {
                    "type": "string",
                    "description": "Expiry in MM/YY format."
                  },
                  "cardCvc": {
                    "type": "string",
                    "description": "Card security code."
                  },
                  "cardholderName": {
                    "type": "string",
                    "description": "Name on the card."
                  },
                  "phone": {
                    "type": "string",
                    "description": "Customer phone, forwarded to the gateway."
                  },
                  "gatewayConnectionId": {
                    "type": "string",
                    "description": "Gateway connection chosen on the checkout page."
                  },
                  "currency": {
                    "type": "string",
                    "description": "Currency the customer was shown on the Pay button. Charged in when the gateway supports it; otherwise USD, then the session's itemLocalCurrency."
                  },
                  "displayAmount": {
                    "type": "integer",
                    "description": "Amount the customer was shown, in that currency's smallest unit. The server re-derives the charge from itemAmountUsdCents and refuses a difference over 1% with 409 PRICE_CHANGED."
                  },
                  "termsAccepted": {
                    "type": "boolean",
                    "description": "Required (true) when the merchant has terms, privacy or refund links; otherwise 400 TERMS_NOT_ACCEPTED."
                  }
                },
                "required": [
                  "email"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "402": {
            "$ref": "#/components/responses/Error402"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "410": {
            "$ref": "#/components/responses/Error410"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": []
      }
    },
    "/checkout-sessions/{sessionId}/pi": {
      "post": {
        "tags": [
          "Checkout Sessions"
        ],
        "summary": "Create a gateway payment intent for a session",
        "description": "Public endpoint: no API key required.",
        "operationId": "postCheckoutSessions_BySessionId_Pi",
        "parameters": [
          {
            "name": "sessionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/checkout-sessions/[sessionId]/pi/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "410": {
            "$ref": "#/components/responses/Error410"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "security": []
      }
    },
    "/checkout-sessions/{sessionId}/public": {
      "get": {
        "tags": [
          "Checkout Sessions"
        ],
        "summary": "Retrieve a checkout session (public)",
        "description": "Public, unauthenticated read used by the hosted checkout page. Returns 410 EXPIRED after expiresAt.\n\nPublic endpoint: no API key required.",
        "operationId": "getCheckoutSessions_BySessionId_Public",
        "parameters": [
          {
            "name": "sessionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "410": {
            "$ref": "#/components/responses/Error410"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": []
      }
    },
    "/checkout-sessions/{sessionId}/razorpay-order": {
      "post": {
        "tags": [
          "Checkout Sessions"
        ],
        "summary": "Create a Razorpay order for a session",
        "description": "Public endpoint: no API key required.",
        "operationId": "postCheckoutSessions_BySessionId_RazorpayOrder",
        "parameters": [
          {
            "name": "sessionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/checkout-sessions/[sessionId]/razorpay-order/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "410": {
            "$ref": "#/components/responses/Error410"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "security": []
      }
    },
    "/checkout-sessions/{sessionId}/renewal-mode": {
      "post": {
        "tags": [
          "Checkout Sessions"
        ],
        "summary": "Choose how a subscription checkout renews",
        "description": "Public endpoint: no API key required.",
        "operationId": "postCheckoutSessions_BySessionId_RenewalMode",
        "parameters": [
          {
            "name": "sessionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/checkout-sessions/[sessionId]/renewal-mode/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": []
      }
    },
    "/checkout-sessions/{sessionId}/saved-cards": {
      "get": {
        "tags": [
          "Checkout Sessions"
        ],
        "summary": "List a customer's saved cards for a session",
        "description": "Public endpoint: no API key required.",
        "operationId": "getCheckoutSessions_BySessionId_SavedCards",
        "parameters": [
          {
            "name": "sessionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "email",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": []
      }
    },
    "/checkout-sessions/{sessionId}/setup": {
      "post": {
        "tags": [
          "Checkout Sessions"
        ],
        "summary": "Create a checkout session setup",
        "description": "Public endpoint: no API key required.",
        "operationId": "postCheckoutSessions_BySessionId_Setup",
        "parameters": [
          {
            "name": "sessionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/checkout-sessions/[sessionId]/setup/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": []
      }
    },
    "/checkout-sessions/{sessionId}/shipping": {
      "post": {
        "tags": [
          "Checkout Sessions"
        ],
        "summary": "Create a checkout session shipping",
        "description": "",
        "operationId": "postCheckoutSessions_BySessionId_Shipping",
        "parameters": [
          {
            "name": "sessionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/checkout-sessions/[sessionId]/shipping/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ]
      }
    },
    "/checkout-sessions/{sessionId}/trial": {
      "post": {
        "tags": [
          "Checkout Sessions"
        ],
        "summary": "Create a checkout session trial",
        "description": "",
        "operationId": "postCheckoutSessions_BySessionId_Trial",
        "parameters": [
          {
            "name": "sessionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/checkout-sessions/[sessionId]/trial/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ]
      }
    },
    "/checkout-sessions/{sessionId}/update-items": {
      "post": {
        "tags": [
          "Checkout Sessions"
        ],
        "summary": "Update checkout session line items",
        "description": "Public endpoint: no API key required.",
        "operationId": "postCheckoutSessions_BySessionId_UpdateItems",
        "parameters": [
          {
            "name": "sessionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/checkout-sessions/[sessionId]/update-items/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "security": []
      }
    },
    "/checkout-sessions/{sessionId}/wallet-confirm": {
      "post": {
        "tags": [
          "Checkout Sessions"
        ],
        "summary": "Confirm a wallet payment",
        "description": "Public endpoint: no API key required.",
        "operationId": "postCheckoutSessions_BySessionId_WalletConfirm",
        "parameters": [
          {
            "name": "sessionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/checkout-sessions/[sessionId]/wallet-confirm/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": []
      }
    },
    "/checkout-sessions/{sessionId}/wallet-init": {
      "post": {
        "tags": [
          "Checkout Sessions"
        ],
        "summary": "Start a wallet payment (Apple Pay / Google Pay)",
        "description": "Public endpoint: no API key required.",
        "operationId": "postCheckoutSessions_BySessionId_WalletInit",
        "parameters": [
          {
            "name": "sessionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/checkout-sessions/[sessionId]/wallet-init/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "410": {
            "$ref": "#/components/responses/Error410"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": []
      }
    },
    "/checkout/sessions": {
      "get": {
        "tags": [
          "Checkout Sessions"
        ],
        "summary": "List checkout sessions",
        "description": "Alias of GET /checkout-sessions.\n\nRequired API key scope: `payments:read`.",
        "operationId": "getCheckout_Sessions",
        "parameters": [
          {
            "name": "dateFrom",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "dateTo",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "mode",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 10000
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 100
            }
          },
          {
            "name": "sortDirection",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "sortField",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 50
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "payments:read"
      },
      "post": {
        "tags": [
          "Checkout Sessions"
        ],
        "summary": "Create a checkout session (SDK shape)",
        "description": "Accepts the @paymenthooks/sdk snake_case body (amount or line_items with price_id, success_url, cancel_url, customer_id, metadata), translates it and forwards to POST /checkout-sessions.\n\nRequired API key scope: `payments:write`.\n\nHonours the `Idempotency-Key` header.",
        "operationId": "postCheckout_Sessions",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "success_url"
                ],
                "properties": {
                  "amount": {
                    "type": "integer",
                    "description": "Total in the smallest unit of currency. Required when line_items is omitted; becomes the session's itemLocalCurrencyAmount."
                  },
                  "currency": {
                    "type": "string",
                    "description": "ISO 4217 code; becomes the session's itemLocalCurrency. Required with amount (no default). With line_items it must match the prices' itemLocalCurrency."
                  },
                  "success_url": {
                    "type": "string",
                    "format": "uri"
                  },
                  "cancel_url": {
                    "type": "string",
                    "format": "uri"
                  },
                  "customer_id": {
                    "type": "string"
                  },
                  "line_items": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "price_id"
                      ],
                      "properties": {
                        "price_id": {
                          "type": "string"
                        },
                        "quantity": {
                          "type": "integer",
                          "minimum": 1
                        }
                      }
                    }
                  },
                  "metadata": {
                    "type": "object",
                    "additionalProperties": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "payments:write"
      }
    },
    "/checkout/sessions/{sessionId}": {
      "get": {
        "tags": [
          "Checkout Sessions"
        ],
        "summary": "Retrieve a checkout session",
        "description": "Alias of GET /checkout-sessions/{sessionId}.\n\nRequired API key scope: `payments:read`.",
        "operationId": "getCheckout_Sessions_BySessionId",
        "parameters": [
          {
            "name": "sessionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "payments:read"
      }
    },
    "/communications/email-preview/{templateCode}": {
      "get": {
        "tags": [
          "Communications"
        ],
        "summary": "Retrieve an email preview",
        "description": "",
        "operationId": "getCommunications_EmailPreview_ByTemplateCode",
        "parameters": [
          {
            "name": "templateCode",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ]
      }
    },
    "/communications/status": {
      "get": {
        "tags": [
          "Communications"
        ],
        "summary": "Retrieve email provider status",
        "description": "Required API key scope: `account:read`.",
        "operationId": "getCommunications_Status",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:read"
      }
    },
    "/communications/test-connection": {
      "post": {
        "tags": [
          "Communications"
        ],
        "summary": "Test the email provider connection",
        "description": "Required API key scope: `account:write`.",
        "operationId": "postCommunications_TestConnection",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "502": {
            "$ref": "#/components/responses/Error502"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:write"
      }
    },
    "/communications/test-email": {
      "get": {
        "tags": [
          "Communications"
        ],
        "summary": "List test email options",
        "description": "",
        "operationId": "getCommunications_TestEmail",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ]
      },
      "post": {
        "tags": [
          "Communications"
        ],
        "summary": "Send a test email",
        "description": "",
        "operationId": "postCommunications_TestEmail",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is validated by `bodySchema` in src/app/api/v1/communications/test-email/route.ts."
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ]
      }
    },
    "/compliance": {
      "get": {
        "tags": [
          "Compliance"
        ],
        "summary": "Retrieve compliance",
        "description": "Required API key scope: `account:read`.",
        "operationId": "getCompliance",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:read"
      },
      "put": {
        "tags": [
          "Compliance"
        ],
        "summary": "Update compliance",
        "description": "Required API key scope: `account:write`.",
        "operationId": "putCompliance",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/compliance/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:write"
      }
    },
    "/connect/accounts": {
      "get": {
        "tags": [
          "Connect"
        ],
        "summary": "List connect accounts",
        "description": "Required API key scope: `payments:read`.",
        "operationId": "getConnect_Accounts",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "payments:read"
      },
      "post": {
        "tags": [
          "Connect"
        ],
        "summary": "Create a connected account",
        "description": "Required API key scope: `payments:write`.",
        "operationId": "postConnect_Accounts",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/connect/accounts/route.ts."
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "payments:write"
      }
    },
    "/connect/accounts/{accountId}": {
      "get": {
        "tags": [
          "Connect"
        ],
        "summary": "Retrieve an account",
        "description": "Required API key scope: `payments:read`.",
        "operationId": "getConnect_Accounts_ByAccountId",
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "payments:read"
      },
      "patch": {
        "tags": [
          "Connect"
        ],
        "summary": "Update an account",
        "description": "Required API key scope: `payments:write`.",
        "operationId": "patchConnect_Accounts_ByAccountId",
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/connect/accounts/[accountId]/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "payments:write"
      },
      "delete": {
        "tags": [
          "Connect"
        ],
        "summary": "Delete an account",
        "description": "Required API key scope: `payments:write`.",
        "operationId": "deleteConnect_Accounts_ByAccountId",
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "payments:write"
      }
    },
    "/connect/accounts/{accountId}/onboarding": {
      "post": {
        "tags": [
          "Connect"
        ],
        "summary": "Start onboarding for an account",
        "description": "Required API key scope: `payments:write`.",
        "operationId": "postConnect_Accounts_ByAccountId_Onboarding",
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/connect/accounts/[accountId]/onboarding/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "payments:write"
      }
    },
    "/connect/charges": {
      "post": {
        "tags": [
          "Connect"
        ],
        "summary": "Create a connected-account charge",
        "description": "Required API key scope: `payments:write`.",
        "operationId": "postConnect_Charges",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/connect/charges/route.ts."
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "payments:write"
      }
    },
    "/connect/transfers": {
      "get": {
        "tags": [
          "Connect"
        ],
        "summary": "List connect transfers",
        "description": "Required API key scope: `payments:read`.",
        "operationId": "getConnect_Transfers",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "payments:read"
      },
      "post": {
        "tags": [
          "Connect"
        ],
        "summary": "Create a transfer to a connected account",
        "description": "Required API key scope: `payments:write`.",
        "operationId": "postConnect_Transfers",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/connect/transfers/route.ts."
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "payments:write"
      }
    },
    "/contact": {
      "post": {
        "tags": [
          "Contact"
        ],
        "summary": "Create a contact",
        "description": "Public endpoint: no API key required.",
        "operationId": "postContact",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is validated by `contactSchema` in src/app/api/v1/contact/route.ts."
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": []
      }
    },
    "/coupons": {
      "get": {
        "tags": [
          "Coupons"
        ],
        "summary": "List coupons",
        "description": "Required API key scope: `products:read`.",
        "operationId": "getCoupons",
        "parameters": [
          {
            "name": "dateFrom",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "dateTo",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 10000
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 100
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "sortDirection",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "sortField",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 50
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "products:read"
      },
      "post": {
        "tags": [
          "Coupons"
        ],
        "summary": "Create a coupon",
        "description": "Required API key scope: `products:write`.",
        "operationId": "postCoupons",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/coupons/route.ts."
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "products:write"
      }
    },
    "/coupons/{couponId}": {
      "get": {
        "tags": [
          "Coupons"
        ],
        "summary": "Retrieve a coupon",
        "description": "Required API key scope: `products:read`.",
        "operationId": "getCoupons_ByCouponId",
        "parameters": [
          {
            "name": "couponId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "products:read"
      },
      "put": {
        "tags": [
          "Coupons"
        ],
        "summary": "Update a coupon",
        "description": "Required API key scope: `products:write`.",
        "operationId": "putCoupons_ByCouponId",
        "parameters": [
          {
            "name": "couponId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/coupons/[couponId]/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "products:write"
      },
      "delete": {
        "tags": [
          "Coupons"
        ],
        "summary": "Delete a coupon",
        "description": "Required API key scope: `products:write`.",
        "operationId": "deleteCoupons_ByCouponId",
        "parameters": [
          {
            "name": "couponId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "products:write"
      }
    },
    "/coupons/{couponId}/archive": {
      "post": {
        "tags": [
          "Coupons"
        ],
        "summary": "Create a coupon archive",
        "description": "Required API key scope: `products:write`.",
        "operationId": "postCoupons_ByCouponId_Archive",
        "parameters": [
          {
            "name": "couponId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "products:write"
      }
    },
    "/credit-notes": {
      "get": {
        "tags": [
          "Credit Notes"
        ],
        "summary": "List credit notes",
        "description": "Required API key scope: `invoices:read`.",
        "operationId": "getCreditNotes",
        "parameters": [
          {
            "name": "customerId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          {
            "name": "dateFrom",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "dateTo",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "invoiceId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 10000
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 100
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "invoices:read"
      },
      "post": {
        "tags": [
          "Credit Notes"
        ],
        "summary": "Create a credit note",
        "description": "Required API key scope: `invoices:write`.",
        "operationId": "postCreditNotes",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/credit-notes/route.ts."
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "invoices:write"
      }
    },
    "/credit-notes/{noteId}": {
      "get": {
        "tags": [
          "Credit Notes"
        ],
        "summary": "Retrieve a credit note",
        "description": "Required API key scope: `invoices:read`.",
        "operationId": "getCreditNotes_ByNoteId",
        "parameters": [
          {
            "name": "noteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "invoices:read"
      },
      "delete": {
        "tags": [
          "Credit Notes"
        ],
        "summary": "Delete a credit note",
        "description": "Required API key scope: `invoices:write`.",
        "operationId": "deleteCreditNotes_ByNoteId",
        "parameters": [
          {
            "name": "noteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "invoices:write"
      }
    },
    "/credit-notes/{noteId}/void": {
      "post": {
        "tags": [
          "Credit Notes"
        ],
        "summary": "Create a credit note void",
        "description": "Required API key scope: `invoices:write`.",
        "operationId": "postCreditNotes_ByNoteId_Void",
        "parameters": [
          {
            "name": "noteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "invoices:write"
      }
    },
    "/currency": {
      "get": {
        "tags": [
          "Currency"
        ],
        "summary": "Retrieve currency",
        "description": "Required API key scope: `account:read`.",
        "operationId": "getCurrency",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:read"
      },
      "post": {
        "tags": [
          "Currency"
        ],
        "summary": "Update currency settings",
        "description": "Required API key scope: `account:write`.",
        "operationId": "postCurrency",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/currency/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "502": {
            "$ref": "#/components/responses/Error502"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:write"
      }
    },
    "/currency/public-rate": {
      "get": {
        "tags": [
          "Currency"
        ],
        "summary": "Retrieve a live exchange rate (public)",
        "description": "Public endpoint: no API key required.",
        "operationId": "getCurrency_PublicRate",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": []
      }
    },
    "/currency/refresh-rates": {
      "post": {
        "tags": [
          "Currency"
        ],
        "summary": "Refresh exchange rates",
        "description": "Restricted to platform administrators (dashboard admin session); API keys are not accepted.",
        "operationId": "postCurrency_RefreshRates",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/currency/refresh-rates/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "502": {
            "$ref": "#/components/responses/Error502"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "x-admin": true
      }
    },
    "/custom-domains": {
      "get": {
        "tags": [
          "Custom Domains"
        ],
        "summary": "List custom domains",
        "description": "Required API key scope: `custom_domains:read`.",
        "operationId": "getCustomDomains",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "custom_domains:read"
      },
      "post": {
        "tags": [
          "Custom Domains"
        ],
        "summary": "Create a custom domain",
        "description": "Required API key scope: `custom_domains:write`.\n\nHonours the `Idempotency-Key` header.",
        "operationId": "postCustomDomains",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/custom-domains/route.ts."
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "custom_domains:write"
      }
    },
    "/custom-domains/events": {
      "get": {
        "tags": [
          "Custom Domains"
        ],
        "summary": "Stream custom domain events (server-sent events)",
        "description": "Required API key scope: `custom_domains:read`.",
        "operationId": "getCustomDomains_Events",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "custom_domains:read",
        "x-streaming": true
      }
    },
    "/custom-domains/{domainId}": {
      "get": {
        "tags": [
          "Custom Domains"
        ],
        "summary": "Retrieve a custom domain",
        "description": "Required API key scope: `custom_domains:read`.",
        "operationId": "getCustomDomains_ByDomainId",
        "parameters": [
          {
            "name": "domainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "custom_domains:read"
      },
      "patch": {
        "tags": [
          "Custom Domains"
        ],
        "summary": "Update a custom domain",
        "description": "Required API key scope: `custom_domains:write`.",
        "operationId": "patchCustomDomains_ByDomainId",
        "parameters": [
          {
            "name": "domainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/custom-domains/[domainId]/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "custom_domains:write"
      },
      "delete": {
        "tags": [
          "Custom Domains"
        ],
        "summary": "Delete a custom domain",
        "description": "Required API key scope: `custom_domains:write`.",
        "operationId": "deleteCustomDomains_ByDomainId",
        "parameters": [
          {
            "name": "domainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "custom_domains:write"
      }
    },
    "/custom-domains/{domainId}/dns-check": {
      "post": {
        "tags": [
          "Custom Domains"
        ],
        "summary": "Check DNS records for a custom domain",
        "description": "Required API key scope: `custom_domains:read`.",
        "operationId": "postCustomDomains_ByDomainId_DnsCheck",
        "parameters": [
          {
            "name": "domainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "custom_domains:read"
      }
    },
    "/custom-domains/{domainId}/ssl/retry": {
      "post": {
        "tags": [
          "Custom Domains"
        ],
        "summary": "Retry SSL provisioning for a custom domain",
        "description": "Required API key scope: `custom_domains:write`.",
        "operationId": "postCustomDomains_ByDomainId_Ssl_Retry",
        "parameters": [
          {
            "name": "domainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "custom_domains:write"
      }
    },
    "/custom-domains/{domainId}/verify": {
      "post": {
        "tags": [
          "Custom Domains"
        ],
        "summary": "Verify a custom domain",
        "description": "Required API key scope: `custom_domains:write`.",
        "operationId": "postCustomDomains_ByDomainId_Verify",
        "parameters": [
          {
            "name": "domainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "custom_domains:write"
      }
    },
    "/customers": {
      "get": {
        "tags": [
          "Customers"
        ],
        "summary": "List customers",
        "description": "Return a paginated list of customers, newest first. Archived customers are left out unless status=archived. An unknown query parameter returns 400 VALIDATION_ERROR naming it.\n\nRequired API key scope: `customers:read`.",
        "operationId": "getCustomers",
        "parameters": [
          {
            "name": "dateFrom",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "dateTo",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number (1-based). Defaults to 1.",
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 10000
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "description": "Results per page, 1-100. Defaults to 25.",
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 100
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Matches customer name or email.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "sortDirection",
            "in": "query",
            "required": false,
            "description": "asc or desc. Defaults to desc.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "sortField",
            "in": "query",
            "required": false,
            "description": "Field to sort by (e.g. createdAt, or a money column such as transactionAmountUsdCents). Defaults to createdAt.",
            "schema": {
              "type": "string",
              "maxLength": 50
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Filter by customer status; archived lists archived customers (left out otherwise).",
            "schema": {
              "type": "string",
              "maxLength": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "customers:read"
      },
      "post": {
        "tags": [
          "Customers"
        ],
        "summary": "Create a customer",
        "description": "Create a customer. Returns 201. Create-only: an email that already exists in your account returns 409 DUPLICATE_EMAIL and the existing customer is left unchanged; use PUT to edit it.\n\nRequired API key scope: `customers:write`.",
        "operationId": "postCustomers",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCustomerRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "customers:write"
      }
    },
    "/customers/overview": {
      "get": {
        "tags": [
          "Customers"
        ],
        "summary": "Retrieve the customer overview",
        "description": "",
        "operationId": "getCustomers_Overview",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ]
      }
    },
    "/customers/{customerId}": {
      "get": {
        "tags": [
          "Customers"
        ],
        "summary": "Retrieve a customer",
        "description": "Retrieve a single customer by ID.\n\nRequired API key scope: `customers:read`.",
        "operationId": "getCustomers_ByCustomerId",
        "parameters": [
          {
            "name": "customerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "customers:read"
      },
      "put": {
        "tags": [
          "Customers"
        ],
        "summary": "Update a customer",
        "description": "Update a customer. Only the fields you send are changed. Only the fields below are accepted; unknown or server-managed fields (e.g. merchantId, totalSpendAmountUsdCents) return 400 VALIDATION_ERROR with error.fields.\n\nRequired API key scope: `customers:write`.",
        "operationId": "putCustomers_ByCustomerId",
        "parameters": [
          {
            "name": "customerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateCustomerRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "customers:write"
      }
    },
    "/customers/{customerId}/addresses": {
      "get": {
        "tags": [
          "Customers"
        ],
        "summary": "List customer addresses",
        "description": "Required API key scope: `customers:read`.",
        "operationId": "getCustomers_ByCustomerId_Addresses",
        "parameters": [
          {
            "name": "customerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "customers:read"
      },
      "post": {
        "tags": [
          "Customers"
        ],
        "summary": "Create a customer address",
        "description": "Required API key scope: `customers:write`.",
        "operationId": "postCustomers_ByCustomerId_Addresses",
        "parameters": [
          {
            "name": "customerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerAddressRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "customers:write"
      }
    },
    "/customers/{customerId}/addresses/{addressId}": {
      "put": {
        "tags": [
          "Customers"
        ],
        "summary": "Update a customer address",
        "description": "Required API key scope: `customers:write`.",
        "operationId": "putCustomers_ByCustomerId_Addresses_ByAddressId",
        "parameters": [
          {
            "name": "customerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "addressId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateCustomerAddressRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "customers:write"
      },
      "delete": {
        "tags": [
          "Customers"
        ],
        "summary": "Delete a customer address",
        "description": "Required API key scope: `customers:write`.",
        "operationId": "deleteCustomers_ByCustomerId_Addresses_ByAddressId",
        "parameters": [
          {
            "name": "customerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "addressId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "customers:write"
      }
    },
    "/customers/{customerId}/archive": {
      "post": {
        "tags": [
          "Customers"
        ],
        "summary": "Create a customer archive",
        "description": "Archive a customer (customers:write, audited). History is kept; the customer is hidden from lists unless status=archived, and new checkouts, payments, subscriptions and invoices for it return 409 CUSTOMER_ARCHIVED. 409 CUSTOMER_HAS_ACTIVE_SUBSCRIPTIONS while a subscription is active, trialing or past_due. POST /api/v1/customers/:id/unarchive restores it. There is no DELETE.",
        "operationId": "postCustomers_ByCustomerId_Archive",
        "parameters": [
          {
            "name": "customerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ]
      }
    },
    "/customers/{customerId}/balance": {
      "get": {
        "tags": [
          "Customers"
        ],
        "summary": "Retrieve customer balance",
        "description": "Required API key scope: `customers:read`.",
        "operationId": "getCustomers_ByCustomerId_Balance",
        "parameters": [
          {
            "name": "customerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "customers:read"
      }
    },
    "/customers/{customerId}/balance-transactions": {
      "get": {
        "tags": [
          "Customers"
        ],
        "summary": "List customer balance transactions",
        "description": "Required API key scope: `customers:read`.",
        "operationId": "getCustomers_ByCustomerId_BalanceTransactions",
        "parameters": [
          {
            "name": "customerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "currency",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 10000
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "customers:read"
      },
      "post": {
        "tags": [
          "Customers"
        ],
        "summary": "Create a customer balance transaction",
        "description": "Required API key scope: `customers:write`.",
        "operationId": "postCustomers_ByCustomerId_BalanceTransactions",
        "parameters": [
          {
            "name": "customerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/customers/[customerId]/balance-transactions/route.ts."
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "customers:write"
      }
    },
    "/customers/{customerId}/communications": {
      "get": {
        "tags": [
          "Customers"
        ],
        "summary": "List customer communications",
        "description": "Required API key scope: `customers:read`.",
        "operationId": "getCustomers_ByCustomerId_Communications",
        "parameters": [
          {
            "name": "customerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channel",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 10000
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "customers:read"
      }
    },
    "/customers/{customerId}/entitlements": {
      "get": {
        "tags": [
          "Customers"
        ],
        "summary": "List a customer's entitlements",
        "description": "Every feature the customer is granted: key, type, enabled, limit (null = unlimited), used, remaining, policy, overageUnits, estimated overage (local and USD cents), resetsAt and source (product, price or customer_override). policy is the price's choice above the maximum: restrict, allow or bill.\n\nRequired API key scope: `entitlements:read`.",
        "operationId": "getCustomers_ByCustomerId_Entitlements",
        "parameters": [
          {
            "name": "customerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "entitlements:read"
      }
    },
    "/customers/{customerId}/entitlements/{key}": {
      "get": {
        "tags": [
          "Customers"
        ],
        "summary": "Retrieve a customer's entitlement",
        "description": "One feature for the customer (the hot path for an app checking access): enabled, limit (null = unlimited), used, remaining, policy, overage so far and resetsAt. A feature the customer is not granted answers 200 with enabled false; an unknown key answers 404 NOT_FOUND.\n\nRequired API key scope: `entitlements:read`.",
        "operationId": "getCustomers_ByCustomerId_Entitlements_ByKey",
        "parameters": [
          {
            "name": "customerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "entitlements:read"
      }
    },
    "/customers/{customerId}/entitlements/{key}/check": {
      "post": {
        "tags": [
          "Customers"
        ],
        "summary": "Check an entitlement",
        "description": "Would quantity more units be allowed now? Read-only and exact; nothing is reserved. reason is null, NO_ENTITLEMENT, ENTITLEMENT_LIMIT_REACHED or ENTITLEMENT_OVERAGE_CAP_REACHED. 404 NOT_FOUND for an unknown key or customer.\n\nRequired API key scope: `entitlements:read`.",
        "operationId": "postCustomers_ByCustomerId_Entitlements_ByKey_Check",
        "parameters": [
          {
            "name": "customerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "quantity": {
                    "type": "integer",
                    "description": "Units the next action would use (whole number from 0, default 1). The body may be empty."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "entitlements:read"
      }
    },
    "/customers/{customerId}/feature-overrides": {
      "get": {
        "tags": [
          "Customers"
        ],
        "summary": "List a customer's feature overrides",
        "description": "The customer's overrides (negotiated exceptions), oldest first, each with its feature, enabled, limitValue, unlimited, policy, reason and expiresAt.\n\nRequired API key scope: `entitlements:read`.",
        "operationId": "getCustomers_ByCustomerId_FeatureOverrides",
        "parameters": [
          {
            "name": "customerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "entitlements:read"
      }
    },
    "/customers/{customerId}/feature-overrides/{key}": {
      "get": {
        "tags": [
          "Customers"
        ],
        "summary": "Retrieve a feature override",
        "description": "The customer's override for one feature. 404 NOT_FOUND when there is none.\n\nRequired API key scope: `entitlements:read`.",
        "operationId": "getCustomers_ByCustomerId_FeatureOverrides_ByKey",
        "parameters": [
          {
            "name": "customerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "entitlements:read"
      },
      "put": {
        "tags": [
          "Customers"
        ],
        "summary": "Create or replace a feature override",
        "description": "Create or replace a customer's override (audited); the customer's entitlements refresh at once. GET returns it (404 when none), DELETE removes it, and GET /customers/:id/feature-overrides lists them. Archived features cannot be overridden.\n\nRequired API key scope: `entitlements:write`.",
        "operationId": "putCustomers_ByCustomerId_FeatureOverrides_ByKey",
        "parameters": [
          {
            "name": "customerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "description": "Why the customer gets different terms (3-500 characters). Kept in the audit log."
                  },
                  "enabled": {
                    "type": "boolean",
                    "description": "Include (true) or exclude (false) the feature for this customer; null keeps the plan's."
                  },
                  "limitValue": {
                    "type": "integer",
                    "description": "A different maximum; null keeps the plan's. Not with unlimited."
                  },
                  "unlimited": {
                    "type": "boolean",
                    "description": "No maximum for this customer. Defaults to false."
                  },
                  "policy": {
                    "type": "string",
                    "enum": [
                      "restrict",
                      "allow",
                      "bill"
                    ],
                    "description": "Above the maximum: restrict, allow (never refused or charged) or bill (metered; billed at the price's overage terms). null keeps the price's."
                  },
                  "expiresAt": {
                    "type": "string",
                    "description": "A future ISO 8601 date after which the plan's terms apply again; null for no expiry. At least one of enabled, limitValue, unlimited or policy must change something."
                  }
                },
                "required": [
                  "reason"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "entitlements:write"
      },
      "delete": {
        "tags": [
          "Customers"
        ],
        "summary": "Remove a feature override",
        "description": "Remove the override (audited); the plan's terms apply again at once. Returns { deleted: true, key }. 404 NOT_FOUND when there is none.\n\nRequired API key scope: `entitlements:write`.",
        "operationId": "deleteCustomers_ByCustomerId_FeatureOverrides_ByKey",
        "parameters": [
          {
            "name": "customerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "entitlements:write"
      }
    },
    "/customers/{customerId}/feature-usage/{key}": {
      "put": {
        "tags": [
          "Customers"
        ],
        "summary": "Report a quantity in use",
        "description": "Set how many of a quantity feature are in use now. 409 ENTITLEMENT_LIMIT_REACHED above the maximum unless the price allows overage, 409 NO_ENTITLEMENT when no subscription grants it. Honours Idempotency-Key.\n\nRequired API key scope: `entitlements:write`.\n\nHonours the `Idempotency-Key` header.",
        "operationId": "putCustomers_ByCustomerId_FeatureUsage_ByKey",
        "parameters": [
          {
            "name": "customerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "quantity": {
                    "type": "integer",
                    "description": "How many of a quantity feature are in use now (e.g. 3 projects), not a delta. Going up past the maximum answers 409 ENTITLEMENT_LIMIT_REACHED unless the price's policy is allow; going down always succeeds. Metered usage is reported with POST /meter-events."
                  }
                },
                "required": [
                  "quantity"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "entitlements:write"
      }
    },
    "/customers/{customerId}/gdpr/delete": {
      "post": {
        "tags": [
          "Customers"
        ],
        "summary": "Erase a customer's data (GDPR)",
        "description": "Required API key scope: `customers:write`.",
        "operationId": "postCustomers_ByCustomerId_Gdpr_Delete",
        "parameters": [
          {
            "name": "customerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/customers/[customerId]/gdpr/delete/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "customers:write"
      }
    },
    "/customers/{customerId}/gdpr/export": {
      "get": {
        "tags": [
          "Customers"
        ],
        "summary": "Export a customer's data (GDPR)",
        "description": "Required API key scope: `customers:read`.",
        "operationId": "getCustomers_ByCustomerId_Gdpr_Export",
        "parameters": [
          {
            "name": "customerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "customers:read"
      }
    },
    "/customers/{customerId}/invoices": {
      "get": {
        "tags": [
          "Customers"
        ],
        "summary": "List customer invoices",
        "description": "Required API key scope: `customers:read`.",
        "operationId": "getCustomers_ByCustomerId_Invoices",
        "parameters": [
          {
            "name": "customerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 10000
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "customers:read"
      }
    },
    "/customers/{customerId}/payment-methods": {
      "get": {
        "tags": [
          "Customers"
        ],
        "summary": "List customer payment methods",
        "description": "Required API key scope: `customers:read`.",
        "operationId": "getCustomers_ByCustomerId_PaymentMethods",
        "parameters": [
          {
            "name": "customerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "customers:read"
      }
    },
    "/customers/{customerId}/payments": {
      "get": {
        "tags": [
          "Customers"
        ],
        "summary": "List customer payments",
        "description": "Required API key scope: `customers:read`.",
        "operationId": "getCustomers_ByCustomerId_Payments",
        "parameters": [
          {
            "name": "customerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 10000
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "customers:read"
      }
    },
    "/customers/{customerId}/subscriptions": {
      "get": {
        "tags": [
          "Customers"
        ],
        "summary": "List customer subscriptions",
        "description": "Required API key scope: `customers:read`.",
        "operationId": "getCustomers_ByCustomerId_Subscriptions",
        "parameters": [
          {
            "name": "customerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 10000
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "customers:read"
      }
    },
    "/customers/{customerId}/tags": {
      "get": {
        "tags": [
          "Customers"
        ],
        "summary": "List customer tags",
        "description": "Required API key scope: `customers:read`.",
        "operationId": "getCustomers_ByCustomerId_Tags",
        "parameters": [
          {
            "name": "customerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "customers:read"
      },
      "put": {
        "tags": [
          "Customers"
        ],
        "summary": "Update customer tags",
        "description": "Required API key scope: `customers:write`.",
        "operationId": "putCustomers_ByCustomerId_Tags",
        "parameters": [
          {
            "name": "customerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/customers/[customerId]/tags/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "customers:write"
      },
      "patch": {
        "tags": [
          "Customers"
        ],
        "summary": "Update customer tags",
        "description": "Required API key scope: `customers:write`.",
        "operationId": "patchCustomers_ByCustomerId_Tags",
        "parameters": [
          {
            "name": "customerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/customers/[customerId]/tags/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "customers:write"
      }
    },
    "/customers/{customerId}/tax-exemptions": {
      "get": {
        "tags": [
          "Customers"
        ],
        "summary": "List customer tax exemptions",
        "description": "",
        "operationId": "getCustomers_ByCustomerId_TaxExemptions",
        "parameters": [
          {
            "name": "customerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ]
      },
      "post": {
        "tags": [
          "Customers"
        ],
        "summary": "Create a customer tax exemption",
        "description": "",
        "operationId": "postCustomers_ByCustomerId_TaxExemptions",
        "parameters": [
          {
            "name": "customerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is validated by `createExemptionSchema` in src/app/api/v1/customers/[customerId]/tax-exemptions/route.ts."
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ]
      },
      "patch": {
        "tags": [
          "Customers"
        ],
        "summary": "Update customer tax exemptions",
        "description": "",
        "operationId": "patchCustomers_ByCustomerId_TaxExemptions",
        "parameters": [
          {
            "name": "customerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "exemptionId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is validated by `updateExemptionSchema` in src/app/api/v1/customers/[customerId]/tax-exemptions/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Customers"
        ],
        "summary": "Delete customer tax exemptions",
        "description": "",
        "operationId": "deleteCustomers_ByCustomerId_TaxExemptions",
        "parameters": [
          {
            "name": "customerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "exemptionId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ]
      }
    },
    "/customers/{customerId}/tax-ids": {
      "get": {
        "tags": [
          "Customers"
        ],
        "summary": "List customer tax IDs",
        "description": "Required API key scope: `customers:read`.",
        "operationId": "getCustomers_ByCustomerId_TaxIds",
        "parameters": [
          {
            "name": "customerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "customers:read"
      },
      "post": {
        "tags": [
          "Customers"
        ],
        "summary": "Create a customer tax ID",
        "description": "Required API key scope: `customers:write`.",
        "operationId": "postCustomers_ByCustomerId_TaxIds",
        "parameters": [
          {
            "name": "customerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is validated by `createTaxIdSchema` in src/app/api/v1/customers/[customerId]/tax-ids/route.ts."
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "customers:write"
      },
      "patch": {
        "tags": [
          "Customers"
        ],
        "summary": "Update customer tax IDs",
        "description": "Required API key scope: `customers:write`.",
        "operationId": "patchCustomers_ByCustomerId_TaxIds",
        "parameters": [
          {
            "name": "customerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "taxIdId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is validated by `updateTaxIdSchema` in src/app/api/v1/customers/[customerId]/tax-ids/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "customers:write"
      },
      "delete": {
        "tags": [
          "Customers"
        ],
        "summary": "Delete a customer tax ID",
        "description": "Required API key scope: `customers:write`.",
        "operationId": "deleteCustomers_ByCustomerId_TaxIds",
        "parameters": [
          {
            "name": "customerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "taxIdId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "customers:write"
      }
    },
    "/customers/{customerId}/transactions": {
      "get": {
        "tags": [
          "Customers"
        ],
        "summary": "List customer transactions",
        "description": "Required API key scope: `customers:read`.",
        "operationId": "getCustomers_ByCustomerId_Transactions",
        "parameters": [
          {
            "name": "customerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 10000
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "customers:read"
      }
    },
    "/customers/{customerId}/unarchive": {
      "post": {
        "tags": [
          "Customers"
        ],
        "summary": "Create a customer unarchive",
        "description": "",
        "operationId": "postCustomers_ByCustomerId_Unarchive",
        "parameters": [
          {
            "name": "customerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ]
      }
    },
    "/developer/deprecated-fields": {
      "get": {
        "tags": [
          "Developer"
        ],
        "summary": "List deprecated API fields still in use",
        "description": "Required API key scope: `account:read`.",
        "operationId": "getDeveloper_DeprecatedFields",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:read"
      }
    },
    "/developer/logs": {
      "get": {
        "tags": [
          "Developer"
        ],
        "summary": "List API request logs",
        "description": "Required API key scope: `account:read`.",
        "operationId": "getDeveloper_Logs",
        "parameters": [
          {
            "name": "dateFrom",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "dateTo",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "method",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 10000
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 100
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "statusCode",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:read"
      }
    },
    "/developer/logs/{logId}": {
      "get": {
        "tags": [
          "Developer"
        ],
        "summary": "Retrieve an API request log",
        "description": "Required API key scope: `account:read`.",
        "operationId": "getDeveloper_Logs_ByLogId",
        "parameters": [
          {
            "name": "logId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:read"
      }
    },
    "/disputes": {
      "get": {
        "tags": [
          "Disputes"
        ],
        "summary": "List disputes",
        "description": "Required API key scope: `payments:read`.",
        "operationId": "getDisputes",
        "parameters": [
          {
            "name": "dateFrom",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "dateTo",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 10000
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 100
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "sortDirection",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "sortField",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 50
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "payments:read"
      }
    },
    "/disputes/{disputeId}": {
      "get": {
        "tags": [
          "Disputes"
        ],
        "summary": "Retrieve a dispute",
        "description": "Required API key scope: `payments:read`.",
        "operationId": "getDisputes_ByDisputeId",
        "parameters": [
          {
            "name": "disputeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "payments:read"
      },
      "put": {
        "tags": [
          "Disputes"
        ],
        "summary": "Update a dispute",
        "description": "Required API key scope: `payments:write`.",
        "operationId": "putDisputes_ByDisputeId",
        "parameters": [
          {
            "name": "disputeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDisputeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "payments:write"
      }
    },
    "/disputes/{disputeId}/evidence": {
      "post": {
        "tags": [
          "Disputes"
        ],
        "summary": "Submit evidence for a dispute",
        "description": "Required API key scope: `payments:write`.\n\nHonours the `Idempotency-Key` header.",
        "operationId": "postDisputes_ByDisputeId_Evidence",
        "parameters": [
          {
            "name": "disputeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SubmitEvidenceRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "502": {
            "$ref": "#/components/responses/Error502"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "payments:write"
      }
    },
    "/disputes/{disputeId}/evidence/files": {
      "get": {
        "tags": [
          "Disputes"
        ],
        "summary": "List evidence files",
        "description": "Required API key scope: `payments:read`.",
        "operationId": "getDisputes_ByDisputeId_Evidence_Files",
        "parameters": [
          {
            "name": "disputeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "payments:read"
      }
    },
    "/disputes/{disputeId}/evidence/files/{fileId}": {
      "get": {
        "tags": [
          "Disputes"
        ],
        "summary": "Retrieve a file",
        "description": "Required API key scope: `payments:read`.",
        "operationId": "getDisputes_ByDisputeId_Evidence_Files_ByFileId",
        "parameters": [
          {
            "name": "disputeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fileId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "payments:read"
      }
    },
    "/email-layouts": {
      "get": {
        "tags": [
          "Email Layouts"
        ],
        "summary": "List email layouts",
        "description": "Restricted to platform administrators (dashboard admin session); API keys are not accepted.",
        "operationId": "getEmailLayouts",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "x-admin": true
      },
      "post": {
        "tags": [
          "Email Layouts"
        ],
        "summary": "Create an email layout",
        "description": "Restricted to platform administrators (dashboard admin session); API keys are not accepted.",
        "operationId": "postEmailLayouts",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "x-admin": true
      }
    },
    "/email-layouts/{layoutCode}": {
      "get": {
        "tags": [
          "Email Layouts"
        ],
        "summary": "Retrieve an email layout",
        "description": "Restricted to platform administrators (dashboard admin session); API keys are not accepted.",
        "operationId": "getEmailLayouts_ByLayoutCode",
        "parameters": [
          {
            "name": "layoutCode",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "x-admin": true
      },
      "put": {
        "tags": [
          "Email Layouts"
        ],
        "summary": "Update an email layout",
        "description": "Restricted to platform administrators (dashboard admin session); API keys are not accepted.",
        "operationId": "putEmailLayouts_ByLayoutCode",
        "parameters": [
          {
            "name": "layoutCode",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "x-admin": true
      },
      "delete": {
        "tags": [
          "Email Layouts"
        ],
        "summary": "Delete an email layout",
        "description": "Restricted to platform administrators (dashboard admin session); API keys are not accepted.",
        "operationId": "deleteEmailLayouts_ByLayoutCode",
        "parameters": [
          {
            "name": "layoutCode",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "x-admin": true
      }
    },
    "/email-templates": {
      "get": {
        "tags": [
          "Email Templates"
        ],
        "summary": "List email templates",
        "description": "Restricted to platform administrators (dashboard admin session); API keys are not accepted.",
        "operationId": "getEmailTemplates",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "x-admin": true
      }
    },
    "/email-templates/{templateCode}": {
      "get": {
        "tags": [
          "Email Templates"
        ],
        "summary": "Retrieve an email template",
        "description": "Restricted to platform administrators (dashboard admin session); API keys are not accepted.",
        "operationId": "getEmailTemplates_ByTemplateCode",
        "parameters": [
          {
            "name": "templateCode",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "x-admin": true
      },
      "put": {
        "tags": [
          "Email Templates"
        ],
        "summary": "Update an email template",
        "description": "Restricted to platform administrators (dashboard admin session); API keys are not accepted.",
        "operationId": "putEmailTemplates_ByTemplateCode",
        "parameters": [
          {
            "name": "templateCode",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "x-admin": true
      }
    },
    "/email-templates/{templateCode}/copy": {
      "post": {
        "tags": [
          "Email Templates"
        ],
        "summary": "Create an email template copy",
        "description": "Restricted to platform administrators (dashboard admin session); API keys are not accepted.",
        "operationId": "postEmailTemplates_ByTemplateCode_Copy",
        "parameters": [
          {
            "name": "templateCode",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "x-admin": true
      }
    },
    "/email-templates/{templateCode}/restore": {
      "post": {
        "tags": [
          "Email Templates"
        ],
        "summary": "Create an email template restore",
        "description": "Restricted to platform administrators (dashboard admin session); API keys are not accepted.",
        "operationId": "postEmailTemplates_ByTemplateCode_Restore",
        "parameters": [
          {
            "name": "templateCode",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "x-admin": true
      }
    },
    "/email-templates/{templateCode}/test": {
      "post": {
        "tags": [
          "Email Templates"
        ],
        "summary": "Test credentials for an email template",
        "description": "Restricted to platform administrators (dashboard admin session); API keys are not accepted.",
        "operationId": "postEmailTemplates_ByTemplateCode_Test",
        "parameters": [
          {
            "name": "templateCode",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "x-admin": true
      }
    },
    "/emails": {
      "get": {
        "tags": [
          "Emails"
        ],
        "summary": "List sent emails",
        "description": "Required API key scope: `account:read`.\n\nRestricted to platform administrators (dashboard admin session); API keys are not accepted.",
        "operationId": "getEmails",
        "parameters": [
          {
            "name": "code",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "dateFrom",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "dateTo",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 10000
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 100
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "sortDirection",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "x-required-scope": "account:read",
        "x-admin": true
      }
    },
    "/emails/{emailId}": {
      "get": {
        "tags": [
          "Emails"
        ],
        "summary": "Retrieve a sent email",
        "description": "Required API key scope: `account:read`.\n\nRestricted to platform administrators (dashboard admin session); API keys are not accepted.",
        "operationId": "getEmails_ByEmailId",
        "parameters": [
          {
            "name": "emailId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "x-required-scope": "account:read",
        "x-admin": true
      }
    },
    "/emails/{emailId}/resend": {
      "post": {
        "tags": [
          "Emails"
        ],
        "summary": "Resend a failed email",
        "description": "Required API key scope: `account:write`.\n\nRestricted to platform administrators (dashboard admin session); API keys are not accepted.",
        "operationId": "postEmails_ByEmailId_Resend",
        "parameters": [
          {
            "name": "emailId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "x-required-scope": "account:write",
        "x-admin": true
      }
    },
    "/embed-policy": {
      "get": {
        "tags": [
          "Embed Policy"
        ],
        "summary": "Retrieve embed policy",
        "description": "Public endpoint: no API key required.",
        "operationId": "getEmbedPolicy",
        "parameters": [
          {
            "name": "paymentLink",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sessionId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": []
      }
    },
    "/events": {
      "get": {
        "tags": [
          "Events"
        ],
        "summary": "List events",
        "description": "Required API key scope: `webhooks:read`.",
        "operationId": "getEvents",
        "parameters": [
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "dateFrom",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "dateTo",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 10000
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 100
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "webhooks:read"
      }
    },
    "/events/stream": {
      "get": {
        "tags": [
          "Events"
        ],
        "summary": "Stream events (server-sent events)",
        "description": "Required API key scope: `webhooks:read`.",
        "operationId": "getEvents_Stream",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "webhooks:read",
        "x-streaming": true
      }
    },
    "/events/{eventId}": {
      "get": {
        "tags": [
          "Events"
        ],
        "summary": "Retrieve an event",
        "description": "Required API key scope: `webhooks:read`.",
        "operationId": "getEvents_ByEventId",
        "parameters": [
          {
            "name": "eventId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "webhooks:read"
      }
    },
    "/external-transactions": {
      "get": {
        "tags": [
          "External Transactions"
        ],
        "summary": "List external transactions",
        "description": "Required API key scope: `payments:read`.",
        "operationId": "getExternalTransactions",
        "parameters": [
          {
            "name": "businessEntityId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "customerId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          {
            "name": "dateFrom",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "dateTo",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "externalProvider",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 10000
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 100
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "sortDirection",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "sortField",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 50
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "payments:read"
      },
      "post": {
        "tags": [
          "External Transactions"
        ],
        "summary": "Record a payment taken on another service",
        "description": "Required API key scope: `payments:write`.\n\nHonours the `Idempotency-Key` header.",
        "operationId": "postExternalTransactions",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateExternalTransactionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "payments:write"
      }
    },
    "/external-transactions/{paymentId}": {
      "get": {
        "tags": [
          "External Transactions"
        ],
        "summary": "Retrieve an external transaction",
        "description": "Required API key scope: `payments:read`.",
        "operationId": "getExternalTransactions_ByPaymentId",
        "parameters": [
          {
            "name": "paymentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "payments:read"
      },
      "patch": {
        "tags": [
          "External Transactions"
        ],
        "summary": "Update or settle an external transaction",
        "description": "Required API key scope: `payments:write`.",
        "operationId": "patchExternalTransactions_ByPaymentId",
        "parameters": [
          {
            "name": "paymentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateExternalTransactionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "payments:write"
      },
      "delete": {
        "tags": [
          "External Transactions"
        ],
        "summary": "Void an external transaction",
        "description": "Required API key scope: `payments:write`.",
        "operationId": "deleteExternalTransactions_ByPaymentId",
        "parameters": [
          {
            "name": "paymentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "reason",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "payments:write"
      }
    },
    "/external-transactions/{paymentId}/refunds": {
      "post": {
        "tags": [
          "External Transactions"
        ],
        "summary": "Record a refund made on another service",
        "description": "Required API key scope: `payments:write`.",
        "operationId": "postExternalTransactions_ByPaymentId_Refunds",
        "parameters": [
          {
            "name": "paymentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RecordExternalRefundRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "payments:write"
      }
    },
    "/features": {
      "get": {
        "tags": [
          "Features & Entitlements"
        ],
        "summary": "List features",
        "description": "Return your feature catalogue, active first then by name, with meta.total, page and pageSize.\n\nRequired API key scope: `products:read`.",
        "operationId": "getFeatures",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number (1-based). Defaults to 1.",
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 10000
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "description": "Results per page, 1-100. Defaults to 50.",
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 100
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Matches part of the key or name, case-insensitive.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Only active or only archived features. Omit for both.",
            "schema": {
              "type": "string",
              "maxLength": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "products:read"
      },
      "post": {
        "tags": [
          "Features & Entitlements"
        ],
        "summary": "Create a feature",
        "description": "Create a feature. Returns 201. key and type (and a metered feature's meterId and resetInterval) are fixed once created. Errors: 400 VALIDATION_ERROR (error.fields names each field, including unknown fields), 409 CONFLICT when the key is already used, 409 FEATURE_METER_AGGREGATION_UNSUPPORTED when the meter is not sum or count. Honours Idempotency-Key.\n\nRequired API key scope: `products:write`.\n\nHonours the `Idempotency-Key` header.",
        "operationId": "postFeatures",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "key": {
                    "type": "string",
                    "description": "What your app checks, e.g. api_calls. 1-64 characters: lower-case letters, digits, _ . - (starting with a letter or digit). Unique in your account; cannot change later."
                  },
                  "name": {
                    "type": "string",
                    "description": "Name customers see, e.g. API calls (max 80 characters)."
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "boolean",
                      "quantity",
                      "metered"
                    ],
                    "description": "boolean: included or not. quantity: how many the customer has in use at a time (e.g. projects), reported with PUT /customers/:id/feature-usage/:key. metered: usage counted by a meter in each period. Cannot change later."
                  },
                  "unit": {
                    "type": "string",
                    "description": "Plural unit shown with limits, e.g. calls (max 30 characters). Not allowed on boolean features."
                  },
                  "meterId": {
                    "type": "string",
                    "description": "Metered features only, and required for them: one of your active meters with sum or count aggregation. A max or last meter answers 409 FEATURE_METER_AGGREGATION_UNSUPPORTED. Cannot change later."
                  },
                  "resetInterval": {
                    "type": "string",
                    "enum": [
                      "billing_period",
                      "month"
                    ],
                    "description": "Metered features only. billing_period (default): usage resets at each subscription period boundary. month: at the start of each calendar month in UTC. Cannot change later."
                  },
                  "description": {
                    "type": "string",
                    "description": "Internal description (max 500 characters)."
                  },
                  "metadata": {
                    "type": "object",
                    "description": "Up to 50 keys (40 characters each) with text values up to 500 characters.",
                    "additionalProperties": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "key",
                  "name",
                  "type"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "products:write"
      }
    },
    "/features/{featureId}": {
      "get": {
        "tags": [
          "Features & Entitlements"
        ],
        "summary": "Retrieve a feature",
        "description": "Retrieve one feature. 404 NOT_FOUND when it is not yours.\n\nRequired API key scope: `products:read`.",
        "operationId": "getFeatures_ByFeatureId",
        "parameters": [
          {
            "name": "featureId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "products:read"
      },
      "patch": {
        "tags": [
          "Features & Entitlements"
        ],
        "summary": "Update or archive a feature",
        "description": "Change name, description, unit, status or metadata. Sending key, type, meterId or resetInterval answers 400 VALIDATION_ERROR (create a new feature instead). Archive with status archived; there is no DELETE.\n\nRequired API key scope: `products:write`.",
        "operationId": "patchFeatures_ByFeatureId",
        "parameters": [
          {
            "name": "featureId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "New name (max 80 characters)."
                  },
                  "description": {
                    "type": "string",
                    "description": "New description, or null to clear it."
                  },
                  "unit": {
                    "type": "string",
                    "description": "New unit, or null to clear it. Not allowed on boolean features."
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "active",
                      "archived"
                    ],
                    "description": "archived: the feature can no longer be added to a product; products and subscriptions that already include it keep it. active restores it. Features are never deleted."
                  },
                  "metadata": {
                    "type": "object",
                    "description": "Up to 50 keys (40 characters each) with text values up to 500 characters.",
                    "additionalProperties": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "products:write"
      }
    },
    "/gateway-currency-support/{gatewayId}": {
      "get": {
        "tags": [
          "Gateways"
        ],
        "summary": "Retrieve a gateway's supported currencies",
        "description": "Public endpoint: no API key required.",
        "operationId": "getGatewayCurrencySupport_ByGatewayId",
        "parameters": [
          {
            "name": "gatewayId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "originalAmount",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "originalCurrency",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": []
      }
    },
    "/gateway-marketplace": {
      "get": {
        "tags": [
          "Gateway Marketplace"
        ],
        "summary": "List marketplace gateways",
        "description": "",
        "operationId": "getGatewayMarketplace",
        "parameters": [
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 10000
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 100
            }
          },
          {
            "name": "region",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ]
      }
    },
    "/gateway-marketplace/categories": {
      "get": {
        "tags": [
          "Gateway Marketplace"
        ],
        "summary": "List gateway categories",
        "description": "",
        "operationId": "getGatewayMarketplace_Categories",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ]
      }
    },
    "/gateway-marketplace/connections": {
      "get": {
        "tags": [
          "Gateway Marketplace"
        ],
        "summary": "List gateway connections",
        "description": "Required API key scope: `routing:read`.",
        "operationId": "getGatewayMarketplace_Connections",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "routing:read"
      }
    },
    "/gateway-marketplace/connections/{connectionId}": {
      "patch": {
        "tags": [
          "Gateway Marketplace"
        ],
        "summary": "Update a connection",
        "description": "Required API key scope: `routing:write`.",
        "operationId": "patchGatewayMarketplace_Connections_ByConnectionId",
        "parameters": [
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is validated by `patchSchema` in src/app/api/v1/gateway-marketplace/connections/[connectionId]/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "routing:write"
      }
    },
    "/gateway-marketplace/connections/{connectionId}/disconnect-impact": {
      "get": {
        "tags": [
          "Gateway Marketplace"
        ],
        "summary": "Retrieve connection disconnect impact",
        "description": "Required API key scope: `routing:read`.",
        "operationId": "getGatewayMarketplace_Connections_ByConnectionId_DisconnectImpact",
        "parameters": [
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "routing:read"
      }
    },
    "/gateway-marketplace/connections/{connectionId}/webhook": {
      "post": {
        "tags": [
          "Gateway Marketplace"
        ],
        "summary": "Create a connection webhook",
        "description": "Required API key scope: `routing:write`.",
        "operationId": "postGatewayMarketplace_Connections_ByConnectionId_Webhook",
        "parameters": [
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "routing:write"
      }
    },
    "/gateway-marketplace/{gatewayId}": {
      "get": {
        "tags": [
          "Gateway Marketplace"
        ],
        "summary": "Retrieve a marketplace gateway",
        "description": "",
        "operationId": "getGatewayMarketplace_ByGatewayId",
        "parameters": [
          {
            "name": "gatewayId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ]
      }
    },
    "/gateway-marketplace/{gatewayId}/connect": {
      "post": {
        "tags": [
          "Gateway Marketplace"
        ],
        "summary": "Connect a gateway marketplace",
        "description": "Required API key scope: `routing:write`.",
        "operationId": "postGatewayMarketplace_ByGatewayId_Connect",
        "parameters": [
          {
            "name": "gatewayId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/gateway-marketplace/[gatewayId]/connect/route.ts."
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "routing:write"
      }
    },
    "/gateway-marketplace/{gatewayId}/disconnect": {
      "post": {
        "tags": [
          "Gateway Marketplace"
        ],
        "summary": "Disconnect a gateway marketplace",
        "description": "Required API key scope: `routing:write`.",
        "operationId": "postGatewayMarketplace_ByGatewayId_Disconnect",
        "parameters": [
          {
            "name": "gatewayId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "502": {
            "$ref": "#/components/responses/Error502"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "routing:write"
      }
    },
    "/gateway-marketplace/{gatewayId}/health": {
      "get": {
        "tags": [
          "Gateway Marketplace"
        ],
        "summary": "Retrieve gateway connection health",
        "description": "",
        "operationId": "getGatewayMarketplace_ByGatewayId_Health",
        "parameters": [
          {
            "name": "gatewayId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ]
      },
      "post": {
        "tags": [
          "Gateway Marketplace"
        ],
        "summary": "Run a health check on a gateway marketplace",
        "description": "",
        "operationId": "postGatewayMarketplace_ByGatewayId_Health",
        "parameters": [
          {
            "name": "gatewayId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ]
      }
    },
    "/gateway-marketplace/{gatewayId}/test": {
      "post": {
        "tags": [
          "Gateway Marketplace"
        ],
        "summary": "Test credentials for a gateway marketplace",
        "description": "Required API key scope: `routing:write`.",
        "operationId": "postGatewayMarketplace_ByGatewayId_Test",
        "parameters": [
          {
            "name": "gatewayId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/gateway-marketplace/[gatewayId]/test/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "routing:write"
      }
    },
    "/gateway-oauth/razorpay/websites": {
      "get": {
        "tags": [
          "Gateway Oauth"
        ],
        "summary": "List razorpay websites",
        "description": "Required API key scope: `routing:read`.",
        "operationId": "getGatewayOauth_Razorpay_Websites",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "routing:read"
      },
      "post": {
        "tags": [
          "Gateway Oauth"
        ],
        "summary": "Create a razorpay website",
        "description": "Required API key scope: `routing:write`.",
        "operationId": "postGatewayOauth_Razorpay_Websites",
        "parameters": [
          {
            "name": "website",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/gateway-oauth/razorpay/websites/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "routing:write"
      },
      "delete": {
        "tags": [
          "Gateway Oauth"
        ],
        "summary": "Delete razorpay websites",
        "description": "Required API key scope: `routing:write`.",
        "operationId": "deleteGatewayOauth_Razorpay_Websites",
        "parameters": [
          {
            "name": "website",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "routing:write"
      }
    },
    "/gateways": {
      "get": {
        "tags": [
          "Gateways"
        ],
        "summary": "List gateways",
        "description": "Required API key scope: `routing:read`.",
        "operationId": "getGateways",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "routing:read"
      }
    },
    "/gateways/{gatewayId}": {
      "put": {
        "tags": [
          "Gateways"
        ],
        "summary": "Update a gateway",
        "description": "Restricted to platform administrators (dashboard admin session); API keys are not accepted.",
        "operationId": "putGateways_ByGatewayId",
        "parameters": [
          {
            "name": "gatewayId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/gateways/[gatewayId]/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "x-admin": true
      }
    },
    "/hosted-invoices/{token}": {
      "get": {
        "tags": [
          "Hosted Invoices"
        ],
        "summary": "Retrieve a hosted invoice",
        "description": "Public endpoint: no API key required.",
        "operationId": "getHostedInvoices_ByToken",
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": []
      }
    },
    "/hosted-invoices/{token}/pay": {
      "post": {
        "tags": [
          "Hosted Invoices"
        ],
        "summary": "Create a hosted invoice pay",
        "description": "Public endpoint: no API key required.",
        "operationId": "postHostedInvoices_ByToken_Pay",
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": []
      }
    },
    "/hosted-invoices/{token}/pdf": {
      "get": {
        "tags": [
          "Hosted Invoices"
        ],
        "summary": "Retrieve hosted invoice pdf",
        "description": "Public endpoint: no API key required.",
        "operationId": "getHostedInvoices_ByToken_Pdf",
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": []
      }
    },
    "/imports": {
      "get": {
        "tags": [
          "Imports"
        ],
        "summary": "List imports",
        "description": "",
        "operationId": "getImports",
        "parameters": [
          {
            "name": "dateFrom",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "dateTo",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 10000
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 100
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "sortDirection",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "sortField",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 50
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ]
      },
      "post": {
        "tags": [
          "Imports"
        ],
        "summary": "Create an import",
        "description": "",
        "operationId": "postImports",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/imports/route.ts."
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ]
      }
    },
    "/imports/events": {
      "get": {
        "tags": [
          "Imports"
        ],
        "summary": "List import events",
        "description": "",
        "operationId": "getImports_Events",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-streaming": true
      }
    },
    "/imports/templates/{type}": {
      "get": {
        "tags": [
          "Imports"
        ],
        "summary": "Retrieve a template",
        "description": "",
        "operationId": "getImports_Templates_ByType",
        "parameters": [
          {
            "name": "type",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ]
      }
    },
    "/imports/{importId}": {
      "get": {
        "tags": [
          "Imports"
        ],
        "summary": "Retrieve an import",
        "description": "",
        "operationId": "getImports_ByImportId",
        "parameters": [
          {
            "name": "importId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ]
      }
    },
    "/imports/{importId}/confirm": {
      "post": {
        "tags": [
          "Imports"
        ],
        "summary": "Create an import confirm",
        "description": "",
        "operationId": "postImports_ByImportId_Confirm",
        "parameters": [
          {
            "name": "importId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ]
      }
    },
    "/imports/{importId}/errors.csv": {
      "get": {
        "tags": [
          "Imports"
        ],
        "summary": "Retrieve import errors.csv",
        "description": "",
        "operationId": "getImports_ByImportId_Errors.csv",
        "parameters": [
          {
            "name": "importId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ]
      }
    },
    "/insights": {
      "get": {
        "tags": [
          "Insights"
        ],
        "summary": "Retrieve insights",
        "description": "Required API key scope: `reports:read`.",
        "operationId": "getInsights",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "reports:read"
      }
    },
    "/invoice-settings": {
      "get": {
        "tags": [
          "Invoice Settings"
        ],
        "summary": "List invoice settings",
        "description": "Required API key scope: `invoices:read`.",
        "operationId": "getInvoiceSettings",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "invoices:read"
      },
      "put": {
        "tags": [
          "Invoice Settings"
        ],
        "summary": "Update invoice settings",
        "description": "Required API key scope: `invoices:write`.",
        "operationId": "putInvoiceSettings",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is validated by `putSchema` in src/app/api/v1/invoice-settings/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "invoices:write"
      }
    },
    "/invoices": {
      "get": {
        "tags": [
          "Invoices"
        ],
        "summary": "List invoices",
        "description": "Return a paginated list of invoices, newest first.\n\nRequired API key scope: `invoices:read`.",
        "operationId": "getInvoices",
        "parameters": [
          {
            "name": "businessEntityId",
            "in": "query",
            "required": false,
            "description": "Only rows of this business (one of your businesses, else 400 VALIDATION_ERROR). An API key scoped to a business always sees only its own business, whatever is sent.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "customerId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          {
            "name": "dateFrom",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "dateTo",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number (1-based). Defaults to 1.",
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 10000
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "description": "Results per page, 1-100. Defaults to 25.",
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 100
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Matches the invoice number.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "sortDirection",
            "in": "query",
            "required": false,
            "description": "asc or desc. Defaults to desc.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "sortField",
            "in": "query",
            "required": false,
            "description": "Field to sort by (e.g. createdAt, or a money column such as transactionAmountUsdCents). Defaults to createdAt.",
            "schema": {
              "type": "string",
              "maxLength": 50
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "draft, sent, open, overdue, paid or void.",
            "schema": {
              "type": "string",
              "maxLength": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "invoices:read"
      },
      "post": {
        "tags": [
          "Invoices"
        ],
        "summary": "Create an invoice",
        "description": "Create an invoice in draft status: invoiceNumber and finalizedAt are null until it is finalised. Set supplyDate when the date of supply differs from the issue date. customerId must be a customer in your account (404 NOT_FOUND otherwise). The USD cents side is converted at the live exchange rate. Returns 201.\n\nRequired API key scope: `invoices:write`.",
        "operationId": "postInvoices",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateInvoiceRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "invoices:write"
      }
    },
    "/invoices/stats": {
      "get": {
        "tags": [
          "Invoices"
        ],
        "summary": "List invoice stats",
        "description": "",
        "operationId": "getInvoices_Stats",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ]
      }
    },
    "/invoices/{invoiceId}": {
      "get": {
        "tags": [
          "Invoices"
        ],
        "summary": "Retrieve an invoice",
        "description": "Retrieve a single invoice including its line items and status.\n\nRequired API key scope: `invoices:read`.",
        "operationId": "getInvoices_ByInvoiceId",
        "parameters": [
          {
            "name": "invoiceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "invoices:read"
      },
      "put": {
        "tags": [
          "Invoices"
        ],
        "summary": "Update an invoice",
        "description": "Update an invoice's dueDate and notes, and a draft's supplyDate (409 INVALID_STATE once issued). These are the only editable fields. Totals and status are server-managed; any other field returns 400 VALIDATION_ERROR, and an empty body returns 400.\n\nRequired API key scope: `invoices:write`.",
        "operationId": "putInvoices_ByInvoiceId",
        "parameters": [
          {
            "name": "invoiceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateInvoiceRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "invoices:write"
      }
    },
    "/invoices/{invoiceId}/apply-credit": {
      "post": {
        "tags": [
          "Invoices"
        ],
        "summary": "Create an invoice apply credit",
        "description": "Required API key scope: `invoices:write`.",
        "operationId": "postInvoices_ByInvoiceId_ApplyCredit",
        "parameters": [
          {
            "name": "invoiceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "invoices:write"
      }
    },
    "/invoices/{invoiceId}/attachments": {
      "get": {
        "tags": [
          "Invoices"
        ],
        "summary": "List invoice attachments",
        "description": "List the invoice's attached files, oldest first, without their content. Requires invoices:read.",
        "operationId": "getInvoices_ByInvoiceId_Attachments",
        "parameters": [
          {
            "name": "invoiceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ]
      },
      "post": {
        "tags": [
          "Invoices"
        ],
        "summary": "Create an invoice attachment",
        "description": "Upload one file to attach to the invoice's emails (multipart/form-data). Up to 5 files per invoice. Errors: 400 VALIDATION_ERROR (type, content or size), 409 ATTACHMENT_LIMIT (5 files already), 413 PAYLOAD_TOO_LARGE, 415 when the body is not multipart, 422 INVALID_STATE for a paid or void invoice. Requires invoices:write. Returns 201.",
        "operationId": "postInvoices_ByInvoiceId_Attachments",
        "parameters": [
          {
            "name": "invoiceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "description": "multipart/form-data part, one file per request. PDF, PNG, JPEG, CSV, TXT, DOCX or XLSX, at most 10 MB. The extension, the declared type and the file's content must agree. The name is sanitized (no paths or control characters, at most 120 characters)."
                  }
                },
                "required": [
                  "file"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ]
      }
    },
    "/invoices/{invoiceId}/attachments/{attachmentId}": {
      "get": {
        "tags": [
          "Invoices"
        ],
        "summary": "Retrieve an invoice attachment",
        "description": "Download one attached file with its stored Content-Type. Requires invoices:read.",
        "operationId": "getInvoices_ByInvoiceId_Attachments_ByAttachmentId",
        "parameters": [
          {
            "name": "invoiceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "attachmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Invoices"
        ],
        "summary": "Delete an invoice attachment",
        "description": "Remove an attached file. Emails already sent keep the copy the customer received. Requires invoices:write.",
        "operationId": "deleteInvoices_ByInvoiceId_Attachments_ByAttachmentId",
        "parameters": [
          {
            "name": "invoiceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "attachmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ]
      }
    },
    "/invoices/{invoiceId}/finalize": {
      "post": {
        "tags": [
          "Invoices"
        ],
        "summary": "Create an invoice finalize",
        "description": "Required API key scope: `invoices:write`.",
        "operationId": "postInvoices_ByInvoiceId_Finalize",
        "parameters": [
          {
            "name": "invoiceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "invoices:write"
      }
    },
    "/invoices/{invoiceId}/hosted-link": {
      "get": {
        "tags": [
          "Invoices"
        ],
        "summary": "Retrieve invoice hosted link",
        "description": "Return the customer's current hosted invoice link as { invoiceId, url } (the same value as hostedInvoiceUrl). 404 for a draft, which has no hosted page yet. Requires invoices:read.\n\nRequired API key scope: `invoices:read`.",
        "operationId": "getInvoices_ByInvoiceId_HostedLink",
        "parameters": [
          {
            "name": "invoiceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "invoices:read"
      },
      "delete": {
        "tags": [
          "Invoices"
        ],
        "summary": "Delete invoice hosted link",
        "description": "Revoke every hosted link of the invoice sent so far (emails, copied links, webhook hosted_invoice_url and invoice_pdf) and return the new link as { invoiceId, url }. Old links then open the Invoice unavailable page (404). Emails, webhooks and GET /api/v1/invoices/:id use the new link from then on. Cannot be undone; recorded in the activity log as invoice.hosted_link_revoked. 404 for a draft or an invoice of another account. Requires invoices:write.\n\nRequired API key scope: `invoices:write`.",
        "operationId": "deleteInvoices_ByInvoiceId_HostedLink",
        "parameters": [
          {
            "name": "invoiceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "invoices:write"
      }
    },
    "/invoices/{invoiceId}/mark-paid": {
      "post": {
        "tags": [
          "Invoices"
        ],
        "summary": "Mark an invoice as paid",
        "description": "Mark an invoice paid for out-of-band payments (wire, cash, etc.) and dispatch invoice.paid. No request body. Paid, void or cancelled invoices return 422 INVALID_STATE; a concurrent change returns 409 INVALID_STATE (the invoice is settled once).\n\nRequired API key scope: `invoices:write`.",
        "operationId": "postInvoices_ByInvoiceId_MarkPaid",
        "parameters": [
          {
            "name": "invoiceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "invoices:write"
      }
    },
    "/invoices/{invoiceId}/pdf": {
      "get": {
        "tags": [
          "Invoices"
        ],
        "summary": "Download an invoice PDF",
        "description": "Download the invoice as a PDF (Content-Type: application/pdf).\n\nRequired API key scope: `invoices:read`.",
        "operationId": "getInvoices_ByInvoiceId_Pdf",
        "parameters": [
          {
            "name": "invoiceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "invoices:read"
      }
    },
    "/invoices/{invoiceId}/send": {
      "post": {
        "tags": [
          "Invoices"
        ],
        "summary": "Send an invoice",
        "description": "Email the invoice to the customer and set its status to sent. A draft is finalised first (numbered, dated, invoice.finalized). The body is optional: { attachmentIds } adds files uploaded to the invoice after the invoice PDF. Errors: 400 VALIDATION_ERROR when an attachment id is not one of this invoice's files; 422 NO_RECIPIENT when the customer has no email; 502 EMAIL_SEND_FAILED (the invoice stays unsent).\n\nRequired API key scope: `invoices:write`.",
        "operationId": "postInvoices_ByInvoiceId_Send",
        "parameters": [
          {
            "name": "invoiceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "invoices:write"
      }
    },
    "/invoices/{invoiceId}/void": {
      "post": {
        "tags": [
          "Invoices"
        ],
        "summary": "Create an invoice void",
        "description": "Required API key scope: `invoices:write`.",
        "operationId": "postInvoices_ByInvoiceId_Void",
        "parameters": [
          {
            "name": "invoiceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "invoices:write"
      }
    },
    "/merchant": {
      "get": {
        "tags": [
          "Merchant"
        ],
        "summary": "Retrieve merchant",
        "description": "Required API key scope: `account:read`.",
        "operationId": "getMerchant",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:read"
      },
      "put": {
        "tags": [
          "Merchant"
        ],
        "summary": "Update merchant",
        "description": "Required API key scope: `account:write`.",
        "operationId": "putMerchant",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/merchant/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:write"
      }
    },
    "/merchant/embed-settings": {
      "get": {
        "tags": [
          "Merchant"
        ],
        "summary": "List merchant embed settings",
        "description": "Required API key scope: `account:read`.",
        "operationId": "getMerchant_EmbedSettings",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:read"
      },
      "put": {
        "tags": [
          "Merchant"
        ],
        "summary": "Update merchant embed settings",
        "description": "Required API key scope: `account:write`.",
        "operationId": "putMerchant_EmbedSettings",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is validated by `putSchema` in src/app/api/v1/merchant/embed-settings/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:write"
      }
    },
    "/merchant/entitlement-settings": {
      "get": {
        "tags": [
          "Merchant"
        ],
        "summary": "Retrieve entitlement settings",
        "description": "Your account's usage alert and access settings: pastDueKeepsAccess, notifyCustomer, alertThresholds, upgradeAllowance and billOverageOnCancel. Overage is set per price (GET /prices/{priceId}/feature-overage).\n\nRequired API key scope: `entitlements:read`.",
        "operationId": "getMerchant_EntitlementSettings",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "entitlements:read"
      },
      "patch": {
        "tags": [
          "Merchant"
        ],
        "summary": "Update entitlement settings",
        "description": "Change your account's usage alert and access settings (audited). Send only the fields to change; unknown fields, and the removed mode, answer 400 VALIDATION_ERROR. GET returns all five settings. Overage is set per price.\n\nRequired API key scope: `entitlements:write`.",
        "operationId": "patchMerchant_EntitlementSettings",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "pastDueKeepsAccess": {
                    "type": "boolean",
                    "description": "past_due subscriptions keep their features while payment is retried. Default true."
                  },
                  "notifyCustomer": {
                    "type": "boolean",
                    "description": "Also email the customer (feature_usage_alert_customer) when their usage crosses an alert threshold. Default false."
                  },
                  "alertThresholds": {
                    "type": "array",
                    "items": {
                      "type": "integer"
                    },
                    "description": "Up to 5 whole percentages from 1 to 100. Default [75, 90, 100]."
                  },
                  "upgradeAllowance": {
                    "type": "string",
                    "enum": [
                      "full",
                      "prorated"
                    ],
                    "description": "After a mid-period upgrade, the new plan's full allowance (default) or a share prorated to the time left."
                  },
                  "billOverageOnCancel": {
                    "type": "boolean",
                    "description": "Invoice billed overage (prices with policy bill) used so far when a subscription is cancelled. Default true."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "entitlements:write"
      }
    },
    "/merchant/pay-page": {
      "get": {
        "tags": [
          "Merchant"
        ],
        "summary": "Retrieve merchant pay page",
        "description": "Required API key scope: `account:read`.",
        "operationId": "getMerchant_PayPage",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:read"
      },
      "put": {
        "tags": [
          "Merchant"
        ],
        "summary": "Update merchant pay page",
        "description": "Required API key scope: `account:write`.",
        "operationId": "putMerchant_PayPage",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is validated by `updateSchema` in src/app/api/v1/merchant/pay-page/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:write"
      }
    },
    "/merchant/platform-mode": {
      "get": {
        "tags": [
          "Merchant"
        ],
        "summary": "Retrieve merchant platform mode",
        "description": "Required API key scope: `account:read`.",
        "operationId": "getMerchant_PlatformMode",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:read"
      },
      "patch": {
        "tags": [
          "Merchant"
        ],
        "summary": "Update merchant platform mode",
        "description": "Required API key scope: `account:write`.",
        "operationId": "patchMerchant_PlatformMode",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/merchant/platform-mode/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:write"
      }
    },
    "/merchant/settings": {
      "get": {
        "tags": [
          "Merchant"
        ],
        "summary": "Retrieve merchant settings",
        "description": "Required API key scope: `account:read`.",
        "operationId": "getMerchant_Settings",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:read"
      },
      "put": {
        "tags": [
          "Merchant"
        ],
        "summary": "Update merchant settings",
        "description": "Required API key scope: `account:write`.",
        "operationId": "putMerchant_Settings",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/merchant/settings/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:write"
      },
      "delete": {
        "tags": [
          "Merchant"
        ],
        "summary": "Delete merchant settings",
        "description": "Required API key scope: `account:write`.",
        "operationId": "deleteMerchant_Settings",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:write"
      }
    },
    "/meter-events": {
      "post": {
        "tags": [
          "Meter Events"
        ],
        "summary": "Create a meter event",
        "description": "Required API key scope: `subscriptions:write`.",
        "operationId": "postMeterEvents",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "subscriptions:write"
      }
    },
    "/meters": {
      "get": {
        "tags": [
          "Meters"
        ],
        "summary": "List meters",
        "description": "Required API key scope: `subscriptions:read`.",
        "operationId": "getMeters",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 10000
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 100
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "subscriptions:read"
      },
      "post": {
        "tags": [
          "Meters"
        ],
        "summary": "Create a meter",
        "description": "Required API key scope: `subscriptions:write`.\n\nHonours the `Idempotency-Key` header.",
        "operationId": "postMeters",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "subscriptions:write"
      }
    },
    "/meters/{meterId}": {
      "get": {
        "tags": [
          "Meters"
        ],
        "summary": "Retrieve a meter",
        "description": "Required API key scope: `subscriptions:read`.",
        "operationId": "getMeters_ByMeterId",
        "parameters": [
          {
            "name": "meterId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "subscriptions:read"
      },
      "put": {
        "tags": [
          "Meters"
        ],
        "summary": "Update a meter",
        "description": "Required API key scope: `subscriptions:write`.",
        "operationId": "putMeters_ByMeterId",
        "parameters": [
          {
            "name": "meterId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "subscriptions:write"
      },
      "patch": {
        "tags": [
          "Meters"
        ],
        "summary": "Update a meter",
        "description": "Required API key scope: `subscriptions:write`.",
        "operationId": "patchMeters_ByMeterId",
        "parameters": [
          {
            "name": "meterId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "subscriptions:write"
      }
    },
    "/meters/{meterId}/usage": {
      "get": {
        "tags": [
          "Meters"
        ],
        "summary": "Retrieve meter usage",
        "description": "Required API key scope: `subscriptions:read`.",
        "operationId": "getMeters_ByMeterId_Usage",
        "parameters": [
          {
            "name": "meterId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "customerId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "subscriptions:read"
      }
    },
    "/newsletter": {
      "post": {
        "tags": [
          "Newsletter"
        ],
        "summary": "Subscribe to the newsletter",
        "description": "Public endpoint: no API key required.",
        "operationId": "postNewsletter",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is validated by `subscribeSchema` in src/app/api/v1/newsletter/route.ts."
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": []
      }
    },
    "/notifications": {
      "get": {
        "tags": [
          "Notifications"
        ],
        "summary": "List notifications",
        "description": "Required API key scope: `account:read`.",
        "operationId": "getNotifications",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:read"
      },
      "put": {
        "tags": [
          "Notifications"
        ],
        "summary": "Update notifications",
        "description": "Required API key scope: `account:write`.",
        "operationId": "putNotifications",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/notifications/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:write"
      }
    },
    "/notifications/alert-rules": {
      "get": {
        "tags": [
          "Notifications"
        ],
        "summary": "List notification alert rules",
        "description": "Required API key scope: `account:read`.",
        "operationId": "getNotifications_AlertRules",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:read"
      },
      "post": {
        "tags": [
          "Notifications"
        ],
        "summary": "Create a notification alert rule",
        "description": "Required API key scope: `account:write`.",
        "operationId": "postNotifications_AlertRules",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/notifications/alert-rules/route.ts."
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:write"
      },
      "put": {
        "tags": [
          "Notifications"
        ],
        "summary": "Update notification alert rules",
        "description": "Required API key scope: `account:write`.",
        "operationId": "putNotifications_AlertRules",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/notifications/alert-rules/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:write"
      }
    },
    "/notifications/alert-rules/{ruleId}": {
      "patch": {
        "tags": [
          "Notifications"
        ],
        "summary": "Update an alert rule",
        "description": "Required API key scope: `account:write`.",
        "operationId": "patchNotifications_AlertRules_ByRuleId",
        "parameters": [
          {
            "name": "ruleId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/notifications/alert-rules/[ruleId]/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:write"
      },
      "delete": {
        "tags": [
          "Notifications"
        ],
        "summary": "Delete an alert rule",
        "description": "Required API key scope: `account:write`.",
        "operationId": "deleteNotifications_AlertRules_ByRuleId",
        "parameters": [
          {
            "name": "ruleId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:write"
      }
    },
    "/notifications/channels": {
      "get": {
        "tags": [
          "Notifications"
        ],
        "summary": "List notification channels",
        "description": "Required API key scope: `account:read`.",
        "operationId": "getNotifications_Channels",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:read"
      },
      "put": {
        "tags": [
          "Notifications"
        ],
        "summary": "Update notification channels",
        "description": "Required API key scope: `account:write`.",
        "operationId": "putNotifications_Channels",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is validated by `putSchema` in src/app/api/v1/notifications/channels/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:write"
      }
    },
    "/notifications/channels/webhook": {
      "get": {
        "tags": [
          "Notifications"
        ],
        "summary": "Retrieve channel webhook",
        "description": "Required API key scope: `account:read`.",
        "operationId": "getNotifications_Channels_Webhook",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:read"
      },
      "put": {
        "tags": [
          "Notifications"
        ],
        "summary": "Update channel webhook",
        "description": "Required API key scope: `account:write`.",
        "operationId": "putNotifications_Channels_Webhook",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is validated by `putSchema` in src/app/api/v1/notifications/channels/webhook/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:write"
      }
    },
    "/notifications/channels/{channel}/credentials": {
      "put": {
        "tags": [
          "Notifications"
        ],
        "summary": "Update channel credentials",
        "description": "",
        "operationId": "putNotifications_Channels_ByChannel_Credentials",
        "parameters": [
          {
            "name": "channel",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is validated by `bodySchema` in src/app/api/v1/notifications/channels/[channel]/credentials/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Notifications"
        ],
        "summary": "Delete channel credentials",
        "description": "",
        "operationId": "deleteNotifications_Channels_ByChannel_Credentials",
        "parameters": [
          {
            "name": "channel",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ]
      }
    },
    "/notifications/count": {
      "get": {
        "tags": [
          "Notifications"
        ],
        "summary": "Retrieve notification count",
        "description": "Required API key scope: `account:read`.",
        "operationId": "getNotifications_Count",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:read"
      }
    },
    "/notifications/preferences": {
      "get": {
        "tags": [
          "Notifications"
        ],
        "summary": "Retrieve notification preferences",
        "description": "Required API key scope: `account:read`.",
        "operationId": "getNotifications_Preferences",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:read"
      },
      "put": {
        "tags": [
          "Notifications"
        ],
        "summary": "Update notification preferences",
        "description": "Required API key scope: `account:write`.",
        "operationId": "putNotifications_Preferences",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/notifications/preferences/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:write"
      }
    },
    "/onboarding": {
      "get": {
        "tags": [
          "Onboarding"
        ],
        "summary": "Retrieve onboarding",
        "description": "Required API key scope: `account:read`.",
        "operationId": "getOnboarding",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:read"
      },
      "post": {
        "tags": [
          "Onboarding"
        ],
        "summary": "Update onboarding progress",
        "description": "Required API key scope: `account:write`.",
        "operationId": "postOnboarding",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/onboarding/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:write"
      }
    },
    "/orders/{orderId}/public": {
      "get": {
        "tags": [
          "Orders"
        ],
        "summary": "Retrieve an order (public)",
        "description": "Public endpoint: no API key required.",
        "operationId": "getOrders_ByOrderId_Public",
        "parameters": [
          {
            "name": "orderId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": []
      }
    },
    "/pay-pages/{handle}": {
      "get": {
        "tags": [
          "Pay Pages"
        ],
        "summary": "Retrieve a pay page",
        "description": "Public endpoint: no API key required.",
        "operationId": "getPayPages_ByHandle",
        "parameters": [
          {
            "name": "handle",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": []
      }
    },
    "/pay-pages/{handle}/checkout": {
      "post": {
        "tags": [
          "Pay Pages"
        ],
        "summary": "Create a pay page checkout",
        "description": "Public endpoint: no API key required.",
        "operationId": "postPayPages_ByHandle_Checkout",
        "parameters": [
          {
            "name": "handle",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/pay-pages/[handle]/checkout/route.ts."
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": []
      }
    },
    "/payment-element/issue-public-id": {
      "post": {
        "tags": [
          "Payment Element"
        ],
        "summary": "Issue a Payment Element public id",
        "description": "Required API key scope: `payments:write`.",
        "operationId": "postPaymentElement_IssuePublicId",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/payment-element/issue-public-id/route.ts."
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "payments:write"
      }
    },
    "/payment-element/tokenize": {
      "post": {
        "tags": [
          "Payment Element"
        ],
        "summary": "Tokenize a card from the Payment Element",
        "description": "Public endpoint: no API key required.",
        "operationId": "postPaymentElement_Tokenize",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/payment-element/tokenize/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": []
      }
    },
    "/payment-links": {
      "get": {
        "tags": [
          "Payment Links"
        ],
        "summary": "List payment links",
        "description": "Return a paginated list of payment links, newest first.\n\nRequired API key scope: `payment_links:read`.",
        "operationId": "getPaymentLinks",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number (1-based). Defaults to 1.",
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 10000
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "description": "Results per page, 1-100. Defaults to 25.",
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 100
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Matches link name or slug.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "sortDirection",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "sortField",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 50
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Filter by link status (e.g. active).",
            "schema": {
              "type": "string",
              "maxLength": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "payment_links:read"
      },
      "post": {
        "tags": [
          "Payment Links"
        ],
        "summary": "Create a payment link",
        "description": "Create a payment link with status active. Unknown body fields return 400 VALIDATION_ERROR. Returns 201 and dispatches payment_link.created.\n\nRequired API key scope: `payment_links:write`.",
        "operationId": "postPaymentLinks",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePaymentLinkRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "payment_links:write"
      }
    },
    "/payment-links/checkout": {
      "post": {
        "tags": [
          "Payment Links"
        ],
        "summary": "Create a checkout session from a payment link",
        "description": "Public endpoint: no API key required.",
        "operationId": "postPaymentLinks_Checkout",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/payment-links/checkout/route.ts."
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "410": {
            "$ref": "#/components/responses/Error410"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": []
      }
    },
    "/payment-links/resolve": {
      "get": {
        "tags": [
          "Payment Links"
        ],
        "summary": "Resolve a payment link by slug (public)",
        "description": "Public endpoint. Resolve a payment link by slug (or ID). Returns 410 LINK_INACTIVE if the link is not active.\n\nPublic endpoint: no API key required.",
        "operationId": "getPaymentLinks_Resolve",
        "parameters": [
          {
            "name": "slug",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "410": {
            "$ref": "#/components/responses/Error410"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": []
      }
    },
    "/payment-links/{linkId}": {
      "get": {
        "tags": [
          "Payment Links"
        ],
        "summary": "Retrieve a payment link",
        "description": "Retrieve a single payment link by ID.\n\nRequired API key scope: `payment_links:read`.",
        "operationId": "getPaymentLinks_ByLinkId",
        "parameters": [
          {
            "name": "linkId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "payment_links:read"
      },
      "put": {
        "tags": [
          "Payment Links"
        ],
        "summary": "Update a payment link",
        "description": "Update a payment link, e.g. to rename or deactivate it. Only the fields below are accepted; unknown or server-managed fields (e.g. paymentCount, itemLocalCurrency) return 400 VALIDATION_ERROR, and an empty body returns 400. An unknown link returns 404 NOT_FOUND; any other failure returns 500 INTERNAL_ERROR.\n\nRequired API key scope: `payment_links:write`.",
        "operationId": "putPaymentLinks_ByLinkId",
        "parameters": [
          {
            "name": "linkId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePaymentLinkRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "payment_links:write"
      }
    },
    "/payment-links/{linkId}/pay": {
      "post": {
        "tags": [
          "Payment Links"
        ],
        "summary": "Pay a payment link",
        "description": "Public endpoint called by the hosted payment page. Supports card and UPI. Returns 410 LINK_INACTIVE for inactive links.\n\nPublic endpoint: no API key required.",
        "operationId": "postPaymentLinks_ByLinkId_Pay",
        "parameters": [
          {
            "name": "linkId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "description": "Customer email (required for card payments)."
                  },
                  "paymentMethod": {
                    "type": "string",
                    "enum": [
                      "card",
                      "upi"
                    ],
                    "description": "Defaults to \"card\"."
                  },
                  "vpa": {
                    "type": "string",
                    "description": "UPI VPA. Required when paymentMethod is \"upi\"."
                  },
                  "cardNumber": {
                    "type": "string",
                    "description": "Card number. Required unless the link is paid through a Stripe connection."
                  },
                  "cardExpiry": {
                    "type": "string",
                    "description": "Expiry in MM/YY format. Required for card payments."
                  },
                  "cardCvc": {
                    "type": "string",
                    "description": "Card security code. Required for card payments."
                  },
                  "cardholderName": {
                    "type": "string",
                    "description": "Name on the card."
                  },
                  "gatewayConnectionId": {
                    "type": "string",
                    "description": "Gateway connection to use."
                  }
                },
                "required": [
                  "email"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "410": {
            "$ref": "#/components/responses/Error410"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": []
      }
    },
    "/payment-links/{linkId}/payments": {
      "get": {
        "tags": [
          "Payment Links"
        ],
        "summary": "List payment link payments",
        "description": "Required API key scope: `payment_links:read`.",
        "operationId": "getPaymentLinks_ByLinkId_Payments",
        "parameters": [
          {
            "name": "linkId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "payment_links:read"
      }
    },
    "/payment-links/{linkId}/send": {
      "post": {
        "tags": [
          "Payment Links"
        ],
        "summary": "Send a payment link",
        "description": "Required API key scope: `payment_links:write`.",
        "operationId": "postPaymentLinks_ByLinkId_Send",
        "parameters": [
          {
            "name": "linkId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is validated by `sendSchema` in src/app/api/v1/payment-links/[linkId]/send/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "502": {
            "$ref": "#/components/responses/Error502"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "payment_links:write"
      }
    },
    "/payment-methods": {
      "get": {
        "tags": [
          "Payment Methods"
        ],
        "summary": "List payment methods",
        "description": "Required API key scope: `customers:read`.",
        "operationId": "getPaymentMethods",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "customers:read"
      },
      "put": {
        "tags": [
          "Payment Methods"
        ],
        "summary": "Update payment methods",
        "description": "Required API key scope: `customers:read`.",
        "operationId": "putPaymentMethods",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/payment-methods/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "customers:read"
      }
    },
    "/payments": {
      "get": {
        "tags": [
          "Payments"
        ],
        "summary": "List payments",
        "description": "Return a paginated list of payments, newest first. Requires payments:read.\n\nRequired API key scope: `payments:read`.",
        "operationId": "getPayments",
        "parameters": [
          {
            "name": "businessEntityId",
            "in": "query",
            "required": false,
            "description": "Only rows of this business (one of your businesses, else 400 VALIDATION_ERROR). An API key scoped to a business always sees only its own business, whatever is sent.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "customerId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          {
            "name": "dateFrom",
            "in": "query",
            "required": false,
            "description": "Inclusive start date, YYYY-MM-DD.",
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "dateTo",
            "in": "query",
            "required": false,
            "description": "Inclusive end date, YYYY-MM-DD.",
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number (1-based). Defaults to 1.",
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 10000
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "description": "Results per page, 1-100. Defaults to 25.",
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 100
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Matches payment id, description, or card last 4.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "sortDirection",
            "in": "query",
            "required": false,
            "description": "asc or desc. Defaults to desc.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "sortField",
            "in": "query",
            "required": false,
            "description": "Field to sort by (e.g. createdAt, or a money column such as transactionAmountUsdCents). Defaults to createdAt.",
            "schema": {
              "type": "string",
              "maxLength": 50
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Filter by payment status (e.g. success, pending, failed).",
            "schema": {
              "type": "string",
              "maxLength": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "payments:read"
      },
      "post": {
        "tags": [
          "Payments"
        ],
        "summary": "Create a payment",
        "description": "Create a payment. The gateway connection is chosen by your routing rules and routing strategy, or forced with gatewayId. An account in test mode is only routed to sandbox connections, never a live gateway. Errors: 404 NOT_FOUND when customerId is not a customer in your account; 422 GATEWAY_NOT_CONNECTED when the forced gateway has no active connection in your mode. Requires the payments:write scope. Returns 201; status reflects the gateway result, and redirectUrl is included when the gateway needs a redirect.\n\nIdempotency for this endpoint uses the body field `idempotencyKey` (not the Idempotency-Key header): a retry with the same key and body replays the original response; the same key with a different body returns 409 IDEMPOTENCY_CONFLICT.\n\nRequired API key scope: `payments:write`.",
        "operationId": "postPayments",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePaymentRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "payments:write"
      }
    },
    "/payments/verify": {
      "get": {
        "tags": [
          "Payments"
        ],
        "summary": "Verify a payment result (public)",
        "description": "Public endpoint: no API key required.",
        "operationId": "getPayments_Verify",
        "parameters": [
          {
            "name": "payment_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "payment_link_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "session_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": []
      }
    },
    "/payments/{paymentId}": {
      "get": {
        "tags": [
          "Payments"
        ],
        "summary": "Retrieve a payment",
        "description": "Retrieve a payment with its event timeline, subscriptionId (when it came from a subscription checkout), and an embedded customer summary. Requires payments:read.\n\nRequired API key scope: `payments:read`.",
        "operationId": "getPayments_ByPaymentId",
        "parameters": [
          {
            "name": "paymentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "payments:read"
      },
      "put": {
        "tags": [
          "Payments"
        ],
        "summary": "Update a payment",
        "description": "Update a payment's description and metadata. These are the only editable fields; other fields are ignored, and a body with neither returns 400 VALIDATION_ERROR. Requires payments:write.\n\nRequired API key scope: `payments:write`.",
        "operationId": "putPayments_ByPaymentId",
        "parameters": [
          {
            "name": "paymentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePaymentRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "payments:write"
      }
    },
    "/payments/{paymentId}/3ds": {
      "get": {
        "tags": [
          "Payments"
        ],
        "summary": "Retrieve 3D Secure status",
        "description": "Required API key scope: `payments:read`.",
        "operationId": "getPayments_ByPaymentId_3ds",
        "parameters": [
          {
            "name": "paymentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "payments:read"
      },
      "post": {
        "tags": [
          "Payments"
        ],
        "summary": "Start 3D Secure authentication",
        "description": "Required API key scope: `payments:write`.",
        "operationId": "postPayments_ByPaymentId_3ds",
        "parameters": [
          {
            "name": "paymentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/payments/[paymentId]/3ds/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "payments:write"
      }
    },
    "/payments/{paymentId}/3ds/challenge": {
      "get": {
        "tags": [
          "Payments"
        ],
        "summary": "Open the 3D Secure challenge page",
        "description": "Public endpoint: no API key required.",
        "operationId": "getPayments_ByPaymentId_3ds_Challenge",
        "parameters": [
          {
            "name": "paymentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "returnUrl",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "302": {
            "description": "Redirect to the next step of the flow (see the Location header)."
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": []
      },
      "post": {
        "tags": [
          "Payments"
        ],
        "summary": "Submit a 3D Secure challenge result",
        "description": "Public endpoint: no API key required.",
        "operationId": "postPayments_ByPaymentId_3ds_Challenge",
        "parameters": [
          {
            "name": "paymentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/payments/[paymentId]/3ds/challenge/route.ts."
              }
            }
          }
        },
        "responses": {
          "302": {
            "description": "Redirect to the next step of the flow (see the Location header)."
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "security": []
      }
    },
    "/payments/{paymentId}/capture": {
      "post": {
        "tags": [
          "Payments"
        ],
        "summary": "Capture a payment",
        "description": "Capture a payment in status requires_capture, fully or partially. Only test-mode authorizations can be captured through the API; other gateways return 422 CAPTURE_NOT_SUPPORTED. Requires payments:write; honours Idempotency-Key.\n\nRequired API key scope: `payments:write`.\n\nHonours the `Idempotency-Key` header.",
        "operationId": "postPayments_ByPaymentId_Capture",
        "parameters": [
          {
            "name": "paymentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "transactionAmountUsdCents": {
                    "type": "integer",
                    "description": "Amount to capture in USD cents. Defaults to the full authorized transactionAmountUsdCents; cannot exceed it. A partial capture scales transactionLocalCurrencyAmount by the same fraction."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "payments:write"
      }
    },
    "/payments/{paymentId}/receipt-link": {
      "get": {
        "tags": [
          "Payments"
        ],
        "summary": "Retrieve payment receipt link",
        "description": "Required API key scope: `payments:read`.",
        "operationId": "getPayments_ByPaymentId_ReceiptLink",
        "parameters": [
          {
            "name": "paymentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "payments:read"
      },
      "delete": {
        "tags": [
          "Payments"
        ],
        "summary": "Delete payment receipt link",
        "description": "Required API key scope: `payments:write`.",
        "operationId": "deletePayments_ByPaymentId_ReceiptLink",
        "parameters": [
          {
            "name": "paymentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "payments:write"
      }
    },
    "/payments/{paymentId}/refund": {
      "post": {
        "tags": [
          "Payments"
        ],
        "summary": "Refund a payment",
        "description": "Refund all or part of a payment in status success or disputed, through the gateway that processed it. Returns 201 with the refund. Errors: 422 INVALID_STATE, 400 EXCEEDS_REFUNDABLE, 409 GATEWAY_NOT_CONNECTED, 502 GATEWAY_REJECTED, 409 IDEMPOTENCY_IN_PROGRESS (the same Idempotency-Key is still being processed). Requires payments:write; honours Idempotency-Key.\n\nRequired API key scope: `payments:write`.\n\nHonours the `Idempotency-Key` header.",
        "operationId": "postPayments_ByPaymentId_Refund",
        "parameters": [
          {
            "name": "paymentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "transactionAmountUsdCents": {
                    "type": "integer",
                    "description": "Amount to refund in USD cents. Cannot exceed transactionAmountUsdCents less transactionRefundedAmountUsdCents. The gateway is refunded the pro-rata share of transactionLocalCurrencyAmount, in transactionLocalCurrency."
                  },
                  "reason": {
                    "type": "string",
                    "description": "Free-text reason recorded on the refund."
                  }
                },
                "required": [
                  "transactionAmountUsdCents"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "payments:write"
      }
    },
    "/payments/{paymentId}/status": {
      "get": {
        "tags": [
          "Payments"
        ],
        "summary": "Retrieve payment status",
        "description": "Required API key scope: `payments:read`.",
        "operationId": "getPayments_ByPaymentId_Status",
        "parameters": [
          {
            "name": "paymentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "payments:read"
      }
    },
    "/payouts": {
      "get": {
        "tags": [
          "Payouts"
        ],
        "summary": "List payouts",
        "description": "Required API key scope: `payments:read`.",
        "operationId": "getPayouts",
        "parameters": [
          {
            "name": "dateFrom",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "dateTo",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "sortDirection",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "sortField",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 50
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "payments:read"
      }
    },
    "/payouts/{payoutId}": {
      "get": {
        "tags": [
          "Payouts"
        ],
        "summary": "Retrieve a payout",
        "description": "Required API key scope: `payments:read`.",
        "operationId": "getPayouts_ByPayoutId",
        "parameters": [
          {
            "name": "payoutId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "payments:read"
      }
    },
    "/payouts/{payoutId}/payments": {
      "get": {
        "tags": [
          "Payouts"
        ],
        "summary": "List payout payments",
        "description": "Required API key scope: `payments:read`.",
        "operationId": "getPayouts_ByPayoutId_Payments",
        "parameters": [
          {
            "name": "payoutId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 100
            }
          },
          {
            "name": "sortDirection",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "sortField",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "payments:read"
      }
    },
    "/plans": {
      "get": {
        "tags": [
          "Plans"
        ],
        "summary": "List plans",
        "description": "",
        "operationId": "getPlans",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 10000
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 100
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ]
      },
      "post": {
        "tags": [
          "Plans"
        ],
        "summary": "Create a plan",
        "description": "Restricted to platform administrators (dashboard admin session); API keys are not accepted.",
        "operationId": "postPlans",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/plans/route.ts."
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "x-admin": true
      }
    },
    "/plans/{planId}": {
      "get": {
        "tags": [
          "Plans"
        ],
        "summary": "Retrieve a plan",
        "description": "",
        "operationId": "getPlans_ByPlanId",
        "parameters": [
          {
            "name": "planId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ]
      },
      "put": {
        "tags": [
          "Plans"
        ],
        "summary": "Update a plan",
        "description": "Restricted to platform administrators (dashboard admin session); API keys are not accepted.",
        "operationId": "putPlans_ByPlanId",
        "parameters": [
          {
            "name": "planId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/plans/[planId]/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "x-admin": true
      }
    },
    "/prices": {
      "get": {
        "tags": [
          "Prices"
        ],
        "summary": "List prices",
        "description": "Required API key scope: `products:read`.",
        "operationId": "getPrices",
        "parameters": [
          {
            "name": "businessEntityId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "businessOnly",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "dateFrom",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "dateTo",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 10000
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 100
            }
          },
          {
            "name": "productId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "sortDirection",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "sortField",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 50
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 50
            }
          },
          {
            "name": "tag",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tagMatch",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "products:read"
      },
      "post": {
        "tags": [
          "Prices"
        ],
        "summary": "Create a price",
        "description": "Required API key scope: `products:write`.",
        "operationId": "postPrices",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePriceBodyRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "products:write"
      }
    },
    "/prices/tags": {
      "get": {
        "tags": [
          "Prices"
        ],
        "summary": "List price tags",
        "description": "Required API key scope: `products:read`.",
        "operationId": "getPrices_Tags",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "products:read"
      }
    },
    "/prices/{priceId}": {
      "get": {
        "tags": [
          "Prices"
        ],
        "summary": "Retrieve a price",
        "description": "Required API key scope: `products:read`.",
        "operationId": "getPrices_ByPriceId",
        "parameters": [
          {
            "name": "priceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "products:read"
      },
      "put": {
        "tags": [
          "Prices"
        ],
        "summary": "Update a price",
        "description": "Required API key scope: `products:write`.",
        "operationId": "putPrices_ByPriceId",
        "parameters": [
          {
            "name": "priceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePriceRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "products:write"
      },
      "delete": {
        "tags": [
          "Prices"
        ],
        "summary": "Delete a price",
        "description": "Required API key scope: `products:write`.",
        "operationId": "deletePrices_ByPriceId",
        "parameters": [
          {
            "name": "priceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "products:write"
      }
    },
    "/prices/{priceId}/feature-overage": {
      "get": {
        "tags": [
          "Prices"
        ],
        "summary": "Retrieve a price's overage terms",
        "description": "The overage terms of each quantity or metered feature on the price's product: policy (restrict | allow | bill), the package price in the price's itemLocalCurrency and in USD cents, package size and cap.\n\nRequired API key scope: `products:read`.",
        "operationId": "getPrices_ByPriceId_FeatureOverage",
        "parameters": [
          {
            "name": "priceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "products:read"
      },
      "put": {
        "tags": [
          "Prices"
        ],
        "summary": "Replace a price's overage terms",
        "description": "Replace the price's overage terms. GET returns the current terms with the package price in the price's currency and in USD cents. Errors: 400 VALIDATION_ERROR, 404 NOT_FOUND, 409 FEATURE_METER_BILLED_BY_PRICE.\n\nRequired API key scope: `products:write`.",
        "operationId": "putPrices_ByPriceId_FeatureOverage",
        "parameters": [
          {
            "name": "priceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "overages": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "featureId": {
                          "type": "string",
                          "description": "A quantity or metered feature on the price's product."
                        },
                        "policy": {
                          "type": "string",
                          "enum": [
                            "restrict",
                            "allow",
                            "bill"
                          ],
                          "description": "restrict (default without an entry): usage above the maximum is refused. allow: recorded, alerted and sent in webhooks, never refused or charged. bill: metered features only; usage above the maximum is billed on the renewal invoice. A feature whose meter a metered price already bills answers 409 FEATURE_METER_BILLED_BY_PRICE."
                        },
                        "itemOverageUnitLocalCurrencyAmount": {
                          "type": "integer",
                          "description": "bill: price per package in the smallest unit of the price's itemLocalCurrency (from 1). The USD cents are derived at the price's itemUsdToLocalCurrencyRate."
                        },
                        "overagePackageSize": {
                          "type": "integer",
                          "description": "bill: units per package (from 1, default 1). Packages are rounded up."
                        },
                        "overageCap": {
                          "type": "integer",
                          "description": "bill: units allowed above the maximum, or null for no cap. Usage beyond it answers 409 ENTITLEMENT_OVERAGE_CAP_REACHED."
                        }
                      },
                      "required": [
                        "featureId",
                        "policy"
                      ]
                    },
                    "description": "The price's whole overage list; it replaces the current one. One entry per quantity or metered feature of the price's product."
                  }
                },
                "required": [
                  "overages"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "products:write"
      }
    },
    "/prices/{priceId}/migrate-subscriptions": {
      "post": {
        "tags": [
          "Prices"
        ],
        "summary": "Create a price migrate subscription",
        "description": "Required API key scope: `subscriptions:write`.",
        "operationId": "postPrices_ByPriceId_MigrateSubscriptions",
        "parameters": [
          {
            "name": "priceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is validated by `bodySchema` in src/app/api/v1/prices/[priceId]/migrate-subscriptions/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "subscriptions:write"
      }
    },
    "/prices/{priceId}/product": {
      "get": {
        "tags": [
          "Prices"
        ],
        "summary": "Retrieve a price's product",
        "description": "Required API key scope: `products:read`.",
        "operationId": "getPrices_ByPriceId_Product",
        "parameters": [
          {
            "name": "priceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "products:read"
      }
    },
    "/prices/{priceId}/subscriptions": {
      "get": {
        "tags": [
          "Prices"
        ],
        "summary": "List price subscriptions",
        "description": "Required API key scope: `subscriptions:read`.",
        "operationId": "getPrices_ByPriceId_Subscriptions",
        "parameters": [
          {
            "name": "priceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "subscriptions:read"
      }
    },
    "/prices/{priceId}/versions": {
      "get": {
        "tags": [
          "Prices"
        ],
        "summary": "List price versions",
        "description": "Required API key scope: `products:read`.",
        "operationId": "getPrices_ByPriceId_Versions",
        "parameters": [
          {
            "name": "priceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "products:read"
      }
    },
    "/products": {
      "get": {
        "tags": [
          "Products"
        ],
        "summary": "List products",
        "description": "Required API key scope: `products:read`.",
        "operationId": "getProducts",
        "parameters": [
          {
            "name": "businessEntityId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "businessOnly",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "dateFrom",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "dateTo",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 10000
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 100
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "sortDirection",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "sortField",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 50
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 50
            }
          },
          {
            "name": "tag",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tagMatch",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "products:read"
      },
      "post": {
        "tags": [
          "Products"
        ],
        "summary": "Create a product",
        "description": "Required API key scope: `products:write`.",
        "operationId": "postProducts",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateProductRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "products:write"
      }
    },
    "/products/tags": {
      "get": {
        "tags": [
          "Products"
        ],
        "summary": "List product tags",
        "description": "Required API key scope: `products:read`.",
        "operationId": "getProducts_Tags",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "products:read"
      }
    },
    "/products/{productId}": {
      "get": {
        "tags": [
          "Products"
        ],
        "summary": "Retrieve a product",
        "description": "Required API key scope: `products:read`.",
        "operationId": "getProducts_ByProductId",
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "products:read"
      },
      "put": {
        "tags": [
          "Products"
        ],
        "summary": "Update a product",
        "description": "Required API key scope: `products:write`.",
        "operationId": "putProducts_ByProductId",
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProductRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "products:write"
      },
      "delete": {
        "tags": [
          "Products"
        ],
        "summary": "Delete a product",
        "description": "Required API key scope: `products:write`.",
        "operationId": "deleteProducts_ByProductId",
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "products:write"
      }
    },
    "/products/{productId}/features": {
      "get": {
        "tags": [
          "Products"
        ],
        "summary": "List a product's features",
        "description": "The product's features in display order: featureId, key, name, type, unit, status, enabled, limitValue (null = unlimited) and displayOrder.\n\nRequired API key scope: `products:read`.",
        "operationId": "getProducts_ByProductId_Features",
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "products:read"
      },
      "put": {
        "tags": [
          "Products"
        ],
        "summary": "Replace a product's features",
        "description": "Replace the product's whole feature list in one transaction (audited). Running subscriptions keep the terms they were snapshotted with until their next period. Errors: 404 NOT_FOUND for an unknown product, 400 VALIDATION_ERROR with error.fields keyed features.N.field.\n\nRequired API key scope: `products:write`.",
        "operationId": "putProducts_ByProductId_Features",
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "features": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "featureId": {
                          "type": "string",
                          "description": "One of your active features. A feature already on the product may stay after it was archived."
                        },
                        "enabled": {
                          "type": "boolean",
                          "description": "Whether the plan includes it. Defaults to true. A disabled feature keeps its row but grants nothing and has no maximum."
                        },
                        "limitValue": {
                          "type": "integer",
                          "description": "Quantity and metered features: the maximum (0 to 2147483647), or null / omitted for unlimited. Boolean features take no maximum."
                        },
                        "displayOrder": {
                          "type": "integer",
                          "description": "Position in What's included (0 to 10000). Defaults to the position in the list."
                        }
                      },
                      "required": [
                        "featureId"
                      ]
                    },
                    "description": "The product's whole feature list (at most 50). It replaces the current list: a feature left out is removed from the product. Send [] to remove all."
                  }
                },
                "required": [
                  "features"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "products:write"
      }
    },
    "/products/{productId}/prices": {
      "get": {
        "tags": [
          "Products"
        ],
        "summary": "List product prices",
        "description": "Required API key scope: `products:read`.",
        "operationId": "getProducts_ByProductId_Prices",
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "products:read"
      }
    },
    "/products/{productId}/subscriptions": {
      "get": {
        "tags": [
          "Products"
        ],
        "summary": "List product subscriptions",
        "description": "Required API key scope: `subscriptions:read`.",
        "operationId": "getProducts_ByProductId_Subscriptions",
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "subscriptions:read"
      }
    },
    "/quote-pages/{token}": {
      "get": {
        "tags": [
          "Quote Pages"
        ],
        "summary": "Retrieve a quote page",
        "description": "Public endpoint: no API key required.",
        "operationId": "getQuotePages_ByToken",
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": []
      }
    },
    "/quote-pages/{token}/pdf": {
      "get": {
        "tags": [
          "Quote Pages"
        ],
        "summary": "Retrieve quote page pdf",
        "description": "Public endpoint: no API key required.",
        "operationId": "getQuotePages_ByToken_Pdf",
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": []
      }
    },
    "/quote-pages/{token}/respond": {
      "post": {
        "tags": [
          "Quote Pages"
        ],
        "summary": "Create a quote page respond",
        "description": "Public endpoint: no API key required.",
        "operationId": "postQuotePages_ByToken_Respond",
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is validated by `bodySchema` in src/app/api/v1/quote-pages/[token]/respond/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": []
      }
    },
    "/quotes": {
      "get": {
        "tags": [
          "Quotes"
        ],
        "summary": "List quotes",
        "description": "Required API key scope: `invoices:read`.",
        "operationId": "getQuotes",
        "parameters": [
          {
            "name": "customerId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          {
            "name": "dateFrom",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "dateTo",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "invoices:read"
      },
      "post": {
        "tags": [
          "Quotes"
        ],
        "summary": "Create a quote",
        "description": "Create a draft quote in one itemLocalCurrency. Stored like an invoice: itemLocalCurrency, itemUsdToLocalCurrencyRate, and each of subtotal, tax and total in the currency's smallest unit and in USD cents. quoteNumber is the next number in your own sequence, QT-nnnn-XXXX (XXXX: the last four characters of your merchant id); quotes numbered before this keep their original QT-nnnn. Accepting it creates an invoice with the same currency, rate and amounts. Errors: 400 VALIDATION_ERROR (unsupported currency), 404 NOT_FOUND (customer), 400 PRICE_NOT_FOUND / PRICE_NOT_QUOTABLE / CURRENCY_MISMATCH / PRICE_AMOUNT_MISMATCH (lineItems[].priceId). Requires invoices:write. Returns 201.\n\nRequired API key scope: `invoices:write`.",
        "operationId": "postQuotes",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "customerId": {
                    "type": "string",
                    "description": "ID of a customer in your account (404 NOT_FOUND otherwise)."
                  },
                  "itemLocalCurrency": {
                    "type": "string",
                    "description": "ISO 4217 code the quote is issued in (any active currency with a live rate). Required unless every line has a priceId: then the prices' one currency (different currencies: 400 CURRENCY_MISMATCH); no default. Every amount is in its smallest unit; the USD cents side is converted once at the live rate and stored with itemUsdToLocalCurrencyRate. The invoice created on acceptance keeps this currency and rate."
                  },
                  "lineItems": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "description": {
                          "type": "string",
                          "description": "Line label. With priceId, defaults to the price's nickname, name or product name."
                        },
                        "quantity": {
                          "type": "integer",
                          "description": "Quantity. Defaults to 1."
                        },
                        "unitAmount": {
                          "type": "integer",
                          "description": "Unit price in the smallest unit of itemLocalCurrency (unitPrice is accepted as an alias). Required unless priceId is set; with priceId it must equal the price's amount (400 PRICE_AMOUNT_MISMATCH)."
                        },
                        "priceId": {
                          "type": "string",
                          "description": "One of your active one-time, per-unit prices. Its currency must be itemLocalCurrency (400 CURRENCY_MISMATCH); recurring, tiered or metered prices return 400 PRICE_NOT_QUOTABLE."
                        }
                      }
                    },
                    "description": "One or more lines."
                  },
                  "taxRate": {
                    "type": "number",
                    "description": "Your own tax percentage, 0-100, applied to the whole quote. Omit taxRate and itemTaxLocalCurrencyAmount to tax each line automatically: by its price (priceId), else by your Tax settings for the customer's place (customerCountry / customerState, else the customer's saved country)."
                  },
                  "itemTaxLocalCurrencyAmount": {
                    "type": "integer",
                    "description": "Your own tax amount in the smallest unit of itemLocalCurrency (with or without taxRate), applied as given."
                  },
                  "taxBehavior": {
                    "type": "string",
                    "description": "\"exclusive\" (tax added on top, default) or \"inclusive\" (the line amounts already contain the tax)."
                  },
                  "taxRateId": {
                    "type": "string",
                    "description": "One of your tax rates for lines without a priceId."
                  },
                  "taxName": {
                    "type": "string",
                    "description": "Name printed for your own tax (default \"Tax\"; max 60 chars)."
                  },
                  "customerCountry": {
                    "type": "string",
                    "description": "The customer's country (ISO 3166-1 alpha-2) for automatic tax. customerState is needed for the United States (422 TAX_STATE_REQUIRED otherwise when you collect tax there), Canada and India. The invoice created on acceptance keeps the same tax."
                  },
                  "expiresAt": {
                    "type": "string",
                    "description": "ISO 8601 expiry. The dashboard sets 30 days."
                  },
                  "notes": {
                    "type": "string",
                    "description": "Notes printed on the quote."
                  },
                  "shippingRate": {
                    "type": "object",
                    "description": "Shipping quoted, in the quote's currency: { id?, displayName, itemLocalCurrencyAmount, taxCode?, taxBehavior? }, as on POST /api/v1/invoices. Taxed with the lines, included in the total, printed on the quote, and carried with its tax onto the invoice created on acceptance. Invalid: 400 VALIDATION_ERROR naming shippingRate."
                  }
                },
                "required": [
                  "customerId",
                  "lineItems"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "invoices:write"
      }
    },
    "/quotes/{quoteId}": {
      "get": {
        "tags": [
          "Quotes"
        ],
        "summary": "Retrieve a quote",
        "description": "Required API key scope: `invoices:read`.",
        "operationId": "getQuotes_ByQuoteId",
        "parameters": [
          {
            "name": "quoteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "invoices:read"
      },
      "patch": {
        "tags": [
          "Quotes"
        ],
        "summary": "Update a quote",
        "description": "Required API key scope: `invoices:write`.",
        "operationId": "patchQuotes_ByQuoteId",
        "parameters": [
          {
            "name": "quoteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/quotes/[quoteId]/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "invoices:write"
      }
    },
    "/quotes/{quoteId}/send": {
      "post": {
        "tags": [
          "Quotes"
        ],
        "summary": "Send a quote",
        "description": "Required API key scope: `invoices:write`.",
        "operationId": "postQuotes_ByQuoteId_Send",
        "parameters": [
          {
            "name": "quoteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "invoices:write"
      }
    },
    "/rbac/me": {
      "get": {
        "tags": [
          "Team & Roles"
        ],
        "summary": "Retrieve rbac me",
        "description": "Required API key scope: `account:read`.",
        "operationId": "getRbac_Me",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:read"
      }
    },
    "/rbac/roles": {
      "get": {
        "tags": [
          "Team & Roles"
        ],
        "summary": "List rbac roles",
        "description": "Required API key scope: `account:read`.",
        "operationId": "getRbac_Roles",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:read"
      },
      "post": {
        "tags": [
          "Team & Roles"
        ],
        "summary": "Create a rbac role",
        "description": "Required API key scope: `account:read`.",
        "operationId": "postRbac_Roles",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is validated by `createRoleSchema` in src/app/api/v1/rbac/roles/route.ts."
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:read"
      }
    },
    "/rbac/roles/{roleId}": {
      "get": {
        "tags": [
          "Team & Roles"
        ],
        "summary": "Retrieve a role",
        "description": "Required API key scope: `account:read`.",
        "operationId": "getRbac_Roles_ByRoleId",
        "parameters": [
          {
            "name": "roleId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:read"
      },
      "patch": {
        "tags": [
          "Team & Roles"
        ],
        "summary": "Update a role",
        "description": "Required API key scope: `account:read`.",
        "operationId": "patchRbac_Roles_ByRoleId",
        "parameters": [
          {
            "name": "roleId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is validated by `updateRoleSchema` in src/app/api/v1/rbac/roles/[roleId]/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:read"
      },
      "delete": {
        "tags": [
          "Team & Roles"
        ],
        "summary": "Delete a role",
        "description": "Required API key scope: `account:read`.",
        "operationId": "deleteRbac_Roles_ByRoleId",
        "parameters": [
          {
            "name": "roleId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "reassignToRoleId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:read"
      }
    },
    "/rbac/users": {
      "get": {
        "tags": [
          "Team & Roles"
        ],
        "summary": "List rbac users",
        "description": "Required API key scope: `account:read`.",
        "operationId": "getRbac_Users",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:read"
      },
      "post": {
        "tags": [
          "Team & Roles"
        ],
        "summary": "Invite a team member",
        "description": "Required API key scope: `account:write`.",
        "operationId": "postRbac_Users",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/rbac/users/route.ts."
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:write"
      }
    },
    "/rbac/users/{userId}": {
      "get": {
        "tags": [
          "Team & Roles"
        ],
        "summary": "Retrieve a user",
        "description": "Required API key scope: `account:read`.",
        "operationId": "getRbac_Users_ByUserId",
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:read"
      },
      "put": {
        "tags": [
          "Team & Roles"
        ],
        "summary": "Update a user",
        "description": "Required API key scope: `account:write`.",
        "operationId": "putRbac_Users_ByUserId",
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/rbac/users/[userId]/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:write"
      },
      "delete": {
        "tags": [
          "Team & Roles"
        ],
        "summary": "Delete a user",
        "description": "Required API key scope: `account:write`.",
        "operationId": "deleteRbac_Users_ByUserId",
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:write"
      }
    },
    "/receipt-pages/{token}": {
      "get": {
        "tags": [
          "Receipt Pages"
        ],
        "summary": "Retrieve a receipt page",
        "description": "Public endpoint: no API key required.",
        "operationId": "getReceiptPages_ByToken",
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": []
      }
    },
    "/receipt-pages/{token}/pdf": {
      "get": {
        "tags": [
          "Receipt Pages"
        ],
        "summary": "Retrieve receipt page pdf",
        "description": "Public endpoint: no API key required.",
        "operationId": "getReceiptPages_ByToken_Pdf",
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": []
      }
    },
    "/refunds": {
      "get": {
        "tags": [
          "Refunds"
        ],
        "summary": "List refunds",
        "description": "Required API key scope: `payments:read`.",
        "operationId": "getRefunds",
        "parameters": [
          {
            "name": "customerId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          {
            "name": "dateFrom",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "dateTo",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 10000
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 100
            }
          },
          {
            "name": "paymentId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "sortDirection",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "sortField",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 50
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "payments:read"
      }
    },
    "/reports": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "List reports",
        "description": "Required API key scope: `reports:read`.",
        "operationId": "getReports",
        "parameters": [
          {
            "name": "dateFrom",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "dateTo",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 50
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "reports:read"
      },
      "post": {
        "tags": [
          "Reports"
        ],
        "summary": "Create a report",
        "description": "Required API key scope: `reports:write`.",
        "operationId": "postReports",
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "reports:write"
      }
    },
    "/reports/payments-export": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Retrieve report payments export",
        "description": "Required API key scope: `payments:read`.",
        "operationId": "getReports_PaymentsExport",
        "parameters": [
          {
            "name": "businessEntityId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "customerId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          {
            "name": "dateFrom",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "dateTo",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 10000
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 100
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "sortDirection",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "sortField",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 50
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "payments:read"
      }
    },
    "/reports/preview": {
      "post": {
        "tags": [
          "Reports"
        ],
        "summary": "Create a report preview",
        "description": "Required API key scope: `reports:read`.",
        "operationId": "postReports_Preview",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "reports:read"
      }
    },
    "/reports/receivables": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "List report receivables",
        "description": "Required API key scope: `reports:read`.",
        "operationId": "getReports_Receivables",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "reports:read"
      }
    },
    "/reports/schedules": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "List report schedules",
        "description": "Required API key scope: `reports:read`.",
        "operationId": "getReports_Schedules",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "reports:read"
      },
      "post": {
        "tags": [
          "Reports"
        ],
        "summary": "Create a report schedule",
        "description": "Required API key scope: `reports:write`.",
        "operationId": "postReports_Schedules",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "reports:write"
      }
    },
    "/reports/schedules/{scheduleId}": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Retrieve a schedule",
        "description": "",
        "operationId": "getReports_Schedules_ByScheduleId",
        "parameters": [
          {
            "name": "scheduleId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ]
      },
      "patch": {
        "tags": [
          "Reports"
        ],
        "summary": "Update a schedule",
        "description": "",
        "operationId": "patchReports_Schedules_ByScheduleId",
        "parameters": [
          {
            "name": "scheduleId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Reports"
        ],
        "summary": "Delete a schedule",
        "description": "",
        "operationId": "deleteReports_Schedules_ByScheduleId",
        "parameters": [
          {
            "name": "scheduleId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ]
      }
    },
    "/reports/tax": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Retrieve report tax",
        "description": "Required API key scope: `reports:read`.",
        "operationId": "getReports_Tax",
        "parameters": [
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "reports:read"
      }
    },
    "/reports/tax/location-evidence": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Retrieve tax location evidence",
        "description": "Required API key scope: `reports:read`.",
        "operationId": "getReports_Tax_LocationEvidence",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "reports:read"
      }
    },
    "/reports/{reportId}": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Retrieve a report",
        "description": "Required API key scope: `reports:read`.",
        "operationId": "getReports_ByReportId",
        "parameters": [
          {
            "name": "reportId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "reports:read"
      }
    },
    "/reports/{reportId}/download": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Download a report as CSV",
        "description": "Required API key scope: `reports:read`.",
        "operationId": "getReports_ByReportId_Download",
        "parameters": [
          {
            "name": "reportId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "reports:read"
      }
    },
    "/routing-rules": {
      "get": {
        "tags": [
          "Routing"
        ],
        "summary": "List routing rules",
        "description": "Required API key scope: `routing:read`.",
        "operationId": "getRoutingRules",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "routing:read"
      },
      "post": {
        "tags": [
          "Routing"
        ],
        "summary": "Create a routing rule",
        "description": "Required API key scope: `routing:write`.",
        "operationId": "postRoutingRules",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateRoutingRuleRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "routing:write"
      }
    },
    "/routing-rules/{ruleId}": {
      "put": {
        "tags": [
          "Routing"
        ],
        "summary": "Update a routing rule",
        "description": "Required API key scope: `routing:write`.",
        "operationId": "putRoutingRules_ByRuleId",
        "parameters": [
          {
            "name": "ruleId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateRoutingRuleRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "routing:write"
      },
      "delete": {
        "tags": [
          "Routing"
        ],
        "summary": "Delete a routing rule",
        "description": "Required API key scope: `routing:write`.",
        "operationId": "deleteRoutingRules_ByRuleId",
        "parameters": [
          {
            "name": "ruleId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "routing:write"
      }
    },
    "/routing/simulate": {
      "post": {
        "tags": [
          "Routing"
        ],
        "summary": "Simulate a routing decision",
        "description": "Required API key scope: `routing:read`.",
        "operationId": "postRouting_Simulate",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/routing/simulate/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "routing:read"
      }
    },
    "/smtp": {
      "get": {
        "tags": [
          "Email Delivery"
        ],
        "summary": "Retrieve SMTP settings",
        "description": "Restricted to platform administrators (dashboard admin session); API keys are not accepted.",
        "operationId": "getSmtp",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "x-admin": true
      },
      "put": {
        "tags": [
          "Email Delivery"
        ],
        "summary": "Update SMTP settings",
        "description": "Restricted to platform administrators (dashboard admin session); API keys are not accepted.",
        "operationId": "putSmtp",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is validated by `smtpSchema` in src/app/api/v1/smtp/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "x-admin": true
      }
    },
    "/smtp/test": {
      "post": {
        "tags": [
          "Email Delivery"
        ],
        "summary": "Test SMTP credentials",
        "description": "Restricted to platform administrators (dashboard admin session); API keys are not accepted.",
        "operationId": "postSmtp_Test",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is validated by `testSchema` in src/app/api/v1/smtp/test/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "x-admin": true
      }
    },
    "/status/public": {
      "get": {
        "tags": [
          "Status"
        ],
        "summary": "Retrieve platform status (public)",
        "description": "Public endpoint: no API key required.",
        "operationId": "getStatus_Public",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "security": []
      }
    },
    "/subscription-schedules": {
      "get": {
        "tags": [
          "Subscription Schedules"
        ],
        "summary": "List subscription schedules",
        "description": "Required API key scope: `subscriptions:read`.",
        "operationId": "getSubscriptionSchedules",
        "parameters": [
          {
            "name": "customerId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 10000
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 100
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "subscriptions:read"
      },
      "post": {
        "tags": [
          "Subscription Schedules"
        ],
        "summary": "Create a subscription schedule",
        "description": "Required API key scope: `subscriptions:write`.\n\nHonours the `Idempotency-Key` header.",
        "operationId": "postSubscriptionSchedules",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/subscription-schedules/route.ts."
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "subscriptions:write"
      }
    },
    "/subscription-schedules/{scheduleId}": {
      "get": {
        "tags": [
          "Subscription Schedules"
        ],
        "summary": "Retrieve a subscription schedule",
        "description": "Required API key scope: `subscriptions:read`.",
        "operationId": "getSubscriptionSchedules_ByScheduleId",
        "parameters": [
          {
            "name": "scheduleId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "subscriptions:read"
      }
    },
    "/subscription-schedules/{scheduleId}/advance": {
      "post": {
        "tags": [
          "Subscription Schedules"
        ],
        "summary": "Advance a subscription schedule",
        "description": "Required API key scope: `subscriptions:write`.\n\nHonours the `Idempotency-Key` header.",
        "operationId": "postSubscriptionSchedules_ByScheduleId_Advance",
        "parameters": [
          {
            "name": "scheduleId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/subscription-schedules/[scheduleId]/advance/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "subscriptions:write"
      }
    },
    "/subscription-schedules/{scheduleId}/cancel": {
      "post": {
        "tags": [
          "Subscription Schedules"
        ],
        "summary": "Cancel a subscription schedule",
        "description": "Required API key scope: `subscriptions:write`.",
        "operationId": "postSubscriptionSchedules_ByScheduleId_Cancel",
        "parameters": [
          {
            "name": "scheduleId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/subscription-schedules/[scheduleId]/cancel/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "subscriptions:write"
      }
    },
    "/subscription-schedules/{scheduleId}/release": {
      "post": {
        "tags": [
          "Subscription Schedules"
        ],
        "summary": "Release a subscription schedule",
        "description": "Required API key scope: `subscriptions:write`.",
        "operationId": "postSubscriptionSchedules_ByScheduleId_Release",
        "parameters": [
          {
            "name": "scheduleId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "subscriptions:write"
      }
    },
    "/subscriptions": {
      "get": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "List subscriptions",
        "description": "Return a paginated list of subscriptions, newest first. Also accepts priceId and productId filters.\n\nRequired API key scope: `subscriptions:read`.",
        "operationId": "getSubscriptions",
        "parameters": [
          {
            "name": "businessEntityId",
            "in": "query",
            "required": false,
            "description": "Only rows of this business (one of your businesses, else 400 VALIDATION_ERROR). An API key scoped to a business always sees only its own business, whatever is sent.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "customerId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          {
            "name": "dateFrom",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "dateTo",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number (1-based). Defaults to 1.",
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 10000
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "description": "Results per page, 1-100. Defaults to 25.",
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 100
            }
          },
          {
            "name": "priceId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "productId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Matches the customer's id, name, or email.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "sortDirection",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "sortField",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 50
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Filter by subscription status (e.g. active, paused, cancelled).",
            "schema": {
              "type": "string",
              "maxLength": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "subscriptions:read"
      },
      "post": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Create a subscription",
        "description": "Create a subscription for a customer in your account against a recurring price. Returns 201 with status trialing when a trial applies, otherwise active, and dispatches subscription.created. Errors: 400 VALIDATION_ERROR for an invalid trialEndAt, 404 NOT_FOUND for an unknown price or customer, 422 INVALID_STATE when the price has an unsupported billing interval, 502 SCHEDULING_FAILED when the renewal cannot be scheduled (the subscription is not created). Honours Idempotency-Key.\n\nRequired API key scope: `subscriptions:write`.\n\nHonours the `Idempotency-Key` header.",
        "operationId": "postSubscriptions",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSubscriptionRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "subscriptions:write"
      }
    },
    "/subscriptions/{subscriptionId}": {
      "get": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Retrieve a subscription",
        "description": "Retrieve a subscription. Returns the same camelCase record as list and create (currentPeriodEnd, nextPaymentAt, ...) and embeds a customer summary.\n\nRequired API key scope: `subscriptions:read`.",
        "operationId": "getSubscriptions_BySubscriptionId",
        "parameters": [
          {
            "name": "subscriptionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "subscriptions:read"
      },
      "put": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Update a subscription",
        "description": "Update a subscription's metadata, the only updatable field. Any other field (e.g. priceId, status) returns 400 VALIDATION_ERROR. To change plans, preview the cost with preview-proration; the switch itself is made from the customer billing page.\n\nRequired API key scope: `subscriptions:write`.",
        "operationId": "putSubscriptions_BySubscriptionId",
        "parameters": [
          {
            "name": "subscriptionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSubscriptionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "subscriptions:write"
      }
    },
    "/subscriptions/{subscriptionId}/amend": {
      "post": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Create a subscription amend",
        "description": "Required API key scope: `subscriptions:write`.",
        "operationId": "postSubscriptions_BySubscriptionId_Amend",
        "parameters": [
          {
            "name": "subscriptionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/subscriptions/[subscriptionId]/amend/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "subscriptions:write"
      }
    },
    "/subscriptions/{subscriptionId}/cancel": {
      "post": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Cancel a subscription",
        "description": "Cancel immediately (status cancelled; unused time may be credited per your prorate-on-cancel setting) or at period end. Already-cancelled subscriptions return 422 INVALID_STATE.\n\nRequired API key scope: `subscriptions:write`.",
        "operationId": "postSubscriptions_BySubscriptionId_Cancel",
        "parameters": [
          {
            "name": "subscriptionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/subscriptions/[subscriptionId]/cancel/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "subscriptions:write"
      }
    },
    "/subscriptions/{subscriptionId}/change-plan": {
      "post": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Create a subscription change plan",
        "description": "Required API key scope: `subscriptions:write`.",
        "operationId": "postSubscriptions_BySubscriptionId_ChangePlan",
        "parameters": [
          {
            "name": "subscriptionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/subscriptions/[subscriptionId]/change-plan/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "subscriptions:write"
      },
      "delete": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Delete subscription change plan",
        "description": "Required API key scope: `subscriptions:write`.",
        "operationId": "deleteSubscriptions_BySubscriptionId_ChangePlan",
        "parameters": [
          {
            "name": "subscriptionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "subscriptions:write"
      }
    },
    "/subscriptions/{subscriptionId}/features": {
      "get": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "List a subscription's features",
        "description": "The features this subscription grants: enabled, used / maximum, policy, overage so far and its estimated charge, reset date, adjustments, and features covered by an earlier subscription of the same customer.\n\nRequired API key scope: `entitlements:read`.",
        "operationId": "getSubscriptions_BySubscriptionId_Features",
        "parameters": [
          {
            "name": "subscriptionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "entitlements:read"
      }
    },
    "/subscriptions/{subscriptionId}/invoice-items": {
      "post": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Create a subscription invoice item",
        "description": "Required API key scope: `subscriptions:write`.\n\nHonours the `Idempotency-Key` header.",
        "operationId": "postSubscriptions_BySubscriptionId_InvoiceItems",
        "parameters": [
          {
            "name": "subscriptionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "subscriptions:write"
      }
    },
    "/subscriptions/{subscriptionId}/invoice-items/{pendingId}": {
      "delete": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Delete a subscription invoice item",
        "description": "Required API key scope: `subscriptions:write`.",
        "operationId": "deleteSubscriptions_BySubscriptionId_InvoiceItems_ByPendingId",
        "parameters": [
          {
            "name": "subscriptionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pendingId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "subscriptions:write"
      }
    },
    "/subscriptions/{subscriptionId}/invoices": {
      "get": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "List subscription invoices",
        "description": "Return the subscription's own invoices (those its payments settled), newest first. Paginated with page and limit.\n\nRequired API key scope: `subscriptions:read`.",
        "operationId": "getSubscriptions_BySubscriptionId_Invoices",
        "parameters": [
          {
            "name": "subscriptionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Results per page. Defaults to 50, max 100.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number (1-based). Defaults to 1.",
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 10000
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "subscriptions:read"
      }
    },
    "/subscriptions/{subscriptionId}/items": {
      "get": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "List subscription items",
        "description": "Required API key scope: `subscriptions:read`.",
        "operationId": "getSubscriptions_BySubscriptionId_Items",
        "parameters": [
          {
            "name": "subscriptionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "subscriptions:read"
      },
      "post": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Create a subscription item",
        "description": "Required API key scope: `subscriptions:write`.\n\nHonours the `Idempotency-Key` header.",
        "operationId": "postSubscriptions_BySubscriptionId_Items",
        "parameters": [
          {
            "name": "subscriptionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "subscriptions:write"
      }
    },
    "/subscriptions/{subscriptionId}/items/{itemId}": {
      "put": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Update a subscription item",
        "description": "Required API key scope: `subscriptions:write`.",
        "operationId": "putSubscriptions_BySubscriptionId_Items_ByItemId",
        "parameters": [
          {
            "name": "subscriptionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "itemId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "subscriptions:write"
      },
      "patch": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Update a subscription item",
        "description": "Required API key scope: `subscriptions:write`.",
        "operationId": "patchSubscriptions_BySubscriptionId_Items_ByItemId",
        "parameters": [
          {
            "name": "subscriptionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "itemId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "subscriptions:write"
      },
      "delete": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Delete a subscription item",
        "description": "Required API key scope: `subscriptions:write`.",
        "operationId": "deleteSubscriptions_BySubscriptionId_Items_ByItemId",
        "parameters": [
          {
            "name": "subscriptionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "itemId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "subscriptions:write"
      }
    },
    "/subscriptions/{subscriptionId}/pause": {
      "post": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Pause a subscription",
        "description": "Pause an active or trialing subscription. Scheduled renewals are cancelled until it is resumed. Other statuses return 422 INVALID_STATE.",
        "operationId": "postSubscriptions_BySubscriptionId_Pause",
        "parameters": [
          {
            "name": "subscriptionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ]
      }
    },
    "/subscriptions/{subscriptionId}/payments": {
      "get": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "List subscription payments",
        "description": "Return the subscription's own payments (its first checkout charge and every renewal), newest first. Paginated with page and limit.\n\nRequired API key scope: `subscriptions:read`.",
        "operationId": "getSubscriptions_BySubscriptionId_Payments",
        "parameters": [
          {
            "name": "subscriptionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Results per page. Defaults to 50, max 100.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number (1-based). Defaults to 1.",
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 10000
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "subscriptions:read"
      }
    },
    "/subscriptions/{subscriptionId}/preview-proration": {
      "post": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Preview a plan change for a subscription",
        "description": "Preview the credit, debit, and net amount of switching to another price. Returns prorationDate, prorationCreditLocalCurrencyAmount, prorationDebitLocalCurrencyAmount, prorationNetLocalCurrencyAmount (all in the smallest unit of itemLocalCurrency), itemLocalCurrency, and remainingDays. Does not change the subscription.\n\nRequired API key scope: `subscriptions:read`.",
        "operationId": "postSubscriptions_BySubscriptionId_PreviewProration",
        "parameters": [
          {
            "name": "subscriptionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/subscriptions/[subscriptionId]/preview-proration/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "subscriptions:read"
      }
    },
    "/subscriptions/{subscriptionId}/reactivate": {
      "post": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Create a subscription reactivate",
        "description": "Required API key scope: `subscriptions:write`.",
        "operationId": "postSubscriptions_BySubscriptionId_Reactivate",
        "parameters": [
          {
            "name": "subscriptionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "subscriptions:write"
      }
    },
    "/subscriptions/{subscriptionId}/resume": {
      "post": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Resume a subscription",
        "description": "Resume a paused subscription. The renewal is rescheduled for its stored next payment date or current period end. Other statuses return 422 INVALID_STATE. If the renewal cannot be scheduled it returns 502 SCHEDULING_FAILED and the subscription stays paused.",
        "operationId": "postSubscriptions_BySubscriptionId_Resume",
        "parameters": [
          {
            "name": "subscriptionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ]
      }
    },
    "/subscriptions/{subscriptionId}/retry": {
      "post": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Retry a subscription",
        "description": "Create a new checkout session for the subscription's itemLocalCurrencyAmount in its itemLocalCurrency so the customer can pay a missed renewal. The response returns that price as itemLocalCurrencyAmount and itemLocalCurrency. Allowed for active, past_due, paused, and cancelled subscriptions. Returns 201 with the checkout URL.",
        "operationId": "postSubscriptions_BySubscriptionId_Retry",
        "parameters": [
          {
            "name": "subscriptionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ]
      }
    },
    "/subscriptions/{subscriptionId}/send-setup-link": {
      "post": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Create a subscription send setup link",
        "description": "Email the customer a link to set up automatic payments again (the mandate_setup_link email; your Subscription emails preference applies). Returns the url, sessionId and the email outcome. Scope subscriptions:write.\n\nRequired API key scope: `subscriptions:write`.",
        "operationId": "postSubscriptions_BySubscriptionId_SendSetupLink",
        "parameters": [
          {
            "name": "subscriptionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "subscriptions:write"
      }
    },
    "/subscriptions/{subscriptionId}/setup-session": {
      "post": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Create a subscription setup session",
        "description": "Create a setup-only session for an active or trialing subscription whose automatic payments are not set up. The customer authorises a new payment method at url; the period is not charged, not advanced and the price does not change. Returns the open session again (reused: true) while it is valid. Scope subscriptions:write. 422 SETUP_NOT_AVAILABLE or NO_SETUP_GATEWAY when it cannot be offered.\n\nRequired API key scope: `subscriptions:write`.",
        "operationId": "postSubscriptions_BySubscriptionId_SetupSession",
        "parameters": [
          {
            "name": "subscriptionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "subscriptions:write"
      }
    },
    "/subscriptions/{subscriptionId}/transactions": {
      "get": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "List subscription transactions",
        "description": "Return transactions recorded against the subscription, newest first.\n\nRequired API key scope: `subscriptions:read`.",
        "operationId": "getSubscriptions_BySubscriptionId_Transactions",
        "parameters": [
          {
            "name": "subscriptionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Results per page. Defaults to 50, max 100.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number (1-based). Defaults to 1.",
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 10000
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "subscriptions:read"
      }
    },
    "/subscriptions/{subscriptionId}/upcoming-invoice": {
      "get": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Retrieve subscription upcoming invoice",
        "description": "Required API key scope: `subscriptions:read`.",
        "operationId": "getSubscriptions_BySubscriptionId_UpcomingInvoice",
        "parameters": [
          {
            "name": "subscriptionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "subscriptions:read"
      }
    },
    "/tax-codes": {
      "get": {
        "tags": [
          "Tax Codes"
        ],
        "summary": "List tax codes",
        "description": "Required API key scope: `tax:read`.",
        "operationId": "getTaxCodes",
        "parameters": [
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "dateFrom",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "dateTo",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 10000
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 100
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "sortDirection",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "sortField",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 50
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "tax:read"
      }
    },
    "/tax-codes/{taxCodeId}": {
      "get": {
        "tags": [
          "Tax Codes"
        ],
        "summary": "Retrieve a tax code",
        "description": "Required API key scope: `tax:read`.",
        "operationId": "getTaxCodes_ByTaxCodeId",
        "parameters": [
          {
            "name": "taxCodeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "tax:read"
      }
    },
    "/tax-rates": {
      "get": {
        "tags": [
          "Tax"
        ],
        "summary": "List tax rates",
        "description": "Required API key scope: `tax:read`.",
        "operationId": "getTaxRates",
        "parameters": [
          {
            "name": "active",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 10000
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 100
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "tax:read"
      },
      "post": {
        "tags": [
          "Tax"
        ],
        "summary": "Create a tax rate",
        "description": "Required API key scope: `tax:write`.",
        "operationId": "postTaxRates",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/tax-rates/route.ts."
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "tax:write"
      }
    },
    "/tax-rates/import": {
      "post": {
        "tags": [
          "Tax"
        ],
        "summary": "Create a tax rate import",
        "description": "Required API key scope: `tax:write`.",
        "operationId": "postTaxRates_Import",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/tax-rates/import/route.ts."
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "tax:write"
      }
    },
    "/tax-rates/{taxRateId}": {
      "get": {
        "tags": [
          "Tax"
        ],
        "summary": "Retrieve a tax rate",
        "description": "Required API key scope: `tax:read`.",
        "operationId": "getTaxRates_ByTaxRateId",
        "parameters": [
          {
            "name": "taxRateId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "tax:read"
      },
      "patch": {
        "tags": [
          "Tax"
        ],
        "summary": "Update a tax rate",
        "description": "Required API key scope: `tax:write`.",
        "operationId": "patchTaxRates_ByTaxRateId",
        "parameters": [
          {
            "name": "taxRateId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/tax-rates/[taxRateId]/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "tax:write"
      }
    },
    "/tax-settings": {
      "get": {
        "tags": [
          "Tax"
        ],
        "summary": "Retrieve tax settings",
        "description": "Required API key scope: `tax:read`.",
        "operationId": "getTaxSettings",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "tax:read"
      },
      "put": {
        "tags": [
          "Tax"
        ],
        "summary": "Update tax settings",
        "description": "Required API key scope: `tax:write`.",
        "operationId": "putTaxSettings",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/tax-settings/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "tax:write"
      }
    },
    "/tax/calculate": {
      "post": {
        "tags": [
          "Tax"
        ],
        "summary": "Calculate tax",
        "description": "Required API key scope: `tax:read`.",
        "operationId": "postTax_Calculate",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is validated by `taxCalculateSchema` in src/app/api/v1/tax/calculate/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "tax:read"
      }
    },
    "/tax/calculate/public": {
      "post": {
        "tags": [
          "Tax"
        ],
        "summary": "Calculate tax for a checkout session (public)",
        "description": "Public endpoint: no API key required.",
        "operationId": "postTax_Calculate_Public",
        "parameters": [
          {
            "name": "sessionId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/tax/calculate/public/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": []
      }
    },
    "/tax/preview": {
      "post": {
        "tags": [
          "Tax"
        ],
        "summary": "Preview tax for an amount",
        "description": "Required API key scope: `tax:write`.",
        "operationId": "postTax_Preview",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is validated by `previewSchema` in src/app/api/v1/tax/preview/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "tax:write"
      }
    },
    "/tax/report-settings": {
      "get": {
        "tags": [
          "Tax"
        ],
        "summary": "List tax report settings",
        "description": "Required API key scope: `tax:read`.",
        "operationId": "getTax_ReportSettings",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "tax:read"
      },
      "put": {
        "tags": [
          "Tax"
        ],
        "summary": "Update tax report settings",
        "description": "Required API key scope: `tax:write`.",
        "operationId": "putTax_ReportSettings",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/tax/report-settings/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "tax:write"
      }
    },
    "/tax/thresholds": {
      "get": {
        "tags": [
          "Tax"
        ],
        "summary": "List tax thresholds",
        "description": "Required API key scope: `tax:read`.",
        "operationId": "getTax_Thresholds",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "tax:read"
      }
    },
    "/tax/thresholds/registrations": {
      "post": {
        "tags": [
          "Tax"
        ],
        "summary": "Create a threshold registration",
        "description": "Required API key scope: `tax:write`.",
        "operationId": "postTax_Thresholds_Registrations",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/tax/thresholds/registrations/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "tax:write"
      }
    },
    "/tax/transactions": {
      "get": {
        "tags": [
          "Tax"
        ],
        "summary": "List tax transactions",
        "description": "Required API key scope: `tax:read`.",
        "operationId": "getTax_Transactions",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "tax:read"
      }
    },
    "/team/invites/{token}": {
      "get": {
        "tags": [
          "Team"
        ],
        "summary": "Look up a team invitation",
        "description": "Public endpoint: no API key required.",
        "operationId": "getTeam_Invites_ByToken",
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": []
      },
      "post": {
        "tags": [
          "Team"
        ],
        "summary": "Accept a team invitation",
        "description": "Public endpoint: no API key required.",
        "operationId": "postTeam_Invites_ByToken",
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is validated by `acceptSchema` in src/app/api/v1/team/invites/[token]/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": []
      }
    },
    "/tenants": {
      "get": {
        "tags": [
          "Tenants"
        ],
        "summary": "List tenants",
        "description": "Restricted to platform administrators (dashboard admin session); API keys are not accepted.",
        "operationId": "getTenants",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 10000
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 100
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "sortDirection",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "sortField",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 50
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "x-admin": true
      },
      "post": {
        "tags": [
          "Tenants"
        ],
        "summary": "Create a tenant",
        "description": "Restricted to platform administrators (dashboard admin session); API keys are not accepted.",
        "operationId": "postTenants",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/tenants/route.ts."
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "x-admin": true
      }
    },
    "/tenants/summary": {
      "get": {
        "tags": [
          "Tenants"
        ],
        "summary": "Retrieve tenant summary",
        "description": "Restricted to platform administrators (dashboard admin session); API keys are not accepted.",
        "operationId": "getTenants_Summary",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "x-admin": true
      }
    },
    "/tenants/{tenantId}": {
      "get": {
        "tags": [
          "Tenants"
        ],
        "summary": "Retrieve a tenant",
        "description": "Restricted to platform administrators (dashboard admin session); API keys are not accepted.",
        "operationId": "getTenants_ByTenantId",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "x-admin": true
      },
      "put": {
        "tags": [
          "Tenants"
        ],
        "summary": "Update a tenant",
        "description": "Restricted to platform administrators (dashboard admin session); API keys are not accepted.",
        "operationId": "putTenants_ByTenantId",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/tenants/[tenantId]/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "x-admin": true
      }
    },
    "/tenants/{tenantId}/limits": {
      "get": {
        "tags": [
          "Tenants"
        ],
        "summary": "List tenant limits",
        "description": "Restricted to platform administrators (dashboard admin session); API keys are not accepted.",
        "operationId": "getTenants_ByTenantId_Limits",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "x-admin": true
      },
      "put": {
        "tags": [
          "Tenants"
        ],
        "summary": "Update tenant limits",
        "description": "Restricted to platform administrators (dashboard admin session); API keys are not accepted.",
        "operationId": "putTenants_ByTenantId_Limits",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/tenants/[tenantId]/limits/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "x-admin": true
      }
    },
    "/tokens": {
      "post": {
        "tags": [
          "Tokens"
        ],
        "summary": "Tokenize a card",
        "description": "Required API key scope: `payments:write`.",
        "operationId": "postTokens",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/tokens/route.ts."
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "payments:write"
      }
    },
    "/transactions": {
      "get": {
        "tags": [
          "Transactions"
        ],
        "summary": "List transactions",
        "description": "Required API key scope: `payments:read`.",
        "operationId": "getTransactions",
        "parameters": [
          {
            "name": "businessEntityId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "customerId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          {
            "name": "dateFrom",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "dateTo",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 10000
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 100
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "sortDirection",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "sortField",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 50
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 50
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "payments:read"
      }
    },
    "/webhooks/endpoints": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "List webhook endpoints",
        "description": "Return all webhook endpoints for your account, newest first. Not paginated. signingSecret is masked (whsec_… plus its last 4 characters); use reveal-secret for the full value.\n\nRequired API key scope: `webhooks:read`.",
        "operationId": "getWebhooks_Endpoints",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "webhooks:read"
      },
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Create a webhook endpoint",
        "description": "Register a webhook endpoint. A whsec_ signing secret is generated and returned in full in this response only. Unknown body fields are rejected. Returns 201. Honours Idempotency-Key.\n\nRequired API key scope: `webhooks:write`.\n\nHonours the `Idempotency-Key` header.",
        "operationId": "postWebhooks_Endpoints",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWebhookEndpointRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "webhooks:write"
      }
    },
    "/webhooks/endpoints/{endpointId}": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Retrieve an endpoint",
        "description": "Return one webhook endpoint (webhooks:read). signingSecret is masked. 404 NOT_FOUND when it does not exist or belongs to another account.\n\nRequired API key scope: `webhooks:read`.",
        "operationId": "getWebhooks_Endpoints_ByEndpointId",
        "parameters": [
          {
            "name": "endpointId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "webhooks:read"
      },
      "put": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Update a webhook endpoint",
        "description": "Update a webhook endpoint. Only the fields below are accepted; unknown fields return 400 VALIDATION_ERROR. signingSecret is masked in the response.\n\nRequired API key scope: `webhooks:write`.",
        "operationId": "putWebhooks_Endpoints_ByEndpointId",
        "parameters": [
          {
            "name": "endpointId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWebhookEndpointRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "webhooks:write"
      }
    },
    "/webhooks/endpoints/{endpointId}/deliveries": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "List a webhook endpoint's deliveries",
        "description": "Required API key scope: `webhooks:read`.",
        "operationId": "getWebhooks_Endpoints_ByEndpointId_Deliveries",
        "parameters": [
          {
            "name": "endpointId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "dateFrom",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "dateTo",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 10000
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 100
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "webhooks:read"
      }
    },
    "/webhooks/endpoints/{endpointId}/reveal-secret": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Create an endpoint reveal secret",
        "description": "Return the endpoint's current signing secret in full. Requires account:write. Each reveal is recorded in the activity log as webhook_endpoint.secret_revealed. Limited to 10 per hour per person (429 RATE_LIMITED with Retry-After).\n\nRequired API key scope: `account:write`.",
        "operationId": "postWebhooks_Endpoints_ByEndpointId_RevealSecret",
        "parameters": [
          {
            "name": "endpointId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "account:write"
      }
    },
    "/webhooks/endpoints/{endpointId}/rotate-secret": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Rotate a webhook endpoint signing secret",
        "description": "Generate a new signing secret. The previous secret stays valid for a 24-hour grace period.\n\nRequired API key scope: `webhooks:write`.",
        "operationId": "postWebhooks_Endpoints_ByEndpointId_RotateSecret",
        "parameters": [
          {
            "name": "endpointId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "webhooks:write"
      }
    },
    "/webhooks/health": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Retrieve webhook delivery health",
        "description": "Required API key scope: `webhooks:read`.",
        "operationId": "getWebhooks_Health",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "webhooks:read"
      }
    },
    "/webhooks/incoming": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "List received gateway webhooks",
        "description": "Required API key scope: `webhooks:read`.",
        "operationId": "getWebhooks_Incoming",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "provider",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "webhooks:read"
      }
    },
    "/webhooks/incoming/{provider}/{connectionId}": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Receive a gateway webhook",
        "description": "Register this URL, with your own gateway connection id, in your gateway's dashboard. The payload is verified with the signing secret stored on that connection.\n\nPublic endpoint: no API key required.",
        "operationId": "postWebhooks_Incoming_ByProvider_ByConnectionId",
        "parameters": [
          {
            "name": "provider",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "JSON object; see the API reference docs. The body is parsed in src/app/api/v1/webhooks/incoming/[provider]/[connectionId]/route.ts."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": []
      }
    },
    "/webhooks/logs": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "List webhook deliveries",
        "description": "Return delivery logs for your endpoints, newest first. Accepts endpointId, page, and pageSize (default 25).\n\nRequired API key scope: `webhooks:read`.",
        "operationId": "getWebhooks_Logs",
        "parameters": [
          {
            "name": "dateFrom",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "dateTo",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "endpointId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 10000
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 100
            }
          },
          {
            "name": "sinceId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "webhooks:read"
      }
    },
    "/webhooks/logs/{logId}": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Retrieve a webhook delivery with its request, response and attempts",
        "description": "Required API key scope: `webhooks:read`.",
        "operationId": "getWebhooks_Logs_ByLogId",
        "parameters": [
          {
            "name": "logId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "webhooks:read"
      }
    },
    "/webhooks/logs/{logId}/replay": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Replay a webhook delivery",
        "description": "Redeliver a logged event to its endpoint as a new signed delivery, keeping the original event id when the log holds the full event. Returns 200; data.success reflects the endpoint's answer. Errors: 404 NOT_FOUND when the log does not exist or belongs to another account; 409 ENDPOINT_INACTIVE when the endpoint is disabled (re-enable it first).\n\nRequired API key scope: `webhooks:write`.",
        "operationId": "postWebhooks_Logs_ByLogId_Replay",
        "parameters": [
          {
            "name": "logId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "webhooks:write"
      }
    },
    "/webhooks/logs/{logId}/resend": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Resend a webhook delivery",
        "description": "Same redelivery as replay, returned as the new delivery log entry (status success or failed). Same 404 NOT_FOUND and 409 ENDPOINT_INACTIVE errors.\n\nRequired API key scope: `webhooks:write`.",
        "operationId": "postWebhooks_Logs_ByLogId_Resend",
        "parameters": [
          {
            "name": "logId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "webhooks:write"
      }
    },
    "/webhooks/retry-queue": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "List the webhook retry queue",
        "description": "Restricted to platform administrators (dashboard admin session); API keys are not accepted.",
        "operationId": "getWebhooks_RetryQueue",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "x-admin": true
      },
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Process the webhook retry queue",
        "description": "Restricted to platform administrators (dashboard admin session); API keys are not accepted.",
        "operationId": "postWebhooks_RetryQueue",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "x-admin": true
      }
    },
    "/webhooks/session-secret": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Retrieve the per-session webhook signing secret",
        "description": "Required API key scope: `webhooks:read`.",
        "operationId": "getWebhooks_SessionSecret",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "webhooks:read"
      }
    },
    "/webhooks/session-secret/rotate": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Rotate the per-session webhook signing secret",
        "description": "Required API key scope: `webhooks:write`.",
        "operationId": "postWebhooks_SessionSecret_Rotate",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "webhooks:write"
      }
    },
    "/webhooks/simulate": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Send a simulated webhook event",
        "description": "Required API key scope: `webhooks:write`.",
        "operationId": "postWebhooks_Simulate",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SimulateWebhookRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "webhooks:write"
      }
    },
    "/webhooks/stream": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Stream webhook events (server-sent events)",
        "description": "Server-sent events (text/event-stream) of every webhook event dispatched for your account, with or without registered endpoints. Scope webhooks:read. The first message is event ready with { merchantId, livemode, signingSecret } (your CLI signing secret, created on first use); then one event webhook with { type, envelope } per event, where envelope is the exact event endpoints receive. Used by ph listen; events are not replayed after a reconnect.\n\nResponds with text/event-stream. First message: `event: ready` with { merchantId, livemode, signingSecret } (the CLI signing secret). Then one `event: webhook` with { type, envelope } per event dispatched for your account, where envelope is the exact event registered endpoints receive. Used by `ph listen`; events are not replayed after a reconnect.\n\nRequired API key scope: `webhooks:read`.",
        "operationId": "getWebhooks_Stream",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "webhooks:read",
        "x-streaming": true
      }
    },
    "/webhooks/stream/secret/rotate": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Rotate the CLI signing secret",
        "description": "Replace the CLI signing secret. Returns 200 { signingSecret }. Streams opened afterwards sign with the new secret; restart running ph listen sessions. Scope webhooks:write.\n\nReturns 200 { signingSecret }. Streams opened afterwards sign with the new secret.\n\nRequired API key scope: `webhooks:write`.",
        "operationId": "postWebhooks_Stream_Secret_Rotate",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "webhooks:write"
      }
    },
    "/webhooks/stream/trigger": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Send a sample event to open streams",
        "description": "Publish a sample event built by the real payload builders to your open streams only; it is never delivered to registered endpoints. Body { eventType } (a known event type, else 400 VALIDATION_ERROR). Returns 201 { eventId, type }. The sample has livemode false and metadata.simulated = 'true'. Scope webhooks:write; 20 per minute (429 RATE_LIMITED).\n\nBody { eventType } (a known event type, else 400 VALIDATION_ERROR). Publishes a sample event (livemode false, metadata.simulated \"true\") to open streams only; it is never delivered to registered endpoints. Returns 201 { eventId, type }. 20 per minute (429 RATE_LIMITED).\n\nRequired API key scope: `webhooks:write`.",
        "operationId": "postWebhooks_Stream_Trigger",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TriggerStreamEventRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-required-scope": "webhooks:write"
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "phk_live_... | phk_pub_...",
        "description": "API key sent as `Authorization: Bearer <key>`. Secret keys (`phk_live_...`) carry the scopes chosen when the key was created; publishable keys (`phk_pub_...`) are limited to payments:read, customers:read and products:read."
      },
      "apiKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key",
        "description": "The same API key sent in the `x-api-key` header instead of `Authorization`. Only `phk_`-prefixed values are accepted."
      },
      "sessionCookie": {
        "type": "apiKey",
        "in": "cookie",
        "name": "paymenthooks_session",
        "description": "Dashboard session cookie. Used only by dashboard-session endpoints that do not accept API keys."
      }
    },
    "parameters": {
      "IdempotencyKey": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": false,
        "description": "Unique key (max 200 characters) that makes the request safe to retry. A retry with the same key replays the original response (marked with `x-idempotent-replayed: true`); keys are scoped to your account.",
        "schema": {
          "type": "string",
          "maxLength": 200
        }
      }
    },
    "schemas": {
      "ApiError": {
        "type": "object",
        "required": [
          "code",
          "message"
        ],
        "properties": {
          "code": {
            "type": "string",
            "description": "Stable machine-readable error code, e.g. VALIDATION_ERROR, NOT_FOUND, INSUFFICIENT_SCOPE."
          },
          "message": {
            "type": "string",
            "description": "Human-readable explanation."
          },
          "fields": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Per-field validation messages keyed by field path."
          },
          "details": {
            "type": "object",
            "additionalProperties": true,
            "description": "Additional structured context."
          }
        }
      },
      "CreateCustomerRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "email": {
            "type": "string",
            "maxLength": 254,
            "format": "email"
          },
          "phone": {
            "type": "string",
            "maxLength": 50
          },
          "country": {
            "type": "string",
            "maxLength": 5
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "taxExempt": {
            "type": "string",
            "enum": [
              "none",
              "exempt",
              "reverse"
            ]
          }
        },
        "required": [
          "name",
          "email"
        ],
        "additionalProperties": false
      },
      "CreateExternalTransactionRequest": {
        "type": "object",
        "properties": {
          "externalProvider": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "externalTransactionId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "pattern": "^[\\x21-\\x7E]+$"
          },
          "status": {
            "default": "succeeded",
            "type": "string",
            "enum": [
              "succeeded",
              "pending",
              "failed"
            ]
          },
          "transactionLocalCurrency": {
            "type": "string",
            "minLength": 3,
            "maxLength": 3
          },
          "transactionLocalCurrencyAmount": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 1000000000000
          },
          "transactionUsdToLocalCurrencyRate": {
            "type": "number",
            "exclusiveMinimum": 0,
            "maximum": 1000000000
          },
          "customerId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "customerEmail": {
            "type": "string",
            "maxLength": 254,
            "format": "email"
          },
          "customerName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "paymentMethod": {
            "default": "other",
            "type": "string",
            "enum": [
              "card",
              "bank_transfer",
              "upi",
              "wallet",
              "bnpl",
              "crypto",
              "cash",
              "check",
              "other"
            ]
          },
          "description": {
            "type": "string",
            "maxLength": 500
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string",
              "minLength": 1,
              "maxLength": 40
            },
            "additionalProperties": {
              "type": "string",
              "maxLength": 500
            }
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          },
          "invoiceId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "businessEntityId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "sendReceipt": {
            "default": false,
            "type": "boolean"
          }
        },
        "required": [
          "externalProvider",
          "externalTransactionId",
          "transactionLocalCurrency",
          "transactionLocalCurrencyAmount"
        ],
        "additionalProperties": false
      },
      "CreateInvoiceRequest": {
        "type": "object",
        "properties": {
          "customerId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "itemLocalCurrencyAmount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "itemLocalCurrency": {
            "description": "ISO 4217 code the invoice is issued in. Required unless every item has a priceId: then it is the prices' one currency (prices in different currencies: 400 CURRENCY_MISMATCH). There is no default. See /docs/money-and-currencies.",
            "type": "string",
            "minLength": 3,
            "maxLength": 3
          },
          "dueDate": {
            "type": "string",
            "maxLength": 30
          },
          "supplyDate": {
            "type": "string",
            "maxLength": 10,
            "format": "date",
            "description": "Date of supply / tax point (YYYY-MM-DD), up to 365 days ahead and 6 years back. Omitted: the issue date, stamped when the invoice is finalised. Printed on the PDF and hosted invoice; VAT / GST is filed under the earliest of this, the issue date and payment."
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "description": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 500
                },
                "quantity": {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "maximum": 9007199254740991
                },
                "unitAmount": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "unitPrice": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "priceId": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                }
              },
              "required": [
                "description"
              ]
            }
          },
          "lineItems": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "description": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 500
                },
                "quantity": {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "maximum": 9007199254740991
                },
                "unitAmount": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "unitPrice": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "priceId": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                }
              },
              "required": [
                "description"
              ]
            }
          },
          "notes": {
            "type": "string",
            "maxLength": 5000
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "taxRate": {
            "type": "number",
            "minimum": 0,
            "maximum": 100
          },
          "itemTaxLocalCurrencyAmount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "taxBehavior": {
            "type": "string",
            "enum": [
              "inclusive",
              "exclusive"
            ]
          },
          "taxRateId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "taxName": {
            "type": "string",
            "maxLength": 60
          },
          "customerCountry": {
            "type": "string",
            "minLength": 2,
            "maxLength": 2
          },
          "customerState": {
            "type": "string",
            "maxLength": 60
          },
          "customerPostalCode": {
            "type": "string",
            "maxLength": 12
          },
          "shippingRate": {
            "description": "Shipping charged on the invoice: { id?, displayName, itemLocalCurrencyAmount, taxCode? (tc_shipping), taxBehavior? (exclusive) } in the invoice currency. Taxed at the customer's place with the items; never discounted.",
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          }
        },
        "required": [
          "customerId"
        ]
      },
      "CreatePaymentLinkRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "itemLocalCurrencyAmount": {
            "description": "Fixed price in the smallest unit of itemLocalCurrency (positive integer). Required unless priceId is set: then the price's own amount is used. See /docs/money-and-currencies.",
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "itemLocalCurrency": {
            "description": "ISO 4217 code the link is priced in. Required unless priceId is set: then it is the price's currency (derived, never defaulted). See /docs/money-and-currencies.",
            "type": "string",
            "minLength": 3,
            "maxLength": 3
          },
          "url": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "pattern": "^[A-Za-z0-9_-]+$"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "inactive"
            ]
          },
          "productId": {
            "type": "string",
            "maxLength": 100
          },
          "priceId": {
            "type": "string",
            "maxLength": 100
          },
          "description": {
            "type": "string",
            "maxLength": 500
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "businessEntityId": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          },
          "shippingOptions": {
            "description": "Shipping rates the checkout offers (at most 5): { id?, displayName, itemLocalCurrencyAmount, taxCode? (tc_shipping), taxBehavior? (exclusive) } in the link's currency. The customer picks one; it is taxed at their address.",
            "maxItems": 5,
            "type": "array",
            "items": {}
          }
        },
        "required": [
          "name"
        ],
        "additionalProperties": false
      },
      "CreatePaymentRequest": {
        "type": "object",
        "properties": {
          "transactionLocalCurrencyAmount": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "transactionLocalCurrency": {
            "type": "string",
            "pattern": "^[A-Za-z]{3}$"
          },
          "customerId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "gatewayId": {
            "type": "string",
            "maxLength": 100
          },
          "paymentMethod": {
            "type": "string",
            "maxLength": 50
          },
          "description": {
            "type": "string",
            "maxLength": 500
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "idempotencyKey": {
            "type": "string",
            "maxLength": 255
          }
        },
        "required": [
          "transactionLocalCurrencyAmount",
          "transactionLocalCurrency",
          "customerId"
        ]
      },
      "CreatePriceBodyRequest": {
        "type": "object",
        "properties": {
          "productId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "itemLocalCurrencyAmount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "itemLocalCurrency": {
            "type": "string",
            "minLength": 3,
            "maxLength": 3
          },
          "currencyOptions": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "object",
                  "properties": {
                    "unitAmount": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 99999999999
                    }
                  },
                  "required": [
                    "unitAmount"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "name": {
            "type": "string",
            "maxLength": 255
          },
          "nickname": {
            "type": "string",
            "maxLength": 255
          },
          "type": {
            "type": "string",
            "enum": [
              "recurring",
              "one_time"
            ]
          },
          "interval": {
            "type": "string",
            "enum": [
              "day",
              "week",
              "month",
              "year",
              "one_time"
            ]
          },
          "intervalCount": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 365
          },
          "trialDays": {
            "type": "integer",
            "minimum": 0,
            "maximum": 730
          },
          "taxBehavior": {
            "type": "string",
            "enum": [
              "inclusive",
              "exclusive"
            ]
          },
          "taxRateId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "archived"
            ]
          },
          "billingScheme": {
            "type": "string",
            "enum": [
              "per_unit",
              "tiered"
            ]
          },
          "tiersMode": {
            "type": "string",
            "enum": [
              "graduated",
              "volume"
            ]
          },
          "tiers": {
            "maxItems": 50,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "upTo": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "exclusiveMinimum": 0,
                      "maximum": 9007199254740991
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "unitAmount": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "flatAmount": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                }
              },
              "required": [
                "upTo",
                "unitAmount"
              ],
              "additionalProperties": false
            }
          },
          "usageType": {
            "type": "string",
            "enum": [
              "licensed",
              "metered"
            ]
          },
          "meterId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "includedQuantity": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000000000
          },
          "showOnHostedPages": {
            "type": "boolean"
          },
          "allowCustomerPlanChange": {
            "type": "boolean"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "tags": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "productId",
          "itemLocalCurrencyAmount"
        ]
      },
      "CreateProductRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "description": {
            "type": "string",
            "maxLength": 1000
          },
          "hsnCode": {
            "type": "string",
            "pattern": "^\\d{4,8}$"
          },
          "taxCode": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "type": {
            "type": "string",
            "maxLength": 50
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "archived"
            ]
          },
          "businessEntityIds": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          "showOnHostedPages": {
            "type": "boolean"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string",
              "maxLength": 100
            },
            "additionalProperties": {}
          },
          "tags": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "name"
        ]
      },
      "CreateRoutingRuleRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "description": {
            "type": "string",
            "maxLength": 1000
          },
          "isEnabled": {
            "type": "boolean"
          },
          "priority": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "conditions": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "field": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                },
                "operator": {
                  "type": "string",
                  "enum": [
                    "eq",
                    "neq",
                    "gt",
                    "gte",
                    "lt",
                    "lte",
                    "contains",
                    "in"
                  ]
                },
                "value": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "number"
                    }
                  ]
                }
              },
              "required": [
                "field",
                "operator",
                "value"
              ]
            }
          },
          "conditionLogic": {
            "type": "string",
            "enum": [
              "AND",
              "OR"
            ]
          },
          "action": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "route_to_gateway"
                  },
                  "gatewayId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "connectionId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "fallbackGatewayId": {
                    "default": null,
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 100
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "fallbackConnectionId": {
                    "default": null,
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 100
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "type",
                  "gatewayId",
                  "connectionId"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "percentage_split"
                  },
                  "targets": {
                    "minItems": 2,
                    "maxItems": 10,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "gatewayId": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 100
                        },
                        "connectionId": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 100
                        },
                        "percentage": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 100
                        }
                      },
                      "required": [
                        "gatewayId",
                        "connectionId"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "fallbackGatewayId": {
                    "default": null,
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 100
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "fallbackConnectionId": {
                    "default": null,
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 100
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "type",
                  "targets"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "lowest_cost"
                  },
                  "targets": {
                    "minItems": 2,
                    "maxItems": 10,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "gatewayId": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 100
                        },
                        "connectionId": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 100
                        }
                      },
                      "required": [
                        "gatewayId",
                        "connectionId"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "fallbackGatewayId": {
                    "default": null,
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 100
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "fallbackConnectionId": {
                    "default": null,
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 100
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "type",
                  "targets"
                ],
                "additionalProperties": false
              }
            ]
          }
        },
        "required": [
          "name",
          "conditions",
          "action"
        ]
      },
      "CreateSubscriptionRequest": {
        "type": "object",
        "properties": {
          "customerId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "priceId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "quantity": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10000
          },
          "items": {
            "minItems": 1,
            "maxItems": 20,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "priceId": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                },
                "priceData": {
                  "type": "object",
                  "properties": {
                    "description": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 255
                    },
                    "productKey": {
                      "type": "string",
                      "pattern": "^[a-z0-9][a-z0-9_.-]{0,63}$"
                    },
                    "productName": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 255
                    },
                    "productCategory": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 100
                    },
                    "unitPrice": {
                      "type": "integer",
                      "exclusiveMinimum": 0,
                      "maximum": 9007199254740991
                    },
                    "itemLocalCurrency": {
                      "type": "string",
                      "pattern": "^[A-Za-z]{3}$"
                    },
                    "recurring": {
                      "type": "object",
                      "properties": {
                        "interval": {
                          "type": "string",
                          "enum": [
                            "day",
                            "week",
                            "month",
                            "year"
                          ]
                        },
                        "intervalCount": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 365
                        }
                      },
                      "required": [
                        "interval"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "description",
                    "unitPrice",
                    "itemLocalCurrency",
                    "recurring"
                  ],
                  "additionalProperties": false
                },
                "quantity": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 10000
                }
              },
              "additionalProperties": false
            }
          },
          "gatewayConnectionId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "trialEndAt": {
            "type": "string",
            "maxLength": 40
          },
          "collectionMethod": {
            "type": "string",
            "enum": [
              "charge_automatically",
              "send_invoice"
            ]
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          }
        },
        "required": [
          "customerId"
        ]
      },
      "CreateWebhookEndpointRequest": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "maxLength": 2048,
            "format": "uri"
          },
          "description": {
            "type": "string",
            "maxLength": 500
          },
          "subscribedEvents": {
            "maxItems": 200,
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 100
            }
          },
          "deliveryFilters": {
            "type": "object",
            "properties": {
              "apiVersion": {
                "type": "string",
                "maxLength": 50
              },
              "gateway": {
                "type": "string",
                "maxLength": 100
              },
              "amountMin": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "amountMax": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            },
            "additionalProperties": false
          }
        },
        "required": [
          "url"
        ],
        "additionalProperties": false
      },
      "CustomerAddressRequest": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "billing",
              "shipping"
            ]
          },
          "line1": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "line2": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ]
          },
          "city": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "state": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 120
              },
              {
                "type": "null"
              }
            ]
          },
          "postalCode": {
            "type": "string",
            "minLength": 1,
            "maxLength": 20
          },
          "country": {
            "type": "string",
            "minLength": 2,
            "maxLength": 3
          },
          "isDefault": {
            "type": "boolean"
          }
        },
        "required": [
          "type",
          "line1",
          "city",
          "postalCode",
          "country"
        ],
        "additionalProperties": false
      },
      "Error": {
        "type": "object",
        "required": [
          "data",
          "error"
        ],
        "properties": {
          "data": {
            "type": "null"
          },
          "error": {
            "$ref": "#/components/schemas/ApiError"
          }
        }
      },
      "LoginRequest": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "maxLength": 255,
            "format": "email",
            "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          },
          "password": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          }
        },
        "required": [
          "email",
          "password"
        ]
      },
      "MfaCodeRequest": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "pattern": "^\\d{6}$"
          }
        },
        "required": [
          "code"
        ]
      },
      "PageMeta": {
        "type": "object",
        "required": [
          "total",
          "page",
          "pageSize"
        ],
        "properties": {
          "total": {
            "type": "integer"
          },
          "page": {
            "type": "integer"
          },
          "pageSize": {
            "type": "integer"
          },
          "totalPages": {
            "type": "integer"
          }
        }
      },
      "RecordExternalRefundRequest": {
        "type": "object",
        "properties": {
          "externalRefundId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "pattern": "^[\\x21-\\x7E]+$"
          },
          "transactionLocalCurrencyAmount": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "reason": {
            "type": "string",
            "maxLength": 500
          },
          "notifyCustomer": {
            "default": false,
            "type": "boolean"
          }
        },
        "required": [
          "externalRefundId",
          "transactionLocalCurrencyAmount"
        ],
        "additionalProperties": false
      },
      "SimulateWebhookRequest": {
        "type": "object",
        "properties": {
          "eventType": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "endpointUrl": {
            "type": "string",
            "maxLength": 2048,
            "format": "uri"
          }
        },
        "required": [
          "eventType"
        ]
      },
      "SubmitEvidenceRequest": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string",
            "maxLength": 10000
          },
          "evidenceFiles": {}
        },
        "additionalProperties": false
      },
      "SuccessEnvelope": {
        "type": "object",
        "required": [
          "data",
          "error"
        ],
        "properties": {
          "data": {
            "description": "The resource, list or result returned by the operation."
          },
          "error": {
            "type": "null"
          },
          "meta": {
            "$ref": "#/components/schemas/PageMeta"
          },
          "livemode": {
            "type": "boolean",
            "description": "True when the response was produced in live mode."
          }
        }
      },
      "TriggerStreamEventRequest": {
        "type": "object",
        "properties": {
          "eventType": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          }
        },
        "required": [
          "eventType"
        ],
        "additionalProperties": false
      },
      "UpdateCustomerAddressRequest": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "billing",
              "shipping"
            ]
          },
          "line1": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "line2": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ]
          },
          "city": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "state": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 120
              },
              {
                "type": "null"
              }
            ]
          },
          "postalCode": {
            "type": "string",
            "minLength": 1,
            "maxLength": 20
          },
          "country": {
            "type": "string",
            "minLength": 2,
            "maxLength": 3
          },
          "isDefault": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "UpdateCustomerRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "email": {
            "type": "string",
            "maxLength": 254,
            "format": "email"
          },
          "phone": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 50
              },
              {
                "type": "null"
              }
            ]
          },
          "country": {
            "type": "string",
            "minLength": 2,
            "maxLength": 5
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string",
              "maxLength": 100
            },
            "additionalProperties": {}
          },
          "taxExempt": {
            "type": "string",
            "enum": [
              "none",
              "exempt",
              "reverse"
            ]
          }
        },
        "additionalProperties": false
      },
      "UpdateDisputeRequest": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "open",
              "under_review",
              "won",
              "lost"
            ]
          }
        },
        "required": [
          "status"
        ],
        "additionalProperties": false
      },
      "UpdateExternalTransactionRequest": {
        "type": "object",
        "properties": {
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string",
              "minLength": 1,
              "maxLength": 40
            },
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 500
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "status": {
            "type": "string",
            "enum": [
              "succeeded",
              "failed"
            ]
          },
          "customerId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "customerEmail": {
            "type": "string",
            "maxLength": 254,
            "format": "email"
          },
          "customerName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "sendReceipt": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "UpdateInvoiceRequest": {
        "type": "object",
        "properties": {
          "dueDate": {
            "type": "string",
            "maxLength": 30
          },
          "supplyDate": {
            "type": "string",
            "maxLength": 10,
            "format": "date",
            "description": "Date of supply / tax point (YYYY-MM-DD), up to 365 days ahead and 6 years back. Omitted: the issue date, stamped when the invoice is finalised. Printed on the PDF and hosted invoice; VAT / GST is filed under the earliest of this, the issue date and payment."
          },
          "notes": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 5000
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "UpdatePaymentLinkRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "itemLocalCurrencyAmount": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "inactive"
            ]
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string",
              "maxLength": 100
            },
            "additionalProperties": {}
          }
        },
        "additionalProperties": false
      },
      "UpdatePaymentRequest": {
        "type": "object",
        "properties": {
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string",
              "maxLength": 100
            },
            "additionalProperties": {}
          }
        },
        "additionalProperties": false
      },
      "UpdatePriceRequest": {
        "type": "object",
        "properties": {
          "itemLocalCurrencyAmount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "currencyOptions": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "object",
                  "properties": {
                    "unitAmount": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 99999999999
                    }
                  },
                  "required": [
                    "unitAmount"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ]
          },
          "nickname": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "archived"
            ]
          },
          "trialDays": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 730
              },
              {
                "type": "null"
              }
            ]
          },
          "taxBehavior": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "inclusive",
                  "exclusive"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "taxRateId": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          },
          "showOnHostedPages": {
            "type": "boolean"
          },
          "allowCustomerPlanChange": {
            "type": "boolean"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string",
              "maxLength": 100
            },
            "additionalProperties": {}
          },
          "tags": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "additionalProperties": false
      },
      "UpdateProductRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 1000
              },
              {
                "type": "null"
              }
            ]
          },
          "hsnCode": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{4,8}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "taxCode": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          },
          "type": {
            "type": "string",
            "maxLength": 50
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "archived"
            ]
          },
          "businessEntityIds": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          "showOnHostedPages": {
            "type": "boolean"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string",
              "maxLength": 100
            },
            "additionalProperties": {}
          },
          "tags": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "additionalProperties": false
      },
      "UpdateRoutingRuleRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "description": {
            "type": "string",
            "maxLength": 1000
          },
          "isEnabled": {
            "type": "boolean"
          },
          "priority": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "conditions": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "field": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                },
                "operator": {
                  "type": "string",
                  "enum": [
                    "eq",
                    "neq",
                    "gt",
                    "gte",
                    "lt",
                    "lte",
                    "contains",
                    "in"
                  ]
                },
                "value": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "number"
                    }
                  ]
                }
              },
              "required": [
                "field",
                "operator",
                "value"
              ]
            }
          },
          "conditionLogic": {
            "type": "string",
            "enum": [
              "AND",
              "OR"
            ]
          },
          "action": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "route_to_gateway"
                  },
                  "gatewayId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "connectionId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "fallbackGatewayId": {
                    "default": null,
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 100
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "fallbackConnectionId": {
                    "default": null,
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 100
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "type",
                  "gatewayId",
                  "connectionId"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "percentage_split"
                  },
                  "targets": {
                    "minItems": 2,
                    "maxItems": 10,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "gatewayId": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 100
                        },
                        "connectionId": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 100
                        },
                        "percentage": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 100
                        }
                      },
                      "required": [
                        "gatewayId",
                        "connectionId"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "fallbackGatewayId": {
                    "default": null,
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 100
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "fallbackConnectionId": {
                    "default": null,
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 100
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "type",
                  "targets"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "lowest_cost"
                  },
                  "targets": {
                    "minItems": 2,
                    "maxItems": 10,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "gatewayId": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 100
                        },
                        "connectionId": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 100
                        }
                      },
                      "required": [
                        "gatewayId",
                        "connectionId"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "fallbackGatewayId": {
                    "default": null,
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 100
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "fallbackConnectionId": {
                    "default": null,
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 100
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "type",
                  "targets"
                ],
                "additionalProperties": false
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "UpdateSubscriptionRequest": {
        "type": "object",
        "properties": {
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string",
              "maxLength": 100
            },
            "additionalProperties": {}
          }
        },
        "required": [
          "metadata"
        ],
        "additionalProperties": false
      },
      "UpdateWebhookEndpointRequest": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "format": "uri"
          },
          "description": {
            "type": "string",
            "maxLength": 500
          },
          "subscribedEvents": {
            "maxItems": 200,
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 100
            }
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "disabled"
            ]
          },
          "deliveryFilters": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "apiVersion": {
                    "type": "string",
                    "maxLength": 50
                  },
                  "gateway": {
                    "type": "string",
                    "maxLength": 100
                  },
                  "amountMin": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "amountMax": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "failureThreshold": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000
          }
        },
        "additionalProperties": false
      }
    },
    "responses": {
      "Error400": {
        "description": "Bad request: the body or parameters failed validation (VALIDATION_ERROR) or the request is malformed.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Error401": {
        "description": "Unauthorized: no valid API key or session was supplied.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Error402": {
        "description": "Payment required: the payment was declined or blocked by fraud screening.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Error403": {
        "description": "Forbidden: the API key lacks the required scope (INSUFFICIENT_SCOPE) or the caller lacks the required role.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Error404": {
        "description": "Not found: the resource does not exist or does not belong to your account.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Error409": {
        "description": "Conflict: the request conflicts with the resource's current state or an earlier idempotent request.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Error410": {
        "description": "Gone: the resource has expired or is no longer active.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Error422": {
        "description": "Unprocessable: the request is valid but cannot be applied in the resource's current state.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Error429": {
        "description": "Too many requests: a rate limit was exceeded.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Error500": {
        "description": "Internal error: the failure was logged server-side.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Error502": {
        "description": "Bad gateway: an upstream payment gateway or service rejected or failed the request.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Error503": {
        "description": "Service unavailable: a required dependency (database, cache, provider) is not available.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    }
  }
}
